// File: /workspace/github_c_makefile_star2_O3/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 0x4858
cmpl $0x3, %edx
je 0x484b
cmpl $0x2, %edx
jne 0x4873
movq 0x10(%rcx), %rcx
cmpl $0x0, 0x8(%rcx)
jle 0x4896
movq (%rcx), %r13
movl $0xa, %ebp
movl $0x8, %r15d
xorl %r12d, %r12d
xorl %r14d, %r14d
movl %ebp, %esi
movb (%r13,%r12), %dl
cmpb $0x30, %dl
cmovel %r15d, %ebp
testq %r12, %r12
cmovnel %esi, %ebp
movl %edx, %esi
andb $-0x21, %sil
cmpq $0x1, %r12
jne 0x47c2
cmpb $0x58, %sil
sete %dil
cmpl $0x8, %ebp
sete %r8b
testb %r8b, %dil
jne 0x4899
cmpb $0x4c, %sil
je 0x4899
movsbl %dl, %eax
cmpl $0x8, %ebp
je 0x47ef
cmpl $0xa, %ebp
jne 0x482f
addl $-0x30, %edx
cmpb $0x9, %dl
ja 0x4801
leal (%r14,%r14,4), %ecx
leal (%rax,%rcx,2), %r14d
addl $-0x30, %r14d
jmp 0x482f
andb $-0x8, %dl
cmpb $0x30, %dl
jne 0x4812
leal (%rax,%r14,8), %r14d
addl $-0x30, %r14d
jmp 0x482f
movq (%rcx), %rcx
leaq 0x3705(%rip), %rdi      # 0x7f10
movl $0x244, %esi            # imm = 0x244
jmp 0x4821
movq (%rcx), %rcx
leaq 0x36f4(%rip), %rdi      # 0x7f10
movl $0x24a, %esi            # imm = 0x24A
leaq 0x377a(%rip), %rdx      # 0x7fa2
xorl %eax, %eax
callq 0x142c
incq %r12
movq (%rbx), %rax
movq (%rax), %rcx
movq 0x10(%rcx), %rcx
movslq 0x8(%rcx), %rdx
cmpq %rdx, %r12
jl 0x478a
jmp 0x4899
movq 0x10(%rcx), %rcx
movq (%rcx), %rcx
movzbl (%rcx), %r14d
jmp 0x4899
movq 0x8(%rax), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x48b2
movq (%rbx), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, (%rbx)
jmp 0x48a3
movq 0x10(%rcx), %rax
movq (%rax), %rcx
leaq 0x368f(%rip), %rdi      # 0x7f10
leaq 0x373a(%rip), %rdx      # 0x7fc2
movl $0x264, %esi            # imm = 0x264
xorl %eax, %eax
callq 0x142c
jmp 0x48a0
xorl %r14d, %r14d
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