// File: /workspace/github_c_makefile_star2_O0/42Bastian[P]lyxass/mnemonics.c
// Function: opa
int opa(int op)
{
  int err;
  int32_t l;

  KillSpace();
  if ( !atom || op == 0x1a || op == 0x3a ){
    op |= 8;
    if ( op >= 0xca ) op ^= 0xf0;
    writeConstByte(op);
    CYCLES += 2;
    return 0;
  }

  if ( (err = Expression( &l )) == EXPR_ERROR ) return 1;
  if ( l < 0 || l > 65535 ) return Error(WORD_ERR,"");

  CYCLES += 5;
  op |= 0x04;
  if ( l > 255 || err == EXPR_UNSOLVED || Current.pass2 ){
    ++CYCLES;
    op |= 0x0a;
    if ( TestAtom(',') ){
      if ( !TestAtomOR('x','X') ) return Error(SYNTAX_ERR,"");
      op |= 0x10;
    }
    writeConstByte(op);
    writeWordLittle((short)l);
  } else {
    if ( TestAtom(',') ){
      if ( !TestAtomOR('x','X') ) return Error(SYNTAX_ERR,"");
      op |= 0x10;
      ++CYCLES;
    }
    writeConstByte(op);
    writeByte((char)l);
  }
  if ( err == EXPR_UNSOLVED ) saveCurrentLine();
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movb $0x0, %al
callq 0x5ad0
leaq 0x168c7(%rip), %rax     # 0x20f20
cmpl $0x0, (%rax)
je 0xa66a
cmpl $0x1a, -0x8(%rbp)
je 0xa66a
cmpl $0x3a, -0x8(%rbp)
jne 0xa6af
movl -0x8(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x8(%rbp)
cmpl $0xca, -0x8(%rbp)
jl 0xa687
movl -0x8(%rbp), %eax
xorl $0xf0, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movsbl %al, %edi
callq 0x3340
leaq 0xe12f(%rip), %rax      # 0x187c8
movq (%rax), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0xa821
leaq -0x10(%rbp), %rdi
callq 0xc920
movl %eax, -0xc(%rbp)
cmpl $0x1, %eax
jne 0xa6cc
movl $0x1, -0x4(%rbp)
jmp 0xa821
cmpl $0x0, -0x10(%rbp)
jl 0xa6db
cmpl $0xffff, -0x10(%rbp)    # imm = 0xFFFF
jle 0xa6f4
movl $0x1b, %edi
leaq 0x6976(%rip), %rsi      # 0x1105d
callq 0xd130
movl %eax, -0x4(%rbp)
jmp 0xa821
leaq 0xe0cd(%rip), %rax      # 0x187c8
movq (%rax), %rax
movl (%rax), %ecx
addl $0x5, %ecx
movl %ecx, (%rax)
movl -0x8(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x8(%rbp)
cmpl $0xff, -0x10(%rbp)
jg 0xa72d
cmpl $0x2, -0xc(%rbp)
je 0xa72d
leaq 0xded4(%rip), %rax      # 0x185f8
cmpl $0x0, 0xe4(%rax)
je 0xa7a4
leaq 0xe094(%rip), %rax      # 0x187c8
movq (%rax), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x8(%rbp), %eax
orl $0xa, %eax
movl %eax, -0x8(%rbp)
movl $0x2c, %edi
callq 0x5a90
cmpl $0x0, %eax
je 0xa78c
movl $0x78, %edi
movl $0x58, %esi
callq 0x5af0
cmpl $0x0, %eax
jne 0xa783
movl $0x12, %edi
leaq 0x68e7(%rip), %rsi      # 0x1105d
callq 0xd130
movl %eax, -0x4(%rbp)
jmp 0xa821
movl -0x8(%rbp), %eax
orl $0x10, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movsbl %al, %edi
callq 0x3340
movl -0x10(%rbp), %eax
movswl %ax, %edi
callq 0x3670
jmp 0xa80d
movl $0x2c, %edi
callq 0x5a90
cmpl $0x0, %eax
je 0xa7f7
movl $0x78, %edi
movl $0x58, %esi
callq 0x5af0
cmpl $0x0, %eax
jne 0xa7dd
movl $0x12, %edi
leaq 0x688a(%rip), %rsi      # 0x1105d
callq 0xd130
movl %eax, -0x4(%rbp)
jmp 0xa821
movl -0x8(%rbp), %eax
orl $0x10, %eax
movl %eax, -0x8(%rbp)
leaq 0xdfdb(%rip), %rax      # 0x187c8
movq (%rax), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x8(%rbp), %eax
movsbl %al, %edi
callq 0x3340
movl -0x10(%rbp), %eax
movsbl %al, %edi
callq 0x3470
cmpl $0x2, -0xc(%rbp)
jne 0xa81a
movb $0x0, %al
callq 0xcfe0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)