// File: /workspace/github_c_makefile_star2_O0/oridb[P]mc/parse/use.c
// Function: fixtypemappings
static void
fixtypemappings(Stab *st)
{
	size_t i;
	Type *t, *old;

	/*
	* merge duplicate definitions.
	* This allows us to compare named types by id, instead
	* of doing a deep walk through the type. This ability
	* depends on when we do type inference.
	*/
	for (i = 0; i < ntypefix; i++) {
		t = htget(tidmap, itop(typefix[i].id));
		if (!t)
			die("Unable to find type for id %zd\n", typefix[i].id);
		*typefix[i].dest = t;
	}

	for (i = 0; i < ntypefix; i++) {
		old = *typefix[i].dest;
		if (old->type == Tyname || old->type == Tygeneric) {
			t = tydedup(old);
			*typefix[i].dest = t;
		}
	}

	/* check for duplicate type definitions */
	for (i = 0; i < ntypefix; i++) {
		t = htget(tidmap, itop(typefix[i].id));
		if ((t->type != Tyname && t->type != Tygeneric))
			continue;
		old = tydedup(t);
		if (!tyeq(t, old) && !isspecialization(t, old))
			lfatal(t->loc, "Duplicate definition of type %s on %s:%d",
				tystr(old), file.files[old->loc.file], old->loc.line);
	}
	lfree(&typefix, &ntypefix);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x400d9(%rip), %rax     # 0x7dd68
jae 0x3dd23
movq 0x400a4(%rip), %rax     # 0x7dd40
movq %rax, -0x28(%rbp)
movq 0x400b9(%rip), %rax     # 0x7dd60
movq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x3d120
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x49490
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3dcf6
movq 0x40087(%rip), %rax     # 0x7dd60
movq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
leaq 0x16876(%rip), %rdi     # 0x54565
movb $0x0, %al
callq 0x1df20
movq -0x18(%rbp), %rcx
movq 0x4005f(%rip), %rax     # 0x7dd60
movq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3dc84
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x40032(%rip), %rax     # 0x7dd68
jae 0x3dd9f
movq 0x40021(%rip), %rax     # 0x7dd60
movq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1c, (%rax)
je 0x3dd66
movq -0x20(%rbp), %rax
cmpl $0x1d, (%rax)
jne 0x3dd8f
movq -0x20(%rbp), %rdi
callq 0x36b70
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq 0x3ffe2(%rip), %rax     # 0x7dd60
movq -0x10(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rax), %rax
movq %rcx, (%rax)
jmp 0x3dd91
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3dd2b
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x3ffb6(%rip), %rax     # 0x7dd68
jae 0x3de8f
movq 0x3ff81(%rip), %rax     # 0x7dd40
movq %rax, -0x30(%rbp)
movq 0x3ff96(%rip), %rax     # 0x7dd60
movq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x3d120
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x49490
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1c, (%rax)
je 0x3de02
movq -0x18(%rbp), %rax
cmpl $0x1d, (%rax)
je 0x3de02
jmp 0x3de7e
movq -0x18(%rbp), %rdi
callq 0x36b70
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x39360
cmpl $0x0, %eax
jne 0x3de7c
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3fae0
cmpl $0x0, %eax
jne 0x3de7c
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x38a10
movq %rax, %rdx
movq -0x38(%rbp), %rax
leaq 0x3ef46(%rip), %rcx     # 0x7cd98
movq 0x8(%rcx), %rcx
movq -0x20(%rbp), %rsi
movslq 0xc(%rsi), %rsi
movq (%rcx,%rsi,8), %rcx
movq -0x20(%rbp), %rsi
movl 0x8(%rsi), %r8d
movq 0x8(%rax), %rdi
leaq 0x16710(%rip), %rsi     # 0x54585
movb $0x0, %al
callq 0x1e110
jmp 0x3de7e
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3dda7
leaq 0x3feca(%rip), %rdi     # 0x7dd60
leaq 0x3fecb(%rip), %rsi     # 0x7dd68
callq 0x48580
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)