LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x74f0
movq %rbx, %rdi
callq 0x4986
testl %eax, %eax
jne 0x75cb
movslq 0x8(%r15), %rdx
testq %rdx, %rdx
jle 0x7537
movq 0x10(%r14), %rax
movq 0x10(%r15), %rsi
movq 0x10(%rbx), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
addq (%rax,%r8,8), %r9
movq %r9, %rcx
subq (%rsi,%r8,8), %rcx
movq %rcx, %r9
sarq $0x3f, %r9
movq %rcx, %r10
btrq $0x3f, %r10
movq %r10, (%rdi,%r8,8)
incq %r8
cmpq %r8, %rdx
jne 0x750b
shrq $0x3f, %rcx
jmp 0x753b
xorl %ecx, %ecx
xorl %edx, %edx
movl 0x8(%r14), %eax
cmpl %eax, %edx
jge 0x75a4
movl %edx, %esi
leal (,%rax,8), %r8d
shll $0x3, %edx
subl %edx, %r8d
testl %ecx, %ecx
je 0x7582
movq 0x10(%r14), %rdx
movq (%rdx,%rsi,8), %rcx
decq %rcx
movq 0x10(%rbx), %rdi
movq %rcx, (%rdi,%rsi,8)
xorl %ecx, %ecx
cmpq $0x0, (%rdx,%rsi,8)
sete %cl
incq %rsi
addl $-0x8, %r8d
cmpq %rsi, %rax
jne 0x7553
jmp 0x75a4
cmpq %r14, %rbx
je 0x75a4
movl %esi, %esi
shlq $0x3, %rsi
movq 0x10(%rbx), %rdi
addq %rsi, %rdi
addq 0x10(%r14), %rsi
movslq %r8d, %rdx
callq 0x1120
movl 0x8(%r14), %eax
cmpl $0x2, %eax
jl 0x75c6
movq 0x10(%rbx), %rcx
movl %eax, %edx
cmpq $0x0, -0x8(%rcx,%rdx,8)
jne 0x75c6
leal -0x1(%rax), %edx
cmpl $0x2, %eax
movl %edx, %eax
jg 0x75ad
movl $0x1, %eax
movl %eax, 0x8(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x0, (%rdx)
movq (%rdi), %rdi
testq %rdi, %rdi
jne 0x80f8
decl (%r15)
addl $0x3f, (%rbx)
movq 0x8(%r14), %rdi
addq $0x8, %r14
jmp 0x80e3
callq 0x4aae
testl %eax, %eax
je 0x8117
movl %eax, %ebp
movl (%r15), %esi
movl %eax, %edx
negl %edx
movq %r14, %rdi
callq 0x4b7f
movl %eax, (%r15)
addl %ebp, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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 0x4910
movq %rax, %r12
xorl %edi, %edi
movq %r15, %rsi
movq %rax, %rdx
movq %r14, %rcx
movq %rbx, %r8
callq 0x7aad
movl %eax, %ebx
movq %r12, %rdi
callq 0x4970
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x82cf
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 0x59c2
cmpl %ebx, %eax
jle 0x81f7
movq %r12, %rdi
movl %ebx, %esi
callq 0x59a5
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 0x59c2
movq %r15, %rdi
movl %eax, %esi
movq 0x10(%rsp), %rdx
movl %ebp, %ecx
callq 0x5888
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)
movl $0x1, %esi
subl %ebx, %ebp
jle 0x8285
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
movq %r14, %rdi
movq %r13, %rdx
movl %ebx, %ecx
callq 0x5974
movl (%r12), %esi
testl %eax, %eax
js 0x82ad
movq %r14, %rdi
movq %r13, %rdx
movl %ebx, %ecx
callq 0x58f2
movl %eax, %esi
movl %eax, (%r12)
movq %r14, %rdi
movq %r13, %rdx
movl %ebx, %ecx
callq 0x5974
testl %eax, %eax
jns 0x82d4
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1970
callq 0x1948
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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 0x2497
movl $0x9, %edi
callq 0x2040
testl %r15d, %r15d
jle 0x2527
leaq 0x6ccb(%rip), %r12      # 0x9172
xorl %ebp, %ebp
movslq %ebp, %r13
movzbl (%r14,%r13), %eax
cmpl $0x40, %eax
je 0x24de
cmpl $0x24, %eax
jne 0x2501
incq %r13
cmpl %r15d, %r13d
jge 0x2501
movzbl (%r14,%r13), %eax
leal -0x30(%rax), %ecx
cmpb $0x2, %cl
ja 0x250b
andl $0x3, %eax
movq (%rsp,%rax,8), %rdi
callq 0x2536
jmp 0x251d
incq %r13
cmpl %r15d, %r13d
jge 0x2501
movzbl (%r14,%r13), %eax
leal -0x30(%rax), %ecx
cmpb $0x2, %cl
ja 0x251d
andl $0x3, %eax
movq (%rsp,%rax,8), %rdi
callq 0x2596
jmp 0x251d
movsbl %al, %edi
callq 0x2040
jmp 0x2520
cmpl $0x6c, %eax
jne 0x251d
movl 0x30(%rbx), %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x2080
movl %r13d, %ebp
incl %ebp
cmpl %r15d, %ebp
jl 0x24a9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2576
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x2577
cmpl $0x1, %eax
je 0x255c
testl %eax, %eax
jne 0x2576
movl 0x8(%rdi), %esi
leaq 0x6c1c(%rip), %rdi      # 0x9171
xorl %eax, %eax
jmp 0x2080
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x2576
movq (%rax), %rsi
testq %rsi, %rsi
je 0x2589
leaq 0x6c01(%rip), %rdi      # 0x9175
jmp 0x2582
retq
movq 0x8(%rdi), %rsi
leaq 0x6bfe(%rip), %rdi      # 0x9180
xorl %eax, %eax
jmp 0x2080
movq 0x10(%rax), %rsi
leaq 0x6be8(%rip), %rdi      # 0x917c
jmp 0x2582
// File: /workspace/github_c_makefile_star2_O3/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 0x25be
movl 0x4(%rdi), %eax
cmpq $0x8, %rax
ja 0x25be
leaq 0x6a59(%rip), %rcx      # 0x9004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x6e, %edi
jmp 0x2040
retq
movl $0x77, %edi
jmp 0x2040
movl $0x62, %edi
jmp 0x2040
leaq 0x6bab(%rip), %rdi      # 0x9185
jmp 0x25e3
leaq 0x6ba5(%rip), %rdi      # 0x9188
xorl %eax, %eax
jmp 0x2080
// File: /workspace/github_c_makefile_star2_O3/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:
testq %rdi, %rdi
je 0x2645
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %ebp
leaq 0x6b4b(%rip), %r14      # 0x9150
leaq 0xbaa4(%rip), %r15      # 0xe0b0
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2080
movl (%rbx), %eax
movq (%r15,%rax,8), %rdi
movq %rbx, %rsi
callq 0x245b
movl $0xa, %edi
callq 0x2040
movq 0x28(%rbx), %rbx
incl %ebp
testq %rbx, %rbx
jne 0x260c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x26ca
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x8(%rdi)
jle 0x26bf
leaq 0x6b66(%rip), %r14      # 0x91c9
leaq 0x6b21(%rip), %r15      # 0x918b
xorl %r12d, %r12d
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 0x815b
incq %r12
movslq 0x8(%rbx), %rax
cmpq %rax, %r12
jge 0x26ac
movq %r15, %rdi
xorl %eax, %eax
callq 0x2080
jmp 0x26b6
movl $0xa, %edi
callq 0x2040
movslq 0x8(%rbx), %rax
cmpq %rax, %r12
jl 0x266d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2100
movq %rax, %rbx
xorl %eax, %eax
movq %rax, 0x50(%rbx)
movq %rax, 0x60(%rbx)
movl %eax, 0x58(%rbx)
movl %eax, 0x68(%rbx)
movq %rax, 0x70(%rbx)
movl %eax, 0x78(%rbx)
movq %rax, 0x80(%rbx)
movl %eax, 0x88(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movq %rax, 0x38(%rbx)
movups %xmm0, 0x90(%rbx)
movq %r15, (%rbx)
testq %r15, %r15
je 0x2c3b
movl (%r15), %ecx
leal -0x3(%rcx), %edx
cmpl $0x2, %edx
jb 0x2c44
cmpl $0x1, %ecx
sete %cl
testl %eax, %eax
setne %dl
testb %dl, %cl
jne 0x2c48
movq 0x28(%r15), %r15
incl %eax
testq %r15, %r15
jne 0x2c12
incl %eax
jmp 0x2c5c
movl $0x1, %ecx
xorl %edx, %edx
jmp 0x2c62
incl %eax
jmp 0x2c51
movq 0x20(%r15), %r15
testq %r15, %r15
je 0x2c5c
movq 0x28(%r15), %rdx
movl %eax, %ecx
movq %r15, %rax
jmp 0x2c62
xorl %edx, %edx
movl %eax, %ecx
xorl %eax, %eax
movq %rdx, (%r14)
movq %rax, 0x8(%rbx)
movl %ecx, 0x10(%rbx)
movq %rbx, %rdi
callq 0x2c7d
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2f88
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x78(%rdi)
jle 0x2f4c
xorl %r14d, %r14d
movq 0x70(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3e51
incq %r14
movslq 0x78(%rbx), %rax
cmpq %rax, %r14
jl 0x2f33
movq 0x70(%rbx), %rdi
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_O3/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), %rcx
movq 0x70(%rdi), %rdi
testq %rcx, %rcx
jle 0x2fb7
xorl %eax, %eax
movq (%rdi,%rax,8), %rdx
cmpl %ebp, (%rdx)
je 0x2ff6
incq %rax
cmpq %rax, %rcx
jne 0x2fa0
incl %ecx
movl %ecx, 0x78(%rbx)
jmp 0x2fc1
incl %ecx
movl %ecx, 0x78(%rbx)
testq %rdi, %rdi
je 0x2fcf
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x2110
jmp 0x2fd9
movl $0x8, %edi
callq 0x2100
movq %rax, 0x70(%rbx)
xorl %eax, %eax
callq 0x3dc0
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_O3/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 0x302e
shlq $0x3, %rsi
callq 0x2110
movl 0x3c(%r14), %r15d
decl %r15d
jmp 0x3038
movl $0x8, %edi
callq 0x2100
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_O3/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 0x307a
shlq $0x3, %rsi
callq 0x2110
movl 0x38(%r14), %r15d
decl %r15d
jmp 0x3084
movl $0x8, %edi
callq 0x2100
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_O3/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 0x30e7
movq (%rbx), %rdi
movq %r12, %rsi
shlq $0x2, %rsi
callq 0x2110
jmp 0x30f1
movl $0x4, %edi
callq 0x2100
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_O3/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 0x312c
cmpl $0x0, (%rax)
jne 0x312c
leaq 0x50(%rbx), %rdi
leaq 0x58(%rbx), %rsi
movl 0x8(%rax), %edx
callq 0x30ba
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x313a
cmpl $0x0, (%rax)
je 0x3142
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 0x30ba
// File: /workspace/github_c_makefile_star2_O3/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 0x327c
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x9c(%rdi)
jne 0x326f
movl $0x1, 0x9c(%rbx)
movq 0x70(%rbx), %rdi
movl 0x78(%rbx), %esi
movl $0x4, %edx
callq 0x3fa8
movq (%rbx), %r14
testq %r14, %r14
je 0x324d
xorl %r15d, %r15d
cmpl 0x10(%rbx), %r15d
jge 0x324d
movups 0x8(%r14), %xmm0
movaps %xmm0, (%rsp)
movq 0x18(%r14), %rax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
movq (%rsp,%r12,8), %r13
testq %r13, %r13
je 0x31f8
cmpl $0x0, (%r13)
jne 0x31f8
movl 0x8(%r13), %esi
movq %rbx, %rdi
callq 0x2f89
movq 0x70(%rbx), %rcx
cltq
movq (%rcx,%rax,8), %rax
movl 0x4(%rax), %eax
movl %eax, 0x8(%r13)
incq %r12
cmpq $0x3, %r12
jne 0x31cb
cmpl $0x6, (%r14)
jne 0x323d
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x323d
movq 0x10(%r14), %rcx
testq %rcx, %rcx
je 0x323d
movl 0x8(%rax), %eax
cmpl 0x8(%rcx), %eax
jne 0x323d
movq 0x20(%r14), %r12
movq 0x28(%r14), %rax
movq %rax, 0x28(%r12)
movq %r12, 0x20(%rax)
movq %r14, %rdi
callq 0x54c4
movq %r12, %r14
movq 0x28(%r14), %r14
incl %r15d
testq %r14, %r14
jne 0x31ac
cmpl $0x0, 0x38(%rbx)
jle 0x326f
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x315c
incq %r14
movslq 0x38(%rbx), %rax
cmpq %rax, %r14
jl 0x3256
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0xa, %edi
movl $0x8, %esi
callq 0x20b0
movq %rax, %rbx
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x3dc0
movq %rax, (%rbx,%r14,8)
movl %r14d, (%rax)
incq %r14
cmpq $0xa, %r14
jne 0x34ac
movq (%rbx), %r13
movq 0x8(%rbx), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3de4
movq 0x18(%rbx), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x3de4
movq 0x40(%rbx), %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x3de4
movq 0x48(%rbx), %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x3de4
movq %rbp, %rdi
movq %r12, %rsi
callq 0x3de4
movq 0x10(%rbx), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x3de4
movq %r13, %rdi
movq %r12, %rsi
callq 0x3de4
movq %r15, %rdi
movq %r12, %rsi
callq 0x3de4
movq 0x20(%rbx), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3de4
movq 0x38(%rbx), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x3de4
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3de4
movq %rbp, %rdi
movq %r12, %rsi
callq 0x3de4
movq 0x28(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3de4
movq 0x30(%rbx), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3de4
movq %r15, %rdi
movq %r13, %rsi
callq 0x3de4
movq %r12, %rdi
movq %r13, %rsi
callq 0x3de4
movq %r13, %rdi
movq %r14, %rsi
callq 0x3de4
movq %rbx, %rdi
movl $0xa, %esi
movl $0x3, %edx
callq 0x3fa8
leaq 0x5cca(%rip), %r14      # 0x9288
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rax
movl 0x4(%rax), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2080
incq %r15
cmpq $0xa, %r15
jne 0x35c1
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
callq 0x3e51
incq %r14
cmpq $0xa, %r14
jne 0x35e1
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_O3/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
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x391a
movl 0x20(%r12), %edx
testl %edx, %edx
jle 0x391c
xorl %r15d, %r15d
xorl %eax, %eax
movq %r12, 0x8(%rsp)
movq 0x10(%r12), %rcx
movq %r15, %r13
shlq $0x4, %r13
movl (%rcx,%r13), %r14d
leal (%r14,%rax), %ebp
cmpl 0x24(%r12), %ebp
jg 0x391c
xorl %ebx, %ebx
testl %r14d, %r14d
jle 0x38f0
testq %rdi, %rdi
je 0x38f0
movq %rcx, 0x10(%rsp)
movl %ebp, (%rsp)
movl %edx, 0x4(%rsp)
movq %r15, 0x18(%rsp)
cltq
leaq (%rax,%rax,4), %r15
shlq $0x2, %r15
addq 0x18(%r12), %r15
movl %r14d, %ebp
xorl %ebx, %ebx
movq %rdi, 0x20(%rsp)
movq %rdi, %r12
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x392e
testl %eax, %eax
je 0x38d5
incq %rbx
cmpq %r14, %rbx
jae 0x38d5
movq 0x28(%r12), %r12
decl %ebp
addq $0x14, %r15
testq %r12, %r12
jne 0x38ac
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %r12
movq 0x18(%rsp), %r15
movl 0x4(%rsp), %edx
movl (%rsp), %ebp
movq 0x10(%rsp), %rcx
cmpl %r14d, %ebx
jne 0x3907
movq 0x8(%rcx,%r13), %rsi
callq *0x8(%r12)
movq %rax, %rdi
movl 0x20(%r12), %edx
incq %r15
movslq %edx, %rcx
movl %ebp, %eax
cmpq %rcx, %r15
jl 0x3854
jmp 0x391c
xorl %edi, %edi
movq %rdi, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3a02
movq %rdx, %rbx
testl %esi, %esi
jle 0x398e
movl %esi, %ecx
movq %rdi, %rdx
xorl %esi, %esi
xorl %eax, %eax
xorl %r14d, %r14d
movq %rbx, %r8
cmpq $0x2, %rsi
jb 0x3964
testq %rax, %rax
je 0x3991
movl (%rdx), %r9d
testb $0x1, %r9b
cmovneq %r8, %rax
testb $0x2, %r9b
cmovneq %r8, %r14
movq 0x28(%r8), %r8
testq %r8, %r8
je 0x3993
incq %rsi
addq $0x14, %rdx
cmpq %rcx, %rsi
jb 0x3959
jmp 0x3993
xorl %r14d, %r14d
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 0x39f5
movl 0xc(%rdi), %r12d
movl 0x10(%rdi), %r15d
movl 0x8(%rdi), %edx
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x3a0d
xorl %ebp, %ebp
testl %eax, %eax
je 0x3a02
movq 0x10(%rbx), %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0x3a0d
testl %eax, %eax
je 0x3a02
movq 0x18(%rbx), %rsi
movq %r14, %rdi
movl %r15d, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3a0d
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_O3/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:
movl $0x1, %eax
testq %rsi, %rsi
je 0x3a42
cmpl $0x6, %edx
ja 0x3a40
movl %edx, %ecx
leaq 0x58d3(%rip), %rdx      # 0x92f8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpl $0x2, (%rsi)
jne 0x3a40
jmp 0x3a42
movq 0x8(%rdi), %rax
jmp 0x3a54
cmpl $0x0, (%rsi)
je 0x3a42
xorl %eax, %eax
retq
cmpl $0x1, (%rsi)
jne 0x3a40
jmp 0x3a42
movq 0x10(%rdi), %rax
jmp 0x3a54
movq 0x18(%rdi), %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x3a5f
// File: /workspace/github_c_makefile_star2_O3/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:
testq %rsi, %rsi
sete %cl
testq %rdi, %rdi
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x3a92
movl (%rdi), %ecx
cmpl (%rsi), %ecx
jne 0x3a92
cmpl $0x2, %ecx
je 0x3ac2
cmpl $0x1, %ecx
je 0x3a93
testl %ecx, %ecx
jne 0x3ad1
movl 0x8(%rdi), %ecx
movl $0x1, %eax
cmpl 0x8(%rsi), %ecx
jne 0x3ad1
retq
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x3ad1
movq 0x8(%rsi), %rcx
testq %rcx, %rcx
je 0x3ad1
pushq %rax
movq 0x10(%rax), %rdi
movq 0x10(%rcx), %rsi
callq 0x20c0
testl %eax, %eax
leaq 0x8(%rsp), %rsp
jne 0x3ad1
movl $0x1, %eax
retq
movq 0x8(%rdi), %rcx
movl $0x1, %eax
cmpq 0x8(%rsi), %rcx
je 0x3a92
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3cdf
movl $0x6, (%rbx)
movq 0x10(%rbx), %rdi
callq 0x54ba
movq 0x18(%r14), %rdi
callq 0x53bd
movq %rax, 0x10(%rbx)
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0x3cbe
movq 0x8(%rbx), %rdi
movq 0x8(%r14), %rsi
callq 0x3a5f
testl %eax, %eax
je 0x3c61
movq 0x8(%r14), %rdi
callq 0x54ba
movq 0x10(%rbx), %rdi
callq 0x53bd
movq %rax, 0x8(%r14)
movq 0x8(%rbx), %rdi
movq 0x10(%r14), %rsi
callq 0x3a5f
testl %eax, %eax
je 0x3c88
movq 0x10(%r14), %rdi
callq 0x54ba
movq 0x10(%rbx), %rdi
callq 0x53bd
movq %rax, 0x10(%r14)
movq 0x8(%rbx), %rdi
movq 0x18(%r14), %rsi
callq 0x3a5f
testl %eax, %eax
je 0x3caf
movq 0x18(%r14), %rdi
callq 0x54ba
movq 0x10(%rbx), %rdi
callq 0x53bd
movq %rax, 0x18(%r14)
movq 0x28(%r14), %r14
testq %r14, %r14
jne 0x3c3a
movq 0x28(%rbx), %r14
jmp 0x3cc1
xorl %r14d, %r14d
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x3cce
movq %r14, 0x28(%rax)
testq %r14, %r14
je 0x3cd7
movq %rax, 0x20(%r14)
movq %rbx, %rdi
callq 0x54c4
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3d4d
movl 0x30(%rdi), %ebp
movq 0x20(%rdi), %rax
movq 0x28(%rdi), %rcx
testq %rax, %rax
je 0x3d0d
movq %rcx, 0x28(%rax)
testq %rcx, %rcx
je 0x3d16
movq %rax, 0x20(%rcx)
callq 0x54c4
movq %rbx, %rax
cmpl %ebp, 0x30(%rax)
jne 0x3d29
movl 0x30(%rbx), %ecx
movl %ecx, 0x30(%rax)
movq 0x28(%rax), %rax
testq %rax, %rax
jne 0x3d1e
movq %rbx, %rax
cmpl %ebp, 0x30(%rax)
jne 0x3d40
movl 0x30(%rbx), %ecx
movl %ecx, 0x30(%rax)
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0x3d35
movq 0x20(%rbx), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/ralloc.c
// Function: vertex_add_edge
void vertex_add_edge(struct vertex *v, struct vertex *v2)
{
	v->num_siblings++;
	if (!v->siblings) v->siblings = malloc(sizeof(struct vertex));
	else v->siblings = realloc(v->siblings, sizeof(struct vertex) * v->num_siblings);
	v->siblings[v->num_siblings-1] = v2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x18(%rdi), %r15
leaq 0x1(%r15), %rsi
movl %esi, 0x18(%rdi)
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x3e36
shlq $0x5, %rsi
callq 0x2110
movl 0x18(%r14), %r15d
decl %r15d
jmp 0x3e40
movl $0x20, %edi
callq 0x2100
movq %rax, 0x10(%r14)
movslq %r15d, %rcx
movq %rbx, (%rax,%rcx,8)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/ralloc.c
// Function: degree
int degree(struct vertex *v)
{
	int deg = 0;
	for (int i = 0; i < v->num_siblings; i++)
		deg += !v->siblings[i]->removed;
	return deg;
}

// Assembly:
movslq 0x18(%rdi), %rcx
testq %rcx, %rcx
jle 0x3e92
movq 0x10(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
cmpl $0x1, 0x8(%rdi)
adcl $0x0, %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x3e7e
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/ralloc.c
// Function: push
void push(struct vstk *stk, struct vertex *v)
{
	stk->num_vertices++;
	if (!stk->vertices) stk->vertices = malloc(sizeof(struct vertex*));
	else stk->vertices = realloc(stk->vertices, sizeof(struct vertex*)*stk->num_vertices);
	stk->vertices[stk->num_vertices-1] = v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x8(%rdi), %r15
leaq 0x1(%r15), %rsi
movl %esi, 0x8(%rdi)
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x3ec5
shlq $0x3, %rsi
callq 0x2110
movl 0x8(%r14), %r15d
decl %r15d
jmp 0x3ecf
movl $0x8, %edi
callq 0x2100
movq %rax, (%r14)
movslq %r15d, %rcx
movq %rbx, (%rax,%rcx,8)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/ralloc.c
// Function: pop
struct vertex *pop(struct vstk *stk)
{
	if (!stk->num_vertices) return NULL;
	struct vertex *v = stk->vertices[stk->num_vertices-1];
	stk->num_vertices--;
	if (!stk->num_vertices) {
		free(stk->vertices);
		stk->vertices = NULL;
	} else {
		stk->vertices = realloc(stk->vertices, stk->num_vertices*sizeof(struct vertex*));
	}
	return v;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movslq 0x8(%rdi), %rax
testq %rax, %rax
je 0x3f0d
movq %rdi, %r14
movq (%rdi), %rdi
movq -0x8(%rdi,%rax,8), %rbx
decl %eax
movl %eax, 0x8(%r14)
je 0x3f11
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x2110
jmp 0x3f18
xorl %ebx, %ebx
jmp 0x3f1b
callq 0x2030
xorl %eax, %eax
movq %rax, (%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/ralloc.c
// Function: fill_stack
void fill_stack(struct vertex **graph, int num, struct vstk *stk, int k)
{
	if (!k) return;
	for (int i = 0; i < num; i++) {
		if (graph[i]->removed) continue;
		if (degree(graph[i]) < k) {
			graph[i]->removed = 1;
			push(stk, graph[i]);
			fill_stack(graph, num, stk, k);
			break;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
testl %ecx, %ecx
sete %al
testl %esi, %esi
setle %cl
orb %al, %cl
jne 0x3f9c
movq %rdx, %r14
movq %rdi, %r15
movl %esi, %r12d
xorl %eax, %eax
movq (%r15,%rax,8), %rsi
cmpl $0x0, 0x8(%rsi)
jne 0x3f81
movslq 0x18(%rsi), %rcx
testq %rcx, %rcx
jle 0x3f7b
movq 0x10(%rsi), %rdi
xorl %r8d, %r8d
xorl %edx, %edx
movq (%rdi,%r8,8), %r9
cmpl $0x1, 0x8(%r9)
adcl $0x0, %edx
incq %r8
cmpq %r8, %rcx
jne 0x3f65
jmp 0x3f7d
xorl %edx, %edx
cmpl %ebx, %edx
jl 0x3f8b
incq %rax
cmpq %r12, %rax
jne 0x3f49
jmp 0x3f9c
movl $0x1, 0x8(%rsi)
movq %r14, %rdi
callq 0x3e95
jmp 0x3f47
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/ralloc.c
// Function: color_graph
void color_graph(struct vertex **graph, int num, int k)
{
	struct vstk stk;
	stk.vertices = NULL;
	stk.num_vertices = 0;
	/*Fill the vertex stack with vertex's in kempe order*/
	fill_stack(graph, num, &stk, k);
	/*Array that holds which colors the siblings of a node uses*/
	int *used_colors = calloc(sizeof(int), k);

	struct vertex *v;
	while ((v=pop(&stk))) {
		/*skip precolored nodes*/
		if (v->color > 0) continue;
		int clr = k;
		for (int i = 0; i < k; i++) used_colors[i] = 0;
		for (int i = 0; i < v->num_siblings; i++) {
			if (v->siblings[i]->color >= 0 && v->siblings[i]->color < k)
				used_colors[v->siblings[i]->color] = 1;
		}
		for (int i = 0; i < k; i++) {
			if (!used_colors[i]) {
				clr = i;
				break;
			}
		}
		if (clr >= k) {/*spill*/
			//v->color = k;
		} else {
			printf("Assigned R%d -> %d\n", v->ocolor, clr);
			v->color = clr;
		}
	}
	/*If k < the degree of all nodes, some nodes may not even be in the stack*/
	for (int i = 0; i < num; i++) {
		if (graph[i]->color < 0) {
			printf("Spilled %d\n", graph[i]->ocolor);
		}
	}

	free(stk.vertices);
	free(used_colors);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r15d
movq %rdi, %rbx
leaq 0x18(%rsp), %r12
movq $0x0, (%r12)
movl $0x0, 0x8(%r12)
movl %esi, 0xc(%rsp)
movq %r12, %rdx
movl %r15d, %ecx
callq 0x3f26
movslq %r15d, %rsi
movl $0x4, %edi
callq 0x20b0
movq %rax, %r14
movq %r12, %rdi
callq 0x3edf
testq %rax, %rax
je 0x40ba
movq %rax, %r12
movl %r15d, %ebp
leaq (,%rbp,4), %rax
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x4(%r12)
jle 0x4034
leaq 0x18(%rsp), %rdi
callq 0x3edf
movq %rax, %r12
testq %rax, %rax
jne 0x4015
jmp 0x40ba
testl %r15d, %r15d
jle 0x4048
movq %r14, %rdi
xorl %esi, %esi
movq 0x10(%rsp), %rdx
callq 0x2090
movslq 0x18(%r12), %rax
testq %rax, %rax
jle 0x4082
movq 0x10(%r12), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movl 0x4(%rsi), %esi
testl %esi, %esi
sets %dil
cmpl %r15d, %esi
setge %r8b
orb %dil, %r8b
jne 0x407a
movl $0x1, (%r14,%rsi,4)
incq %rdx
cmpq %rdx, %rax
jne 0x4059
testl %r15d, %r15d
jle 0x401d
xorl %r13d, %r13d
cmpl $0x0, (%r14,%r13,4)
je 0x409b
incq %r13
cmpq %r13, %rbp
jne 0x408a
jmp 0x401d
movl (%r12), %esi
leaq 0x5286(%rip), %rdi      # 0x932c
movl %r13d, %edx
xorl %eax, %eax
callq 0x2080
movl %r13d, 0x4(%r12)
jmp 0x401d
movl 0xc(%rsp), %eax
testl %eax, %eax
jle 0x40ed
movl %eax, %r12d
leaq 0x5274(%rip), %r15      # 0x9340
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rax
cmpl $0x0, 0x4(%rax)
jns 0x40e5
movl (%rax), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2080
incq %r13
cmpq %r13, %r12
jne 0x40cf
movq 0x18(%rsp), %rdi
callq 0x2030
movq %r14, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2030
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: block_emit
void block_emit(struct generator *context, struct block *b)
{
	struct node *p = context->parent;
	context->scope = b->scope;
	for (int i = 0; i < b->num_stmt; i++) {
		generate_from_node(b->stmt_list[i], context, IGNORE);
		/*Merge it into the block*/
		TLIST(p)=merge(TLIST(p), TLIST(b->stmt_list[i]));
		FLIST(p)=merge(FLIST(p), FLIST(b->stmt_list[i]));
	}
	context->scope = b->scope->parent;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %r15
movq 0x10(%rsi), %rax
movq %rax, 0x8(%rdi)
cmpl $0x0, 0x8(%rsi)
jle 0x4506
movq %rsi, %r14
xorl %r12d, %r12d
movq (%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq 0x4151
movq 0x10(%r15), %rax
movq 0x8(%rax), %rdi
movq (%r14), %rax
movq (%rax,%r12,8), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x52c8
movq 0x10(%r15), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rdi
movq (%r14), %rax
movq (%rax,%r12,8), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x52c8
movq 0x10(%r15), %rcx
movq %rax, 0x10(%rcx)
incq %r12
movslq 0x8(%r14), %rax
cmpq %rax, %r12
jl 0x449e
movq 0x10(%r14), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: cond_emit
void cond_emit(struct generator *context, struct cond *c)
{
	/*Emit comparison, if false jump to block end, at end of block jump after else block*/
	int start = REQ_LABEL(context), otherwise = REQ_LABEL(context), end = REQ_LABEL(context);
	generate_from_node(c->condition, context, IGNORE);
	/*True is patched to the start of the block, false is patched to where the else block would be*/
	backpatch(TLIST_REF(c->condition), start);
	backpatch(FLIST_REF(c->condition), otherwise);

	emit_label(context, start);
	generate_from_node(c->body, context, IGNORE);
	/*If there is a else block, then emit an unconditional jump to the end of that*/
	if (c->otherwise)
		emit_jump(context, end, UNCONDITIONAL);
	emit_label(context, otherwise);
	/*If else statement exists, then traverse that too*/
	generate_from_node(c->otherwise, context, IGNORE);
	emit_label(context, end);
	/*The body's patched to the parents*/
	if (c->body) {
		TLIST(context->parent) = merge(TLIST(context->parent), TLIST(c->body));
		FLIST(context->parent) = merge(FLIST(context->parent), FLIST(c->body));
	}
	if (c->otherwise) {
		TLIST(context->parent) = merge(TLIST(context->parent), TLIST(c->otherwise));
		FLIST(context->parent) = merge(FLIST(context->parent), FLIST(c->otherwise));
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %r12d
leal 0x1(%r12), %r15d
leal 0x2(%r12), %ebp
leal 0x3(%r12), %eax
movl %eax, 0x4(%rdi)
movq (%rsi), %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq 0x4151
movq (%r14), %rax
movq 0x10(%rax), %rdi
addq $0x8, %rdi
movl %r12d, %esi
callq 0x518b
movq (%r14), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl %r15d, %esi
callq 0x518b
movq %rbx, %rdi
movl %r12d, %esi
callq 0x5125
movq 0x8(%r14), %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq 0x4151
cmpq $0x0, 0x10(%r14)
je 0x45a6
movq %rbx, %rdi
movl %ebp, %esi
movl $0x2, %edx
callq 0x524d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5125
movq 0x10(%r14), %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq 0x4151
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5125
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x461b
movq 0x20(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq 0x8(%rcx), %rdi
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x52c8
movq 0x20(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rdi
movq 0x8(%r14), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x52c8
movq 0x20(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq %rax, 0x10(%rcx)
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x466a
movq 0x20(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq 0x8(%rcx), %rdi
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x52c8
movq 0x20(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rdi
movq 0x10(%r14), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x52c8
movq 0x20(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq %rax, 0x10(%rcx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: decl_emit
void decl_emit(struct generator *context, struct declaration *decl)
{
	struct ir_stmt *stmt = ir_stmt_init();
	stmt->type = stmt_alloc;
	alloc_type(context->scope, decl->ident);
	struct symbol *s = get_symbol(context->scope, decl->ident);
	stmt->arg1 = from_sym(s);
	if (decl->initializer) {
		emit(context, stmt);
		stmt = ir_stmt_init();
		stmt->type = stmt_store;
		stmt->arg2 = generate_from_node(decl->initializer, context, VALUE);
		stmt->arg1 = from_sym(s);
	}
	emit(context, stmt);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movl $0x38, %edi
callq 0x2100
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movq $0x0, 0x28(%rax)
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movl $0x5, (%rax)
movq 0x8(%rbx), %rdi
movq (%r15), %rsi
callq 0x7ec6
movq 0x8(%rbx), %rdi
movq (%r15), %rsi
callq 0x7d8e
movq %rax, %r12
movq %rax, %rdi
callq 0x5369
movq %rax, 0x10(%r14)
cmpq $0x0, 0x10(%r15)
je 0x474f
movq %r14, %rdi
callq 0x5429
cmpq $0x0, 0x10(%rbx)
je 0x46f9
movq 0x18(%rbx), %rax
movq %r14, 0x28(%rax)
movq %rax, 0x20(%r14)
jmp 0x46fd
movq %r14, 0x10(%rbx)
movq %r14, 0x18(%rbx)
movl $0x38, %edi
callq 0x2100
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movq $0x0, 0x28(%rax)
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movl $0x12, (%rax)
movq 0x10(%r15), %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0x4151
movq %rax, 0x18(%r14)
movq %r12, %rdi
callq 0x5369
movq %rax, 0x10(%r14)
movq %r14, %rdi
callq 0x5429
cmpq $0x0, 0x10(%rbx)
je 0x4770
movq 0x18(%rbx), %rax
addq $0x18, %rbx
movq %r14, 0x28(%rax)
movq %rax, 0x20(%r14)
jmp 0x4778
movq %r14, 0x10(%rbx)
addq $0x18, %rbx
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq