// File: /workspace/github_c_makefile_star2_O3/pocari[P]compilerbook-9cc/parser.c
// Function: program
Program *program() {
  Function head = {};
  Function *cur = &head;
  while (!at_eof()) {
    switch(next_decl()) {
      case NEXT_DECL_FUNCTION_DEF:
        {
          Function *f = function_def_or_decl();
          if (f) {
            cur->next = f;
            cur = cur->next;
          }
        }
        break;
      case NEXT_DECL_GLOBAL_VAR_OR_TYPEDEF:
        global_var_decl();
        break;
      default:
        // ここには来ないはず
        assert(false);
    }
  }
  Program *program = calloc(1, sizeof(Program));
  program->global_var = globals;
  program->functions = head.next;

  return program;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq $0x0, 0x30(%rsp)
leaq 0xb87b(%rip), %rax      # 0x10480
movq (%rax), %r12
cmpl $0x1e, (%r12)
jne 0x4c16
xorl %ebx, %ebx
jmp 0x516e
leaq 0x30(%rsp), %r15
leaq 0x8(%rsp), %rbp
leaq 0x794f(%rip), %rbx      # 0xc576
movl $0x0, 0x8(%rsp)
movq %rbp, %rdi
callq 0x522f
cmpl $0x1, 0x8(%rsp)
je 0x4d30
movq %rax, %r14
leaq 0x7a6e(%rip), %rdi      # 0xc6ba
callq 0x51eb
testb %al, %al
jne 0x4d30
movq %r14, %rdi
leaq 0x40(%rsp), %rsi
callq 0x58f5
movq %rbx, %rdi
callq 0x51eb
testb %al, %al
je 0x4d30
leaq 0xb803(%rip), %rax      # 0x10480
movq %r12, (%rax)
movq $0x0, 0xb7c5(%rip) # 0x10450
leaq 0x1c(%rsp), %rdi
callq 0x522f
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x58f5
movq %rax, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x2100
movq %rax, %r13
movq %r14, 0x8(%rax)
movq 0x10(%rsp), %r12
movq %r12, 0x10(%rax)
movq %r14, %rdi
callq 0x9e59
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x761c
movb $0x0, 0x20(%rax)
movq 0xb75c(%rip), %rax      # 0x10440
movq %rax, 0x20(%rsp)
movq 0xb748(%rip), %rax      # 0x10438
movq %rax, 0x28(%rsp)
incl 0xb735(%rip)            # 0x10430
movq %rbx, %rdi
leaq 0xb77b(%rip), %rbx      # 0x10480
callq 0x5b5c
leaq 0x7878(%rip), %rdi      # 0xc589
callq 0x51eb
movq (%rbx), %r14
testb %al, %al
je 0x4e52
movq 0x8(%r14), %rax
movq %rax, (%rbx)
xorl %r12d, %r12d
jmp 0x5008
leaq 0xb749(%rip), %rbx      # 0x10480
movq %r12, (%rbx)
movl $0x0, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x522f
movq %rax, %r14
leaq 0x7964(%rip), %rdi      # 0xc6ba
callq 0x51eb
movq (%rbx), %r13
testb %al, %al
je 0x4d6e
movq 0x8(%r13), %rax
movq %rax, (%rbx)
jmp 0x5040
movq %r14, %rdi
movq %rbp, %rsi
callq 0x58f5
movq %rax, %r14
movl 0x10(%rsp), %ebp
cmpl $0x1, %ebp
jne 0x4dd1
leaq 0x792e(%rip), %rdi      # 0xc6ba
callq 0x5b5c
movq 0x8(%rsp), %r12
movl $0x1, %edi
movl $0x30, %esi
callq 0x2100
movq %r12, 0x8(%rax)
movq 0xb690(%rip), %rcx      # 0x10440
movq %rcx, (%rax)
movl 0xb677(%rip), %ecx      # 0x10430
movl %ecx, 0x2c(%rax)
movq %rax, 0xb67d(%rip)      # 0x10440
movq %r14, 0x18(%rax)
leaq 0x8(%rsp), %rbp
jmp 0x5040
movq 0x8(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x761c
movq %rax, %r12
cmpl $0x2, %ebp
sete 0x20(%rax)
cmpl $0x4, %ebp
je 0x4e13
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq %r12, 0x8(%rax)
movq 0xb61f(%rip), %rcx      # 0x10428
movq %rcx, (%rax)
movq %rax, 0xb615(%rip)      # 0x10428
cmpl $0x4, 0x10(%rsp)
leaq 0x8(%rsp), %rbp
je 0x4e84
leaq 0x7adb(%rip), %rdi      # 0xc901
callq 0x51eb
testb %al, %al
je 0x4e79
movq (%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, (%rbx)
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x76f2
movq 0x40(%rsp), %rax
movq %rax, 0x18(%r12)
jmp 0x4e84
cmpl $0xa, (%r14)
jne 0x4e95
movq 0x8(%r14), %r12
movq %r12, (%rbx)
leaq 0x7723(%rip), %rdi      # 0xc589
callq 0x51eb
testb %al, %al
je 0x4e95
movq 0x8(%r12), %rax
jmp 0x4d25
cmpb $0x1, 0xc(%r14)
je 0x519d
leaq 0x782f(%rip), %rdi      # 0xc6ba
callq 0x5b5c
jmp 0x5040
movq %r14, (%rbx)
xorl %edi, %edi
callq 0x522f
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x58f5
cmpl $0x8, (%rax)
jne 0x4eba
movq 0x10(%rax), %rdi
callq 0x9de4
movq 0x40(%rsp), %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x761c
movq %rax, %r14
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq %r14, 0x8(%rax)
movq 0xb567(%rip), %rcx      # 0x10450
movq %rcx, (%rax)
movq %rax, 0xb55d(%rip)      # 0x10450
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq %rax, %rbp
movq %r14, 0x8(%rax)
leaq 0x7679(%rip), %rdi      # 0xc589
callq 0x51eb
testb %al, %al
je 0x4f21
movq %rbp, %r14
jmp 0x4fcc
leaq 0x7787(%rip), %rdi      # 0xc6af
callq 0x5b5c
leaq 0x7c50(%rip), %rdi      # 0xcb84
callq 0x51eb
testb %al, %al
jne 0x4fde
xorl %edi, %edi
callq 0x522f
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x58f5
cmpl $0x8, (%rax)
jne 0x4f63
movq 0x10(%rax), %rdi
callq 0x9de4
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x761c
movq %rax, %r12
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq %r12, 0x8(%rax)
movq 0xb4be(%rip), %rcx      # 0x10450
movq %rcx, (%rax)
movq %rax, 0xb4b4(%rip)      # 0x10450
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq %rax, %r14
movq %r12, 0x8(%rax)
movq %rbp, (%rax)
leaq 0x75cd(%rip), %rdi      # 0xc589
callq 0x51eb
movq %r14, %rbp
testb %al, %al
je 0x4f21
movq (%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, (%rbx)
xorl %r12d, %r12d
movq %r14, %rbp
jmp 0x4fff
movq (%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, (%rbx)
movb $0x1, 0x35(%r13)
leaq 0x7595(%rip), %rdi      # 0xc589
callq 0x5b5c
movl $0x38, %r12d
movq %rbp, 0x28(%r13)
leaq 0x8(%rsp), %rbp
leaq 0x76ab(%rip), %rdi      # 0xc6ba
callq 0x51eb
testb %al, %al
je 0x5060
movq (%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, (%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0xb412(%rip)      # 0x10440
movq 0x28(%rsp), %rax
movq %rax, 0xb3fe(%rip)      # 0x10438
decl 0xb3f0(%rip)            # 0x10430
movq %r15, %r13
movq (%rbx), %r12
cmpl $0x1e, (%r12)
movq %r13, %r15
leaq 0x7521(%rip), %rbx      # 0xc576
jne 0x4c27
jmp 0x5169
leaq 0x72af(%rip), %rdi      # 0xc316
callq 0x5b5c
movl $0xc8, %edx
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x20e0
leaq 0x7626(%rip), %rdi      # 0xc6ad
callq 0x51eb
testb %al, %al
je 0x5094
xorl %eax, %eax
jmp 0x50cd
movq %r15, 0x38(%rsp)
movq %r14, %rbp
leaq 0x760a(%rip), %r15      # 0xc6ad
callq 0x867b
movq %rax, %r14
movq %rax, 0x30(%rbp)
movq %r15, %rdi
callq 0x51eb
movq %r14, %rbp
testb %al, %al
je 0x50a3
movq 0x70(%rsp), %rax
leaq 0x8(%rsp), %rbp
movq 0x38(%rsp), %r15
movq (%rbx), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, (%rbx)
movq %rax, 0x18(%r13)
movq 0xb36e(%rip), %rcx      # 0x10450
movq %rcx, 0x20(%r13)
cmpl $0x2, 0x1c(%rsp)
sete 0x34(%r13)
testq %rcx, %rcx
je 0x5122
movq 0x8(%rcx), %rsi
movq (%rsi), %rdi
movl 0x8(%rdi), %r8d
movl %r12d, %eax
cltd
idivl %r8d
cmpl $0x1, %edx
movl %eax, %r12d
sbbl $-0x1, %r12d
imull %r8d, %r12d
addl 0x4(%rdi), %r12d
movl %r12d, 0x10(%rsi)
movq (%rcx), %rcx
jmp 0x50f0
leal 0x7(%r12), %eax
testl %r12d, %r12d
cmovnsl %r12d, %eax
shrl $0x3, %eax
andl $0x7, %r12d
cmpl $0x1, %r12d
sbbl $-0x1, %eax
shll $0x3, %eax
movl %eax, 0x30(%r13)
movq 0x20(%rsp), %rax
movq %rax, 0xb2f1(%rip)      # 0x10440
movq 0x28(%rsp), %rax
movq %rax, 0xb2dd(%rip)      # 0x10438
decl 0xb2cf(%rip)            # 0x10430
movq %r13, (%r15)
jmp 0x5043
movq 0x30(%rsp), %rbx
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq 0xb2a4(%rip), %rcx      # 0x10428
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r13), %rdi
leaq 0x79be(%rip), %rsi      # 0xcb66
xorl %eax, %eax
callq 0x487c