// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x17
popq %rdi
callq 0x7994
movq %rax, -0x40(%rbp)
leaq 0x971c(%rip), %rdi      # 0x14370
callq 0x24df
movq %rax, %rbx
callq 0x9824
leaq 0x2b8(%r15), %rdi
movslq 0x95d9(%rip), %rsi      # 0x14248
callq 0xc15c
movq %rax, -0x38(%rbp)
pushq $0x68
popq %rdi
callq 0x325f
movq %rax, %r13
movq %rax, -0x30(%rbp)
movq 0x95ca(%rip), %rax      # 0x14258
movq %rax, (%r13)
movl $0x1, 0x8(%r13)
pushq $0x6
popq %rsi
movq %r15, %rdi
callq 0x731e
movq %rax, 0x10(%r13)
movq %rbx, %rdi
callq 0x24df
movq %rax, 0x18(%r13)
leaq 0x20(%r13), %rdi
pushq $0x8
popq %r14
movq %r14, %rsi
callq 0xbf0c
movq %r13, %rdi
addq $0x40, %rdi
movq %r14, %rsi
callq 0xbf0c
leaq 0x238(%r15), %r12
xorl %r14d, %r14d
cmpq %r14, 0x248(%r15)
jbe 0xadcb
movq %r12, %rdi
movq %r14, %rsi
callq 0xc15c
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x2150
testl %eax, %eax
je 0xad0a
incq %r14
jmp 0xacde
movl %r14d, 0x60(%r13)
movq -0x38(%rbp), %rdi
addq $0x20d0, %rdi           # imm = 0x20D0
leaq -0x30(%rbp), %r14
movq %r14, %rsi
callq 0xc1b9
movq (%r14), %r14
movq -0x40(%rbp), %r13
movq %r14, 0x38(%r13)
cmpl $0x19, 0x9629(%rip)     # 0x14360
jne 0xadf0
callq 0x9824
movl 0x9618(%rip), %eax      # 0x14360
leaq -0x30(%rbp), %r12
cmpl $0x1a, %eax
je 0xad8b
movq %r15, %rdi
callq 0xa8aa
movq %rax, -0x30(%rbp)
movq 0x10(%r14), %rdi
addq $0x28, %rdi
movq %r12, %rsi
callq 0xc1b9
movl 0x95ed(%rip), %eax      # 0x14360
cmpq $0x1a, %rax
je 0xad4c
cmpl $0x1f, %eax
jne 0xadd7
callq 0x9824
movl 0x95d7(%rip), %eax      # 0x14360
jmp 0xad4c
callq 0x9824
movl 0x95ca(%rip), %eax      # 0x14360
cmpq $0x1d, %rax
jne 0xadf9
callq 0x9824
movq %r15, %rdi
callq 0xa8aa
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 0x459f(%rip), %rdi      # 0xf371
movq %rbx, %rsi
jmp 0xade9
leaq 0x8e62(%rip), %rcx      # 0x13c40
movq (%rcx,%rax,8), %rsi
leaq 0x416f(%rip), %rdi      # 0xef58
xorl %eax, %eax
callq 0x78e4
leaq 0x453c(%rip), %rdi      # 0xf333
jmp 0xadd2
leaq 0x8e40(%rip), %rcx      # 0x13c40
movq (%rcx,%rax,8), %rsi
leaq 0x4546(%rip), %rdi      # 0xf351
jmp 0xade9