// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/parse/specialize.c
// Function: genautocall
void
genautocall(Node **call, size_t ncall, Node *local, char *fn)
{
	Node *name, *decl, *func, *block, *init;
	Type *tyvoid, *tyvoidfn;
	size_t i;

	name = mkname(Zloc, fn);
	decl = mkdecl(Zloc, name, mktyvar(Zloc));
	block = mkblock(Zloc, mkstab(0));
	tyvoid = mktype(Zloc, Tyvoid);
	tyvoidfn = mktyfunc(Zloc, NULL, 0, tyvoid);

	for (i = 0; i < ncall; i++) {
		init = initdecl(call[i], tyvoidfn);
		callinit(block, init, tyvoid, tyvoidfn);
	}
	if (local)
		callinit(block, local, tyvoid, tyvoidfn);

	func = mkfunc(Zloc, NULL, 0, mktype(Zloc, Tyvoid), block);
	init = mkexpr(Zloc, Olit, func, NULL);
	init->expr.type = tyvoidfn;

	decl->decl.init = init;
	decl->decl.isconst = 1;
	decl->decl.isglobl = 1;
	decl->decl.type = tyvoidfn;
	decl->decl.vis = Vishidden;

	func->lit.fnval->func.scope->super = file.globls;
	block->block.scope->super = func->lit.fnval->func.scope->super;

	lappend(&file.stmts, &file.nstmts, decl);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0xffffffff, -0x68(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x64(%rbp)
movq -0x20(%rbp), %rsi
movq -0x68(%rbp), %rdi
callq 0x2f540
movq %rax, -0x28(%rbp)
movl $0xffffffff, -0x70(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x6c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl $0xffffffff, -0x78(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x74(%rbp)
movq -0x78(%rbp), %rdi
callq 0x370c0
movq -0xb0(%rbp), %rsi
movq %rax, %rdx
movq -0x70(%rbp), %rdi
callq 0x2ff20
movq %rax, -0x30(%rbp)
movl $0xffffffff, -0x80(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x7c(%rbp)
xorl %edi, %edi
callq 0x32b90
movq %rax, %rsi
movq -0x80(%rbp), %rdi
callq 0x2f980
movq %rax, -0x40(%rbp)
movl $0xffffffff, -0x88(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x84(%rbp)
movq -0x88(%rbp), %rdi
movl $0x1, %esi
callq 0x36c10
movq %rax, -0x50(%rbp)
movl $0xffffffff, -0x90(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x8c(%rbp)
movq -0x50(%rbp), %rcx
movq -0x90(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x37520
movq %rax, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x3267c
movq -0x8(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x58(%rbp), %rsi
callq 0x327c0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
callq 0x32860
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x32636
cmpq $0x0, -0x18(%rbp)
je 0x32698
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
callq 0x32860
movl $0xffffffff, -0x98(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x94(%rbp)
movl $0xffffffff, -0xa0(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x9c(%rbp)
movq -0xa0(%rbp), %rdi
movl $0x1, %esi
callq 0x36c10
movq %rax, %rcx
movq -0x40(%rbp), %r8
movq -0x98(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x2f860
movq %rax, -0x38(%rbp)
movl $0xffffffff, -0xa8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xa4(%rbp)
movq -0x38(%rbp), %rdx
movq -0xa8(%rbp), %rdi
movl $0x35, %esi
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x2f400
movq %rax, -0x48(%rbp)
movq -0x58(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x48(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x30(%rbp), %rax
movb $0x1, 0x72(%rax)
movq -0x30(%rbp), %rax
movb $0x1, 0x71(%rax)
movq -0x58(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movb $0x2, 0x70(%rax)
leaq 0x4a633(%rip), %rax     # 0x7cd98
movq 0x90(%rax), %rcx
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x20(%rax), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x20(%rax), %rax
movq (%rax), %rcx
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rdx
leaq 0x4a5f8(%rip), %rsi     # 0x7cd98
movq %rsi, %rdi
addq $0x40, %rdi
addq $0x48, %rsi
callq 0x48290
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)