// File: /workspace/github_c_makefile_star2_O1/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 0x4fa3
testl %eax, %eax
je 0x88bd
leaq 0x4(%rsp), %rdi
callq 0x9e70
movl $0x1, %r14d
cmpl $0x1, %eax
je 0x8a09
movl %eax, %ebx
movl $0xffffff00, %eax       # imm = 0xFFFFFF00
addl 0x4(%rsp), %eax
cmpl $0xfffffe7f, %eax       # imm = 0xFFFFFE7F
ja 0x891b
leaq 0x46df(%rip), %rsi      # 0xcf92
movl $0x1a, %edi
jmp 0x8a01
leaq 0x1466c(%rip), %rax     # 0x1cf30
movl (%rax), %r15d
leaq 0x4(%rsp), %rdi
callq 0x9e70
movl $0x1, %r14d
cmpl $0x1, %eax
je 0x8a09
movl %eax, %ebx
cmpl $0x28, %r15d
jne 0x8900
leaq 0x14645(%rip), %rax     # 0x1cf34
cmpl $0x29, (%rax)
jne 0x8900
leaq 0x4b5f(%rip), %rdi      # 0xd45a
callq 0xa900
cmpl $0x10000, 0x4(%rsp)     # imm = 0x10000
jb 0x8960
leaq 0x4681(%rip), %rsi      # 0xcf92
movl $0x1b, %edi
jmp 0x8a01
leaq 0xbeb6(%rip), %rax      # 0x147d8
movq (%rax), %rax
addl $0x2, (%rax)
cmpl $0x20, %ebp
movl $0x89, %eax
cmovnel %ebp, %eax
movsbl %al, %edi
callq 0x3348
movsbl 0x4(%rsp), %edi
callq 0x33fe
xorl %r14d, %r14d
cmpl $0x2, %ebx
jne 0x8a09
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xa204
jmp 0x8a09
leaq 0xbe71(%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 0xbc7b(%rip), %rdx      # 0x14608
cmpl $0x0, 0xe4(%rdx)
sete %r14b
andb %sil, %r14b
je 0x89a2
orl $0x4, %ebp
jmp 0x89aa
orl $0xc, %ebp
addl $0x4, %ecx
movl %ecx, (%rax)
movl $0x2c, %edi
callq 0x4fa3
testl %eax, %eax
je 0x89db
movl %ebp, %eax
notl %eax
testb $-0x40, %al
je 0x89f5
movl $0x78, %edi
movl $0x58, %esi
callq 0x5083
testl %eax, %eax
je 0x89f5
orl $0x10, %ebp
movq (%r15), %rax
incl (%rax)
movsbl %bpl, %edi
callq 0x3348
movl 0x4(%rsp), %eax
testb %r14b, %r14b
je 0x8a17
movsbl %al, %edi
jmp 0x8940
leaq 0x4596(%rip), %rsi      # 0xcf92
movl $0x12, %edi
callq 0xa2c8
movl %eax, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movswl %ax, %edi
callq 0x353c
jmp 0x8945