// File: /workspace/github_c_makefile_star2_O1/42Bastian[P]lyxass/expression.c
// Function: uni
int uni(int64_t *value)
{
  int err;
  char save;
  int64_t a = 0;


  KillSpace();

  save = atom;

  if ( atom == '-' || atom == '!' || atom == '~' ||
       atom == '>' || atom == '<' ){
    GetAtom();
  }

  switch ( atom ){
  case '$' :
    GetAtom();
    err = gethex( &a );
    break;
  case '%':
    GetAtom();
    err = getbin( &a );
    break;
  case '*':
    GetAtom();
    a = Global.pc;
    err = EXPR_OK;
    break;
  case '@':
    GetAtom();
    a = Global.var;
    err = EXPR_OK;
    break;
  case '"':
  {
    char help[80];
    char *ptr = help;
    int i = 5;

    GetAtom();
    if ( !GetString(help, '"') ){
      Error(SYNTAX_ERR, "Missing '\"'" );
      return EXPR_ERROR;
    }
    while ( *ptr && --i){
      a = (a<<8)| (int)*ptr++;
    }

    err = EXPR_OK;
  }
  break;
  case '\'':
  {
    char help[80];
    char *ptr = help;
    int i = 5;

    GetAtom();
    if ( !GetString(help, '\'') ){
      Error(SYNTAX_ERR, "Missing \"'\"");
      return EXPR_ERROR;
    }
    while ( *ptr && --i){
      a = (a<<8)| (int)*ptr++;
    }

    err = EXPR_OK;
  }
  break;
  case '(':
    GetAtom();
    err = sum( &a );
    if ( !TestAtom(')') ){
      Error(EXPR_ERR,"");
      return EXPR_ERR;
    }
    break;
  case '0':
    if ( next_atom == 'x' || next_atom == 'X' ){
      GetAtom();
      GetAtom();
      err = gethex(&a);
      break;
    }
  default:
    if ( atom >= '0' && atom <= '9' ){
      err = getdec( &a );
    }  else {
      err = getlabel( &a );
    }
  }
  if ( err ) return err;

  switch ( save ){
  case '-' : a = -a; break;
  case '!' : a = !a; break;
  case '~' : a = ~a; break;
  case '<' : a = a & 0xff; break;
  case '>' : a = (a >> 8) & 0xff; break;
  }
  *value = a;
  return EXPR_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq $0x0, 0x8(%rsp)
xorl %eax, %eax
callq 0x5037
leaq 0x136bc(%rip), %r15     # 0x1cf30
movl (%r15), %r14d
cmpq $0x3e, %r14
ja 0x988d
movabsq $0x5000200200000000, %rax # imm = 0x5000200200000000
btq %r14, %rax
jb 0x9893
cmpl $0x7e, %r14d
jne 0x9898
callq 0x4f15
movl (%r15), %eax
leal -0x22(%rax), %ecx
cmpl $0xe, %ecx
ja 0x9908
leaq 0x3c1a(%rip), %rdx      # 0xd4c4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
callq 0x4f15
leaq 0x10(%rsp), %rdi
movl $0x22, %esi
callq 0x5125
movl %eax, %ebp
testl %eax, %eax
je 0x9a2b
movq 0x8(%rsp), %rax
movb 0x10(%rsp), %cl
testb %cl, %cl
je 0x99c3
xorl %edx, %edx
cmpl $0x4, %edx
je 0x99c3
shlq $0x8, %rax
movsbq %cl, %rcx
orq %rcx, %rax
movb 0x11(%rsp,%rdx), %cl
incq %rdx
testb %cl, %cl
jne 0x98e4
jmp 0x99c3
cmpl $0x40, %eax
jne 0x994c
callq 0x4f15
leaq 0xaa97(%rip), %rax      # 0x143b0
movslq 0x18(%rax), %rax
jmp 0x9a12
leaq 0x1360f(%rip), %rcx     # 0x1cf38
movl (%rcx), %ecx
andl $-0x21, %ecx
cmpl $0x58, %ecx
jne 0x994c
callq 0x4f15
callq 0x4f15
leaq 0x8(%rsp), %rdi
callq 0x9669
jmp 0x9a1e
addl $-0x30, %eax
leaq 0x8(%rsp), %rdi
cmpl $0x9, %eax
ja 0x9a19
callq 0x95b2
jmp 0x9a1e
callq 0x4f15
leaq 0x8(%rsp), %rdi
callq 0x971d
jmp 0x9a1e
callq 0x4f15
leaq 0x10(%rsp), %rdi
movl $0x27, %esi
callq 0x5125
movl %eax, %ebp
testl %eax, %eax
je 0x9a22
movq 0x8(%rsp), %rax
movb 0x10(%rsp), %cl
testb %cl, %cl
je 0x99c3
xorl %edx, %edx
cmpl $0x4, %edx
je 0x99c3
shlq $0x8, %rax
movsbq %cl, %rcx
orq %rcx, %rax
movb 0x11(%rsp,%rdx), %cl
incq %rdx
testb %cl, %cl
jne 0x99a8
movq %rax, 0x8(%rsp)
jmp 0x9a3c
callq 0x4f15
leaq 0x8(%rsp), %rdi
callq 0x9ab2
movl %eax, %ebp
movl $0x29, %edi
callq 0x4fa3
testl %eax, %eax
jne 0x9a42
leaq 0x35a2(%rip), %rsi      # 0xcf92
movl $0x11, %ebp
movl $0x11, %edi
callq 0xa2c8
jmp 0x9aa5
callq 0x4f15
leaq 0xa9a0(%rip), %rax      # 0x143b0
movl (%rax), %eax
movq %rax, 0x8(%rsp)
jmp 0x9a40
callq 0x97b9
movl %eax, %ebp
jmp 0x9a42
leaq 0x37e6(%rip), %rsi      # 0xd20f
jmp 0x9a32
leaq 0x37d1(%rip), %rsi      # 0xd203
movl $0x12, %edi
callq 0xa2c8
testl %ebp, %ebp
je 0x9a76
xorl %ebp, %ebp
testl %ebp, %ebp
jne 0x9aa5
movsbl %r14b, %eax
cmpl $0x3b, %eax
jle 0x9a65
cmpl $0x3c, %eax
je 0x9a7d
cmpl $0x3e, %eax
je 0x9a84
cmpl $0x7e, %eax
jne 0x9a9b
notq 0x8(%rsp)
jmp 0x9a9b
cmpl $0x21, %eax
je 0x9a8b
cmpl $0x2d, %eax
jne 0x9a9b
negq 0x8(%rsp)
jmp 0x9a9b
movl $0x1, %ebp
jmp 0x9aa5
movzbl 0x8(%rsp), %eax
jmp 0x9a96
movzbl 0x9(%rsp), %eax
jmp 0x9a96
xorl %eax, %eax
cmpq $0x0, 0x8(%rsp)
sete %al
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq