// File: /workspace/github_c_makefile_star2_O3/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
movq %rdi, %rbx
leaq -0x30(%rbp), %rax
movq %rdi, (%rax)
callq 0xa40d
leaq -0x150(%rbp), %r14
movq %rax, -0x8(%r14)
callq 0xa40d
movq %rax, -0x10(%r14)
callq 0xa40d
movq %rax, 0x58(%r14)
callq 0xa40d
movq %rax, 0x60(%r14)
callq 0x5cf8
movq %rax, 0x68(%r14)
movq %rdx, 0x70(%r14)
callq 0x5cf8
leaq -0x80(%rbp), %rcx
movq %rax, (%rcx)
movq %rdx, 0x8(%rcx)
leaq -0x170(%rbp), %r14
movl (%rbx), %r12d
cmpl $0x1a, %r12d
je 0x324d
cmpl $0x2, %r12d
je 0x3647
movq %r14, %r13
movl $0x1, %edi
movl $0x470, %esi            # imm = 0x470
callq 0x10d0
movq %rax, -0x70(%rbp)
movq %rbx, -0x38(%rbp)
xorl %r14d, %r14d
cmpl $0x46, %r12d
jne 0x3277
leaq 0x20(%rbx), %rax
movq %rax, -0x38(%rbp)
movl 0x20(%rbx), %r12d
movl $0x1, %r15d
movq %rax, %rbx
jmp 0x327a
leaq 0x13e88(%rip), %rax     # 0x170dc
cmpl $0x0, (%rax)
jne 0x3676
leaq -0x30(%rbp), %rdi
movl $0x1a, %esi
leaq 0xb40b(%rip), %rdx      # 0xe678
callq 0x9563
jmp 0x363e
xorl %r15d, %r15d
cmpl $0x47, %r12d
jne 0x328e
addq $0x20, %rbx
movq %rbx, -0x38(%rbp)
movl $0x1, %r14d
movq %rbx, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x9cb4
testq %rax, %rax
je 0x32dd
movl $0x0, -0x680(%rbp)
movl $0xa, %ecx
leaq -0x670(%rbp), %rdx
movq %rdx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r13, %r14
movq %r13, %rdi
movq %rdx, %rsi
callq 0x3687
movq $0x0, -0x678(%rbp)
jmp 0x361a
movl %r14d, -0x44(%rbp)
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
leaq -0x38(%rbp), %r12
movq %r12, %rsi
leaq -0x40(%rbp), %rdx
callq 0x9e69
movq %r13, %r14
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3687
cmpl $0x3, -0xd0(%rbp)
jne 0x3420
movl -0xb8(%rbp), %r15d
movq -0xb0(%rbp), %rax
movq %rax, -0x68(%rbp)
movl -0xa8(%rbp), %eax
movq %rax, -0x50(%rbp)
movq -0xc8(%rbp), %rsi
movl $0xa, %ecx
leaq -0x1c0(%rbp), %r14
movq %r14, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq $0x0, -0x168(%rbp)
callq 0xa40d
movq %rax, -0x170(%rbp)
movl $0x0, -0x100(%rbp)
movl $0xa, %ecx
leaq -0x150(%rbp), %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x40(%rbp), %rsi
movq %rsi, -0xd8(%rbp)
movq -0x158(%rbp), %rdi
callq 0xa39c
movq %rax, %r12
movl $0x1, %edi
movl $0x50, %esi
callq 0x10d0
movq %rbx, %rdx
movq %rax, %rbx
movl $0xa, %ecx
movq %rax, %rdi
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
testq %r12, %r12
je 0x33e6
movq %r13, %rdi
movq %rdx, %rsi
movq %r12, %rdx
leaq 0xb2f5(%rip), %rcx      # 0xe6c5
callq 0x5f2a
cmpl $0x0, 0x28(%r12)
jne 0x33f9
cmpl $0x0, -0xa8(%rbp)
je 0x33f9
movq -0x158(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %rbx, %rdx
callq 0xa344
movq -0x38(%rbp), %rax
cmpl $0x1a, (%rax)
jne 0x34b0
addq $0x20, %rax
movq %rax, -0x30(%rbp)
movl $0x2, -0x680(%rbp)
movq %r13, %r14
jmp 0x361a
movq %r12, %rdi
movl $0x1a, %esi
leaq 0xb26a(%rip), %rdx      # 0xe699
callq 0x9563
movl $0x1, %edi
movl $0x50, %esi
callq 0x10d0
movl $0xa, %ecx
movq %rax, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x160(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %rax, %rdx
callq 0xa344
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x680(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x678(%rbp)
movl $0xa, %ecx
leaq -0x670(%rbp), %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2ffc
movl %eax, -0x218(%rbp)
movl %r15d, -0x214(%rbp)
jmp 0x361a
callq 0x5cf8
movq %rax, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
movl $0x1, -0x680(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x678(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x22c(%rbp)
movl $0xa, %ecx
leaq -0x280(%rbp), %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
callq 0x95ca
testl %eax, %eax
je 0x3553
movq %r13, %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x3117
movl %eax, %ebx
movl %eax, -0x228(%rbp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x2ffc
movl %eax, -0x224(%rbp)
testl %ebx, %ebx
je 0x3553
leaq -0x210(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x96ed
movq %r13, %rdi
movq %rbx, %rsi
leaq -0x60(%rbp), %rdx
leaq 0xb19d(%rip), %rcx      # 0xe6e5
callq 0x3890
movl %eax, -0x220(%rbp)
movl $0x0, -0x21c(%rbp)
movq -0x50(%rbp), %rax
decl %eax
cmpl $0x1, %eax
leaq -0x38(%rbp), %r12
movq %r13, %r14
leaq -0x6d0(%rbp), %r13
ja 0x35e0
testl %r15d, %r15d
jle 0x35d0
xorl %ebx, %ebx
movq -0x68(%rbp), %rax
movq (%rax,%rbx,8), %rax
movl $0xa, %ecx
leaq -0x210(%rbp), %rdx
movq %rdx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x50(%rax), %rax
movl $0xa, %ecx
movq %r13, %rdi
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
cmpq $0x6, %rbx
je 0x367b
movq %r14, %rdi
movq %r13, %rsi
leaq -0x60(%rbp), %rdx
movq %rax, %rcx
callq 0x3890
incq %rbx
cmpq %rbx, %r15
jne 0x357d
cmpl $0x2, -0x50(%rbp)
jne 0x35e0
movl $0x1, -0x21c(%rbp)
leaq -0x620(%rbp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x47a1
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movups -0x60(%rbp), %xmm0
leaq -0x670(%rbp), %rax
movups %xmm0, 0x3e0(%rax)
xorl %eax, %eax
subl -0x100(%rbp), %eax
movl %eax, -0x230(%rbp)
movl $0x470, %edx            # imm = 0x470
movq -0x70(%rbp), %rbx
movq %rbx, %rdi
leaq -0x680(%rbp), %rsi
callq 0x1100
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
callq 0x5d9b
movq -0x30(%rbp), %rbx
jmp 0x3200
leaq 0xb009(%rip), %rdx      # 0xe657
leaq -0x30(%rbp), %rdi
movl $0x2, %esi
callq 0x9563
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 0xb06b(%rip), %rdi      # 0xe6ed
callq 0x9581