// File: /workspace/github_c_makefile_star2_O1/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 0xb83a(%rip), %r12      # 0x10480
movq (%r12), %r15
cmpl $0x1e, (%r15)
jne 0x4c84
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq 0xb7c2(%rip), %rcx      # 0x10428
movq %rcx, (%rax)
movq 0x30(%rsp), %rcx
movq %rcx, 0x8(%rax)
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x8(%rsp), %rbx
leaq 0x10(%rsp), %rbp
leaq 0x79c6(%rip), %r14      # 0xc665
movl $0x0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x5288
cmpl $0x1, 0x8(%rsp)
je 0x4f49
movq %rax, %r13
leaq 0x79ae(%rip), %rdi      # 0xc672
callq 0x5244
testb %al, %al
je 0x4ce2
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq %rcx, (%r12)
testq %rax, %rax
jne 0x4f49
movq $0x0, 0x40(%rsp)
movq %r13, %rdi
leaq 0x40(%rsp), %rsi
callq 0x59d0
leaq 0x7877(%rip), %rdi      # 0xc576
callq 0x5244
testb %al, %al
je 0x4f49
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq %rcx, (%r12)
testq %rax, %rax
je 0x4f49
movq %r15, (%r12)
movq $0x0, 0xb720(%rip) # 0x10450
leaq 0x1c(%rsp), %rdi
callq 0x5288
movq %rax, %rdi
movq %rbp, %rsi
callq 0x59d0
movq %rax, %r13
movl $0x1, %edi
movl $0x38, %esi
callq 0x2100
movq %rax, %rbp
movq %r13, 0x8(%rax)
movq 0x10(%rsp), %r15
movq %r15, 0x10(%rax)
movq %r13, %rdi
callq 0xa271
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x7888
movb $0x0, 0x20(%rax)
movq 0xb6b9(%rip), %rax      # 0x10440
movq %rax, 0x28(%rsp)
movq 0xb6a5(%rip), %r13      # 0x10438
incl 0xb697(%rip)            # 0x10430
leaq 0x77d6(%rip), %rdi      # 0xc576
callq 0x5c3c
leaq 0x77dd(%rip), %rdi      # 0xc589
callq 0x5244
testb %al, %al
je 0x4dca
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq %rcx, (%r12)
testq %rax, %rax
jne 0x50bb
movq (%r12), %r15
cmpl $0xa, (%r15)
jne 0x4dfd
movq 0x8(%r15), %rbx
movq %rbx, (%r12)
leaq 0x77a6(%rip), %rdi      # 0xc589
callq 0x5244
testb %al, %al
je 0x4dfd
movq 0x8(%rbx), %rax
movq %rax, (%r12)
testq %rbx, %rbx
jne 0x50bb
movq %r15, (%r12)
xorl %edi, %edi
callq 0x5288
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x59d0
cmpl $0x8, (%rax)
movq %r13, 0x38(%rsp)
jne 0x4e28
movq 0x10(%rax), %rdi
callq 0xa1fc
movq 0x40(%rsp), %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x7888
movq %rax, %r15
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq %r15, 0x8(%rax)
movq 0xb5f9(%rip), %rcx      # 0x10450
movq %rcx, (%rax)
movq %rax, 0xb5ef(%rip)      # 0x10450
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq %rax, %r13
movq %r15, 0x8(%rax)
leaq 0x8(%rsp), %rbx
leaq 0x7706(%rip), %rdi      # 0xc589
callq 0x5244
testb %al, %al
je 0x4ea1
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq %rcx, (%r12)
testq %rax, %rax
jne 0x50b2
leaq 0x77bf(%rip), %rdi      # 0xc667
callq 0x5c3c
leaq 0x7c88(%rip), %rdi      # 0xcb3c
callq 0x5244
testb %al, %al
je 0x4ed2
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq %rcx, (%r12)
testq %rax, %rax
jne 0x50a2
xorl %edi, %edi
callq 0x5288
movq %rax, %rdi
movq %rbx, %rsi
callq 0x59d0
cmpl $0x8, (%rax)
jne 0x4ef2
movq 0x10(%rax), %rdi
callq 0xa1fc
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x7888
movq %rax, %r15
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq %r15, 0x8(%rax)
movq 0xb52f(%rip), %rcx      # 0x10450
movq %rcx, (%rax)
movq %rax, 0xb525(%rip)      # 0x10450
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq %r15, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %r13
jmp 0x4e7c
movq %r15, (%r12)
movl $0x0, 0x10(%rsp)
movq %rbp, %rdi
callq 0x5288
movq %rax, %r13
leaq 0x770b(%rip), %rdi      # 0xc672
callq 0x5244
testb %al, %al
je 0x4f85
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq %rcx, (%r12)
testq %rax, %rax
jne 0x508f
movq (%r12), %r15
movq %r13, %rdi
movq %rbx, %rsi
callq 0x59d0
movq %rax, %r13
movl 0x10(%rsp), %ebx
cmpl $0x1, %ebx
jne 0x4fec
leaq 0x76cb(%rip), %rdi      # 0xc672
callq 0x5c3c
movq 0x8(%rsp), %rbx
movl $0x1, %edi
movl $0x30, %esi
callq 0x2100
movq %rbx, 0x8(%rax)
movq 0xb475(%rip), %rcx      # 0x10440
movq %rcx, (%rax)
movl 0xb45c(%rip), %ecx      # 0x10430
movl %ecx, 0x2c(%rax)
movq %rax, 0xb462(%rip)      # 0x10440
movq %r13, 0x18(%rax)
leaq 0x8(%rsp), %rbx
jmp 0x508f
movq 0x8(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x7888
movq %rax, %rbp
cmpl $0x2, %ebx
sete 0x20(%rax)
cmpl $0x4, %ebx
je 0x502e
movl $0x1, %edi
movl $0x10, %esi
callq 0x2100
movq %rbp, 0x8(%rax)
movq 0xb404(%rip), %rcx      # 0x10428
movq %rcx, (%rax)
movq %rax, 0xb3fa(%rip)      # 0x10428
cmpl $0x4, 0x10(%rsp)
leaq 0x8(%rsp), %rbx
je 0x507e
leaq 0x7878(%rip), %rdi      # 0xc8b9
callq 0x5244
testb %al, %al
je 0x5073
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq %rcx, (%r12)
testq %rax, %rax
je 0x5073
leaq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x795e
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rbp)
jmp 0x507e
cmpb $0x1, 0xc(%r13)
je 0x51f6
leaq 0x75ed(%rip), %rdi      # 0xc672
callq 0x5c3c
leaq 0x10(%rsp), %rbp
movq (%r12), %r15
cmpl $0x1e, (%r15)
jne 0x4c9f
jmp 0x4c50
movb $0x1, 0x35(%rbp)
leaq 0x74dc(%rip), %rdi      # 0xc589
callq 0x5c3c
movq %r13, 0x28(%rbp)
movq 0x38(%rsp), %r13
leaq 0x75b0(%rip), %rdi      # 0xc672
callq 0x5244
testb %al, %al
je 0x5101
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq %rcx, (%r12)
testq %rax, %rax
je 0x5101
movq 0x28(%rsp), %rax
movq %rax, 0xb358(%rip)      # 0x10440
movq %r13, 0xb349(%rip)      # 0x10438
decl 0xb33b(%rip)            # 0x10430
xorl %ebp, %ebp
leaq 0x8(%rsp), %rbx
jmp 0x51db
leaq 0x720e(%rip), %rdi      # 0xc316
callq 0x5c3c
movl $0xc8, %edx
leaq 0x40(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x20e0
movq %r14, %rdi
callq 0x5244
testb %al, %al
je 0x513e
movq (%r12), %rax
movq 0x8(%rax), %rcx
movq %rcx, (%r12)
testq %rax, %rax
jne 0x514c
callq 0x894b
movq %rax, 0x30(%r15)
movq %rax, %r15
jmp 0x5121
movq 0x70(%rsp), %rax
movq %rax, 0x18(%rbp)
movq 0xb2f4(%rip), %rcx      # 0x10450
cmpl $0x2, 0x1c(%rsp)
movq %rcx, 0x20(%rbp)
sete 0x34(%rbp)
cmpb $0x0, 0x35(%rbp)
movl $0x0, %eax
movl $0x38, %edx
cmovnel %edx, %eax
leaq 0x8(%rsp), %rbx
testq %rcx, %rcx
je 0x51a8
movq 0x8(%rcx), %rsi
movq (%rsi), %rdi
movl 0x8(%rdi), %r8d
cltd
idivl %r8d
cmpl $0x1, %edx
sbbl $-0x1, %eax
imull %r8d, %eax
addl 0x4(%rdi), %eax
movl %eax, 0x10(%rsi)
movq (%rcx), %rcx
jmp 0x517f
leal 0x7(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
shrl $0x3, %ecx
andl $0x7, %eax
cmpl $0x1, %eax
sbbl $-0x1, %ecx
shll $0x3, %ecx
movl %ecx, 0x30(%rbp)
movq 0x28(%rsp), %rax
movq %rax, 0xb272(%rip)      # 0x10440
movq %r13, 0xb263(%rip)      # 0x10438
decl 0xb255(%rip)            # 0x10430
testq %rbp, %rbp
je 0x508a
movq 0x20(%rsp), %rax
movq %rbp, (%rax)
movq %rbp, 0x20(%rsp)
jmp 0x508a
movq 0x18(%r15), %rdi
leaq 0x791d(%rip), %rsi      # 0xcb1e
xorl %eax, %eax
callq 0x487c