// File: /workspace/github_c_makefile_star2_O2/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, %r15
leaq -0x30(%rbp), %rax
movq %rdi, (%rax)
callq 0x9319
leaq -0xf8(%rbp), %rbx
movq %rax, -0x8(%rbx)
callq 0x9319
movq %rax, -0x10(%rbx)
callq 0x9319
movq %rax, 0x58(%rbx)
callq 0x9319
movq %rax, 0x60(%rbx)
callq 0x49e0
movq %rax, 0x68(%rbx)
movq %rdx, 0x70(%rbx)
callq 0x49e0
leaq -0x78(%rbp), %rcx
movq %rax, (%rcx)
movq %rdx, 0x8(%rcx)
leaq -0x678(%rbp), %rbx
movl (%r15), %r12d
cmpl $0x1a, %r12d
je 0x21e9
cmpl $0x2, %r12d
je 0x25fc
movl $0x470, %esi            # imm = 0x470
pushq $0x1
popq %rdi
callq 0x10d0
movq %rax, -0x68(%rbp)
movq %r15, -0x38(%rbp)
xorl %r13d, %r13d
cmpl $0x46, %r12d
jne 0x2211
leaq 0x20(%r15), %rax
movq %rax, -0x38(%rbp)
movl 0x20(%r15), %r12d
movq %rax, %r15
pushq $0x1
popq %r14
jmp 0x2214
leaq 0x13eec(%rip), %rax     # 0x160dc
cmpl $0x0, (%rax)
jne 0x2635
leaq -0x30(%rbp), %rdi
pushq $0x1a
popq %rsi
leaq 0xb495(%rip), %rdx      # 0xd69c
callq 0x8168
jmp 0x25f3
xorl %r14d, %r14d
cmpl $0x47, %r12d
jne 0x2226
addq $0x20, %r15
movq %r15, -0x38(%rbp)
pushq $0x1
popq %r13
movq %r15, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x8bcf
testq %rax, %rax
je 0x226e
andl $0x0, -0x678(%rbp)
pushq $0xa
popq %rcx
leaq -0x668(%rbp), %rdx
movq %rdx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x118(%rbp), %rdi
movq %rdx, %rsi
callq 0x2659
andq $0x0, -0x670(%rbp)
jmp 0x25d3
leaq -0x168(%rbp), %r15
movq %r15, %rdi
leaq -0x38(%rbp), %r12
movq %r12, %rsi
leaq -0x40(%rbp), %rdx
callq 0x8da1
leaq -0x118(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2659
cmpl $0x3, -0x168(%rbp)
jne 0x2395
movl -0x150(%rbp), %r12d
movq -0x148(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0x140(%rbp), %eax
movq %rax, -0x48(%rbp)
movq -0x160(%rbp), %rsi
pushq $0xa
popq %rbx
movq %rbx, %rcx
leaq -0x208(%rbp), %r14
movq %r14, %rdi
rep  movsq (%rsi), %es:(%rdi)
andq $0x0, -0x110(%rbp)
callq 0x9319
movq %rax, -0x118(%rbp)
andl $0x0, -0xa8(%rbp)
movq %rbx, %rcx
leaq -0xf8(%rbp), %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x40(%rbp), %rsi
movq %rsi, -0x80(%rbp)
movq -0x100(%rbp), %rdi
callq 0x92a8
movq %rax, %r14
pushq $0x1
popq %rdi
pushq $0x50
popq %rsi
callq 0x10d0
movq %r15, %rdx
movq %rax, %r15
movq %rbx, %rcx
movq %rax, %rdi
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
testq %r14, %r14
je 0x241c
leaq -0x118(%rbp), %rdi
movq %rdx, %rsi
movq %r14, %rdx
leaq 0xb390(%rip), %rcx      # 0xd6e9
callq 0x4c73
cmpl $0x0, 0x28(%r14)
leaq -0x678(%rbp), %rbx
jne 0x2436
cmpl $0x0, -0x140(%rbp)
je 0x2436
movq -0x100(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %r15, %rdx
callq 0x9250
jmp 0x2436
movq %r12, %rdi
pushq $0x1a
popq %rsi
leaq 0xb31b(%rip), %rdx      # 0xd6bd
callq 0x8168
pushq $0x1
popq %rdi
pushq $0x50
popq %rsi
callq 0x10d0
pushq $0xa
popq %r12
movq %r12, %rcx
movq %rax, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x108(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %rax, %rdx
callq 0x9250
andl $0x0, -0x678(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x670(%rbp)
movq %r12, %rcx
leaq -0x668(%rbp), %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1e24
movl %eax, -0x210(%rbp)
movl %r14d, -0x20c(%rbp)
jmp 0x25cc
movq -0x100(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %r15, %rdx
callq 0x9250
leaq -0x678(%rbp), %rbx
movq -0x38(%rbp), %rax
cmpl $0x1a, (%rax)
jne 0x2456
addq $0x20, %rax
movq %rax, -0x30(%rbp)
movl $0x2, -0x678(%rbp)
jmp 0x25d3
callq 0x49e0
movq %rax, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movl $0x1, -0x678(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x670(%rbp)
movl %r13d, -0x224(%rbp)
pushq $0xa
popq %r13
movq %r13, %rcx
leaq -0x278(%rbp), %rdi
leaq -0x208(%rbp), %r15
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
callq 0x81cb
testl %eax, %eax
leaq -0x118(%rbp), %rbx
je 0x2505
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2038
movl %eax, %r14d
movl %eax, -0x220(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1e24
movl %eax, -0x21c(%rbp)
testl %r14d, %r14d
je 0x2505
leaq -0x1b8(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x862d
movq %rbx, %rdi
movq %r14, %rsi
leaq -0x58(%rbp), %rdx
leaq 0xb20f(%rip), %rcx      # 0xd709
callq 0x284d
movl %eax, -0x218(%rbp)
andl $0x0, -0x214(%rbp)
movq -0x48(%rbp), %rax
decl %eax
cmpl $0x1, %eax
leaq -0x38(%rbp), %r15
ja 0x2592
testl %r12d, %r12d
movl $0x0, %eax
cmovlel %eax, %r12d
xorl %r14d, %r14d
cmpq %r14, %r12
je 0x2582
movq -0x60(%rbp), %rax
movq (%rax,%r14,8), %rax
movq %r13, %rcx
leaq -0x1b8(%rbp), %rdx
movq %rdx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x50(%rax), %rax
movq %r13, %rcx
leaq -0x6c8(%rbp), %r8
movq %r8, %rdi
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
cmpq $0x6, %r14
je 0x2629
movq %rbx, %rdi
movq %r8, %rsi
leaq -0x58(%rbp), %rdx
movq %rax, %rcx
callq 0x284d
incq %r14
jmp 0x252a
cmpl $0x2, -0x48(%rbp)
jne 0x2592
movl $0x1, -0x214(%rbp)
leaq -0x618(%rbp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3434
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movups -0x58(%rbp), %xmm0
leaq -0x668(%rbp), %rax
movups %xmm0, 0x3e0(%rax)
xorl %eax, %eax
subl -0xa8(%rbp), %eax
movl %eax, -0x228(%rbp)
leaq -0x678(%rbp), %rbx
movl $0x470, %edx            # imm = 0x470
movq -0x68(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1100
leaq -0x78(%rbp), %rdi
movq %r14, %rsi
callq 0x4a57
movq -0x30(%rbp), %r15
jmp 0x21a3
leaq 0xb078(%rip), %rdx      # 0xd67b
leaq -0x30(%rbp), %rdi
pushq $0x2
popq %rsi
callq 0x8168
movq -0x78(%rbp), %rax
movq -0x70(%rbp), %rdx
addq $0x6a8, %rsp            # imm = 0x6A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb0e1(%rip), %rdi      # 0xd711
callq 0x8186
movq 0x139bc(%rip), %rax     # 0x15ff8
movq (%rax), %rcx
leaq 0xb045(%rip), %rdi      # 0xd68b
pushq $0x31
popq %rsi
pushq $0x1
popq %rdx
callq 0x1180
pushq $0x1
popq %rdi
callq 0x1170