// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/parse/infer.c
// Function: checkstruct
static void
checkstruct(Node *n, Postcheck ***post, size_t *npost)
{
	Type *t, *et;
	Node *val, *name;
	size_t i, j;
	Postcheck *pc;

	t = tybase(tf(n->lit.type));
	/*
	 * If we haven't inferred the type, and it's inside another struct,
	 * we'll eventually get to it.
	 *
	 * If, on the other hand, it is genuinely underspecified, we'll give
	 * a better error on it later.
	 */
	if (t->type == Tyvar)
		return;
	if (t->type != Tystruct)
		fatal(n, "struct literal is used as non struct type %s", tystr(n->lit.type));
	for (i = 0; i < n->expr.nargs; i++) {
		val = n->expr.args[i];
		name = val->expr.idx;

		et = NULL;
		for (j = 0; j < t->nmemb; j++) {
			if (!strcmp(namestr(t->sdecls[j]->decl.name), namestr(name))) {
				et = type(t->sdecls[j]);
				break;
			}
		}

		if (et) {
			unify(val, et, type(val));
		} else {
			assert(post != NULL);
			pc = xalloc(sizeof(Postcheck));
			pc->node = n;
			pc->stab = curstab();
			pc->env = curenv();
			lappend(post, npost, pc);
			return;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x277c0
movq %rax, %rdi
callq 0x36a30
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x19, (%rax)
jne 0x2e52b
jmp 0x2e6d7
movq -0x20(%rbp), %rax
cmpl $0x17, (%rax)
je 0x2e55e
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x38a10
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x24340(%rip), %rsi     # 0x52897
movb $0x0, %al
callq 0x1dfe0
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x40(%rcx), %rax
jae 0x2e6d7
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x78(%rcx), %rax
jae 0x2e61e
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rdi
callq 0x30600
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rdi
callq 0x30600
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x6220
cmpl $0x0, %eax
jne 0x2e60e
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2a8f0
movq %rax, -0x28(%rbp)
jmp 0x2e61e
jmp 0x2e610
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2e5a8
cmpq $0x0, -0x28(%rbp)
je 0x2e650
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rdi
callq 0x2a8f0
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq %rax, %rdx
callq 0x28c00
jmp 0x2e6c4
cmpq $0x0, -0x10(%rbp)
je 0x2e659
jmp 0x2e678
leaq 0x24264(%rip), %rdi     # 0x528c4
leaq 0x23bc9(%rip), %rsi     # 0x52230
movl $0x96b, %edx            # imm = 0x96B
leaq 0x2425e(%rip), %rcx     # 0x528d1
callq 0x6160
movl $0x18, %edi
callq 0x481b0
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
callq 0x32d60
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
callq 0x32f30
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x48290
jmp 0x2e6d7
jmp 0x2e6c6
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2e566
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)