// File: /workspace/github_c_makefile_star2_O0/42Bastian[P]lyxass/jaguar.c
// Function: GetRegisterOrPC
int GetRegisterOrPC(int *reg)
{
  extern int LabelTable[256];

  label_t regL,*regL2;
  int32_t solved;
  char *p;

  SavePosition();

  *reg = -1;

  KillSpace();

  if ( (atom == 'r' || atom == 'R') && isdigit(next_atom) ){
   int32_t l;
    GetAtom();
    if ( getdec32(&l) == EXPR_ERR ) return Error(REG_ERR,"");
    if ( l > 31 ) return Error(REG_ERR,"");
    *reg = (int)l;
    return 0;
  }

  if ( (atom == 'p' || atom == 'P') &&
       (next_atom == 'c' || next_atom == 'C') ){
    *reg = 64;
    GetAtom();
    GetAtom();
    if ( !LabelTable[atom] ) return 0;
    RestorePosition();
  }

  p = srcLinePtr - 1;

  if ( GetLabel(&regL) ) return 1;

  if ( (regL2 = FindLabel(&regL, &solved)) == NULL ) return Error(REG_ERR,"");

  if (regL2->type != REGISTER ) return Error(REG_ERR,"");

  if (regL2->type == REGISTER && regL2->value == -1 ) return Error(REG_ERR,"");

  if ( regL2->len > 2 ){
    *p++ = 'r';
    *p++ = (char)(regL2->value / 10 + '0');
    *p++ = (char)(regL2->value % 10 + '0');
    *p++ = atom;
    memmove(p,srcLinePtr,strlen(srcLinePtr)+1);
  } else {
    memmove(p+4,srcLinePtr,strlen(srcLinePtr)+1);
    *p++ = 'r';
    *p++ = (char)(regL2->value / 10 + '0');
    *p++ = (char)(regL2->value % 10 + '0');
    *p++ = atom;
  }
  srcLinePtr = p;
  next_atom = *p;

  *reg = (int)regL2->value;

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
callq 0x5a50
movq -0x10(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movb $0x0, %al
callq 0x5ad0
leaq 0x13474(%rip), %rax     # 0x20f20
cmpl $0x72, (%rax)
je 0xdac1
leaq 0x13468(%rip), %rax     # 0x20f20
cmpl $0x52, (%rax)
jne 0xdb4a
callq 0x31d0
movq (%rax), %rax
leaq 0x13458(%rip), %rcx     # 0x20f28
movslq (%rcx), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xdb4a
callq 0x59e0
leaq -0x8c(%rbp), %rdi
callq 0xba90
cmpl $0x11, %eax
jne 0xdb10
movl $0x2c, %edi
leaq 0x355a(%rip), %rsi      # 0x1105d
callq 0xd130
movl %eax, -0x4(%rbp)
jmp 0xde77
cmpl $0x1f, -0x8c(%rbp)
jle 0xdb32
movl $0x2c, %edi
leaq 0x3538(%rip), %rsi      # 0x1105d
callq 0xd130
movl %eax, -0x4(%rbp)
jmp 0xde77
movl -0x8c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0xde77
leaq 0x133cf(%rip), %rax     # 0x20f20
cmpl $0x70, (%rax)
je 0xdb62
leaq 0x133c3(%rip), %rax     # 0x20f20
cmpl $0x50, (%rax)
jne 0xdbb6
leaq 0x133bf(%rip), %rax     # 0x20f28
cmpl $0x63, (%rax)
je 0xdb7a
leaq 0x133b3(%rip), %rax     # 0x20f28
cmpl $0x43, (%rax)
jne 0xdbb6
movq -0x10(%rbp), %rax
movl $0x40, (%rax)
callq 0x59e0
callq 0x59e0
leaq 0x1338b(%rip), %rax     # 0x20f20
movslq (%rax), %rcx
leaq 0x13c01(%rip), %rax     # 0x217a0
cmpl $0x0, (%rax,%rcx,4)
jne 0xdbb1
movl $0x0, -0x4(%rbp)
jmp 0xde77
callq 0x5a70
leaq 0x13353(%rip), %rax     # 0x20f10
movq (%rax), %rax
addq $-0x1, %rax
movq %rax, -0x88(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x5de0
cmpl $0x0, %eax
je 0xdbe5
movl $0x1, -0x4(%rbp)
jmp 0xde77
leaq -0x70(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0x6f20
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
jne 0xdc15
movl $0x2c, %edi
leaq 0x3455(%rip), %rsi      # 0x1105d
callq 0xd130
movl %eax, -0x4(%rbp)
jmp 0xde77
movq -0x78(%rbp), %rax
cmpl $0x40, 0x4(%rax)
je 0xdc38
movl $0x2c, %edi
leaq 0x3432(%rip), %rsi      # 0x1105d
callq 0xd130
movl %eax, -0x4(%rbp)
jmp 0xde77
movq -0x78(%rbp), %rax
cmpl $0x40, 0x4(%rax)
jne 0xdc66
movq -0x78(%rbp), %rax
cmpq $-0x1, 0x8(%rax)
jne 0xdc66
movl $0x2c, %edi
leaq 0x3404(%rip), %rsi      # 0x1105d
callq 0xd130
movl %eax, -0x4(%rbp)
jmp 0xde77
movq -0x78(%rbp), %rax
cmpl $0x2, (%rax)
jle 0xdd58
movq -0x88(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x88(%rbp)
movb $0x72, (%rax)
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movl $0xa, %ecx
cqto
idivq %rcx
addq $0x30, %rax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movl $0xa, %ecx
cqto
idivq %rcx
addq $0x30, %rdx
movb %dl, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
leaq 0x13230(%rip), %rax     # 0x20f20
movl (%rax), %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movq -0x88(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq 0x131f0(%rip), %rax     # 0x20f10
movq (%rax), %rax
movq %rax, -0x98(%rbp)
leaq 0x131df(%rip), %rax     # 0x20f10
movq (%rax), %rdi
callq 0x30a0
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x3170
jmp 0xde3c
movq -0x88(%rbp), %rax
addq $0x4, %rax
movq %rax, -0xb0(%rbp)
leaq 0x1319f(%rip), %rax     # 0x20f10
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
leaq 0x1318e(%rip), %rax     # 0x20f10
movq (%rax), %rdi
callq 0x30a0
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x3170
movq -0x88(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x88(%rbp)
movb $0x72, (%rax)
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movl $0xa, %ecx
cqto
idivq %rcx
addq $0x30, %rax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movl $0xa, %ecx
cqto
idivq %rcx
addq $0x30, %rdx
movb %dl, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
leaq 0x130ff(%rip), %rax     # 0x20f20
movl (%rax), %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movq -0x88(%rbp), %rcx
leaq 0x130c6(%rip), %rax     # 0x20f10
movq %rcx, (%rax)
movq -0x88(%rbp), %rax
movsbl (%rax), %ecx
leaq 0x130ca(%rip), %rax     # 0x20f28
movl %ecx, (%rax)
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)