// File: /workspace/github_c_makefile_star2_O1/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 0x8991
movq %rax, %r13
leaq 0xa01d(%rip), %rdi      # 0x16360
callq 0x2807
movq %rax, %rbx
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0x9ff8(%rip)      # 0x16350
leaq 0x2b8(%r15), %rdi
movslq 0x9ed2(%rip), %rsi      # 0x16238
callq 0xdf24
movq %rax, %r14
movl $0x68, %edi
callq 0x21b0
testq %rax, %rax
je 0xc51d
movq %r14, -0x40(%rbp)
movq %rax, -0x30(%rbp)
movq 0x9eb8(%rip), %rcx      # 0x16248
movq %rcx, (%rax)
movl $0x1, 0x8(%rax)
movq %r15, %rdi
movl $0x6, %esi
callq 0x816f
movq -0x30(%rbp), %rcx
movq %rax, 0x10(%rcx)
movq %rbx, %rdi
callq 0x2807
movq -0x30(%rbp), %rdi
movq %rax, 0x18(%rdi)
addq $0x20, %rdi
movl $0x8, %esi
callq 0xdcb4
movq -0x30(%rbp), %rdi
addq $0x40, %rdi
movl $0x8, %esi
callq 0xdcb4
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpq $0x0, 0x248(%r15)
je 0xc42c
movq %r13, -0x38(%rbp)
leaq 0x238(%r15), %r14
xorl %r13d, %r13d
movq %r14, %rdi
movq %r13, %rsi
callq 0xdf24
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x2150
testl %eax, %eax
je 0xc425
incq %r13
cmpq %r13, 0x248(%r15)
ja 0xc3fd
jmp 0xc428
movl %r13d, %r12d
movq -0x38(%rbp), %r13
testl %r12d, %r12d
js 0xc52b
leaq -0x30(%rbp), %r14
movq (%r14), %rax
movl %r12d, 0x60(%rax)
movq -0x40(%rbp), %rdi
addq $0x20d0, %rdi           # imm = 0x20D0
movq %r14, %rsi
callq 0xdf81
movq (%r14), %r14
movq %r14, 0x38(%r13)
cmpl $0x19, 0x9eef(%rip)     # 0x16350
jne 0xc534
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0x9edc(%rip)      # 0x16350
cmpl $0x1a, %eax
je 0xc4c0
leaq -0x30(%rbp), %r12
movq %r15, %rdi
callq 0xbf76
movq %rax, -0x30(%rbp)
movq 0x10(%r14), %rdi
addq $0x28, %rdi
movq %r12, %rsi
callq 0xdf81
movl 0x9eb1(%rip), %eax      # 0x16350
cmpq $0x1a, %rax
je 0xc4b7
cmpl $0x1f, %eax
jne 0xc509
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0x9e99(%rip)      # 0x16350
cmpl $0x1a, 0x9e92(%rip)     # 0x16350
jne 0xc47d
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0x9e83(%rip)      # 0x16350
cmpl $0x1d, %eax
jne 0xc540
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0x9e71(%rip)      # 0x16350
movq %r15, %rdi
callq 0xbf76
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 0x9730(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x4a35(%rip), %rdi      # 0x10f50
jmp 0xc554
leaq 0x5773(%rip), %rdi      # 0x11c97
xorl %eax, %eax
callq 0x384e
leaq 0x4e37(%rip), %rdi      # 0x11369
jmp 0xc53b
leaq 0x4df0(%rip), %rdi      # 0x1132b
movq %rbx, %rsi
jmp 0xc554
movl %eax, %eax
leaq 0x96f7(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x4df5(%rip), %rdi      # 0x11349
xorl %eax, %eax
callq 0x88df