LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/type.c
// Function: typecompatible
bool
typecompatible(struct type *t1, struct type *t2)
{
	struct decl *p1, *p2;
	struct expr *e1, *e2;

	if (t1 == t2)
		return true;
	if (t1->kind != t2->kind) {
		/*
		enum types are compatible with their underlying
		type, but not with each other (unless they are the
		same type)
		*/
		return t1->kind == TYPEENUM && t2 == t1->base ||
		       t2->kind == TYPEENUM && t1 == t2->base;
	}
	switch (t1->kind) {
	case TYPEPOINTER:
		goto derived;
	case TYPEARRAY:
		if (t1->incomplete || t2->incomplete)
			goto derived;
		e1 = t1->u.array.length;
		e2 = t2->u.array.length;
		if (e1 && e2 && e1->kind == EXPRCONST && e2->kind == EXPRCONST && e1->u.constant.u != e2->u.constant.u)
			return false;
		goto derived;
	case TYPEFUNC:
		if (t1->u.func.isvararg != t2->u.func.isvararg)
			return false;
		for (p1 = t1->u.func.params, p2 = t2->u.func.params; p1 && p2; p1 = p1->next, p2 = p2->next) {
			if (!typecompatible(p1->type, p2->type))
				return false;
		}
		if (p1 || p2)
			return false;
		goto derived;
	derived:
		return t1->qual == t2->qual && typecompatible(t1->base, t2->base);
	}
	return false;
}

