LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/integer.c
// Function: tt_int_sanity
int _tt_int_sanity(const struct tt_int *ti)
{
	if (ti->msb == 0 || ti->msb > ti->_max)
		return TT_APN_ESANITY;

	/* Check significands */
	if (ti->msb > 1 && ti->buf[ti->msb-1] == 0)
		return TT_APN_ESANITY;

	/* Check carry guard bit */
	for (int i = 0; i < ti->msb; i++)
		if ((ti->buf[i] & _tt_word_top_bit))
			return TT_APN_ESANITY;

	/* Check unused high words */
	for (int i = ti->msb; i < ti->_max; i++)
		if (ti->buf[i])
			return TT_APN_ESANITY;

	return 0;
}

// Assembly:
movl 0x8(%rdi), %edx
movl $0xffffff31, %eax       # imm = 0xFFFFFF31
testq %rdx, %rdx
je 0x4057
movslq 0x4(%rdi), %rcx
cmpl %ecx, %edx
jg 0x4057
cmpl $0x2, %edx
jl 0x401c
movq 0x10(%rdi), %rsi
cmpq $0x0, -0x8(%rsi,%rdx,8)
je 0x4057
xorl %esi, %esi
testl %edx, %edx
movl $0x0, %r8d
cmovgl %edx, %r8d
cmpq %rsi, %r8
je 0x4040
movq 0x10(%rdi), %r9
cmpq $0x0, (%r9,%rsi,8)
leaq 0x1(%rsi), %rsi
jns 0x402a
jmp 0x4057
movslq %edx, %rdx
cmpq %rcx, %rdx
jge 0x4058
movq 0x10(%rdi), %rsi
cmpq $0x0, (%rsi,%rdx,8)
leaq 0x1(%rdx), %rdx
je 0x4043
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/integer.c
// Function: tt_int_print
void _tt_int_print(const struct tt_int *ti)
{
	char *s = NULL;
	tt_int_to_string(ti, &s, 10);
	printf("%s\n", s);
	free(s);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rbx
andq $0x0, (%rbx)
pushq $0xa
popq %rdx
movq %rbx, %rsi
callq 0x4603
movq (%rbx), %rdi
callq 0x1060
movq (%rbx), %rdi
callq 0x1030
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/integer.c
// Function: tt_int_shift
int tt_int_shift(struct tt_int *ti, int shift)
{
	if (shift > 0) {
		int ret = _tt_int_realloc(ti, ti->msb +
				(shift+_tt_word_bits-1)/_tt_word_bits);
		if (ret)
			return ret;
	}

	ti->msb = _tt_int_shift_buf(ti->buf, ti->msb, shift);
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
testl %esi, %esi
jle 0x4293
leal 0x3e(%r14), %eax
pushq $0x3f
popq %rcx
xorl %edx, %edx
divl %ecx
addl 0x8(%rbx), %eax
movq %rbx, %rdi
movl %eax, %esi
callq 0x3ec0
testl %eax, %eax
je 0x4293
pushq $-0x1
popq %rax
jmp 0x42a7
movq 0x10(%rbx), %rdi
movl 0x8(%rbx), %esi
movl %r14d, %edx
callq 0x40ab
movl %eax, 0x8(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/mach.c
// Function: tt_int_from_uint
int tt_int_from_uint(struct tt_int *ti, uint64_t num)
{
	_tt_int_zero(ti);

	ti->buf[0] = num & ~_tt_word_top_bit;
	num >>= _tt_word_bits;
	if (num) {
		ti->buf[ti->msb++] = num & ~_tt_word_top_bit;
		num >>= _tt_word_bits;
		if (num)
			ti->buf[ti->msb++] = num;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3fad
movq %r14, %rcx
btrq $0x3f, %rcx
movq 0x10(%rbx), %rax
movq %rcx, (%rax)
testq %r14, %r14
jns 0x4cd1
movslq 0x8(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x8(%rbx)
movq $0x1, (%rax,%rcx,8)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/mach.c
// Function: tt_int_from_sint
int tt_int_from_sint(struct tt_int *ti, int64_t num)
{
	if (num < 0) {
		tt_int_from_uint(ti, -num);
		ti->sign = 1;
	} else {
		tt_int_from_uint(ti, num);
	}

	return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
js 0x4cee
movq %rbx, %rdi
callq 0x4c9c
jmp 0x4cff
negq %rsi
movq %rbx, %rdi
callq 0x4c9c
movl $0x1, (%rbx)
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/basic.c
// Function: tt_int_add_buf
int _tt_int_add_buf(_tt_word *int1, int msb1, const _tt_word *int2, int msb2)
{
	int i, carry = 0;

	for (i = 0; i < msb2; i++)
		int1[i] = add_int(int1[i], int2[i], &carry);
	for (; i < msb1; i++) {
		if (carry == 0)
			return msb1;
		int1[i]++;
		carry = !int1[i];
	}
	if (carry)
		int1[i++] = 1;

	return i;
}

// Assembly:
movl %esi, %eax
xorl %r8d, %r8d
testl %ecx, %ecx
cmovlel %r8d, %ecx
xorl %esi, %esi
cmpq %r8, %rcx
je 0x4d36
movl %esi, %r9d
addq (%rdi,%r8,8), %r9
addq (%rdx,%r8,8), %r9
movq %r9, %rsi
shrq $0x3f, %rsi
btrq $0x3f, %r9
movq %r9, (%rdi,%r8,8)
incq %r8
jmp 0x4d11
movslq %eax, %rdx
cmpq %rdx, %rcx
jge 0x4d51
testl %esi, %esi
je 0x4d60
xorl %esi, %esi
incq (%rdi,%rcx,8)
sete %sil
incq %rcx
jmp 0x4d39
testl %esi, %esi
je 0x4d61
leal 0x1(%rcx), %eax
movq $0x1, (%rdi,%rcx,8)
retq
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/basic.c
// Function: tt_int_sub_buf
int _tt_int_sub_buf(_tt_word *int1, int msb1, const _tt_word *int2, int msb2)
{
	int i, borrow = 0;

	for (i = 0; i < msb2; i++)
		int1[i] = sub_int(int1[i], int2[i], &borrow);
	for (; i < msb1; i++) {
		if (borrow == 0)
			return msb1;
		borrow = !int1[i];
		int1[i]--;
	}
	while (i > 1 && int1[i-1] == 0)
		i--;

	return i;
}

// Assembly:
movl %esi, %eax
xorl %r8d, %r8d
testl %ecx, %ecx
cmovlel %r8d, %ecx
xorl %esi, %esi
cmpq %r8, %rcx
je 0x4d98
negl %esi
movslq %esi, %r9
addq (%rdi,%r8,8), %r9
subq (%rdx,%r8,8), %r9
movq %r9, %rsi
shrq $0x3f, %rsi
btrq $0x3f, %r9
movq %r9, (%rdi,%r8,8)
incq %r8
jmp 0x4d71
movslq %eax, %rdx
cmpq %rdx, %rcx
jge 0x4db4
testl %esi, %esi
je 0x4dc9
xorl %esi, %esi
subq $0x1, (%rdi,%rcx,8)
setb %sil
incq %rcx
jmp 0x4d9b
movl %ecx, %eax
cmpl $0x2, %eax
jl 0x4dc9
movl %eax, %ecx
cmpq $0x0, -0x8(%rdi,%rcx,8)
jne 0x4dc9
decl %eax
jmp 0x4db6
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/basic.c
// Function: tt_int_cmp_buf
int _tt_int_cmp_buf(const _tt_word *int1, int msb1,
		const _tt_word *int2, int msb2)
{
	if (msb1 > msb2)
		return 1;
	else if (msb1 < msb2)
		return -1;

	for (int i = msb1-1; i >= 0; i--) {
		if (int1[i] > int2[i])
			return 1;
		else if (int1[i] < int2[i])
			return -1;
	}

	return 0;
}

// Assembly:
pushq $0x1
popq %rax
cmpl %ecx, %esi
jg 0x4df5
pushq $-0x1
popq %rcx
jl 0x4df3
movl %esi, %esi
testl %esi, %esi
jle 0x4df6
movq -0x8(%rdi,%rsi,8), %r8
movq -0x8(%rdx,%rsi,8), %r9
cmpq %r9, %r8
ja 0x4df5
decq %rsi
cmpq %r9, %r8
jae 0x4dd8
movl %ecx, %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/basic.c
// Function: tt_int_mul_buf
int _tt_int_mul_buf(_tt_word *intr, const _tt_word *int1, int msb1,
		const _tt_word *int2, int msb2)
{
	/* mul_buf_xxx cannot treat 0 correctly */
	if ((msb1 == 1 && int1[0] == 0) || (msb2 == 1 && int2[0] == 0))
		return 1;

	int msbmin, msbmax;
	if (msb1 > msb2) {
		msbmax = msb1;
		msbmin = msb2;
	} else {
		msbmax = msb2;
		msbmin = msb1;
	}

	/* Use classic algorithm when input size below crosspoint */
	if (msbmin < KARA_CROSS)
		return mul_buf_classic(intr, int1, msb1, int2, msb2);

	/* Allocate working buffer for Karatsuba algorithm */
	/* recursive calls = (int)(log2(msbmax) - log2(KARA_CROSS)) + 2; */
	const int recurse = 33 - __builtin_clz((msbmax / KARA_CROSS) + 1);
	const int worksz = msbmax * 4 + recurse * (recurse + 9);
	void *workbuf = malloc(worksz * _tt_word_sz);
	if (workbuf == NULL)
		return TT_ENOMEM;

	int ret = mul_buf_kara(intr, int1, msb1, int2, msb2, workbuf);

	free(workbuf);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
pushq $0x1
popq %rax
cmpl $0x1, %edx
jne 0x4e3d
cmpq $0x0, (%r15)
je 0x4edb
cmpl $0x1, %ebx
jne 0x4e4c
cmpq $0x0, (%r14)
je 0x4edb
cmpl %ebx, %ebp
movl %ebx, %eax
cmovll %ebp, %eax
cmpl $0xf, %eax
jg 0x4e76
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
movl %ebx, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4eea
cmpl %ebx, %ebp
movl %ebx, %ecx
cmovgl %ebp, %ecx
pushq $0x10
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
incl %eax
bsrl %eax, %eax
xorl $0x1f, %eax
pushq $0x21
popq %rdx
subl %eax, %edx
shll $0x5, %ecx
shll $0x3, %eax
movl $0x150, %esi            # imm = 0x150
subl %eax, %esi
imull %edx, %esi
addl %ecx, %esi
movslq %esi, %rdi
callq 0x1140
testq %rax, %rax
je 0x4ed8
movq %rax, %r13
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
movl %ebx, %r8d
movq %rax, %r9
callq 0x507d
movl %eax, %ebx
movq %r13, %rdi
callq 0x1030
movl %ebx, %eax
jmp 0x4edb
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/basic.c
// Function: add_sub_ints
static int add_sub_ints(struct tt_int *dst, const struct tt_int *src1,
		const struct tt_int *src2, int sub)
{
	int ret = 0;

	/* Zero dst if not overlap with src1 and src2 */
	if (dst != src1 && dst != src2)
		_tt_int_zero(dst);

	int sign1 = src1->sign;
	int sign2 = src2->sign;
	if (sub)
		sign2 = !sign2;

	if (sign1 == sign2) {
		dst->sign = sign1;
		ret = add_ints_abs(dst, src1, src2);
	} else {
		int cmp12 = tt_int_cmp_abs(src1, src2);
		if (cmp12 >= 0) {
			dst->sign = sign1;
			ret = sub_ints_abs(dst, src1, src2);
		} else {
			dst->sign = sign2;
			ret = sub_ints_abs(dst, src2, src1);
		}
	}

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
cmpq %rsi, %rdi
sete %al
cmpq %rdx, %rdi
sete %cl
orb %al, %cl
jne 0x60a1
movq %rbx, %rdi
callq 0x3fad
movl (%r14), %r12d
movl (%r15), %eax
xorl %r13d, %r13d
testl %eax, %eax
sete %r13b
testl %ebp, %ebp
cmovel %eax, %r13d
cmpl %r13d, %r12d
jne 0x6135
movl %r12d, (%rbx)
movl 0x8(%r14), %eax
cmpl 0x8(%r15), %eax
movq %r15, %r12
cmovlq %r14, %r12
cmovlq %r15, %r14
movl 0x8(%r14), %esi
cmpl %esi, 0x4(%rbx)
jg 0x60f2
incl %esi
movq %rbx, %rdi
callq 0x3ec0
movl %eax, %ebp
testl %eax, %eax
jne 0x61ee
movl 0x8(%r14), %esi
movl %esi, 0x8(%rbx)
movl 0x8(%r12), %eax
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
xorl %ecx, %ecx
cmpq %rdx, %rax
je 0x6152
movq 0x10(%r14), %rdi
movq 0x10(%r12), %r8
movl %ecx, %r9d
addq (%rdi,%rdx,8), %r9
addq (%r8,%rdx,8), %r9
movq %r9, %rcx
shrq $0x3f, %rcx
btrq $0x3f, %r9
movq 0x10(%rbx), %rdi
movq %r9, (%rdi,%rdx,8)
incq %rdx
jmp 0x6103
movq %r14, %rdi
movq %r15, %rsi
callq 0x6671
testl %eax, %eax
js 0x6191
movl %r12d, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
jmp 0x619d
movslq 0x8(%r14), %rdi
leal (,%rdi,8), %edx
leal (,%rax,8), %r8d
subl %r8d, %edx
cmpq %rdi, %rax
jge 0x61b0
testl %ecx, %ecx
je 0x61cd
movq 0x10(%r14), %rcx
movq (%rcx,%rax,8), %r8
xorl %ecx, %ecx
incq %r8
sete %cl
movq 0x10(%rbx), %r9
movq %r8, (%r9,%rax,8)
incq %rax
addl $-0x8, %edx
jmp 0x6168
movl %r13d, (%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x66df
xorl %ebp, %ebp
testl %ecx, %ecx
je 0x61ee
movq 0x10(%rbx), %rax
leal 0x1(%rsi), %ecx
movl %ecx, 0x8(%rbx)
movslq %esi, %rcx
movq $0x1, (%rax,%rcx,8)
jmp 0x61ee
xorl %ebp, %ebp
cmpq %rbx, %r14
je 0x61ee
shlq $0x3, %rax
movq 0x10(%rbx), %rdi
addq %rax, %rdi
addq 0x10(%r14), %rax
movslq %edx, %rdx
movq %rax, %rsi
callq 0x1120
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/basic.c
// Function: tt_int_mul
int tt_int_mul(struct tt_int *dst, const struct tt_int *src1,
		const struct tt_int *src2)
{
	if (_tt_int_is_zero(src1) || _tt_int_is_zero(src2)) {
		_tt_int_zero(dst);
		return 0;
	}

	/* Allocate result buffer */
	_tt_word *r = calloc(src1->msb + src2->msb, _tt_word_sz);
	if (!r)
		return TT_ENOMEM;

	const int sign = src1->sign ^ src2->sign;
	int msb = _tt_int_mul_buf(r, src1->buf, src1->msb,
			src2->buf, src2->msb);
	/* TODO: drop memcpy by replacing dst->buf with r directly */
	if (dst->_max < msb) {
		int ret = _tt_int_realloc(dst, msb);
		if (ret)
			return ret;
	}
	memcpy(dst->buf, r, msb*_tt_word_sz);
	memset(dst->buf + msb, 0, (dst->_max - msb)*_tt_word_sz);
	dst->msb = msb;
	dst->sign = sign;

	free(r);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movl 0x8(%rsi), %r15d
cmpl $0x1, %r15d
jne 0x6233
movq 0x10(%r13), %rax
cmpq $0x0, (%rax)
je 0x62f1
movl 0x8(%r12), %ebp
cmpl $0x1, %ebp
jne 0x624c
movq 0x10(%r12), %rax
cmpq $0x0, (%rax)
je 0x62f1
leal (%r15,%rbp), %eax
movslq %eax, %rdi
pushq $0x8
popq %rsi
callq 0x1100
testq %rax, %rax
je 0x62fd
movq %rax, %r14
movl (%r12), %eax
xorl (%r13), %eax
movl %eax, 0x4(%rsp)
movq 0x10(%r13), %rsi
movq 0x10(%r12), %rcx
movq %r14, %rdi
movl %r15d, %edx
movl %ebp, %r8d
callq 0x4e12
movl %eax, %r15d
cmpl %eax, 0x4(%rbx)
jge 0x62a3
movq %rbx, %rdi
movl %r15d, %esi
callq 0x3ec0
movl %eax, %ebp
testl %eax, %eax
jne 0x6300
movq 0x10(%rbx), %rdi
leal (,%r15,8), %eax
movslq %eax, %rdx
movq %r14, %rsi
callq 0x1120
movslq %r15d, %rax
leaq (,%rax,8), %rdi
addq 0x10(%rbx), %rdi
movslq 0x4(%rbx), %rdx
subq %rax, %rdx
shlq $0x3, %rdx
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x10e0
movl %r15d, 0x8(%rbx)
movl 0x4(%rsp), %eax
movl %eax, (%rbx)
movq %r14, %rdi
callq 0x1030
jmp 0x6300
movq %rbx, %rdi
callq 0x3fad
xorl %ebp, %ebp
jmp 0x6300
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/basic.c
// Function: tt_int_cmp
int tt_int_cmp(const struct tt_int *src1, const struct tt_int *src2)
{
	int ret;

	if (src1->sign != src2->sign) {
		if (_tt_int_is_zero(src1) && _tt_int_is_zero(src2))
			return 0;
		ret = src2->sign - src1->sign;
	} else {
		ret = tt_int_cmp_abs(src1, src2);
		if (src1->sign)
			ret = -ret;
	}

	return ret;
}

// Assembly:
pushq %rbx
movl (%rdi), %ebx
movl (%rsi), %eax
subl %ebx, %eax
jne 0x66a4
callq 0x6671
movl %eax, %ecx
negl %eax
testl %ebx, %ebx
cmovel %ecx, %eax
jmp 0x66c6
cmpl $0x1, 0x8(%rdi)
jne 0x66c6
movq 0x10(%rdi), %rcx
cmpq $0x0, (%rcx)
jne 0x66c6
cmpl $0x1, 0x8(%rsi)
jne 0x66c6
movq 0x10(%rsi), %rcx
cmpq $0x0, (%rcx)
jne 0x66c6
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/basic.c
// Function: sub_ints_abs
static int sub_ints_abs(struct tt_int *dst, const struct tt_int *src1,
		const struct tt_int *src2)
{
	/* Make sure dst buffer is large enough. TODO: It's overkill. */
	if (dst->_max < src1->msb) {
		int ret = _tt_int_realloc(dst, src1->msb);
		if (ret)
			return ret;
	}

	/* Sub array */
	int i, borrow = 0;
	for (i = 0; i < src2->msb; i++)
		dst->buf[i] = sub_int(src1->buf[i], src2->buf[i], &borrow);
	for (; i < src1->msb; i++) {
		if (borrow == 0) {
			if (dst != src1)
				memcpy(&dst->buf[i], &src1->buf[i],
						(src1->msb-i)*_tt_word_sz);
			break;
		}
		dst->buf[i] = src1->buf[i] - 1;
		borrow = !src1->buf[i];
	}

	/* Check new msb */
	dst->msb = src1->msb;
	while (dst->msb > 1 && dst->buf[dst->msb-1] == 0)
		dst->msb--;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rsi), %esi
cmpl %esi, 0x4(%rdi)
jge 0x6705
movq %rbx, %rdi
callq 0x3ec0
testl %eax, %eax
jne 0x67d2
movl 0x8(%r15), %esi
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %esi
xorl %ecx, %ecx
cmpq %rax, %rsi
je 0x6745
movq 0x10(%r14), %rdx
movq 0x10(%r15), %rdi
negl %ecx
movslq %ecx, %r8
addq (%rdx,%rax,8), %r8
subq (%rdi,%rax,8), %r8
movq %r8, %rcx
shrq $0x3f, %rcx
btrq $0x3f, %r8
movq 0x10(%rbx), %rdx
movq %r8, (%rdx,%rax,8)
incq %rax
jmp 0x6712
movl 0x8(%r14), %eax
movslq %eax, %rdi
leal (,%rdi,8), %edx
leal (,%rsi,8), %r8d
subl %r8d, %edx
cmpq %rdi, %rsi
jge 0x67ac
testl %ecx, %ecx
je 0x678c
movq 0x10(%r14), %r8
movq (%r8,%rsi,8), %rcx
decq %rcx
movq 0x10(%rbx), %r9
movq %rcx, (%r9,%rsi,8)
xorl %ecx, %ecx
cmpq $0x0, (%r8,%rsi,8)
sete %cl
incq %rsi
addl $-0x8, %edx
jmp 0x675e
cmpq %r14, %rbx
je 0x67ac
shlq $0x3, %rsi
movq 0x10(%rbx), %rdi
addq %rsi, %rdi
addq 0x10(%r14), %rsi
movslq %edx, %rdx
callq 0x1120
movl 0x8(%r14), %eax
testl %eax, %eax
pushq $0x1
popq %rcx
cmovlel %eax, %ecx
cmpl $0x2, %eax
jl 0x67cd
movq 0x10(%rbx), %rdx
movl %eax, %esi
cmpq $0x0, -0x8(%rdx,%rsi,8)
jne 0x67cb
decl %eax
jmp 0x67b4
movl %eax, %ecx
movl %ecx, 0x8(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/gcd.c
// Function: to_odd
static _tt_word *to_odd(_tt_word *a, int *msb, uint *shift)
{
	*shift = 0;

	while (*a == 0) {
		a++;
		(*msb)--;
		(*shift) += _tt_word_bits;
	}

	int zc = _tt_int_word_ctz(*a);
	if (zc) {
		*msb = _tt_int_shift_buf(a, *msb, -zc);
		(*shift) += zc;
	}

	return a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
xorl %eax, %eax
movl %eax, (%rbx)
movq (%r14), %rdi
testq %rdi, %rdi
jne 0x722d
decl (%r15)
addq $0x8, %r14
movl (%rbx), %eax
addl $0x3f, %eax
jmp 0x7215
callq 0x3fe0
testl %eax, %eax
je 0x724c
movl %eax, %ebp
movl (%r15), %esi
movl %eax, %edx
negl %edx
movq %r14, %rdi
callq 0x40ab
movl %eax, (%r15)
addl %ebp, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/gcd.c
// Function: _ctz
static uint __ctz(const _tt_word *a)
{
	uint z = 0;

	while (*a == 0) {
		a++;
		z += _tt_word_bits;
	}

	return z + _tt_int_word_ctz(*a);
}

// Assembly:
pushq %rbx
xorl %ebx, %ebx
movq (%rdi), %rax
testq %rax, %rax
jne 0x726e
addq $0x8, %rdi
addl $0x3f, %ebx
jmp 0x725d
movq %rax, %rdi
callq 0x3fe0
addl %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/mod.c
// Function: tt_int_mod_inv
int tt_int_mod_inv(struct tt_int *m,
		const struct tt_int *a, const struct tt_int *b)
{
	struct tt_int *n = tt_int_alloc();

	int ret = tt_int_extgcd(NULL, m, n, a, b);
	tt_int_free(n);

	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x3e50
movq %rax, %r12
xorl %edi, %edi
movq %r15, %rsi
movq %rax, %rdx
movq %r14, %rcx
movq %rbx, %r8
callq 0x6c8c
movl %eax, %ebx
movq %r12, %rdi
callq 0x3eaa
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/apn/integer/mod.c
// Function: tt_int_mont_reduce
int _tt_int_mont_reduce(_tt_word *r, int *msbr, const _tt_word *c, int msbc,
		const _tt_word *u, int msbu, const _tt_word *n, int msbn,
		_tt_word *t)
{
	tt_assert_fa(msbc <= msbn*2);

	/* q = u*c % lambda (TODO: drop 1/4 calculation) */
	_tt_word *q = t;
	memset(q, 0, msbn*2*_tt_word_sz);
	int msbq = _tt_int_mul_buf(q, u, msbu, c, _tt_min(msbc, msbn));
	if (msbq > msbn)
		msbq = _tt_int_get_msb(q, msbn);
	/* Q = c + q*n */
	_tt_word *Q = q + msbq;
	memset(Q, 0, msbn*2*_tt_word_sz);
	int msbQ = _tt_int_mul_buf(Q, q, msbq, n, msbn);
	msbQ = _tt_int_add_buf(Q, msbQ, c, msbc);
	/* r = Q / lambda */
	memset(r, 0, (msbn+1)*_tt_word_sz);
	*msbr = 1;
	if (msbQ > msbn) {
		*msbr = msbQ - msbn;
		memcpy(r, Q+msbn, (*msbr)*_tt_word_sz);
	}
	if (_tt_int_cmp_buf(r, *msbr, n, msbn) >= 0)
		*msbr = _tt_int_sub_buf(r, *msbr, n, msbn);

	tt_assert_fa(_tt_int_cmp_buf(r, *msbr, n, msbn) < 0);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl 0x68(%rsp), %r13d
leal (,%r13,2), %eax
cmpl %ecx, %eax
jl 0x7423
movl %ecx, %ebp
movq %rsi, 0x18(%rsp)
movq %rdi, 0x20(%rsp)
movq 0x70(%rsp), %r14
movl %r13d, %eax
shll $0x4, %eax
cltq
movq %r14, %rdi
xorl %esi, %esi
movq %rdx, %r15
movq %rax, 0x8(%rsp)
movq %rax, %rdx
movl %r9d, %r12d
movq %r8, %rbx
callq 0x10e0
cmpl %r13d, %ebp
movl %r13d, %r8d
cmovll %ebp, %r8d
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rbx
movl %r12d, %edx
movq %r14, %r12
movq %r15, 0x10(%rsp)
movq %r15, %rcx
callq 0x4e12
cmpl %ebx, %eax
jle 0x734b
movq %r12, %rdi
movl %ebx, %esi
callq 0x4df9
movslq %eax, %r14
leaq (%r12,%r14,8), %r15
movq %r15, %rdi
xorl %esi, %esi
movq 0x8(%rsp), %rdx
callq 0x10e0
movq %r15, %rdi
movq %r12, %rsi
movl %r14d, %edx
movq 0x60(%rsp), %r13
movq %r13, %rcx
movl %ebx, %r8d
callq 0x4e12
movq %r15, %rdi
movl %eax, %esi
movq 0x10(%rsp), %rdx
movl %ebp, %ecx
callq 0x4d04
movl %eax, %ebp
leal 0x8(,%rbx,8), %eax
movslq %eax, %rdx
movq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x10e0
movq 0x18(%rsp), %r12
movl $0x1, (%r12)
subl %ebx, %ebp
jle 0x73d6
movl %ebp, (%r12)
movslq %ebx, %rax
leaq (%r15,%rax,8), %rsi
shll $0x3, %ebp
movslq %ebp, %rdx
movq %r14, %rdi
callq 0x1120
movl (%r12), %esi
jmp 0x73d9
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %r13, %rdx
movl %ebx, %ecx
callq 0x4dca
movl (%r12), %esi
testl %eax, %eax
js 0x7401
movq %r14, %rdi
movq %r13, %rdx
movl %ebx, %ecx
callq 0x4d64
movl %eax, %esi
movl %eax, (%r12)
movq %r14, %rdi
movq %r13, %rdx
movl %ebx, %ecx
callq 0x4dca
testl %eax, %eax
jns 0x743c
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf5d8(%rip), %rsi      # 0x16a02
leaq 0x2c51(%rip), %rdx      # 0xa082
leaq 0xf5de(%rip), %rcx      # 0x16a16
pushq $0x26
jmp 0x7453
leaq 0xf5bf(%rip), %rsi      # 0x16a02
leaq 0x2c38(%rip), %rdx      # 0xa082
leaq 0xf5c5(%rip), %rcx      # 0x16a16
pushq $0x3d
popq %r8
xorl %edi, %edi
xorl %eax, %eax
callq 0x7de8
callq 0x1050
nop
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/debug.c
// Function: ir_debug_fmt
void ir_debug_fmt(const char *fmt, struct ir_stmt *stmt)
{
	struct ir_operand *cop[3] =
	    { stmt->result, stmt->arg1, stmt->arg2 };
	int len = strlen(fmt);
	if (stmt->type != stmt_label) printf("\t");
	for (int i = 0; i < len; i++) {
		if (fmt[i] == '$' && (i + 1) < len) {
			char c = fmt[i + 1];
			if (c >= '0' && c < '3')
				ir_operand_debug(cop[fmt[i + 1] - '0']);
			else if (c == 'l') printf("%d", stmt->label);
			i++;
		} else if (fmt[i] == '@' && (i + 1) < len) {
			char c = fmt[i + 1];
			if (c >= '0' && c < '3')
				ir_operand_size_debug(cop[fmt[i + 1] - '0']);
			i++;
		} else {
			printf("%c", fmt[i]);
		}
 	}
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movups 0x8(%rsi), %xmm0
movaps %xmm0, (%rsp)
movq 0x18(%rsi), %rax
movq %rax, 0x10(%rsp)
callq 0x2070
movq %rax, %r15
cmpl $0x1, (%rbx)
je 0x2454
pushq $0x9
popq %rdi
callq 0x2040
leaq 0x5d17(%rip), %r12      # 0x8172
xorl %ebp, %ebp
cmpl %r15d, %ebp
jge 0x24dd
movslq %ebp, %r13
movzbl (%r14,%r13), %eax
cmpl $0x40, %eax
je 0x2497
cmpl $0x24, %eax
jne 0x24ba
incq %r13
cmpl %r15d, %r13d
jge 0x24ba
movzbl (%r14,%r13), %eax
leal -0x30(%rax), %ecx
cmpb $0x2, %cl
ja 0x24c4
andl $0x3, %eax
movq (%rsp,%rax,8), %rdi
callq 0x24ec
jmp 0x24d6
incq %r13
cmpl %r15d, %r13d
jge 0x24ba
movzbl (%r14,%r13), %eax
leal -0x30(%rax), %ecx
cmpb $0x2, %cl
ja 0x24d6
andl $0x3, %eax
movq (%rsp,%rax,8), %rdi
callq 0x254c
jmp 0x24d6
movsbl %al, %edi
callq 0x2040
jmp 0x24d9
cmpl $0x6c, %eax
jne 0x24d6
movl 0x30(%rbx), %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x2080
movl %r13d, %ebp
incl %ebp
jmp 0x245d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/debug.c
// Function: ir_operand_debug
void ir_operand_debug(struct ir_operand *oper)
{
	if (!oper) return;
	switch (oper->type) {
		case oper_reg: printf("R%d", oper->val.virt_reg); 	break;
		case oper_sym:
			if (!oper->val.sym) break;
			if (oper->val.sym->offset)
				printf("fp-%ld", oper->val.sym->offset);
			else printf("_%s", oper->val.sym->identifier);
			break;
		case oper_cnum: printf("#%ld", oper->val.constant); 	break;
		default: break;
	}
}

// Assembly:
testq %rdi, %rdi
je 0x252c
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x252d
cmpl $0x1, %eax
je 0x2512
testl %eax, %eax
jne 0x252c
movl 0x8(%rdi), %esi
leaq 0x5c66(%rip), %rdi      # 0x8171
xorl %eax, %eax
jmp 0x2080
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x252c
movq (%rax), %rsi
testq %rsi, %rsi
je 0x253f
leaq 0x5c4b(%rip), %rdi      # 0x8175
jmp 0x2538
retq
movq 0x8(%rdi), %rsi
leaq 0x5c48(%rip), %rdi      # 0x8180
xorl %eax, %eax
jmp 0x2080
movq 0x10(%rax), %rsi
leaq 0x5c32(%rip), %rdi      # 0x817c
jmp 0x2538
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/debug.c
// Function: ir_operand_size_debug
void ir_operand_size_debug(struct ir_operand *oper)
{
	if (!oper) return;
	/*print size*/
	if (oper->size==0)
		printf("n");
	else if (oper->size==1)
		printf("b");
	else if (oper->size==2)
		printf("w");
	else if (oper->size==4)
		printf("dw");
	else if (oper->size==8)
		printf("qw");
}

// Assembly:
testq %rdi, %rdi
je 0x256e
movl 0x4(%rdi), %eax
cmpq $0x8, %rax
ja 0x256e
leaq 0x5aa3(%rip), %rcx      # 0x8004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x6e
jmp 0x2575
retq
pushq $0x77
jmp 0x2575
pushq $0x62
popq %rdi
jmp 0x2040
leaq 0x5c03(%rip), %rdi      # 0x8185
jmp 0x258b
leaq 0x5bfd(%rip), %rdi      # 0x8188
xorl %eax, %eax
jmp 0x2080
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/debug.c
// Function: ir_debug
void ir_debug(struct ir_stmt *head)
{
	struct ir_stmt *stmt = head;
	int ln = 0;
	while (stmt) {
		printf("%2d: ", ++ln);
		ir_stmt_debug(stmt);
		printf("\n");
		stmt = stmt->next;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rbp
leaq 0x5baa(%rip), %r14      # 0x8150
pushq $0xa
popq %r15
testq %rbx, %rbx
je 0x25d3
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2080
movq %rbx, %rdi
callq 0x2405
movl %r15d, %edi
callq 0x2040
movq 0x28(%rbx), %rbx
incl %ebp
jmp 0x25aa
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/debug.c
// Function: symbol_table_debug
void symbol_table_debug(struct symbol_table *scope)
{
	if (!scope)
		return;
	for (int i = 0; i < scope->num_syms; i++) {
		printf("%s: ", scope->syms[i]->identifier);
		print_type(scope->syms[i]->type);
		if ((i + 1) < scope->num_syms)
			printf(", ");
		else
			printf("\n");
	}
}

// Assembly:
testq %rdi, %rdi
je 0x265c
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x5bd4(%rip), %r14      # 0x81c9
leaq 0x5b8f(%rip), %r15      # 0x818b
pushq $0xa
popq %rbp
xorl %r12d, %r12d
movslq 0x8(%rbx), %rax
cmpq %rax, %r12
jge 0x2654
movq 0x10(%rbx), %rax
movq (%rax,%r12,8), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2080
movq 0x10(%rbx), %rax
movq (%rax,%r12,8), %rax
movq 0x18(%rax), %rdi
callq 0x75e7
leal 0x1(%r12), %eax
cmpl %eax, 0x8(%rbx)
jle 0x2648
movq %r15, %rdi
xorl %eax, %eax
callq 0x2080
jmp 0x264f
movl %ebp, %edi
callq 0x2040
incq %r12
jmp 0x2602
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/live.c
// Function: bb_init
struct bb *bb_init(struct ir_stmt *s, struct ir_stmt **next)
{
	struct bb *blk = malloc(sizeof(struct bb));

	blk->succ = NULL, blk->pred = NULL;
	blk->nsucc = 0, blk->npred = 0;

	blk->use = NULL, blk->def = NULL;
	blk->nuse = 0, blk->ndef = 0;

	blk->graph = NULL;
	blk->nvert = 0;

	blk->in = NULL, blk->out = NULL;
	blk->nin = 0, blk->nout = 0;
	blk->visited = 0;

	blk->blk = s;
	int len = 1;
	/*Basic blocks can start at labels but must end at a jump or any label not at the start*/
	while (s) {
		if (s->type == stmt_cgoto || s->type == stmt_ugoto) {
			break;
		}
		if (s->type == stmt_label && len != 1) {
			/*Do not include this*/
			s = s->prev;
			len--;
			break;
		}
		len++;
		s = s->next;
	}
	*next = s ? s->next : NULL;
	blk->lst = s;
	blk->len = len;

	bb_set(blk);

	return blk;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0xa0, %edi
callq 0x20f0
movq %rax, %rbx
andq $0x0, 0x50(%rax)
andq $0x0, 0x60(%rax)
andl $0x0, 0x58(%rax)
andl $0x0, 0x68(%rax)
andq $0x0, 0x70(%rax)
andl $0x0, 0x78(%rax)
andq $0x0, 0x80(%rax)
andl $0x0, 0x88(%rax)
xorps %xmm0, %xmm0
andq $0x0, 0x38(%rax)
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x90(%rax)
movq %r15, (%rax)
xorl %eax, %eax
testq %r15, %r15
je 0x2b95
movl (%r15), %ecx
leal -0x3(%rcx), %edx
cmpl $0x2, %edx
jb 0x2b99
cmpl $0x1, %ecx
sete %cl
testl %eax, %eax
setne %dl
testb %dl, %cl
jne 0x2b9d
movq 0x28(%r15), %r15
incl %eax
jmp 0x2b6e
incl %eax
jmp 0x2bac
incl %eax
jmp 0x2ba6
movq 0x20(%r15), %r15
testq %r15, %r15
je 0x2bac
movq 0x28(%r15), %rcx
jmp 0x2bb1
xorl %r15d, %r15d
xorl %ecx, %ecx
movq %rcx, (%r14)
movq %r15, 0x8(%rbx)
movl %eax, 0x10(%rbx)
movq %rbx, %rdi
callq 0x2bcc
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/live.c
// Function: bb_free
void bb_free(struct bb *blk)
{
	if (!blk) return;
	for (int i = 0; i < blk->nvert; i++)
		vertex_free(blk->graph[i]);
	free(blk->graph);
	free(blk->succ);
	free(blk->pred);
	free(blk->use);
	free(blk->def);
	free(blk);
}

// Assembly:
testq %rdi, %rdi
je 0x2ea8
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movslq 0x78(%rbx), %rax
movq 0x70(%rbx), %rdi
cmpq %rax, %r14
jge 0x2e70
movq (%rdi,%r14,8), %rdi
callq 0x3ceb
incq %r14
jmp 0x2e55
callq 0x2030
movq 0x28(%rbx), %rdi
callq 0x2030
movq 0x30(%rbx), %rdi
callq 0x2030
movq 0x50(%rbx), %rdi
callq 0x2030
movq 0x60(%rbx), %rdi
callq 0x2030
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2030
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/live.c
// Function: bb_get_treg
int bb_get_treg(struct bb *blk, int reg)
{
	for (int i = 0; i < blk->nvert; i++) {
		if (blk->graph[i]->ocolor == reg) return i;
	}
	blk->nvert++;
	if (!blk->graph) blk->graph = malloc(sizeof(struct vertex*));
	else blk->graph = realloc(blk->graph, sizeof(struct vertex*)*blk->nvert);
	struct vertex *v = vertex_init();
	v->ocolor = reg;
	blk->graph[blk->nvert-1] = v;
	return blk->nvert-1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movslq 0x78(%rdi), %rsi
xorl %eax, %eax
testl %esi, %esi
movl $0x0, %ecx
cmovgl %esi, %ecx
cmpq %rax, %rcx
je 0x2ed7
movq 0x70(%rbx), %rdx
movq (%rdx,%rax,8), %rdx
cmpl %ebp, (%rdx)
je 0x2f16
incq %rax
jmp 0x2ec1
incq %rsi
movl %esi, 0x78(%rbx)
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x2ef1
shlq $0x3, %rsi
callq 0x2100
jmp 0x2ef9
pushq $0x8
popq %rdi
callq 0x20f0
movq %rax, 0x70(%rbx)
xorl %eax, %eax
callq 0x3c64
movl %ebp, (%rax)
movq 0x70(%rbx), %rcx
movslq 0x78(%rbx), %rdx
movq %rax, -0x8(%rcx,%rdx,8)
leal -0x1(%rdx), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/live.c
// Function: bb_addpred
void bb_addpred(struct bb *blk, struct bb *pred)
{
	blk->npred++;
	if (!blk->pred) blk->pred = malloc(sizeof(struct bb*));
	else blk->pred = realloc(blk->pred, blk->npred * sizeof(struct bb*));
	blk->pred[blk->npred-1] = pred;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x3c(%rdi), %r15
leaq 0x1(%r15), %rsi
movl %esi, 0x3c(%rdi)
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x2f4e
shlq $0x3, %rsi
callq 0x2100
movl 0x3c(%r14), %r15d
decl %r15d
jmp 0x2f56
pushq $0x8
popq %rdi
callq 0x20f0
movq %rax, 0x30(%r14)
movslq %r15d, %rcx
movq %rbx, (%rax,%rcx,8)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/live.c
// Function: bb_addsucc
void bb_addsucc(struct bb *blk, struct bb *succ)
{
	blk->nsucc++;
	if (!blk->succ) blk->succ = malloc(sizeof(struct bb*));
	else blk->succ = realloc(blk->succ, blk->nsucc * sizeof(struct bb*));
	blk->succ[blk->nsucc-1] = succ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x38(%rdi), %r15
leaq 0x1(%r15), %rsi
movl %esi, 0x38(%rdi)
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0x2f98
shlq $0x3, %rsi
callq 0x2100
movl 0x38(%r14), %r15d
decl %r15d
jmp 0x2fa0
pushq $0x8
popq %rdi
callq 0x20f0
movq %rax, 0x28(%r14)
movslq %r15d, %rcx
movq %rbx, (%rax,%rcx,8)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/live.c
// Function: intarr_add
void intarr_add(int **arr, int *num, int val)
{
	int n = *num, *array = *arr;
	n++;
	if (n == 1) {
		array = malloc(sizeof(int));
	} else {
		array = realloc(array, sizeof(int) * n);
	}

	array[n - 1] = val;

	*num = n;
	*arr = array;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movslq (%rsi), %r15
leaq 0x1(%r15), %r12
testq %r15, %r15
je 0x3003
movq (%rbx), %rdi
movq %r12, %rsi
shlq $0x2, %rsi
callq 0x2100
jmp 0x300b
pushq $0x4
popq %rdi
callq 0x20f0
movl %ebp, (%rax,%r15,4)
movl %r12d, (%r14)
movq %rax, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/live.c
// Function: use
void use(struct bb *blk, struct ir_stmt *s)
{
	if (s->arg1 && s->arg1->type == oper_reg)
		intarr_add(&blk->use, &blk->nuse, s->arg1->val.virt_reg);
	if (s->arg2 && s->arg2->type == oper_reg)
		intarr_add(&blk->use, &blk->nuse, s->arg2->val.virt_reg);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %rax
testq %rax, %rax
je 0x3046
cmpl $0x0, (%rax)
jne 0x3046
leaq 0x50(%rbx), %rdi
leaq 0x58(%rbx), %rsi
movl 0x8(%rax), %edx
callq 0x2fd6
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x3054
cmpl $0x0, (%rax)
je 0x305c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x50(%rbx), %rdi
addq $0x58, %rbx
movl 0x8(%rax), %edx
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2fd6
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/live.c
// Function: bb_creg
void bb_creg(struct bb *bb)
{
	if (!bb) return;
	if (bb->visited) return;
	bb->visited = 1;
	color_graph(bb->graph, bb->nvert, 4);
	struct ir_stmt *stmt = bb->blk;
	int ln = 0;
	while (stmt && ln < bb->len) {
		struct ir_operand *op[3] = { stmt->result, stmt->arg1, stmt->arg2 };
		for (int i = 0; i < 3; i++) {
			if (op[i] && op[i]->type == oper_reg) {
				/*Find it in the graph*/
				int idx = bb_get_treg(bb, op[i]->val.virt_reg);
				op[i]->val.virt_reg = bb->graph[idx]->color;
			}
		}
		/*Remove useless move statements*/
		if (stmt->type == stmt_move && stmt->result && stmt->arg1) {
			int v1 = stmt->result->val.virt_reg;
			int v2 = stmt->arg1->val.virt_reg;
			if (v1 == v2) {
				stmt->prev->next = stmt->next;
				stmt->next->prev = stmt->prev;
				struct ir_stmt *sv = stmt->prev;
				ir_stmt_free(stmt);
				stmt = sv;
			}
		}
		stmt = stmt->next;
		ln++;
	}
	for (int i = 0; i < bb->nsucc; i++) {
		bb_creg(bb->succ[i]);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x30a1
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x9c(%rdi)
je 0x30a2
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x1, 0x9c(%rbx)
movq 0x70(%rbx), %rdi
movl 0x78(%rbx), %esi
pushq $0x4
popq %rdx
callq 0x3e25
movq (%rbx), %r14
xorl %r15d, %r15d
testq %r14, %r14
je 0x3169
cmpl 0x10(%rbx), %r15d
jge 0x3169
movups 0x8(%r14), %xmm0
movaps %xmm0, (%rsp)
movq 0x18(%r14), %rax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
cmpq $0x3, %r12
je 0x3121
movq (%rsp,%r12,8), %r13
testq %r13, %r13
je 0x311c
cmpl $0x0, (%r13)
jne 0x311c
movl 0x8(%r13), %esi
movq %rbx, %rdi
callq 0x2ea9
movq 0x70(%rbx), %rcx
cltq
movq (%rcx,%rax,8), %rax
movl 0x4(%rax), %eax
movl %eax, 0x8(%r13)
incq %r12
jmp 0x30e9
cmpl $0x6, (%r14)
jne 0x315d
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x315d
movq 0x10(%r14), %rcx
testq %rcx, %rcx
je 0x315d
movl 0x8(%rax), %eax
cmpl 0x8(%rcx), %eax
jne 0x315d
movq 0x20(%r14), %r12
movq 0x28(%r14), %rax
movq %rax, 0x28(%r12)
movq %r12, 0x20(%rax)
movq %r14, %rdi
callq 0x4daf
movq %r12, %r14
movq 0x28(%r14), %r14
incl %r15d
jmp 0x30c1
xorl %r14d, %r14d
movslq 0x38(%rbx), %rax
cmpq %rax, %r14
jge 0x3094
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3076
incq %r14
jmp 0x316c
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/main.c
// Function: test_graph
void test_graph()
{
	int num = 10;
	/*Set up basic graph to color*/
	struct vertex **graph = calloc(num, sizeof(struct vertex*));
	for (int i = 0; i < num; i++) {
		graph[i] = vertex_init();
		graph[i]->ocolor = i;
	}
	/*b c d e f g h j k m*/
	/*0 1 2 3 4 5 6 7 8 9*/
	/*m f e j b k g h d c*/
	/*
Vertex b: color 1: good
Vertex c: color 2: good
Vertex d: color 1: good
Vertex e: color 2: good
Vertex f: color 1: good
Vertex g: color 1: good
Vertex h: color 2: good
Vertex j: color 0: good
Vertex k: color 2: good
Vertex m: color 0: good

	 *
	 * */

	add_edge(graph[0], graph[1]);
	add_edge(graph[0], graph[3]);
	add_edge(graph[0], graph[8]);
	add_edge(graph[0], graph[9]);

	add_edge(graph[1], graph[9]);

	add_edge(graph[2], graph[8]);
	add_edge(graph[2], graph[9]);

	add_edge(graph[3], graph[9]);
	add_edge(graph[3], graph[4]);
	add_edge(graph[3], graph[7]);

	add_edge(graph[4], graph[7]);
	add_edge(graph[4], graph[9]);

	add_edge(graph[5], graph[8]);
	add_edge(graph[5], graph[6]);
	add_edge(graph[5], graph[7]);

	add_edge(graph[6], graph[7]);

	add_edge(graph[7], graph[8]);

	color_graph(graph, num, 3);

	for (int i = 0; i < num; i++)
		printf("Node %d: color %d\n", i, graph[i]->color);

	for (int i = 0; i < num; i++) vertex_free(graph[i]);
	free(graph);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $0xa
popq %rdi
pushq $0x8
popq %rsi
callq 0x20a0
movq %rax, %rbx
xorl %r14d, %r14d
cmpq $0xa, %r14
je 0x33bd
xorl %eax, %eax
callq 0x3c64
movq %rax, (%rbx,%r14,8)
movl %r14d, (%rax)
incq %r14
jmp 0x33a4
movq (%rbx), %r13
movq 0x8(%rbx), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3c80
movq 0x18(%rbx), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x3c80
movq 0x40(%rbx), %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x3c80
movq 0x48(%rbx), %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x3c80
movq %rbp, %rdi
movq %r12, %rsi
callq 0x3c80
movq 0x10(%rbx), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x3c80
movq %r13, %rdi
movq %r12, %rsi
callq 0x3c80
movq %r15, %rdi
movq %r12, %rsi
callq 0x3c80
movq 0x20(%rbx), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3c80
movq 0x38(%rbx), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x3c80
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3c80
movq %rbp, %rdi
movq %r12, %rsi
callq 0x3c80
movq 0x28(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3c80
movq 0x30(%rbx), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3c80
movq %r15, %rdi
movq %r13, %rsi
callq 0x3c80
movq %r12, %rdi
movq %r13, %rsi
callq 0x3c80
movq %r13, %rdi
movq %r14, %rsi
callq 0x3c80
pushq $0xa
popq %rsi
pushq $0x3
popq %rdx
movq %rbx, %rdi
callq 0x3e25
leaq 0x4dd4(%rip), %r14      # 0x8288
xorl %r15d, %r15d
cmpq $0xa, %r15
je 0x34d6
movq (%rbx,%r15,8), %rax
movl 0x4(%rax), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2080
incq %r15
jmp 0x34b7
xorl %r14d, %r14d
cmpq $0xa, %r14
je 0x34ed
movq (%rbx,%r14,8), %rdi
callq 0x3ceb
incq %r14
jmp 0x34d9
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/match.c
// Function: find_stmt_match
struct ir_stmt *find_stmt_match(struct pattern_state *state)
{
	if (!state->entry) return NULL;
	int offset = 0, ns = 0;
	struct ir_stmt *iter=NULL, *a=state->entry;

	for (int i = 0; i < state->num_patts; i++) {
		ns = state->plist[i].num_stmt;
		iter = a;
		if (offset + ns > state->num_spatts) {
			break;
		}
		int nm;
		/*first check if the statement types are right*/
		for (nm = 0; nm < ns && iter; nm++, iter=iter->next) {
			if (!match_pattern(state->splist+nm+offset, ns-nm, iter)) {
				break;
			}
		}
		if (nm == ns) {
			a = state->callback(a, state->plist[i].value);
		}

		offset += ns;
	}
	return a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq (%rdi), %r12
xorl %edx, %edx
testq %r12, %r12
je 0x37cf
movq %rdi, %r14
xorl %esi, %esi
movslq 0x20(%r14), %rcx
cmpq %rcx, %rsi
jge 0x37d2
movq 0x10(%r14), %rdi
movq %rsi, %r8
shlq $0x4, %r8
movl (%rdi,%r8), %r15d
leal (%r15,%rdx), %ecx
cmpl 0x24(%r14), %ecx
jg 0x37d2
movq %r8, 0x18(%rsp)
movq %rdi, 0x20(%rsp)
movl %ecx, 0x4(%rsp)
movq %rsi, 0x8(%rsp)
movslq %r15d, %rbx
movslq %edx, %rcx
imulq $0x14, %rcx, %rbp
xorl %r13d, %r13d
movq %r12, 0x10(%rsp)
cmpq %rbx, %r13
jge 0x3795
testq %r12, %r12
je 0x3795
movq 0x18(%r14), %rdi
addq %rbp, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x37e4
testl %eax, %eax
je 0x3795
incq %r13
movq 0x28(%r12), %r12
decl %r15d
addq $0x14, %rbp
jmp 0x3764
testl %r15d, %r15d
je 0x37a1
movq 0x10(%rsp), %r12
jmp 0x37bc
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x8(%rax,%rcx), %rsi
movq 0x10(%rsp), %rdi
callq *0x8(%r14)
movq %rax, %r12
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %ecx
incq %rsi
movl %ecx, %edx
jmp 0x3715
xorl %r12d, %r12d
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/match.c
// Function: match_pattern
int match_pattern(struct stmt_pattern *spat, int max, struct ir_stmt *st)
{
	if (st->type != (*spat).st_type) return 0;

	struct ir_stmt *src = NULL, *dst = NULL;
	struct ir_stmt *cur = st;
	int it = 0;
	while (cur && it < max) {
		if (it > 1 && !src) break;
		if ((spat[it].flags&SRC)) src = cur;
		if ((spat[it].flags&DST)) dst = cur;
		it++;
		cur = cur->next;
	}
	if (!src || !dst) src=st, dst=st;
	struct stmt_pattern pat = *spat;

	if ((pat.flags&LBL)) return dst->label == src->label;

	if (!match_operand(dst, src->result, 	pat.result)) return 0;
	if (!match_operand(dst, src->arg1, 	pat.arg1)) return 0;
	if (!match_operand(dst, src->arg2, 	pat.arg2)) return 0;

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl (%rdx), %eax
xorl %ebp, %ebp
cmpl 0x4(%rdi), %eax
jne 0x38b2
movq %rdx, %rbx
movslq %esi, %rcx
movq %rdi, %rdx
xorl %esi, %esi
movq %rbx, %r8
xorl %r14d, %r14d
xorl %eax, %eax
testq %r8, %r8
je 0x3843
cmpq %rcx, %rsi
jge 0x3843
cmpq $0x2, %rsi
jb 0x3821
testq %rax, %rax
je 0x3841
movl (%rdx), %r9d
testb $0x1, %r9b
cmovneq %r8, %rax
testb $0x2, %r9b
cmovneq %r8, %r14
incq %rsi
movq 0x28(%r8), %r8
addq $0x14, %rdx
jmp 0x380c
xorl %eax, %eax
testq %rax, %rax
setne %cl
testq %r14, %r14
setne %dl
testb %dl, %cl
cmoveq %rbx, %r14
cmovneq %rax, %rbx
testb $0x4, (%rdi)
jne 0x38a5
movl 0xc(%rdi), %r12d
movl 0x10(%rdi), %r15d
movl 0x8(%rdi), %edx
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x38bd
xorl %ebp, %ebp
testl %eax, %eax
je 0x38b2
movq 0x10(%rbx), %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0x38bd
testl %eax, %eax
je 0x38b2
movq 0x18(%rbx), %rsi
movq %r14, %rdi
movl %r15d, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x38bd
movl 0x30(%r14), %eax
xorl %ebp, %ebp
cmpl 0x30(%rbx), %eax
sete %bpl
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/match.c
// Function: match_operand
int match_operand(struct ir_stmt *st, struct ir_operand *a, enum oper_pattern pat)
{
	if (!a) return 1;
	if (pat == opat_ignore) return 1;
	if (pat == opat_imm && a->type == oper_cnum) return 1;
	if (pat == opat_reg && a->type == oper_reg) return 1;
	if (pat == opat_mem && a->type == oper_sym) return 1;

	if (pat == opat_result) return compare_operands(a, st->result);
	if (pat == opat_arg1) return compare_operands(a, st->arg1);
	if (pat == opat_arg2) return compare_operands(a, st->arg2);

	return 0;
}

// Assembly:
pushq $0x1
popq %rax
testq %rsi, %rsi
je 0x38f0
cmpl $0x6, %edx
ja 0x38ee
movl %edx, %ecx
leaq 0x4a25(%rip), %rdx      # 0x82f8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpl $0x2, (%rsi)
jne 0x38ee
jmp 0x38f0
movq 0x8(%rdi), %rax
jmp 0x3902
cmpl $0x0, (%rsi)
je 0x38f0
xorl %eax, %eax
retq
cmpl $0x1, (%rsi)
jne 0x38ee
jmp 0x38f0
movq 0x10(%rdi), %rax
jmp 0x3902
movq 0x18(%rdi), %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x390d
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/match.c
// Function: compare_operands
int compare_operands(struct ir_operand *a, struct ir_operand *b)
{
	if (!b || !a) return 0;
	if (a->type != b->type) return 0;
	enum oper_type t = a->type;
	if (t==oper_reg&&a->val.virt_reg==b->val.virt_reg) return 1;
	if (t==oper_cnum&&a->val.constant==b->val.constant) return 1;
	if (t==oper_sym&&a->val.sym&&b->val.sym&&!strcmp(a->val.sym->identifier,b->val.sym->identifier)) return 1;
	return 0;
}

// Assembly:
pushq %rbx
testq %rsi, %rsi
sete %al
testq %rdi, %rdi
sete %cl
xorl %ebx, %ebx
orb %al, %cl
jne 0x3970
movl (%rdi), %eax
cmpl (%rsi), %eax
jne 0x3970
cmpl $0x2, %eax
je 0x3963
cmpl $0x1, %eax
je 0x393e
testl %eax, %eax
jne 0x3970
movl 0x8(%rdi), %eax
cmpl 0x8(%rsi), %eax
je 0x396d
jmp 0x3970
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x3970
movq 0x8(%rsi), %rcx
testq %rcx, %rcx
je 0x3970
movq 0x10(%rax), %rdi
movq 0x10(%rcx), %rsi
callq 0x20b0
testl %eax, %eax
jne 0x3970
jmp 0x396d
movq 0x8(%rdi), %rax
cmpq 0x8(%rsi), %rax
jne 0x3970
pushq $0x1
popq %rbx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/peep.c
// Function: reduce_store_load
struct ir_stmt * reduce_store_load(struct ir_stmt *a)
{
	/*Use the value of the previous store instead of load again*/
	struct ir_stmt *ld = a->next;
	if (!ld) return a;
	/*Change the load to a move, with the previous stores operand as the value*/
	ld->type = stmt_move;
	ir_operand_free(ld->arg1);
	ld->arg1 = copy(a->arg2);
	/*Now all occurances of ld->result can be replaced with ld->arg1 */
	struct ir_stmt *cur = ld->next;
	while (cur) {
		if (compare_operands(ld->result, cur->result)) {
			ir_operand_free(cur->result);
			cur->result = copy(ld->arg1);
		}
		if (compare_operands(ld->result, cur->arg1)) {
			ir_operand_free(cur->arg1);
			cur->arg1 = copy(ld->arg1);
		}
		if (compare_operands(ld->result, cur->arg2)) {
			ir_operand_free(cur->arg2);
			cur->arg2 = copy(ld->arg1);
		}

		cur = cur->next;
	}
	unlink(ld);
	struct ir_stmt *n = ld->next;
	ir_stmt_free(ld);
	return n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x28(%rdi), %rbx
testq %rbx, %rbx
je 0x3b7c
movl $0x6, (%rbx)
movq 0x10(%rbx), %rdi
callq 0x4daa
movq 0x18(%r14), %rdi
callq 0x4ce1
movq %rax, 0x10(%rbx)
leaq 0x28(%rbx), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x3b5a
movq 0x8(%rbx), %rdi
movq 0x8(%r14), %rsi
callq 0x390d
testl %eax, %eax
je 0x3b03
movq 0x8(%r14), %rdi
callq 0x4daa
movq 0x10(%rbx), %rdi
callq 0x4ce1
movq %rax, 0x8(%r14)
movq 0x8(%rbx), %rdi
movq 0x10(%r14), %rsi
callq 0x390d
testl %eax, %eax
je 0x3b2a
movq 0x10(%r14), %rdi
callq 0x4daa
movq 0x10(%rbx), %rdi
callq 0x4ce1
movq %rax, 0x10(%r14)
movq 0x8(%rbx), %rdi
movq 0x18(%r14), %rsi
callq 0x390d
testl %eax, %eax
je 0x3b51
movq 0x18(%r14), %rdi
callq 0x4daa
movq 0x10(%rbx), %rdi
callq 0x4ce1
movq %rax, 0x18(%r14)
addq $0x28, %r14
jmp 0x3ad4
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %r14
testq %rax, %rax
je 0x3b6b
movq %r14, 0x28(%rax)
testq %r14, %r14
je 0x3b74
movq %rax, 0x20(%r14)
movq %rbx, %rdi
callq 0x4daf
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Mithreindeir[P]ewcc/src/peep.c
// Function: reduce_label
struct ir_stmt *reduce_label(struct ir_stmt *a)
{
	/*If there is 2 labels, remove the 2nd and replace all occurances with the first*/
	struct ir_stmt *l2 = a->next;
	if (!l2) return a;
	int sl = l2->label;
	unlink(l2);

	ir_stmt_free(l2);
	struct ir_stmt *cur = a;
	/*loop forward and replace*/
	while (cur) {
		if (cur->label == sl) cur->label = a->label;
		cur = cur->next;
	}
	/*loop backwards and replace*/
	cur = a;
	while (cur) {
		if (cur->label == sl) cur->label = a->label;
		cur = cur->prev;
	}
	return a->prev;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0x3bee
movl 0x30(%rdi), %ebp
movq 0x20(%rdi), %rax
movq 0x28(%rdi), %rcx
testq %rax, %rax
je 0x3baa
movq %rcx, 0x28(%rax)
testq %rcx, %rcx
je 0x3bb3
movq %rax, 0x20(%rcx)
callq 0x4daf
movq %rbx, %rax
testq %rax, %rax
je 0x3bd1
cmpl %ebp, 0x30(%rax)
jne 0x3bcb
movl 0x30(%rbx), %ecx
movl %ecx, 0x30(%rax)
movq 0x28(%rax), %rax
jmp 0x3bbb
movq %rbx, %rax
testq %rax, %rax
je 0x3bea
cmpl %ebp, 0x30(%rax)
jne 0x3be4
movl 0x30(%rbx), %ecx
movl %ecx, 0x30(%rax)
movq 0x20(%rax), %rax
jmp 0x3bd4
movq 0x20(%rbx), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq