it was caused because this function takes a parameter in BP. You're not supposed to do that, but you can. There's no x86 cops.
but ghidra for some reason thought it was a undefined, which is a 1-byte type. BP is a 16-bit register. So instead of just using the parameter directly, it decompiled the code as doing this:
iVar7 = CONCAT11(unaff_00000015, bp_parameter)