// Assembly:
cmpq %rsi, %rdi
je 0xd994
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%r14), %eax
movl (%rbx), %ecx
cmpl %ecx, %eax
jne 0xd997
cmpl $0xc, %eax
je 0xd976
cmpl $0xe, %eax
je 0xd92b
cmpl $0xd, %eax
jne 0xd9b2
cmpb $0x0, 0x3c(%r14)
jne 0xd976
cmpb $0x0, 0x3c(%rbx)
jne 0xd976
movq 0x40(%r14), %rax
testq %rax, %rax
je 0xd976
movq 0x40(%rbx), %rcx
testq %rcx, %rcx
je 0xd976
cmpl $0x1, (%rax)
jne 0xd976
cmpl $0x1, (%rcx)
jne 0xd976
movq 0x30(%rax), %rax
cmpq 0x30(%rcx), %rax
je 0xd976
jmp 0xd9b2
movb 0x40(%r14), %al
cmpb 0x40(%rbx), %al
jne 0xd9b2
movq 0x48(%r14), %r15
movq 0x48(%rbx), %r12
testq %r12, %r12
setne %cl
testq %r15, %r15
setne %dl
je 0xd96c
testq %r12, %r12
je 0xd96c
movq 0x10(%r15), %rdi
movq 0x10(%r12), %rsi
callq 0xd8b8
testb %al, %al
je 0xd9b2
movq 0x38(%r15), %r15
movq 0x38(%r12), %r12
jmp 0xd93c
xorl %eax, %eax
testb %dl, %dl
jne 0xd9b4
testb %cl, %cl
jne 0xd9b4
movl 0x38(%r14), %eax
cmpl 0x38(%rbx), %eax
jne 0xd9b2
movq 0x20(%r14), %r14
movq 0x20(%rbx), %rbx
cmpq %rbx, %r14
jne 0xd8cf
movb $0x1, %al
jmp 0xd9b4
movb $0x1, %al
retq
cmpl $0x6, %eax
jne 0xd9a4
movb $0x1, %al
cmpq %rbx, 0x20(%r14)
je 0xd9b4
cmpl $0x6, %ecx
jne 0xd9b2
cmpq %r14, 0x20(%rbx)
sete %al
jmp 0xd9b4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/type.c
// Function: typepromote
struct type *
typepromote(struct type *t, unsigned width)
{
	if (t == &typefloat)
		return &typedouble;
	if (t->prop & PROPINT && (typerank(t) <= typerank(&typeint) || width <= typeint.size * 8)) {
		if (width == -1)
			width = t->size * 8;
		return width - t->u.basic.issigned < typeint.size * 8 ? &typeint : &typeuint;
	}
	return t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0xe439(%rip), %rax      # 0x1be10
cmpq %rax, %rdi
je 0xda48
movq %rdi, %rbx
testb $0x2, 0x4(%rdi)
je 0xda4f
movl %esi, %r14d
movq %rbx, %rdi
callq 0xda5d
movl %eax, %ebp
leaq 0xe207(%rip), %r15      # 0x1bc00
movq %r15, %rdi
callq 0xda5d
cmpl %eax, %ebp
jbe 0xda18
movl %r14d, %eax
movq 0xe201(%rip), %rcx      # 0x1bc10
shlq $0x3, %rcx
cmpq %rax, %rcx
jb 0xda4f
cmpl $-0x1, %r14d
jne 0xda26
movl 0x10(%rbx), %r14d
shll $0x3, %r14d
movzbl 0x40(%rbx), %eax
subl %eax, %r14d
movq 0xe1dc(%rip), %rax      # 0x1bc10
shlq $0x3, %rax
cmpq %r14, %rax
leaq 0xe216(%rip), %rbx      # 0x1bc58
cmovaq %r15, %rbx
jmp 0xda4f
leaq 0xe419(%rip), %rbx      # 0x1be68
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/type.c
// Function: typerank
static int
typerank(struct type *t)
{
	if (t->kind == TYPEENUM)
		t = t->base;
	assert(t->prop & PROPINT);
	switch (t->kind) {
	case TYPEBOOL:  return 1;
	case TYPECHAR:  return 2;
	case TYPESHORT: return 3;
	case TYPEINT:   return 4;
	case TYPELONG:  return 5;
	case TYPELLONG: return 6;
	}
	fatal("internal error; unhandled integer type");
	return 0;
}

// Assembly:
pushq %rbx
cmpl $0x6, (%rdi)
jne 0xda67
movq 0x20(%rdi), %rdi
testb $0x2, 0x4(%rdi)
je 0xdaa3
movl (%rdi), %eax
addl $-0x2, %eax
cmpl $0x7, %eax
jae 0xda8f
movl $0x6f, %ecx
btl %eax, %ecx
jae 0xda8f
movl %eax, %eax
leaq 0x7bea(%rip), %rcx      # 0x15674
movl (%rcx,%rax,4), %ebx
jmp 0xda9f
leaq 0x7bb5(%rip), %rdi      # 0x1564b
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xe058
movl %ebx, %eax
popq %rbx
retq
leaq 0x7b38(%rip), %rdi      # 0x155e2
leaq 0x79e1(%rip), %rsi      # 0x15492
leaq 0x7b77(%rip), %rcx      # 0x1562f
movl $0x64, %edx
callq 0x30e0
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/type.c
// Function: typecommonreal
struct type *
typecommonreal(struct type *t1, unsigned w1, struct type *t2, unsigned w2)
{
	struct type *tmp;

	assert(t1->prop & PROPREAL && t2->prop & PROPREAL);
	if (t1 == &typeldouble || t2 == &typeldouble)
		return &typeldouble;
	if (t1 == &typedouble || t2 == &typedouble)
		return &typedouble;
	if (t1 == &typefloat || t2 == &typefloat)
		return &typefloat;
	t1 = typepromote(t1, w1);
	t2 = typepromote(t2, w2);
	if (t1 == t2)
		return t1;
	if (t1->u.basic.issigned == t2->u.basic.issigned)
		return typerank(t1) > typerank(t2) ? t1 : t2;
	if (t1->u.basic.issigned) {
		tmp = t1;
		t1 = t2;
		t2 = tmp;
	}
	if (typerank(t1) >= typerank(t2))
		return t1;
	if (t1->size < t2->size)
		return t2;
	if (t2 == &typelong)
		return &typeulong;
	if (t2 == &typellong)
		return &typeullong;
	fatal("internal error; could not find common real type");
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testb $0x4, 0x4(%rdi)
je 0xdbee
movq %rdx, %r14
testb $0x4, 0x4(%rdx)
je 0xdbee
movl %ecx, %ebp
leaq 0xe3d7(%rip), %rbx      # 0x1bec0
cmpq %rbx, %rdi
sete %al
cmpq %rbx, %r14
sete %cl
orb %al, %cl
jne 0xdbe0
leaq 0xe364(%rip), %rbx      # 0x1be68
cmpq %rbx, %rdi
sete %al
cmpq %rbx, %r14
sete %cl
orb %al, %cl
jne 0xdbe0
leaq 0xe2f1(%rip), %rbx      # 0x1be10
cmpq %rbx, %rdi
sete %al
cmpq %rbx, %r14
sete %cl
orb %al, %cl
jne 0xdbe0
callq 0xd9c9
movq %rax, %rbx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd9c9
cmpq %rax, %rbx
je 0xdbe0
movq %rax, %r15
movb 0x40(%rbx), %al
cmpb 0x40(%r15), %al
jne 0xdb74
movq %rbx, %rdi
callq 0xda5d
movl %eax, %ebp
movq %r15, %rdi
callq 0xda5d
cmpl %eax, %ebp
cmovbeq %r15, %rbx
jmp 0xdbe0
testb %al, %al
movq %r15, %r14
cmovneq %rbx, %r14
cmovneq %r15, %rbx
movq %rbx, %rdi
callq 0xda5d
movl %eax, %ebp
movq %r14, %rdi
callq 0xda5d
cmpl %eax, %ebp
jae 0xdbe0
movq 0x10(%rbx), %rax
cmpq 0x10(%r14), %rax
jae 0xdba6
movq %r14, %rbx
jmp 0xdbe0
leaq 0xe103(%rip), %rax      # 0x1bcb0
cmpq %rax, %r14
je 0xdbd0
leaq 0xe1a7(%rip), %rax      # 0x1bd60
cmpq %rax, %r14
je 0xdbd9
leaq 0x792a(%rip), %rdi      # 0x154ef
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xe058
jmp 0xdbe0
leaq 0xe131(%rip), %rbx      # 0x1bd08
jmp 0xdbe0
leaq 0xe1d8(%rip), %rbx      # 0x1bdb8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7872(%rip), %rdi      # 0x15467
leaq 0x7896(%rip), %rsi      # 0x15492
leaq 0x7896(%rip), %rcx      # 0x15499
movl $0xbe, %edx
callq 0x30e0
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/type.c
// Function: typeadjust
struct type *
typeadjust(struct type *t, enum typequal *tq)
{
	enum typequal ptrqual;

	switch (t->kind) {
	case TYPEARRAY:
		ptrqual = t->u.array.ptrqual;
		t = mkpointertype(t->base, *tq | t->qual);
		*tq = ptrqual;
		break;
	case TYPEFUNC:
		assert(*tq == QUALNONE);
		t = mkpointertype(t, QUALNONE);
		break;
	}

	return t;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0xe, %eax
je 0xdc3a
cmpl $0xd, %eax
jne 0xdc8e
movl 0x48(%rbx), %ebp
movq 0x20(%rbx), %rdi
movl 0x38(%rbx), %esi
orl (%r14), %esi
callq 0xd803
movl %ebp, (%r14)
jmp 0xdc91
cmpl $0x0, (%r14)
jne 0xdc96
movl $0x58, %edi
callq 0xe142
movabsq $0x100000000c, %rcx     # imm = 0x100000000C
movq %rcx, (%rax)
movq $0x0, 0x18(%rax)
movw $0x0, 0x3c(%rax)
movq %rbx, 0x20(%rax)
movl $0x0, 0x38(%rax)
movq $0x8, 0x10(%rax)
movl $0x8, 0x8(%rax)
movl 0x4(%rbx), %ecx
andl $0x40, %ecx
orl $0x10, %ecx
movl %ecx, 0x4(%rax)
movq %rax, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x7882(%rip), %rdi      # 0x1551f
leaq 0x77ee(%rip), %rsi      # 0x15492
leaq 0x7884(%rip), %rcx      # 0x1552f
movl $0xe9, %edx
callq 0x30e0
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/type.c
// Function: typemember
struct member *
typemember(struct type *t, const char *name, unsigned long long *offset)
{
	struct member *m, *sub;

	assert(t->kind == TYPESTRUCT || t->kind == TYPEUNION);
	for (m = t->u.structunion.members; m; m = m->next) {
		if (m->name) {
			if (strcmp(m->name, name) == 0) {
				*offset += m->offset;
				return m;
			}
		} else {
			sub = typemember(m->type, name, offset);
			if (sub) {
				*offset += m->offset;
				return sub;
			}
		}
	}
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl (%rdi), %eax
addl $-0xf, %eax
cmpl $0x2, %eax
jae 0xdd1a
movq 0x48(%rdi), %r15
testq %r15, %r15
je 0xdd06
movq %rdx, %rbx
movq %rsi, %r14
movq (%r15), %rdi
testq %rdi, %rdi
je 0xdce9
movq %r14, %rsi
callq 0x3140
testl %eax, %eax
jne 0xdcfd
jmp 0xdd0a
movq 0x8(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xdcb5
testq %rax, %rax
jne 0xdd0d
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0xdcd3
xorl %eax, %eax
jmp 0xdd14
movq %r15, %rax
movq 0x18(%r15), %rcx
addq %rcx, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x7846(%rip), %rdi      # 0x15567
leaq 0x776a(%rip), %rsi      # 0x15492
leaq 0x7866(%rip), %rcx      # 0x15595
movl $0xf6, %edx
callq 0x30e0
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/type.c
// Function: typehasint
bool
typehasint(struct type *t, unsigned long long i, bool sign)
{
	assert(t->prop & PROPINT);
	if (sign && i >= -1ull << 63)
		return t->u.basic.issigned && i >= -1ull << (t->size << 3) - 1;
	return i <= 0xffffffffffffffffull >> (8 - t->size << 3) + t->u.basic.issigned;
}

// Assembly:
testb $0x2, 0x4(%rdi)
je 0xdd8a
testq %rsi, %rsi
setns %al
xorb $0x1, %dl
orb %al, %dl
jne 0xdd6b
cmpb $0x1, 0x40(%rdi)
jne 0xdd87
movb 0x10(%rdi), %cl
shlb $0x3, %cl
decb %cl
movq $-0x1, %rax
shlq %cl, %rax
cmpq %rsi, %rax
setbe %al
retq
movl 0x10(%rdi), %eax
movl 0x40(%rdi), %ecx
shll $0x3, %eax
subl %eax, %ecx
movq $-0x1, %rax
shrq %cl, %rax
cmpq %rsi, %rax
setae %al
retq
xorl %eax, %eax
retq
pushq %rax
leaq 0x7850(%rip), %rdi      # 0x155e2
leaq 0x76f9(%rip), %rsi      # 0x15492
leaq 0x7854(%rip), %rcx      # 0x155f4
movl $0x10b, %edx            # imm = 0x10B
callq 0x30e0
nop
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/utf.c
// Function: utf8enc
size_t
utf8enc(unsigned char *s, uint_least32_t c)
{
	if (c < 0x80) {
		s[0] = c;
		return 1;
	}
	if (c < 0x800) {
		s[0] = 0xc0 | c >> 6;
		s[1] = 0x80 | c & 0x3f;
		return 2;
	}
	if (c < 0xd800 || c - 0xe000 < 0x2000) {
		s[0] = 0xe0 | c >> 12;
		s[1] = 0x80 | c >> 6 & 0x3f;
		s[2] = 0x80 | c & 0x3f;
		return 3;
	}
	if (c - 0x10000 < 0x100000) {
		s[0] = 0xf0 | c >> 18;
		s[1] = 0x80 | c >> 12 & 0x3f;
		s[2] = 0x80 | c >> 6 & 0x3f;
		s[3] = 0x80 | c & 0x3f;
		return 4;
	}
	assert(0);
	return 0;
}

// Assembly:
cmpl $0x7f, %esi
ja 0xddba
movb %sil, (%rdi)
movl $0x1, %eax
retq
cmpl $0x7ff, %esi            # imm = 0x7FF
ja 0xdddd
movl %esi, %eax
shrl $0x6, %eax
orb $-0x40, %al
movb %al, (%rdi)
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x1(%rdi)
movl $0x2, %eax
retq
cmpl $0xd800, %esi           # imm = 0xD800
setae %al
movl %esi, %ecx
andl $0xffffe000, %ecx       # imm = 0xFFFFE000
cmpl $0xe000, %ecx           # imm = 0xE000
setne %cl
testb %cl, %al
jne 0xde22
movl %esi, %eax
shrl $0xc, %eax
orb $-0x20, %al
movb %al, (%rdi)
movl %esi, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%rdi)
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x2(%rdi)
movl $0x3, %eax
retq
leal -0x10000(%rsi), %eax
cmpl $0xfffff, %eax          # imm = 0xFFFFF
ja 0xde62
movl %esi, %eax
shrl $0x12, %eax
orb $-0x10, %al
movb %al, (%rdi)
movl %esi, %eax
shrl $0xc, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%rdi)
movl %esi, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x2(%rdi)
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x3(%rdi)
movl $0x4, %eax
retq
pushq %rax
leaq 0x7ef4(%rip), %rdi      # 0x15d5e
leaq 0x781f(%rip), %rsi      # 0x15690
leaq 0x781e(%rip), %rcx      # 0x15696
movl $0x1f, %edx
callq 0x30e0
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/utf.c
// Function: utf8dec
size_t
utf8dec(uint_least32_t *c, const unsigned char *s, size_t n)
{
	size_t i, l;
	unsigned char b;
	uint_least32_t x;

	b = s[0];
	if (b < 0x80) {
		*c = b;
		return 1;
	}
	if ((b & 0xe0) == 0xc0) {
		x = b & 0x1f;
		l = 2;
	} else if ((b & 0xf0) == 0xe0) {
		x = b & 0x0f;
		l = 3;
	} else if ((b & 0xf8) == 0xf0) {
		x = b & 0x07;
		l = 4;
	} else {
		return -1;
	}
	if (n < l)
		return -1;
	for (i = 1; i < l; ++i) {
		b = *++s;
		if ((b & 0xc0) != 0x80)
			return -1;
		x = x << 6 | b & 0x3f;
	}
	if (x >= 0x110000 || x - 0xd800 < 0x0200)
		return -1;
	*c = x;
	return l;
}

// Assembly:
movzbl (%rsi), %ecx
movl $0x1, %r8d
testb %cl, %cl
js 0xde95
movl %ecx, (%rdi)
movq %r8, %rax
retq
movl %ecx, %eax
andl $-0x20, %eax
cmpl $0xc0, %eax
jne 0xdeaf
movl $0x2, %r8d
movl $0x1f, %r9d
jmp 0xdeec
movl %ecx, %eax
andl $-0x10, %eax
cmpl $0xe0, %eax
jne 0xdec9
movl $0x3, %r8d
movl $0xf, %r9d
jmp 0xdeec
movl %ecx, %r8d
andl $-0x8, %r8d
movq $-0x1, %rax
cmpl $0xf0, %r8d
jne 0xde94
movl $0x4, %r8d
movl $0x7, %r9d
movq $-0x1, %rax
cmpq %rdx, %r8
ja 0xde94
andl %r9d, %ecx
movl $0x1, %r9d
movl %ecx, %edx
movzbl (%rsi,%r9), %ecx
movl %ecx, %r10d
andl $-0x40, %r10d
cmpl $0x80, %r10d
jne 0xde94
movl %edx, %r10d
shll $0x6, %r10d
andl $0x3f, %ecx
orl %r10d, %ecx
incq %r9
cmpq %r9, %r8
jne 0xdf01
cmpl $0x110000, %r10d        # imm = 0x110000
setae %sil
andl $0x7ff8, %edx           # imm = 0x7FF8
cmpl $0x360, %edx            # imm = 0x360
sete %dl
orb %sil, %dl
je 0xde8f
jmp 0xde94
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/utf.c
// Function: utf16enc
size_t
utf16enc(uint_least16_t *s, uint_least32_t c)
{
	if (c < 0xd800 || c - 0xe000 < 0x2000) {
		s[0] = c;
		return 1;
	}
	c -= 0x10000;
	if (c < 0x100000) {
		s[0] = 0xd800 | c >> 10 & 0x3ff;
		s[1] = 0xdc00 | c & 0x3ff;
		return 2;
	}
	assert(0);
	return 0;
}

// Assembly:
cmpl $0xd800, %esi           # imm = 0xD800
setae %al
movl %esi, %ecx
andl $0xffffe000, %ecx       # imm = 0xFFFFE000
cmpl $0xe000, %ecx           # imm = 0xE000
setne %cl
testb %cl, %al
jne 0xdf80
movw %si, (%rdi)
movl $0x1, %eax
retq
leal -0x10000(%rsi), %eax
cmpl $0xfffff, %eax          # imm = 0xFFFFF
ja 0xdfae
shrl $0xa, %eax
orl $0xd800, %eax           # imm = 0xD800
movw %ax, (%rdi)
andl $0x3ff, %esi            # imm = 0x3FF
orl $0xdc00, %esi           # imm = 0xDC00
movw %si, 0x2(%rdi)
movl $0x2, %eax
retq
pushq %rax
leaq 0x7da8(%rip), %rdi      # 0x15d5e
leaq 0x76d3(%rip), %rsi      # 0x15690
leaq 0x7702(%rip), %rcx      # 0x156c6
movl $0x56, %edx
callq 0x30e0
nop
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/util.c
// Function: xreallocarray
void *
xreallocarray(void *buf, size_t n, size_t m)
{
	buf = reallocarray(buf, n, m);
	if (!buf && n && m)
		fatal("reallocarray:");

	return buf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
callq 0xe0e2
testq %r14, %r14
je 0xe12c
testq %rbx, %rbx
je 0xe12c
testq %rax, %rax
je 0xe134
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x75bd(%rip), %rdi      # 0x156f8
xorl %eax, %eax
callq 0xe058
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/util.c
// Function: xmalloc
void *
xmalloc(size_t len)
{
	void *buf;

	buf = malloc(len);
	if (!buf && len)
		fatal("malloc:");

	return buf;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x3180
testq %rax, %rax
setne %cl
testq %rbx, %rbx
sete %dl
orb %cl, %dl
je 0xe15d
popq %rbx
retq
leaq 0x75a2(%rip), %rdi      # 0x15706
xorl %eax, %eax
callq 0xe058
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/util.c
// Function: arrayadd
void *
arrayadd(struct array *a, size_t n)
{
	void *v;

	if (a->cap - a->len < n) {
		do a->cap = a->cap ? a->cap * 2 : 256;
		while (a->cap - a->len < n);
		a->val = realloc(a->val, a->cap);
		if (!a->val)
			fatal("realloc");
	}
	v = (char *)a->val + a->len;
	a->len += n;

	return v;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rsi
movq %rsi, %rax
subq %rcx, %rax
cmpq %rbx, %rax
jae 0xe1e2
movl $0x100, %eax            # imm = 0x100
testq %rsi, %rsi
leaq (%rsi,%rsi), %rsi
cmoveq %rax, %rsi
movq %rsi, %rdx
subq %rcx, %rdx
cmpq %rbx, %rdx
jb 0xe1b2
movq %rsi, 0x10(%r14)
movq (%r14), %rdi
callq 0x31d0
movq %rax, (%r14)
testq %rax, %rax
je 0xe1f7
movq 0x8(%r14), %rcx
jmp 0xe1e5
movq (%r14), %rax
addq %rcx, %rax
addq %rcx, %rbx
movq %rbx, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7510(%rip), %rdi      # 0x1570e
xorl %eax, %eax
callq 0xe058
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/util.c
// Function: arraylast
void *
arraylast(struct array *a, size_t n)
{
	if (a->len == 0)
		return NULL;
	assert(n <= a->len);
	return (char *)a->val + a->len - n;
}

// Assembly:
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0xe254
cmpq %rsi, %rax
jb 0xe257
addq (%rdi), %rax
subq %rsi, %rax
retq
xorl %eax, %eax
retq
pushq %rax
leaq 0x74b7(%rip), %rdi      # 0x15716
leaq 0x74bc(%rip), %rsi      # 0x15722
leaq 0x74bc(%rip), %rcx      # 0x15729
movl $0x7d, %edx
callq 0x30e0
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: switchcase
void
switchcase(struct switchcases *cases, unsigned long long i, struct block *b)
{
	struct switchcase *c;

	c = treeinsert(&cases->root, i, sizeof(*c));
	if (!c->node.new)
		error(&tok.loc, "multiple 'case' labels with same value");
	c->body = b;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl $0x28, %edx
callq 0xd624
movq %rax, %r14
cmpb $0x0, 0x1c(%rax)
jne 0xe2d3
leaq 0xde47(%rip), %rdi      # 0x1c108
addq $0x8, %rdi
leaq 0x75f8(%rip), %rsi      # 0x158c4
xorl %eax, %eax
callq 0xd55c
movq %rbx, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: mkblock
struct block *
mkblock(char *name)
{
	static unsigned id;
	struct block *b;

	b = xmalloc(sizeof(*b));
	b->label.kind = VALUE_LABEL;
	b->label.u.name = name;
	b->label.id = ++id;
	b->insts = (struct array){0};
	b->jump.kind = JUMP_NONE;
	b->phi.res.kind = VALUE_NONE;
	b->next = NULL;

	return b;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x88, %edi
callq 0xe142
movl $0x7, (%rax)
movq %rbx, 0x8(%rax)
movl 0xde43(%rip), %ecx      # 0x1c140
incl %ecx
movl %ecx, 0xde3b(%rip)      # 0x1c140
movl %ecx, 0x4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movl %ecx, 0x60(%rax)
movl %ecx, 0x50(%rax)
movq %rcx, 0x80(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: mkglobal
struct value *
mkglobal(struct decl *d)
{
	static unsigned id;
	struct value *v;

	v = xmalloc(sizeof(*v));
	v->kind = VALUE_GLOBAL;
	if (d->kind == DECLOBJECT && d->u.obj.storage == SDTHREAD)
		v->kind |= VALUE_THREAD;
	if (d->asmname) {
		v->u.name = d->asmname;
		v->id = 0;
	} else {
		v->u.name = d->name;
		v->id = d->linkage == LINKNONE ? ++id : 0;
	}

	return v;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x10, %edi
callq 0xe142
movl $0x1, (%rax)
cmpl $0x1, 0x8(%rbx)
jne 0xe34a
cmpl $0x1, 0x44(%rbx)
jne 0xe34a
movl $0x11, (%rax)
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
je 0xe35b
movq %rcx, 0x8(%rax)
xorl %ecx, %ecx
jmp 0xe378
movq (%rbx), %rcx
movq %rcx, 0x8(%rax)
xorl %ecx, %ecx
cmpl $0x0, 0xc(%rbx)
jne 0xe378
movl 0xddd4(%rip), %ecx      # 0x1c144
incl %ecx
movl %ecx, 0xddcc(%rip)      # 0x1c144
movl %ecx, 0x4(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: delfunc
void
delfunc(struct func *f)
{
	struct block *b;
	struct inst **inst;

	while (b = f->start) {
		f->start = b->next;
		arrayforeach (&b->insts, inst)
			free(*inst);
		free(b->insts.val);
		free(b);
	}
	mapfree(&f->gotos, free);
	free(f);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %r14
testq %r14, %r14
je 0xedbf
movq 0x80(%r14), %rax
movq %rax, 0x28(%rbx)
movq 0x10(%r14), %r15
cmpq $0x0, 0x18(%r14)
je 0xeda9
movq (%r15), %rdi
callq 0x3250
addq $0x8, %r15
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rax
addq %rdi, %rax
cmpq %rax, %r15
jne 0xed8b
jmp 0xedac
movq %r15, %rdi
callq 0x3250
movq %r14, %rdi
callq 0x3250
movq 0x28(%rbx), %r14
jmp 0xed70
leaq 0x38(%rbx), %rdi
movq 0xc1ce(%rip), %rsi      # 0x1af98
callq 0xa638
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3250
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: funcjnz
void
funcjnz(struct func *f, struct value *v, struct type *t, struct block *l1, struct block *l2)
{
	struct block *b = f->end;

	if (b->jump.kind)
		return;
	if (t) {
		assert(t->prop & PROPSCALAR);
		/*
		Ideally we would just do this conversion unconditionally,
		but QBE is not currently able to optimize the conversion
		away for int.
		*/
		if (t->prop & PROPINT && t->size < 4)
			v = convert(f, &typeint, t, v);
		else if (t->prop & PROPFLOAT || t->size > 4)
			v = convert(f, &typebool, t, v);
	}
	b->jump.kind = JUMP_JNZ;
	b->jump.arg = v;
	b->jump.blk[0] = l1;
	b->jump.blk[1] = l2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x30(%rdi), %r15
cmpl $0x0, 0x60(%r15)
jne 0xee62
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, %rax
testq %rdx, %rdx
je 0xee4e
movl 0x4(%rdx), %ecx
testb $0x10, %cl
je 0xee68
testb $0x2, %cl
je 0xee33
cmpq $0x4, 0x10(%rdx)
jae 0xee33
leaq 0xcdcf(%rip), %rsi      # 0x1bc00
jmp 0xee46
leaq 0xcbb6(%rip), %rsi      # 0x1b9f0
testb $0x20, %cl
jne 0xee46
cmpq $0x5, 0x10(%rdx)
jb 0xee4e
movq %rax, %rcx
callq 0xee87
movl $0x2, 0x60(%r15)
movq %rax, 0x68(%r15)
movq %r14, 0x70(%r15)
movq %rbx, 0x78(%r15)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5737(%rip), %rdi      # 0x145a6
leaq 0x6a7e(%rip), %rsi      # 0x158f4
leaq 0x6a7d(%rip), %rcx      # 0x158fa
movl $0x252, %edx            # imm = 0x252
callq 0x30e0
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: funcgoto
struct gotolabel *
funcgoto(struct func *f, char *name)
{
	void **entry;
	struct gotolabel *g;
	struct mapkey key;

	mapkey(&key, name, strlen(name));
	entry = mapput(&f->gotos, &key);
	g = *entry;
	if (!g) {
		g = xmalloc(sizeof(*g));
		g->label = mkblock(name);
		*entry = g;
	}

	return g;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x3090
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xa500
addq $0x38, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0xa6a0
movq (%rax), %r15
testq %r15, %r15
jne 0xf244
movq %rax, %r14
movl $0x10, %edi
callq 0xe142
movq %rax, %r15
movl $0x88, %edi
callq 0xe142
movl $0x7, (%rax)
movq %rbx, 0x8(%rax)
movl 0xcf27(%rip), %ecx      # 0x1c140
incl %ecx
movl %ecx, 0xcf1f(%rip)      # 0x1c140
movl %ecx, 0x4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movl %ecx, 0x60(%rax)
movl %ecx, 0x50(%rax)
movq %rcx, 0x80(%rax)
movq %rax, (%r15)
movq %r15, (%r14)
movq %r15, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: calcvla
static void
calcvla(struct func *f, struct type *t)
{
	struct value *length, *basesize;

	if (!(t->prop & PROPVM))
		return;
	if (t->base)
		calcvla(f, t->base);
	if (t->kind == TYPEFUNC || t->size)
		return;
	assert(t->kind == TYPEARRAY);
	if (!t->u.array.size) {
		assert(t->base->size || t->base->kind == TYPEARRAY);
		assert(t->u.array.length);
		length = convert(f, &typeulong, t->u.array.length->type, funcexpr(f, t->u.array.length));
		basesize = t->base->size ? mkintconst(t->base->size) : t->base->u.array.size;
		t->u.array.size = funcinst(f, IMUL, 'l', length, basesize);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testb $0x40, 0x4(%rsi)
je 0xffcf
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rsi), %rsi
testq %rsi, %rsi
je 0xff1d
movq %r14, %rdi
callq 0xfef4
movl (%rbx), %eax
cmpl $0xe, %eax
je 0xffcf
cmpq $0x0, 0x10(%rbx)
jne 0xffcf
cmpl $0xd, %eax
jne 0xffdb
cmpq $0x0, 0x50(%rbx)
jne 0xffcf
movq 0x20(%rbx), %rax
cmpq $0x0, 0x10(%rax)
jne 0xff5b
cmpl $0xd, (%rax)
jne 0x10019
movq 0x40(%rbx), %rsi
testq %rsi, %rsi
je 0xfffa
movq 0x8(%rsi), %r15
movq %r14, %rdi
callq 0xf251
leaq 0xbd8d(%rip), %rsi      # 0x1bd08
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
callq 0xee87
movq %rax, %r15
movq 0x20(%rbx), %rax
movq 0x10(%rax), %r12
testq %r12, %r12
je 0xffb2
movl $0x10, %edi
callq 0xe142
movq %rax, %r8
movl $0x2, (%rax)
movq %r12, 0x8(%rax)
jmp 0xffb6
movq 0x50(%rax), %r8
movq %r14, %rdi
movl $0x5, %esi
movl $0x6c, %edx
movq %r15, %rcx
callq 0x10201
movq %rax, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x5ab2(%rip), %rdi      # 0x15a94
leaq 0x590b(%rip), %rsi      # 0x158f4
leaq 0x5eb3(%rip), %rcx      # 0x15ea3
movl $0x158, %edx            # imm = 0x158
callq 0x30e0
leaq 0x5ef9(%rip), %rdi      # 0x15efa
leaq 0x58ec(%rip), %rsi      # 0x158f4
leaq 0x5e94(%rip), %rcx      # 0x15ea3
movl $0x15b, %edx            # imm = 0x15B
callq 0x30e0
leaq 0x5eae(%rip), %rdi      # 0x15ece
leaq 0x58cd(%rip), %rsi      # 0x158f4
leaq 0x5e75(%rip), %rcx      # 0x15ea3
movl $0x15a, %edx            # imm = 0x15A
callq 0x30e0
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: funcload
static struct value *
funcload(struct func *f, struct type *t, struct lvalue lval)
{
	struct value *v;
	struct qbetype qt;

	switch (t->kind) {
	case TYPESTRUCT:
	case TYPEUNION:
	case TYPEARRAY:
		return lval.addr;
	}
	qt = qbetype(t);
	v = funcinst(f, qt.load, qt.base, lval.addr, NULL);
	return funcbits(f, t, v, lval.bits);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movl (%rsi), %eax
cmpl $0x10, %eax
ja 0x1006c
movl $0x1a000, %ecx          # imm = 0x1A000
btl %eax, %ecx
jae 0x1006c
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
callq 0x102e0
movsbl %al, %edx
movq %rax, %rsi
shrq $0x20, %rsi
movq %r15, %rdi
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x10201
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
movl %ebx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1167a
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: funclval
static struct lvalue
funclval(struct func *f, struct expr *e)
{
	struct lvalue lval = {0};
	struct decl *d;

	if (e->kind == EXPRBITFIELD) {
		lval.bits = e->u.bitfield.bits;
		e = e->base;
	}
	switch (e->kind) {
	case EXPRIDENT:
		d = e->u.ident.decl;
		if (d->kind != DECLOBJECT && d->kind != DECLFUNC)
			error(&tok.loc, "identifier '%s' is not an object or function", d->name);
		if (d == f->namedecl) {
			fputs("data ", stdout);
			emitname(d->value);
			printf(" = { b \"%s\", b 0 }\n", f->name);
			f->namedecl = NULL;
		}
		lval.addr = d->value;
		break;
	case EXPRSTRING:
		d = stringdecl(e);
		lval.addr = d->value;
		break;
	case EXPRCOMPOUND:
		if (e->toeval)
			funcexpr(f, e->toeval);
		d = e->u.compound.decl;
		funcinit(f, d, e->u.compound.init, true);
		lval.addr = d->value;
		break;
	case EXPRUNARY:
		if (e->op != TMUL)
			error(&tok.loc, "expression is not an object");
		lval.addr = funcexpr(f, e->base);
		break;
	default:
		if (e->type->kind != TYPESTRUCT && e->type->kind != TYPEUNION)
			error(&tok.loc, "expression is not an object");
		lval.addr = funcexpr(f, e);
	}
	return lval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movl (%rsi), %eax
cmpl $0x4, %eax
jne 0x100c9
movl 0x30(%r15), %ebx
movq 0x18(%r15), %r15
movl (%r15), %eax
jmp 0x100cb
xorl %ebx, %ebx
cmpl $0x7, %eax
ja 0x101c0
movl %eax, %eax
leaq 0x575b(%rip), %rcx      # 0x15838
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x30(%r15), %r15
movl 0x8(%r15), %eax
decl %eax
cmpl $0x2, %eax
jb 0x10111
movq (%r15), %rdx
leaq 0xc009(%rip), %rdi      # 0x1c108
addq $0x8, %rdi
leaq 0x5e02(%rip), %rsi      # 0x15f0c
xorl %eax, %eax
callq 0xd55c
cmpq 0x8(%r14), %r15
jne 0x10150
movq 0xaea2(%rip), %rax      # 0x1afc0
movq (%rax), %rsi
leaq 0x59d1(%rip), %rdi      # 0x15af9
callq 0x30f0
movq 0x20(%r15), %rdi
callq 0x10edd
movq 0x10(%r14), %rsi
leaq 0x5df8(%rip), %rdi      # 0x15f39
xorl %eax, %eax
callq 0x30b0
movq $0x0, 0x8(%r14)
movq 0x20(%r15), %rax
jmp 0x101f2
movq 0x28(%r15), %rsi
testq %rsi, %rsi
je 0x1016a
movq %r14, %rdi
callq 0xf251
movq 0x30(%r15), %r12
movq 0x38(%r15), %rdx
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %ecx
callq 0x103e2
movq 0x20(%r12), %rax
jmp 0x101f2
movq %r15, %rdi
callq 0x55fe
movq 0x20(%rax), %rax
jmp 0x101f2
cmpl $0x4b, 0x14(%r15)
je 0x101b7
leaq 0xbf63(%rip), %rdi      # 0x1c108
addq $0x8, %rdi
leaq 0x5d9d(%rip), %rsi      # 0x15f4d
xorl %eax, %eax
callq 0xd55c
movq 0x18(%r15), %rsi
movq %r14, %rdi
jmp 0x101ed
movq 0x8(%r15), %rax
movl (%rax), %eax
addl $-0xf, %eax
cmpl $0x2, %eax
jb 0x101e7
leaq 0xbf33(%rip), %rdi      # 0x1c108
addq $0x8, %rdi
leaq 0x5d6d(%rip), %rsi      # 0x15f4d
xorl %eax, %eax
callq 0xd55c
movq %r14, %rdi
movq %r15, %rsi
callq 0xf251
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: funcinst
static struct value *
funcinst(struct func *f, int op, int class, struct value *arg0, struct value *arg1)
{
	struct inst *inst;
	struct block *b;

	if (f->end->jump.kind) {
		b = mkblock("dead");
		funclabel(f, b);
	}
	inst = mkinst(f, op, class, arg0, arg1);
	arrayaddptr(&f->end->insts, inst);
	return &inst->res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %r14
movq %rcx, %r12
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %rbx
movq 0x30(%rdi), %rax
cmpl $0x0, 0x60(%rax)
je 0x10276
movl $0x88, %edi
callq 0xe142
movl $0x7, (%rax)
leaq 0x5d31(%rip), %rcx      # 0x15f69
movq %rcx, 0x8(%rax)
movl 0xbefe(%rip), %ecx      # 0x1c140
incl %ecx
movl %ecx, 0xbef6(%rip)      # 0x1c140
movl %ecx, 0x4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movl %ecx, 0x60(%rax)
movl %ecx, 0x50(%rax)
movq %rcx, 0x80(%rax)
movq 0x30(%rbx), %rcx
movq %rax, 0x80(%rcx)
movq %rax, 0x30(%rbx)
movl $0x28, %edi
callq 0xe142
movl %ebp, (%rax)
movl %r15d, 0x4(%rax)
movq %r12, 0x18(%rax)
movq %r14, 0x20(%rax)
testl %r15d, %r15d
sete %dl
cmpl $0x59, %ebp
sete %sil
xorl %ecx, %ecx
orb %dl, %sil
jne 0x102ba
movq $0x0, 0x10(%rax)
movl 0x58(%rbx), %ecx
incl %ecx
movl %ecx, 0x58(%rbx)
movl %ecx, 0xc(%rax)
movl $0x5, %ecx
movq %rax, %r14
addq $0x8, %r14
movl %ecx, 0x8(%rax)
movq 0x30(%rbx), %rdi
addq $0x10, %rdi
movq %rax, %rsi
callq 0xe205
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: qbetype
static struct qbetype
qbetype(struct type *t)
{
	static const struct qbetype
		ub = {'w', 'b', ILOADUB, ISTOREB},
		sb = {'w', 'b', ILOADSB, ISTOREB},
		uh = {'w', 'h', ILOADUH, ISTOREH},
		sh = {'w', 'h', ILOADSH, ISTOREH},
		w = {'w', 'w', ILOADW, ISTOREW},
		l = {'l', 'l', ILOADL, ISTOREL},
		s = {'s', 's', ILOADS, ISTORES},
		d = {'d', 'd', ILOADD, ISTORED},
		v = {0};

	if (t == &typevoid)
		return v;
	if (!(t->prop & PROPSCALAR))
		return l;
	switch (t->size) {
	case 1: return t->u.basic.issigned ? sb : ub;
	case 2: return t->u.basic.issigned ? sh : uh;
	case 4: return t->prop & PROPFLOAT ? s : w;
	case 8: return t->prop & PROPFLOAT ? d : l;
	case 16: fatal("long double is not yet supported");
	}
	assert(0);
}

// Assembly:
pushq %rax
cmpq 0xacb8(%rip), %rdi      # 0x1afa0
je 0x10342
movabsq $0x1700006c6c, %rax     # imm = 0x1700006C6C
movl 0x4(%rdi), %ecx
movl $0x11, %edx
testb $0x10, %cl
je 0x10346
movq 0x10(%rdi), %rdx
leaq -0x1(%rdx), %rsi
cmpq $0x7, %rsi
ja 0x103af
leaq 0x553e(%rip), %rdx      # 0x15858
movslq (%rdx,%rsi,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movzbl 0x40(%rdi), %ecx
xorl $0x1, %ecx
shlq $0x20, %rcx
movabsq $0x1b00006277, %rax     # imm = 0x1B00006277
addq %rcx, %rax
movl $0x14, %edx
jmp 0x10346
xorl %eax, %eax
xorl %edx, %edx
popq %rcx
retq
xorl %edx, %edx
testb $0x20, %cl
sete %dl
movabsq $0x1800007777, %rcx     # imm = 0x1800007777
movabsq $0x1600007373, %rax     # imm = 0x1600007373
cmoveq %rcx, %rax
leal 0x10(,%rdx,2), %edx
jmp 0x10346
xorl %edx, %edx
testb $0x20, %cl
sete %dl
movabsq $0x1500006464, %rcx     # imm = 0x1500006464
cmovneq %rcx, %rax
leal 0xf(,%rdx,2), %edx
jmp 0x10346
movzbl 0x40(%rdi), %ecx
xorl $0x1, %ecx
shlq $0x20, %rcx
movabsq $0x1900006877, %rax     # imm = 0x1900006877
addq %rcx, %rax
movl $0x13, %edx
jmp 0x10346
cmpq $0x10, %rdx
jne 0x103c3
leaq 0x5bb2(%rip), %rdi      # 0x15f6e
xorl %eax, %eax
callq 0xe058
leaq 0x5994(%rip), %rdi      # 0x15d5e
leaq 0x5523(%rip), %rsi      # 0x158f4
leaq 0x5bb7(%rip), %rcx      # 0x15f8f
movl $0xcb, %edx
callq 0x30e0
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: zero
static void
zero(struct func *func, struct value *addr, int align, unsigned long long offset, unsigned long long end)
{
	static const enum instkind store[] = {
		[1] = ISTOREB,
		[2] = ISTOREH,
		[4] = ISTOREW,
		[8] = ISTOREL,
	};
	static struct value z = {.kind = VALUE_INTCONST};
	struct value *tmp;
	int a = 1;

	while (offset < end) {
		if ((align - (offset & align - 1)) & a) {
			tmp = offset ? funcinst(func, IADD, ptrclass, addr, mkintconst(offset)) : addr;
			funcinst(func, store[a], 0, &z, tmp);
			offset += a;
		}
		if (a < align)
			a <<= 1;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0x4(%rsp)
movq %r8, 0x10(%rsp)
cmpq %r8, %rcx
jae 0x1073c
movq %rcx, %r14
movq %rsi, %rbx
movslq 0x4(%rsp), %rax
movq %rax, 0x8(%rsp)
decl %eax
movslq %eax, %r15
movl $0x1, %ebp
movq %rdi, %r13
movq %r14, %rax
andq %r15, %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
movslq %ebp, %r12
testq %r12, %rcx
je 0x1072c
movq %rbx, %r8
testq %r14, %r14
je 0x1070d
movl $0x10, %edi
callq 0xe142
movl $0x2, (%rax)
movq %r14, 0x8(%rax)
movq %r13, %rdi
movl $0x1, %esi
movl $0x6c, %edx
movq %rbx, %rcx
movq %rax, %r8
callq 0x10201
movq %rax, %r8
leaq 0x518c(%rip), %rax      # 0x158a0
movl (%rax,%r12,4), %esi
movq %r13, %rdi
xorl %edx, %edx
leaq 0xb84c(%rip), %rcx      # 0x1bf70
callq 0x10201
addq %r12, %r14
cmpl 0x4(%rsp), %ebp
setl %cl
shll %cl, %ebp
cmpq 0x10(%rsp), %r14
jb 0x106c0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: emitclass
static void
emitclass(int class, struct value *v)
{
	if (v && v->kind == VALUE_TYPE)
		emitname(v);
	else if (class)
		putchar(class);
	else
		fatal("type has no QBE representation");
}

// Assembly:
testq %rsi, %rsi
je 0x10ec7
cmpl $0x6, (%rsi)
jne 0x10ec7
movq %rsi, %rdi
jmp 0x10edd
testl %edi, %edi
jne 0x3030
leaq 0x5123(%rip), %rdi      # 0x15ff9
xorl %eax, %eax
jmp 0xe058
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: emitname
static void
emitname(struct value *v)
{
	static const char sigil[] = {
		[VALUE_TEMP] = '%',
		[VALUE_GLOBAL] = '$',
		[VALUE_TYPE] = ':',
		[VALUE_LABEL] = '@',
	};
	int kind;

	kind = v->kind & 0xf;
	if (kind >= LEN(sigil) || !sigil[kind])
		fatal("invalid value");
	putchar(sigil[kind]);
	if (kind == VALUE_GLOBAL && v->id)
		fputs(".L", stdout);
	if (v->u.name)
		fputs(v->u.name, stdout);
	if (v->id)
		printf(".%u", v->id);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %r14d
andl $0xf, %r14d
cmpl $0x7, %r14d
ja 0x10efc
movl $0x1d, %eax
btl %r14d, %eax
jae 0x10f0a
leaq 0x5115(%rip), %rdi      # 0x16018
xorl %eax, %eax
callq 0xe058
leaq 0x5417(%rip), %rax      # 0x16328
movsbl (%r14,%rax), %edi
callq 0x3030
cmpl $0x1, %r14d
jne 0x10f3d
cmpl $0x0, 0x4(%rbx)
je 0x10f3d
movq 0xa092(%rip), %rax      # 0x1afc0
movq (%rax), %rsi
leaq 0x50ee(%rip), %rdi      # 0x16026
callq 0x30f0
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x10f55
movq 0xa073(%rip), %rax      # 0x1afc0
movq (%rax), %rsi
callq 0x30f0
movl 0x4(%rbx), %esi
testl %esi, %esi
je 0x10f71
leaq 0x50c6(%rip), %rdi      # 0x16029
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x30b0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]cproc/qbe.c
// Function: emitvalue
static void
emitvalue(struct value *v)
{
	switch (v->kind & 0xf) {
	case VALUE_INTCONST:
		printf("%llu", v->u.i);
		break;
	case VALUE_FLTCONST:
		printf("s_%.17g", v->u.f);
		break;
	case VALUE_DBLCONST:
		printf("d_%.17g", v->u.f);
		break;
	case VALUE_GLOBAL:
		if (v->kind & VALUE_THREAD)
			fputs("thread ", stdout);
		/* fallthrough */
	default:
		emitname(v);
		break;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
movl %eax, %ecx
andl $0xf, %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x10fb5
leaq 0x48fa(%rip), %rdx      # 0x1588c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
testb $0x10, %al
je 0x10fb5
movq 0xa01a(%rip), %rax      # 0x1afc0
movq (%rax), %rsi
leaq 0x4b39(%rip), %rdi      # 0x15ae9
callq 0x30f0
movq %rbx, %rdi
popq %rbx
jmp 0x10edd
movsd 0x8(%rbx), %xmm0
leaq 0x5063(%rip), %rdi      # 0x1602d
jmp 0x10fd8
movsd 0x8(%rbx), %xmm0
leaq 0x505d(%rip), %rdi      # 0x16035
movb $0x1, %al
popq %rbx
jmp 0x30b0
movq 0x8(%rbx), %rsi
leaq 0x16b4(%rip), %rdi      # 0x1269f
xorl %eax, %eax
popq %rbx
jmp 0x30b0
// File: /workspace/github_c_makefile_star2_O3/cirocosta[P]stress/src/files.c
// Function: create_file
void
create_file(const char* base, const int i)
{
	FILE* fp;
	char* filename;

	_STRESS_MUST(asprintf(&filename, "%s/file%d", base, i) > 0,
	             "Couldn't create name for file %d",
	             i);
	_STRESS_MUST(
	  (fp = fopen(filename, "a")), "Couldn't create file %s", filename);
	fprintf(fp, "dummy");
	fclose(fp);
	free(filename);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq %rdi, %rdx
leaq 0x6a8(%rip), %rsi       # 0x2117
leaq 0x8(%rsp), %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x1140
testl %eax, %eax
jle 0x1acb
movq 0x8(%rsp), %rdi
leaq 0x6c1(%rip), %rsi       # 0x214e
callq 0x1150
testq %rax, %rax
je 0x1ad2
movq %rax, %rbx
leaq 0x6c7(%rip), %rdi       # 0x2168
movl $0x5, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x1190
movq %rbx, %rdi
callq 0x10b0
movq 0x8(%rsp), %rdi
callq 0x1030
addq $0x10, %rsp
popq %rbx
retq
movl %ebx, %edi
callq 0x13fc
leaq 0x8(%rsp), %rdi
callq 0x14b2
// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/compile.c
// Function: main
int main(int argc, char **argv)
{
	char *file;
	struct string_list *filelist = NULL;

	bits_in_bool = 8;

	clean_up_symbols(sparse_initialize(argc, argv, &filelist));
	FOR_EACH_PTR(filelist, file) {
		struct symbol_list *list;
		const char *basename = strrchr(file, '/');
		basename = basename ?  basename+1 : file;

		list = sparse(file);

		// Do type evaluation and simplification
		emit_unit_begin(basename);
		clean_up_symbols(list);
		emit_unit_end();
	} END_FOR_EACH_PTR(file);

#if 0
	// And show the allocation statistics
	show_ident_alloc();
	show_token_alloc();
	show_symbol_alloc();
	show_expression_alloc();
	show_statement_alloc();
	show_string_alloc();
	show_bytes_alloc();
#endif
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rbx
movq $0x0, (%rbx)
leaq 0x59880(%rip), %rax     # 0x6839c
movl $0x8, (%rax)
movq %rbx, %rdx
callq 0x11f5e
movq %rax, %rdi
callq 0xebc4
movq (%rbx), %r15
testq %r15, %r15
je 0xebb4
movq %r15, %r12
movzwl (%r12), %eax
testb %al, %al
jle 0xebaa
xorl %r13d, %r13d
movq 0x18(%r12,%r13,8), %rbx
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0xeb5e
testq %rbx, %rbx
je 0xeb9b
movq %rbx, %rdi
movl $0x2f, %esi
callq 0xe130
leaq 0x1(%rax), %r14
testq %rax, %rax
cmoveq %rbx, %r14
movq %rbx, %rdi
callq 0x12296
movq %rax, %rbx
movq %r14, %rdi
callq 0x3f5b8
movq %rbx, %rdi
callq 0xebc4
callq 0x3f5c9
movzwl (%r12), %eax
incq %r13
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r13
jl 0xeb49
movq 0x10(%r12), %r12
cmpq %r15, %r12
jne 0xeb3d
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/compile.c
// Function: clean_up_symbols
static void clean_up_symbols(struct symbol_list *list)
{
	struct symbol *sym;

	FOR_EACH_PTR(list, sym) {
		expand_symbol(sym);
		emit_one_symbol(sym);
	} END_FOR_EACH_PTR(sym);
}

// Assembly:
testq %rdi, %rdi
je 0xec2e
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdi, %r15
movzwl (%r15), %eax
testb %al, %al
jle 0xec1a
xorl %r12d, %r12d
movq 0x18(%r15,%r12,8), %r14
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0xebf7
testq %r14, %r14
je 0xec0b
movq %r14, %rdi
callq 0xeec8
movq %r14, %rdi
callq 0x3f64b
movzwl (%r15), %eax
incq %r12
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r12
jl 0xebe2
movq 0x10(%r15), %r15
cmpq %rbx, %r15
jne 0xebd7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/compile-i386.c
// Function: emit_unit_end
static void textbuf_emit(struct textbuf **buf_p)
{
	struct textbuf *tmp, *list = *buf_p;

	while (list) {
		tmp = list;
		if (tmp->next == tmp)
			list = NULL;
		else {
			tmp->prev->next = tmp->next;
			tmp->next->prev = tmp->prev;
			list = tmp->next;
		}

		fputs(tmp->text, stdout);

		free(tmp);
	}

	*buf_p = list;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x573eb(%rip), %rbx     # 0x969c0
testq %rbx, %rbx
je 0x3f623
movq 0x24927(%rip), %r14     # 0x63f08
movq 0x10(%rbx), %rax
cmpq %rbx, %rax
je 0x3f604
movq 0x18(%rbx), %rcx
movq %rax, 0x10(%rcx)
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
movq %rcx, 0x18(%rax)
movq 0x10(%rbx), %r15
jmp 0x3f607
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
movq (%r14), %rsi
callq 0xe150
movq %rbx, %rdi
callq 0xe030
movq %r15, %rbx
testq %r15, %r15
jne 0x3f5e1
movq $0x0, 0x57392(%rip) # 0x969c0
leaq 0x28f43(%rip), %rax     # 0x68578
movq (%rax), %rsi
leaq 0xf34a(%rip), %rdi      # 0x4e989
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xe110
// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/compile-i386.c
// Function: emit_object_pre
static void emit_object_pre(const char *name, unsigned long modifiers,
			    unsigned long alignment, unsigned int byte_size)
{
	if ((modifiers & MOD_STATIC) == 0)
		printf(".globl %s\n", name);
	emit_section(".data");
	if (alignment)
		printf("\t.align %lu\n", alignment);
	printf("\t.type\t%s, @object\n", name);
	printf("\t.size\t%s, %d\n", name, byte_size);
	printf("%s:\n", name);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rdi, %rbx
testb $0x4, %sil
jne 0x40163
leaq 0xe91c(%rip), %rdi      # 0x4ea75
movq %rbx, %rsi
xorl %eax, %eax
callq 0xe110
leaq 0xe916(%rip), %rdi      # 0x4ea80
callq 0x413fc
testq %r14, %r14
je 0x40185
leaq 0xe90b(%rip), %rdi      # 0x4ea86
movq %r14, %rsi
xorl %eax, %eax
callq 0xe110
leaq 0xe907(%rip), %rdi      # 0x4ea93
movq %rbx, %rsi
xorl %eax, %eax
callq 0xe110
leaq 0xe90a(%rip), %rdi      # 0x4eaa7
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe110
leaq 0x33c7(%rip), %rdi      # 0x43577
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0xe110
// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/compile-i386.c
// Function: emit_scalar
static void emit_scalar(struct expression *expr, unsigned int bit_size)
{
	const char *type;
	long long ll;

	assert(expr->type == EXPR_VALUE);

	if (expr->value == 0ULL) {
		printf("\t.zero\t%d\n", bit_size / 8);
		return;
	}

	ll = (long long) expr->value;

	switch (bit_size) {
	case 8:		type = "byte";	ll = (char) ll; break;
	case 16:	type = "value";	ll = (short) ll; break;
	case 32:	type = "long";	ll = (int) ll; break;
	case 64:	type = "quad";	break;
	default:	type = NULL;	break;
	}

	assert(type != NULL);

	printf("\t.%s\t%lld\n", type, ll);
}

// Assembly:
pushq %rax
cmpb $0x1, (%rdi)
jne 0x40236
movq 0x20(%rdi), %rdx
testq %rdx, %rdx
je 0x401f5
addl $-0x8, %esi
roll $0x1d, %esi
cmpl $0x7, %esi
ja 0x40255
leaq 0xe645(%rip), %rax      # 0x4e824
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movsbq %dl, %rdx
leaq 0x4fd5(%rip), %rsi      # 0x451c8
jmp 0x40227
shrl $0x3, %esi
leaq 0xe7ee(%rip), %rdi      # 0x4e9ed
xorl %eax, %eax
popq %rcx
jmp 0xe110
movslq %edx, %rdx
leaq 0x8166(%rip), %rsi      # 0x48377
jmp 0x40227
leaq 0xe8e9(%rip), %rsi      # 0x4eb03
jmp 0x40227
movswq %dx, %rdx
leaq 0xb6f4(%rip), %rsi      # 0x4b91b
leaq 0xe8da(%rip), %rdi      # 0x4eb08
xorl %eax, %eax
popq %rcx
jmp 0xe110
leaq 0xe879(%rip), %rdi      # 0x4eab6
leaq 0xe788(%rip), %rsi      # 0x4e9cc
leaq 0xe884(%rip), %rcx      # 0x4eacf
movl $0x397, %edx            # imm = 0x397
callq 0xe140
leaq 0xe763(%rip), %rdi      # 0x4e9bf
leaq 0xe769(%rip), %rsi      # 0x4e9cc
leaq 0xe865(%rip), %rcx      # 0x4eacf
movl $0x3a8, %edx            # imm = 0x3A8
callq 0xe140
// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/compile-i386.c
// Function: stor_sym_init
static void stor_sym_init(struct symbol *sym)
{
	struct storage *stor;
	struct symbol_private *priv;

	priv = calloc(1, sizeof(*priv) + sizeof(*stor));
	if (!priv)
		die("OOM in stor_sym_init");

	stor = (struct storage *) (priv + 1);

	priv->addr = stor;
	stor->type = STOR_SYM;
	stor->sym = sym;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, %edi
movl $0x38, %esi
callq 0xe1e0
testq %rax, %rax
je 0x402a3
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, (%rax)
movl $0x2, 0x8(%rax)
movq %rbx, 0x28(%rax)
popq %rbx
retq
leaq 0xe869(%rip), %rdi      # 0x4eb13
xorl %eax, %eax
callq 0x11dc6
// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/compile-i386.c
// Function: emit_initializer
static void emit_initializer(struct symbol *sym,
			     struct expression *expr)
{
	int distance = ea_current - ea_last - 1;

	if (distance > 0)
		printf("\t.zero\t%d\n", (sym->bit_size / 8) * distance);

	if (expr->type == EXPR_VALUE) {
		struct symbol *base_type = sym->ctype.base_type;
		assert(base_type != NULL);

		emit_scalar(expr, sym->bit_size / get_expression_value(base_type->array_size));
		return;
	}
	if (expr->type != EXPR_INITIALIZER)
		return;

	assert(0); /* FIXME */
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x55789(%rip), %eax     # 0x969c8
notl %eax
addl 0x55785(%rip), %eax     # 0x969cc
testl %eax, %eax
jle 0x4126b
movl 0x50(%r14), %ecx
leal 0x7(%rcx), %esi
testl %ecx, %ecx
cmovnsl %ecx, %esi
sarl $0x3, %esi
imull %eax, %esi
leaq 0xd789(%rip), %rdi      # 0x4e9ed
xorl %eax, %eax
callq 0xe110
movzbl (%rbx), %eax
cmpl $0x1, %eax
je 0x41280
cmpl $0x18, %eax
je 0x412b2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x60(%r14), %rax
testq %rax, %rax
je 0x412d1
movslq 0x50(%r14), %r14
movq 0x58(%rax), %rdi
callq 0xf595
movq %rax, %rcx
movq %r14, %rax
cqto
idivq %rcx
movq %rbx, %rdi
movl %eax, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x401be
leaq 0x6b8c(%rip), %rdi      # 0x47e45
leaq 0xd70c(%rip), %rsi      # 0x4e9cc
leaq 0xd731(%rip), %rcx      # 0x4e9f8
movl $0x3d1, %edx            # imm = 0x3D1
callq 0xe140
leaq 0xd6e2(%rip), %rdi      # 0x4e9ba
leaq 0xd6ed(%rip), %rsi      # 0x4e9cc
leaq 0xd712(%rip), %rcx      # 0x4e9f8
movl $0x3c9, %edx            # imm = 0x3C9
callq 0xe140