// File: /workspace/github_c_makefile_star2_O1/ShinyaKato[P]skcc/preprocess.c
// Function: primary_expression
int primary_expression(struct pp_node **node) {
  if((*node)->token->type == PP_NUM) {
    int value = 0;
    int base = 10;
    unsigned char *s = (*node)->token->text->head;
    for(int i = 0; i < (*node)->token->text->size; i++) {
      char c = s[i];
      if(i == 0 && c == '0') {
        base = 8;
      }
      if(i == 1 && (c == 'x' || c == 'X') && base == 8) {
        base = 16;
        break;
      }
      if(c == 'l' || c == 'L') break;
      if(base == 10) {
        if('0' <= c && c <= '9') {
          value = value * 10 + (c - '0');
        } else {
          error("invalid integer constant: \"%s\"\n", (*node)->token->text->head);
        }
      } else if(base == 8) {
        if('0' <= c && c <= '7') {
          value = value * 8 + (c - '0');
        } else {
          error("invalid integer constant: \"%s\"\n", (*node)->token->text->head);
        }
      } else if(base == 16) {
        if('0' <= c && c <= '9') {
          value = value * 16 + (c - '0');
        } else if('a' <= c && c <= 'f') {
          value = value * 16 + (c - 'a' + 10);
        } else if('A' <= c && c <= 'F') {
          value = value * 16 + (c - 'A' + 10);
        } else {
          error("invalid integer constant: \"%s\"\n", (*node)->token->text->head);
        }
      }
    }
    *node = (*node)->next;
    return value;
  } else if((*node)->token->type == PP_CHAR) {
    int value = (*node)->token->text->head[0];
    *node = (*node)->next;
    return value;
  } else if((*node)->token->type == PP_LPAREN) {
    *node = (*node)->next;
    int value = conditional_expression(node);
    *node = (*node)->next;
    return value;
  }
  error("invalid integer constant expression: %s\n", (*node)->token->text->head);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movq (%rax), %rcx
movl (%rcx), %edx
cmpl $0x7, %edx
je 0x5007
cmpl $0x3, %edx
je 0x4ffa
cmpl $0x2, %edx
jne 0x5022
movq (%rbx), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
cmpl $0x0, 0x8(%rax)
jle 0x5045
movq 0x10(%rcx), %rcx
movq (%rcx), %r13
movl $0xa, %ebp
movl $0x8, %edi
xorl %r12d, %r12d
xorl %r14d, %r14d
movl %ebp, %ecx
movb (%r13,%r12), %dl
cmpb $0x30, %dl
cmovel %edi, %ebp
testq %r12, %r12
cmovnel %ecx, %ebp
cmpq $0x1, %r12
jne 0x4efd
movl %edx, %ecx
andb $-0x21, %cl
cmpb $0x58, %cl
jne 0x4efd
cmpl $0x8, %ebp
jne 0x4efd
xorl %r15d, %r15d
movl $0x10, %ebp
jmp 0x4faf
movl %edx, %ecx
andb $-0x21, %cl
cmpb $0x4c, %cl
jne 0x4f0f
xorl %r15d, %r15d
jmp 0x4faf
movsbl %dl, %ecx
movb $0x1, %r15b
cmpl $0x8, %ebp
je 0x4f54
cmpl $0x10, %ebp
je 0x4f3e
cmpl $0xa, %ebp
jne 0x4faf
addl $-0x30, %edx
cmpb $0x9, %dl
ja 0x4f8d
leal (%r14,%r14,4), %eax
leal (%rcx,%rax,2), %r14d
addl $-0x30, %r14d
jmp 0x4faf
leal -0x30(%rdx), %esi
cmpb $0x9, %sil
ja 0x4f66
shll $0x4, %r14d
addl %ecx, %r14d
addl $-0x30, %r14d
jmp 0x4faf
andb $-0x8, %dl
cmpb $0x30, %dl
jne 0x4f7c
leal (%rcx,%r14,8), %r14d
addl $-0x30, %r14d
jmp 0x4faf
leal -0x61(%rdx), %esi
cmpb $0x5, %sil
ja 0x4fd4
shll $0x4, %r14d
addl %ecx, %r14d
addl $-0x57, %r14d
jmp 0x4faf
movq (%rax), %rcx
leaq 0x2eaa(%rip), %rdi      # 0x7e30
movl $0x24a, %esi            # imm = 0x24A
jmp 0x4f9c
movq (%rax), %rcx
leaq 0x2e99(%rip), %rdi      # 0x7e30
movl $0x244, %esi            # imm = 0x244
leaq 0x2f1f(%rip), %rdx      # 0x7ec2
xorl %eax, %eax
callq 0x140c
movl $0x8, %edi
testb %r15b, %r15b
je 0x5048
incq %r12
movq (%rbx), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq 0x8(%rax), %rcx
cmpq %rcx, %r12
jl 0x4ec8
jmp 0x5048
addl $-0x41, %edx
cmpb $0x5, %dl
ja 0x4fe9
shll $0x4, %r14d
addl %ecx, %r14d
addl $-0x37, %r14d
jmp 0x4faf
movq (%rax), %rcx
leaq 0x2e3d(%rip), %rdi      # 0x7e30
movl $0x254, %esi            # imm = 0x254
jmp 0x4f9c
movq 0x10(%rcx), %rcx
movq (%rcx), %rcx
movzbl (%rcx), %r14d
jmp 0x504b
movq 0x8(%rax), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x5064
movq (%rbx), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, (%rbx)
jmp 0x5055
movq 0x10(%rcx), %rax
movq (%rax), %rcx
leaq 0x2e00(%rip), %rdi      # 0x7e30
leaq 0x2eab(%rip), %rdx      # 0x7ee2
movl $0x264, %esi            # imm = 0x264
xorl %eax, %eax
callq 0x140c
jmp 0x5052
xorl %r14d, %r14d
movq (%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, (%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq