// File: /workspace/github_c_makefile_star2_O2/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), %rcx
movq (%rcx), %rax
movl (%rax), %edx
cmpl $0x7, %edx
je 0x4217
cmpl $0x3, %edx
je 0x4203
cmpl $0x2, %edx
jne 0x4232
movq 0x10(%rax), %rax
movq (%rax), %r13
pushq $0xa
popq %r12
pushq $0x8
popq %rbp
xorl %r15d, %r15d
xorl %r14d, %r14d
movslq 0x8(%rax), %rdx
cmpq %rdx, %r15
jge 0x420e
movl %r12d, %esi
movb (%r13,%r15), %dl
cmpb $0x30, %dl
cmovel %ebp, %r12d
testq %r15, %r15
cmovnel %esi, %r12d
movl %edx, %esi
andb $-0x21, %sil
cmpq $0x1, %r15
jne 0x4182
cmpb $0x58, %sil
sete %dil
cmpl $0x8, %r12d
sete %r8b
testb %r8b, %dil
jne 0x420e
cmpb $0x4c, %sil
je 0x420e
movsbl %dl, %ecx
cmpl $0x8, %r12d
je 0x41b1
cmpl $0xa, %r12d
jne 0x41f1
addl $-0x30, %edx
cmpb $0x9, %dl
ja 0x41c3
imull $0xa, %r14d, %eax
leal (%rax,%rcx), %r14d
addl $-0x30, %r14d
jmp 0x41f1
andb $-0x8, %dl
cmpb $0x30, %dl
jne 0x41d4
leal (%rcx,%r14,8), %r14d
addl $-0x30, %r14d
jmp 0x41f1
movq (%rax), %rcx
leaq 0x2d43(%rip), %rdi      # 0x6f10
movl $0x244, %esi            # imm = 0x244
jmp 0x41e3
movq (%rax), %rcx
leaq 0x2d32(%rip), %rdi      # 0x6f10
movl $0x24a, %esi            # imm = 0x24A
leaq 0x2db8(%rip), %rdx      # 0x6fa2
xorl %eax, %eax
callq 0x1252
incq %r15
movq (%rbx), %rcx
movq (%rcx), %rax
movq 0x10(%rax), %rax
jmp 0x413a
movq 0x10(%rax), %rax
movq (%rax), %rax
movzbl (%rax), %r14d
movq 0x8(%rcx), %rax
movq %rax, (%rbx)
jmp 0x4253
movq 0x8(%rcx), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x4265
movq (%rbx), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, (%rbx)
jmp 0x4256
movq 0x10(%rax), %rax
movq (%rax), %rcx
leaq 0x2cd0(%rip), %rdi      # 0x6f10
leaq 0x2d7b(%rip), %rdx      # 0x6fc2
movl $0x264, %esi            # imm = 0x264
xorl %eax, %eax
callq 0x1252
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq