Error: Asm: byte value exceeds bounds 1032

FPC [main] x64
x64 win - bug 🐞
x32 win - bug 🐞
x64 lin - bug 🐞

Based on: #41553

Compile:
/home/user/fpcupdeluxe/fpc/bin/x86_64-linux/fpc -n -Fu/home/user/fpcupdeluxe/fpc/units/x86_64-linux/rtl -O- -OoLEVEL1 -OoPEEPHOLE -OoLEVEL2 -OoREGVAR app.lpr
or
fpc.exe -n -FuC:\fpclaztrunk\fpc\units\x86_64-win64\rtl -O- -OoLEVEL1 -OoPEEPHOLE -OoLEVEL2 -OoREGVAR app.lpr

program app;
{$mode objfpc}

function FuncRetBool: Boolean;
begin
end;

function pek(flags: cardinal): integer;
  function kek: boolean;
  begin
    Result := (flags and $20 <> 0) and (flags and $8 = 0) and (flags and $400 = 0) and not FuncRetBool;
  end;
begin
end;

begin
end.
Edited by alligator