// File: /workspace/github_c_makefile_star2_O3/42Bastian[P]lyxass/mnemonics.c
// Function: op8
int op8(int op)
{
  int err;
  int32_t l;
  int flag = 0;
  int brace = 0;

  if ( TestAtom('#') ){

    if ( (err = Expression( &l )) == EXPR_ERROR ) return 1;
    if ( l < -128 || l > 255 ) return Error(BYTE_ERR,"");
    CYCLES += 2;
    writeConstByte(op == 0x20 ? 0x89 : op);
    writeByte((char)l);
  } else {
    brace = atom == '(';
    if ( (err = Expression( &l )) == EXPR_ERROR ) return 1;
    if ( brace && last_atom == ')' ){
      Warning("BIT/LDY/CPY (n) translates to BIT/LDY/CPY n\n");
    }

    if ( l < 0 || l > 65535 ) return Error(WORD_ERR,"");
    op |= 0x04;
    CYCLES += 3;
    if ( l > 255 || err == EXPR_UNSOLVED || Current.pass2 ){
      op |= 0x08;
      flag = 1;
      CYCLES++;
    }
    if ( TestAtom(',') ){
      if ( (op & 0xc0) == 0xc0) return Error(SYNTAX_ERR,"");                     // no cpy ABCD,x !!!
      if ( !TestAtomOR('x','X') ) return Error(SYNTAX_ERR,"");
      op |= 0x10;
      CYCLES++;
    }

    writeConstByte(op);
    if ( flag ){
      writeWordLittle((short)l);
    } else {
      writeByte((char)l);
    }
  }
  if ( err == EXPR_UNSOLVED ) saveCurrentLine();
  return 0;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebp
movl $0x23, %edi
callq 0x4fa8
testl %eax, %eax
je 0x880b
leaq 0x4(%rsp), %rdi
callq 0x9d6c
movl $0x1, %r14d
cmpl $0x1, %eax
je 0x895c
movl %eax, %ebx
movl $0xffffff00, %eax       # imm = 0xFFFFFF00
addl 0x4(%rsp), %eax
cmpl $0xfffffe7f, %eax       # imm = 0xFFFFFE7F
ja 0x8869
leaq 0x4791(%rip), %rsi      # 0xcf92
movl $0x1a, %edi
jmp 0x8954
leaq 0x1471e(%rip), %rax     # 0x1cf30
movl (%rax), %r15d
leaq 0x4(%rsp), %rdi
callq 0x9d6c
movl $0x1, %r14d
cmpl $0x1, %eax
je 0x895c
movl %eax, %ebx
cmpl $0x28, %r15d
jne 0x884e
leaq 0x146f7(%rip), %rax     # 0x1cf34
cmpl $0x29, (%rax)
jne 0x884e
leaq 0x4c7a(%rip), %rdi      # 0xd4c3
callq 0xa81b
cmpl $0x10000, 0x4(%rsp)     # imm = 0x10000
jb 0x88ae
leaq 0x4733(%rip), %rsi      # 0xcf92
movl $0x1b, %edi
jmp 0x8954
leaq 0xbf68(%rip), %rax      # 0x147d8
movq (%rax), %rax
addl $0x2, (%rax)
cmpl $0x20, %ebp
movl $0x89, %eax
cmovnel %ebp, %eax
movsbl %al, %edi
callq 0x3355
movsbl 0x4(%rsp), %edi
callq 0x340b
xorl %r14d, %r14d
cmpl $0x2, %ebx
jne 0x895c
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xa118
jmp 0x895c
leaq 0xbf23(%rip), %r15      # 0x147d8
movq (%r15), %rax
movl (%rax), %ecx
leal 0x3(%rcx), %edx
movl %edx, (%rax)
cmpl $0x100, 0x4(%rsp)       # imm = 0x100
setl %dl
cmpl $0x2, %ebx
setne %sil
andb %dl, %sil
leaq 0xbd2d(%rip), %rdx      # 0x14608
cmpl $0x0, 0xe4(%rdx)
sete %r14b
andb %sil, %r14b
je 0x88f0
orl $0x4, %ebp
jmp 0x88f8
orl $0xc, %ebp
addl $0x4, %ecx
movl %ecx, (%rax)
movl $0x2c, %edi
callq 0x4fa8
testl %eax, %eax
je 0x8929
movl %ebp, %eax
notl %eax
testb $-0x40, %al
je 0x8948
movl $0x78, %edi
movl $0x58, %esi
callq 0x504d
testl %eax, %eax
je 0x8948
orl $0x10, %ebp
movq (%r15), %rax
incl (%rax)
movsbl %bpl, %edi
callq 0x3355
movl 0x4(%rsp), %eax
testb %r14b, %r14b
je 0x896a
movsbl %al, %edi
callq 0x340b
xorl %r14d, %r14d
jmp 0x895c
leaq 0x4643(%rip), %rsi      # 0xcf92
movl $0x12, %edi
callq 0xa1d8
movl %eax, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movswl %ax, %edi
callq 0x355d
jmp 0x8893