// File: /workspace/github_c_makefile_star2_O3/goodpaul6[P]generic/script.c
// Function: parse_extern_decl
static expr_t* parse_extern_decl(script_t* script)
{
	expr_t* exp = create_expr(EXP_EXTERN);

	char* name = estrdup(g_lexeme);

	get_next_token();

	exp->extern_decl = declare_extern(script, name);

	if (g_cur_tok != TOK_OPENPAREN) error_exit_p("Expected '(' after extern %s\n", name);
	get_next_token();

	while (g_cur_tok != TOK_CLOSEPAREN)
	{
		type_tag_t* arg_tag = parse_type_tag(script);
		vec_push_back(&exp->extern_decl->tag->func.arg_types, &arg_tag);

		if (g_cur_tok == TOK_COMMA) get_next_token();
		else if (g_cur_tok != TOK_CLOSEPAREN) error_exit_p("Unexpected token '%s'\n", g_token_names[g_cur_tok]);
	}
	get_next_token();

	if (g_cur_tok != TOK_COLON) error_exit_p("Expected ':' but received '%s'\n", g_token_names[g_cur_tok]);
	get_next_token();

	exp->extern_decl->tag->func.return_type = parse_type_tag(script);

	free(name);

	return exp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
movl $0x17, %edi
callq 0x8840
movq %rax, -0x40(%rbp)
leaq 0xa1b7(%rip), %rdi      # 0x16370
callq 0x2817
movq %rax, %rbx
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa192(%rip)      # 0x16360
leaq 0x2b8(%r15), %rdi
movslq 0xa06c(%rip), %rsi      # 0x16248
callq 0xdcf3
movq %rax, -0x38(%rbp)
movl $0x68, %edi
callq 0x21c0
testq %rax, %rax
je 0xc383
movq %rax, %r13
movq %rax, -0x30(%rbp)
movq 0xa052(%rip), %rax      # 0x16258
movq %rax, (%r13)
movl $0x1, 0x8(%r13)
movq %r15, %rdi
movl $0x6, %esi
callq 0x8156
movq %rax, 0x10(%r13)
movq %rbx, %rdi
callq 0x2817
movq %rax, 0x18(%r13)
leaq 0x20(%r13), %rdi
movl $0x8, %esi
callq 0xda7c
movq %r13, %rdi
addq $0x40, %rdi
movl $0x8, %esi
callq 0xda7c
cmpq $0x0, 0x248(%r15)
je 0xc288
leaq 0x238(%r15), %r12
xorl %r14d, %r14d
movq %r12, %rdi
movq %r14, %rsi
callq 0xdcf3
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x2160
testl %eax, %eax
je 0xc299
incq %r14
cmpq %r14, 0x248(%r15)
ja 0xc262
leaq 0x50da(%rip), %rdi      # 0x11369
movq %rbx, %rsi
xorl %eax, %eax
callq 0x878e
movl %r14d, 0x60(%r13)
movq -0x38(%rbp), %rdi
addq $0x20d0, %rdi           # imm = 0x20D0
leaq -0x30(%rbp), %r14
movq %r14, %rsi
callq 0xdd50
movq (%r14), %r14
movq -0x40(%rbp), %r13
movq %r14, 0x38(%r13)
cmpl $0x19, 0xa09a(%rip)     # 0x16360
jne 0xc391
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa087(%rip)      # 0x16360
cmpl $0x1a, %eax
je 0xc323
leaq -0x30(%rbp), %r12
movq %r15, %rdi
callq 0xbde7
movq %rax, -0x30(%rbp)
movq 0x10(%r14), %rdi
addq $0x28, %rdi
movq %r12, %rsi
callq 0xdd50
movl 0xa05c(%rip), %eax      # 0x16360
cmpq $0x1f, %rax
jne 0xc31e
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa049(%rip)      # 0x16360
cmpl $0x1a, %eax
jne 0xc2e2
jmp 0xc323
cmpl $0x1a, %eax
jne 0xc36c
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa030(%rip)      # 0x16360
cmpl $0x1d, %eax
jne 0xc39d
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa01e(%rip)      # 0x16360
movq %r15, %rdi
callq 0xbde7
movq 0x10(%r14), %rcx
movq %rax, 0x48(%rcx)
movq %rbx, %rdi
callq 0x2030
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x98cd(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x4bd2(%rip), %rdi      # 0x10f50
jmp 0xc292
leaq 0x590d(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x388c
leaq 0x4f93(%rip), %rdi      # 0x1132b
jmp 0xc28f
movl %eax, %eax
leaq 0x989a(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x4f98(%rip), %rdi      # 0x11349
jmp 0xc292