// File: /workspace/github_c_makefile_star2_O1/hsjoihs[P]c-compiler/parse_analyze_toplevel.c
// Function: parse
struct Vector /*<Toplevel>*/ parse(const struct Token *tokvec)
{
	struct AnalyzerState ps;
	ps.func_info_map = init_map();
	ps.global_vars_type_map = init_map();
	ps.global_struct_or_union_tag_map = init_map();
	ps.global_enum_tag_map = init_map();
	ps.global_enumerator_list = init_vector();

	struct Vector /*<Toplevel>*/ vec = init_vector();
	while (1) {
		if (tokvec[0].kind == END) {
			expect_and_consume(&tokvec, END, "the end of file");
			break;
		} else if (tokvec[0].kind == SEMICOLON) {
			if (global_flag_pedantic) {
				// gcc 12.1 with `-pedantic` flag gives out `warning: ISO C does
				// not allow extra ';' outside of a function`.
				fprintf(stderr,
				        "ISO C forbids an extra ';' outside of a function\n");
				exit(EXIT_FAILURE);
			} else {
				expect_and_consume(&tokvec, SEMICOLON, "extra ';' outside of a function\n");
			}
		} else {
			struct Toplevel *ptr = calloc(1, sizeof(struct Toplevel));
			*ptr = parse_toplevel_definition(&ps, &tokvec);
			push_vector(&vec, ptr);
		}
	}
	return vec;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6a8, %rsp            # imm = 0x6A8
leaq -0x38(%rbp), %rax
movq %rdi, (%rax)
callq 0xa39e
leaq -0x100(%rbp), %rbx
movq %rax, -0x8(%rbx)
callq 0xa39e
movq %rax, -0x10(%rbx)
callq 0xa39e
movq %rax, 0x58(%rbx)
callq 0xa39e
movq %rax, 0x60(%rbx)
callq 0x5af4
movq %rax, 0x68(%rbx)
movq %rdx, 0x70(%rbx)
callq 0x5af4
leaq -0x80(%rbp), %rcx
movq %rax, (%rcx)
movq %rdx, 0x8(%rcx)
leaq -0x120(%rbp), %r12
leaq -0x630(%rbp), %r14
movq -0x38(%rbp), %r15
movl (%r15), %eax
cmpl $0x1a, %eax
je 0x329a
cmpl $0x2, %eax
je 0x365b
movl $0x1, %edi
movl $0x470, %esi            # imm = 0x470
callq 0x10d0
movq %rax, -0x70(%rbp)
movq %r15, -0x30(%rbp)
xorl %r13d, %r13d
cmpl $0x46, (%r15)
movl $0x0, %ebx
jne 0x3233
addq $0x20, %r15
movq %r15, -0x30(%rbp)
movl $0x1, %ebx
movq -0x30(%rbp), %rax
cmpl $0x47, (%rax)
jne 0x324a
addq $0x20, %rax
movq %rax, -0x30(%rbp)
movl $0x1, %r13d
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9c4d
testq %rax, %rax
je 0x32c4
movl $0x0, -0x630(%rbp)
movl $0xa, %ecx
leaq -0x620(%rbp), %rdx
movq %rdx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
movq %rdx, %rsi
callq 0x369b
movq $0x0, -0x628(%rbp)
jmp 0x3636
leaq 0x13e3b(%rip), %rax     # 0x170dc
cmpl $0x0, (%rax)
jne 0x368a
leaq -0x38(%rbp), %rdi
movl $0x1a, %esi
leaq 0xb3be(%rip), %rdx      # 0xe678
callq 0x94af
jmp 0x31e8
leaq -0x170(%rbp), %r15
movq %r15, %rdi
movq %r12, %r14
leaq -0x30(%rbp), %r12
movq %r12, %rsi
leaq -0x40(%rbp), %rdx
callq 0x9e06
movq %r14, %rdi
movq %r15, %rsi
callq 0x369b
cmpl $0x3, -0x170(%rbp)
jne 0x33f5
movl -0x158(%rbp), %eax
movq %rax, -0x50(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x68(%rbp)
movl -0x148(%rbp), %eax
movq %rax, -0x48(%rbp)
movq -0x168(%rbp), %rsi
movl $0xa, %ecx
leaq -0x6d0(%rbp), %r14
movq %r14, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq $0x0, -0x118(%rbp)
callq 0xa39e
movq %rax, -0x120(%rbp)
movl $0x0, -0xb0(%rbp)
movl $0xa, %ecx
leaq -0x100(%rbp), %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x40(%rbp), %rsi
movq %rsi, -0x88(%rbp)
movq -0x108(%rbp), %rdi
callq 0xa32d
movq %rax, %r12
movl $0x1, %edi
movl $0x50, %esi
callq 0x10d0
movq %rax, %rbx
movl $0xa, %ecx
movq %rax, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
testq %r12, %r12
je 0x3487
leaq -0x120(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
leaq 0xb30a(%rip), %rcx      # 0xe6c5
callq 0x5d65
cmpl $0x0, 0x28(%r12)
leaq -0x30(%rbp), %r15
jne 0x349e
cmpl $0x0, -0x148(%rbp)
je 0x349e
movq -0x108(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %rbx, %rdx
callq 0xa2d8
jmp 0x349e
movq %r12, %rdi
movl $0x1a, %esi
leaq 0xb295(%rip), %rdx      # 0xe699
callq 0x94af
movl $0x1, %edi
movl $0x50, %esi
callq 0x10d0
movl $0xa, %ecx
movq %rax, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x110(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %rax, %rdx
callq 0xa2d8
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x630(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x628(%rbp)
movl $0xa, %ecx
leaq -0x620(%rbp), %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movq %r15, %rsi
callq 0x2fe0
movl %eax, -0x1c8(%rbp)
movl %ebx, -0x1c4(%rbp)
movq %r14, %r12
jmp 0x362f
movq -0x108(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %rbx, %rdx
callq 0xa2d8
leaq -0x30(%rbp), %r15
movq -0x30(%rbp), %rax
cmpl $0x1a, (%rax)
jne 0x34c9
addq $0x20, %rax
movq %rax, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movl $0x2, -0x630(%rbp)
leaq -0x120(%rbp), %r12
jmp 0x362f
callq 0x5af4
movq %rax, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
movl $0x1, -0x630(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x628(%rbp)
movl %r13d, -0x1dc(%rbp)
movl $0xa, %ecx
leaq -0x230(%rbp), %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
callq 0x9516
testl %eax, %eax
leaq -0x120(%rbp), %r12
je 0x356d
movq %r12, %rdi
movq %r14, %rsi
callq 0x30fb
movl %eax, %ebx
movl %eax, -0x1d8(%rbp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x2fe0
movl %eax, -0x1d4(%rbp)
testl %ebx, %ebx
je 0x356d
leaq -0x1c0(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9639
movq %r12, %rdi
movq %rbx, %rsi
leaq -0x60(%rbp), %rdx
leaq 0xb183(%rip), %rcx      # 0xe6e5
callq 0x389c
movl %eax, -0x1d0(%rbp)
movl $0x0, -0x1cc(%rbp)
movq -0x48(%rbp), %rax
decl %eax
cmpl $0x1, %eax
leaq -0x1c0(%rbp), %r14
leaq -0x680(%rbp), %r13
ja 0x35f5
cmpl $0x0, -0x50(%rbp)
jle 0x35e5
xorl %ebx, %ebx
movq -0x68(%rbp), %rax
movq (%rax,%rbx,8), %rax
movl $0xa, %ecx
movq %r14, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x50(%rax), %rax
movl $0xa, %ecx
movq %r13, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
cmpq $0x6, %rbx
je 0x368f
movq %r12, %rdi
movq %r13, %rsi
leaq -0x60(%rbp), %rdx
movq %rax, %rcx
callq 0x389c
incq %rbx
cmpq %rbx, -0x50(%rbp)
jne 0x3598
cmpl $0x2, -0x48(%rbp)
jne 0x35f5
movl $0x1, -0x1cc(%rbp)
leaq -0x5d0(%rbp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x45e0
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movups -0x60(%rbp), %xmm0
leaq -0x620(%rbp), %rax
movups %xmm0, 0x3e0(%rax)
xorl %eax, %eax
subl -0xb0(%rbp), %eax
movl %eax, -0x1e0(%rbp)
leaq -0x630(%rbp), %r14
movl $0x470, %edx            # imm = 0x470
movq -0x70(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1100
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
callq 0x5ba7
jmp 0x31e8
leaq 0xaff5(%rip), %rdx      # 0xe657
leaq -0x38(%rbp), %rdi
movl $0x2, %esi
callq 0x94af
movq -0x80(%rbp), %rax
movq -0x78(%rbp), %rdx
addq $0x6a8, %rsp            # imm = 0x6A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1493
leaq 0xb057(%rip), %rdi      # 0xe6ed
callq 0x94cd