LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: loop_emit
void loop_emit(struct generator *context, struct loop *l)
{
	int cmp = REQ_LABEL(context), start = REQ_LABEL(context), end = REQ_LABEL(context);
	generate_from_node(l->init, context, IGNORE);
	/*Unconditional jump to compare block*/
	emit_jump(context, cmp, UNCONDITIONAL);
	emit_label(context, start);
	generate_from_node(l->body, context, IGNORE);
	generate_from_node(l->iter, context, IGNORE);
	emit_label(context, cmp);
	generate_from_node(l->condition, context, IGNORE);
	emit_label(context, end);
	/*True is backpatched to the loop start, false is patched to after the loop ends*/
	backpatch(TLIST_REF(l->condition), start);
	backpatch(FLIST_REF(l->condition), end);
	/*The bodys truelist/falselist are continue/break, so patch to start/end respectively*/
	backpatch(TLIST_REF(l->body), start);
	backpatch(FLIST_REF(l->body), end);
	/*The loop body gets patched up to the parent*/
	if (l->body) {
		TLIST(context->parent) = merge(TLIST(context->parent), TLIST(l->body));
		FLIST(context->parent) = merge(FLIST(context->parent), FLIST(l->body));
	}
}

// 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 %rbx, %rdi
movl %r12d, %esi
movl $0x2, %edx
callq 0x524d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5125
movq 0x18(%r14), %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq 0x4151
movq 0x10(%r14), %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq 0x4151
movq %rbx, %rdi
movl %r12d, %esi
callq 0x5125
movq 0x8(%r14), %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq 0x4151
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5125
movq 0x8(%r14), %rax
movq 0x10(%rax), %rdi
addq $0x8, %rdi
movl %r15d, %esi
callq 0x518b
movq 0x8(%r14), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl %ebp, %esi
callq 0x518b
movq 0x18(%r14), %rax
movq 0x10(%rax), %rdi
addq $0x8, %rdi
movl %r15d, %esi
callq 0x518b
movq 0x18(%r14), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl %ebp, %esi
callq 0x518b
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x48bb
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 0x18(%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: call_emit
struct ir_operand *call_emit(struct generator *context, struct call *c, int result)
{
	struct ir_stmt *s = ir_stmt_init();
	struct type *ct = TYPE(context->parent);
	/*If function has return type, then store result in register*/
	if (ct && ct->type == type_datatype) {
		if (ct->info.data_type != type_void) {
			s->result = from_reg(context->reg_cnt++);
		}
	}
	for (int i = c->argc-1; i >= 0; i--) {
		struct ir_stmt *p = ir_stmt_init();
		p->type = stmt_param;
		p->arg1 = from_cnum(i);
		p->arg2 = generate_from_node(c->argv[i], context, VALUE);
		emit(context, p);
	}
	s->type = stmt_call;
	s->arg1 = generate_from_node(c->func, context, ADDRESS);
	emit(context, s);
	return result != IGNORE ? copy(s->result) : NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0x14(%rsp)
movq %rsi, %r12
movq %rdi, %r14
movl $0x38, %edi
callq 0x2100
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movq $0x0, 0x28(%rax)
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movq 0x20(%r14), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x491d
cmpl $0x0, 0x18(%rax)
je 0x4a4e
movq $0x0, 0x8(%rsp)
movslq (%r12), %rbx
testq %rbx, %rbx
jle 0x49d5
decq %rbx
movabsq $0x400000002, %r13      # imm = 0x400000002
movl $0x38, %edi
callq 0x2100
movq %rax, %rbp
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movq $0x0, 0x28(%rax)
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movl $0x7, (%rax)
movl $0x10, %edi
callq 0x2100
movq %r13, (%rax)
movq %rbx, 0x8(%rax)
movq %rax, 0x10(%rbp)
movq 0x10(%r12), %rax
movq (%rax,%rbx,8), %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x4151
movq %rax, 0x18(%rbp)
movq %rbp, %rdi
callq 0x5429
cmpq $0x0, 0x10(%r14)
je 0x49b9
movq 0x18(%r14), %rax
movq %rbp, 0x28(%rax)
movq %rax, 0x20(%rbp)
jmp 0x49bd
movq %rbp, 0x10(%r14)
movq %rbp, 0x18(%r14)
leaq -0x1(%rbx), %rax
incq %rbx
cmpq $0x1, %rbx
movq %rax, %rbx
ja 0x4940
movl $0x2, (%r15)
movq 0x8(%r12), %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x4151
movq %rax, 0x10(%r15)
movq %r15, %rdi
callq 0x5429
cmpq $0x0, 0x10(%r14)
je 0x4a13
movq 0x18(%r14), %rax
addq $0x18, %r14
movq %r15, 0x28(%rax)
movq %rax, 0x20(%r15)
jmp 0x4a1b
movq %r15, 0x10(%r14)
addq $0x18, %r14
movq %r15, (%r14)
cmpl $0x3, 0x14(%rsp)
jne 0x4a36
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x53bd
cmpl $0x0, (%rax)
je 0x491d
leaq 0x8(%r15), %rbx
movl (%r14), %r13d
leal 0x1(%r13), %eax
movl %eax, (%r14)
movl $0x10, %edi
callq 0x2100
movq $0x0, (%rax)
movl %r13d, 0x8(%rax)
movq %rax, 0x8(%rsp)
movq %rax, (%rbx)
jmp 0x4926
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: ident_emit
struct ir_operand *ident_emit(struct generator *context, char *ident, int result)
{
	//if (result == IGNORE) return NULL;
	struct symbol *s = get_symbol(context->scope, ident);
	if (result == ADDRESS) return from_sym(s);
	/*Arrays are converted to pointers to the first member of the array*/
	if (TYPE(context->parent) && TYPE(context->parent)->type == type_array) {
		struct ir_stmt *stmt = ir_stmt_init();
		stmt->type = stmt_addr;
		stmt->result = from_reg(context->reg_cnt++);
		stmt->arg1 = from_sym(s);
		emit(context, stmt);
		return copy(stmt->result);
	}
	/*If the value is asked for then emit a load instruction with the symbol address*/
	struct ir_stmt *stmt = ir_stmt_init();
	stmt->type = stmt_load;
	stmt->result = from_reg(context->reg_cnt++);
	stmt->arg1 = from_sym(s);
	emit(context, stmt);
	return copy(stmt->result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x7d8e
movq %rax, %r14
cmpl $0x1, %ebp
jne 0x4abe
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5369
movq 0x20(%rbx), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x4afe
cmpl $0x2, 0x18(%rax)
jne 0x4afe
movl $0x38, %edi
callq 0x2100
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
xorl %r13d, %r13d
movq %r13, 0x28(%rax)
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movl $0x13, (%rax)
jmp 0x4b26
movl $0x38, %edi
callq 0x2100
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
xorl %r13d, %r13d
movq %r13, 0x28(%rax)
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movl $0x11, (%rax)
movl (%rbx), %ebp
leal 0x1(%rbp), %eax
movl %eax, (%rbx)
movl $0x10, %edi
callq 0x2100
movq %rax, %r12
movq %r13, (%rax)
movl %ebp, 0x8(%rax)
movq %rax, 0x8(%r15)
movq %r14, %rdi
callq 0x5369
movq %rax, 0x10(%r15)
movq %r15, %rdi
callq 0x5429
cmpq %r13, 0x10(%rbx)
je 0x4b70
movq 0x18(%rbx), %rax
addq $0x18, %rbx
movq %r15, 0x28(%rax)
movq %rax, 0x20(%r15)
jmp 0x4b78
movq %r15, 0x10(%rbx)
addq $0x18, %rbx
movq %r15, (%rbx)
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x53bd
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: emit_label
struct ir_stmt *emit_label(struct generator *context, int label)
{
	struct ir_stmt *stmt = ir_stmt_init();
	stmt->type = stmt_label;
	stmt->label = label;
	emit(context, stmt);
	return stmt;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
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 $0x1, (%rax)
movl %ebp, 0x30(%rax)
movq %rax, %rdi
callq 0x5429
cmpq $0x0, 0x10(%rbx)
je 0x5178
movq 0x18(%rbx), %rax
addq $0x18, %rbx
movq %r14, 0x28(%rax)
movq %rax, 0x20(%r14)
jmp 0x5180
movq %r14, 0x10(%rbx)
addq $0x18, %rbx
movq %r14, (%rbx)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: backpatch
void backpatch(struct ir_list **rlist, int label)
{
	if (!rlist) return;
	struct ir_list *list = *rlist;
	if (!list) return;
	for (int i = 0; i < list->num_stmt; i++)
		list->list[i]->label = label;
	free_list(list);
	*rlist = NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x51d7
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x51d0
movslq 0x8(%r14), %rax
movq (%r14), %rdi
testq %rax, %rax
jle 0x51bc
xorl %ecx, %ecx
movq (%rdi,%rcx,8), %rdx
movl %esi, 0x30(%rdx)
incq %rcx
cmpq %rcx, %rax
jne 0x51ad
callq 0x2030
movq %r14, %rdi
callq 0x2030
movq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: emit
void emit(struct generator *context, struct ir_stmt *stmt)
{
	eval_size(stmt);
	if (!context->head) {
		context->head = stmt;
		context->cur = stmt;
	} else {
		context->cur->next = stmt;
		stmt->prev = context->cur;
		context->cur = stmt;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x5429
cmpq $0x0, 0x10(%r14)
je 0x5203
movq 0x18(%r14), %rax
addq $0x18, %r14
movq %rbx, 0x28(%rax)
movq %rax, 0x20(%rbx)
jmp 0x520b
movq %rbx, 0x10(%r14)
addq $0x18, %r14
movq %rbx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: emit_jump
struct ir_stmt *emit_jump(struct generator *context, int label, int conditional)
{
	struct ir_stmt *stmt = ir_stmt_init();
	if (conditional == CONDITIONAL)
		stmt->type = stmt_cgoto;
	else
		stmt->type = stmt_ugoto;
	stmt->label = label;
	emit(context, stmt);
	return stmt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r15d
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)
xorl %eax, %eax
cmpl $0x1, %ebp
sete %al
addl $0x3, %eax
movl %eax, (%r14)
movl %r15d, 0x30(%r14)
movq %r14, %rdi
callq 0x5429
cmpq $0x0, 0x10(%rbx)
je 0x52af
movq 0x18(%rbx), %rax
addq $0x18, %rbx
movq %r14, 0x28(%rax)
movq %rax, 0x20(%r14)
jmp 0x52b7
movq %r14, 0x10(%rbx)
addq $0x18, %rbx
movq %r14, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: merge
struct ir_list *merge(struct ir_list *list1, struct ir_list *list2)
{
	if (!list1 && list2) return list2;
	if (!list2 && list1) return list1;
	if (!list1 && !list2) return NULL;

	int os = list1->num_stmt;
	int ns = list1->num_stmt + list2->num_stmt;
	list1->num_stmt = ns;
	list1->list = realloc(list1->list, sizeof(struct ir_stmt*)*ns);
	for (int i = os; i < ns; i++) {
		list1->list[i] = list2->list[i-os];
	}
	free_list(list2);
	return list1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
je 0x52e9
movq %r14, %rbx
jmp 0x535c
movq %rdi, %rbx
testq %r14, %r14
sete %al
testq %rdi, %rdi
setne %cl
testb %al, %cl
jne 0x535c
movq %rbx, %rax
orq %r14, %rax
je 0x535a
movslq 0x8(%rbx), %r15
movslq 0x8(%r14), %r13
leaq (%r15,%r13), %r12
movl %r12d, 0x8(%rbx)
movq (%rbx), %rdi
leaq (,%r12,8), %rsi
callq 0x2110
movq %rax, (%rbx)
testq %r13, %r13
jle 0x5348
xorl %eax, %eax
movq (%r14), %rcx
movq (%rcx,%rax), %rcx
movq (%rbx), %rdx
movq %rcx, (%rdx,%r15,8)
incq %r15
addq $0x8, %rax
cmpq %r12, %r15
jl 0x532e
movq (%r14), %rdi
callq 0x2030
movq %r14, %rdi
callq 0x2030
jmp 0x535c
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: from_sym
struct ir_operand *from_sym(struct symbol *s)
{
	if (!s) {
		printf("Unresolved symbol!\n");
		exit (-1);
	}
	struct ir_operand *oper = malloc(sizeof(struct ir_operand));
	oper->size = s->size;
	oper->type = oper_sym;
	oper->val.sym = s;
	return oper;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x538e
movq %rdi, %rbx
movl $0x10, %edi
callq 0x2100
movl 0x8(%rbx), %ecx
movl %ecx, 0x4(%rax)
movl $0x1, (%rax)
movq %rbx, 0x8(%rax)
popq %rbx
retq
leaq 0x4070(%rip), %rdi      # 0x9405
callq 0x2060
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2120
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: copy
struct ir_operand *copy(struct ir_operand *oper)
{
	struct ir_operand *cpy = NULL;
	if (oper->type == oper_reg)
		cpy = from_reg(oper->val.virt_reg);
	else if (oper->type == oper_sym)
		cpy = from_sym(oper->val.sym);
	else if (oper->type == oper_cnum)
		cpy = from_cnum(oper->val.constant);
	if (cpy) cpy->size = oper->size;
	return cpy;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x53ff
cmpl $0x1, %eax
je 0x53ed
testl %eax, %eax
jne 0x53fb
movl 0x8(%rbx), %ebp
movl $0x10, %edi
callq 0x2100
movq $0x0, (%rax)
movl %ebp, 0x8(%rax)
jmp 0x541e
movq 0x8(%rbx), %rdi
callq 0x5369
testq %rax, %rax
jne 0x541e
xorl %eax, %eax
jmp 0x5424
movq 0x8(%rbx), %r14
movl $0x10, %edi
callq 0x2100
movabsq $0x400000002, %rcx      # imm = 0x400000002
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
movl 0x4(%rbx), %ecx
movl %ecx, 0x4(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: eval_size
void eval_size(struct ir_stmt *stmt)
{
	int dfsize = 0;
	if (stmt->result && stmt->result->size) dfsize = stmt->result->size;
	else if (stmt->arg1 && stmt->arg1->size) dfsize = stmt->arg1->size;
	else if (stmt->arg2 && stmt->arg2->size) dfsize = stmt->arg2->size;

	if (stmt->result && !stmt->result->size)
		stmt->result->size = dfsize;
	if (stmt->arg1 && !stmt->arg1->size)
		stmt->arg1->size = dfsize;
	if (stmt->arg2 && !stmt->arg2->size)
		stmt->arg2->size = dfsize;
}

// Assembly:
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x5439
movl 0x4(%rcx), %eax
testl %eax, %eax
jne 0x5467
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x5449
movl 0x4(%rax), %eax
testl %eax, %eax
jne 0x5459
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x5457
movl 0x4(%rax), %eax
jmp 0x5459
xorl %eax, %eax
testq %rcx, %rcx
je 0x5467
cmpl $0x0, 0x4(%rcx)
jne 0x5467
movl %eax, 0x4(%rcx)
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x5479
cmpl $0x0, 0x4(%rcx)
jne 0x5479
movl %eax, 0x4(%rcx)
movq 0x18(%rdi), %rcx
testq %rcx, %rcx
je 0x5488
cmpl $0x0, 0x4(%rcx)
je 0x5489
retq
movl %eax, 0x4(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/tac.c
// Function: ir_stmt_free
void ir_stmt_free(struct ir_stmt *stmt)
{
	if (!stmt) return;
	ir_operand_free(stmt->result);
	ir_operand_free(stmt->arg1);
	ir_operand_free(stmt->arg2);
	free(stmt);
}

// Assembly:
testq %rdi, %rdi
je 0x5500
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x54db
callq 0x2030
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x54e9
callq 0x2030
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x54f7
callq 0x2030
movq %rbx, %rdi
popq %rbx
jmp 0x2030
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/ast.c
// Function: unit_add
void unit_add(struct unit *u, struct stmt *edecl)
{
	u->num_decls++;
	if (!u->edecls) u->edecls = malloc(sizeof(struct stmt*));
	else u->edecls = realloc(u->edecls, sizeof(struct stmt*)*u->num_decls);
	u->edecls[u->num_decls-1] = edecl;
}

// 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 0x5a0a
shlq $0x3, %rsi
callq 0x2110
movl 0x8(%r14), %r15d
decl %r15d
jmp 0x5a14
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/frontend/ast.c
// Function: call_addarg
void call_addarg(struct call *c, struct expr *e)
{
	c->argc++;
	if (!c->argv) c->argv = malloc(sizeof(struct expr *));
	else c->argv = realloc(c->argv, sizeof(struct expr*)*c->argc);
	c->argv[c->argc-1] = e;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movslq (%rdi), %r15
leaq 0x1(%r15), %rsi
movl %esi, (%rdi)
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x5bf2
shlq $0x3, %rsi
callq 0x2110
movl (%r14), %r15d
decl %r15d
jmp 0x5bfc
movl $0x8, %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/frontend/ast.c
// Function: block_addstmt
void block_addstmt(struct block *b, struct stmt *s)
{
	b->num_stmt++;
	if (!b->stmt_list)
		b->stmt_list = malloc(sizeof(struct stmt *));
	else
		b->stmt_list =
		    realloc(b->stmt_list,
			    sizeof(struct stmt *) * b->num_stmt);
	b->stmt_list[b->num_stmt - 1] = s;
}

// 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 0x5c98
shlq $0x3, %rsi
callq 0x2110
movl 0x8(%r14), %r15d
decl %r15d
jmp 0x5ca2
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/frontend/cdecl.c
// Function: parse_declarator
int parse_declarator(struct parser *p, struct declaration *decl)
{
	struct type *t1 = NULL;
	while (match(p, t_asterisk))
		t1 = types_merge(t1, type_init(type_ptr));
	if (parse_dir_declarator(p, decl)) {
		decl->type = types_merge(decl->type, t1);
		return 1;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movl $0xf, %esi
callq 0x7c4e
xorl %r14d, %r14d
xorl %r12d, %r12d
testq %rax, %rax
je 0x611f
movl $0x1, %edi
callq 0x7f14
movq %r12, %rdi
movq %rax, %rsi
callq 0x7f2e
movq %rax, %r12
movq %r15, %rdi
movl $0xf, %esi
callq 0x7c4e
jmp 0x60f3
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5e4c
testl %eax, %eax
je 0x6144
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x7f2e
movq %rax, 0x8(%rbx)
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/cdecl.c
// Function: parse_param
struct declaration *parse_param(struct parser *p)
{
	enum type_specifier dtype = type_void;
	if (match(p, t_int))
		dtype = type_int;
	if (match(p, t_char))
		dtype = type_char;
	if (!dtype)
		return NULL;	/*technically wrong, types aren't required by the grammar */
	struct declaration *decl = parse_init_declarator(p, dtype);
	return decl;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x4, %esi
callq 0x7c4e
xorl %ebp, %ebp
testq %rax, %rax
setne %bpl
movq %rbx, %rdi
movl $0x5, %esi
callq 0x7c4e
testq %rax, %rax
movl $0x2, %esi
cmovel %ebp, %esi
testl %esi, %esi
je 0x6196
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x619f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/cdecl.c
// Function: parse_init_declarator
struct declaration *parse_init_declarator(struct parser *p,
					  enum type_specifier dtype)
{
	struct declaration *decl;
	decl = malloc(sizeof(struct declaration));
	decl->initializer = NULL;
	decl->ident = NULL;
	decl->type = NULL;
	if (!parse_declarator(p, decl)) {
		free(decl);
		return 0;
	}

	struct type *decldtype = type_init(type_datatype);
	decldtype->info.data_type = dtype;
	decl->type = types_merge(decl->type, decldtype);
	return decl;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x1, %edi
movl $0x18, %esi
callq 0x20b0
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x60d5
testl %eax, %eax
je 0x61e4
xorl %edi, %edi
callq 0x7f14
movl %ebp, (%rax)
movq 0x8(%rbx), %rdi
movq %rax, %rsi
callq 0x7f2e
movq %rax, 0x8(%rbx)
jmp 0x61ee
movq %rbx, %rdi
callq 0x2030
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/cdecl.c
// Function: parse_declaration
struct stmt *parse_declaration(struct parser *p)
{
	enum type_specifier dtype = type_void;
	if (match(p, t_int))
		dtype = type_int;
	if (match(p, t_char))
		dtype = type_char;
	if (!dtype)
		return NULL;	/*technically wrong, types aren't required by the grammar */
	struct declaration *decl = parse_init_declarator(p, dtype);
	set_type(get_scope(p), decl->ident, decl->type);
	if (match(p, t_semic))
		return node_init(node_decl, decl);
	if (!match(p, t_equal))
		syntax_error(p,
			     "Expected assignment expression after declaration");
	struct expr *e = parse_asn_expr(p);
	if (!e)
		syntax_error(p, "Invalid initializer after declaration");
	decl->initializer = e;
	if (!match(p, t_semic))
		syntax_error(p, "Expected ';' after initializer");
	return node_init(node_decl, decl);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x4, %esi
callq 0x7c4e
xorl %ebp, %ebp
testq %rax, %rax
setne %bpl
movq %rbx, %rdi
movl $0x5, %esi
callq 0x7c4e
testq %rax, %rax
movl $0x2, %esi
cmovel %ebp, %esi
testl %esi, %esi
je 0x62e3
movq %rbx, %rdi
callq 0x619f
movq %rax, %r14
movq %rbx, %rdi
callq 0x7cee
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rax, %rdi
callq 0x7e0e
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x62cc
movq %rbx, %rdi
movl $0x13, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x6288
leaq 0x3398(%rip), %rsi      # 0x9618
movq %rbx, %rdi
callq 0x7ca4
movq %rbx, %rdi
callq 0x7142
movq %rax, %r15
testq %rax, %rax
jne 0x62a7
leaq 0x33aa(%rip), %rsi      # 0x9649
movq %rbx, %rdi
callq 0x7ca4
movq %r15, 0x10(%r14)
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x62cc
leaq 0x33ab(%rip), %rsi      # 0x966f
movq %rbx, %rdi
callq 0x7ca4
movl $0xc, %edi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5764
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/cdecl.c
// Function: parse_function
struct stmt *parse_function(struct parser *p)
{
	enum type_specifier dtype = type_int;
	if (match(p, t_void)) dtype=type_void;
	else if (match(p, t_int))  dtype = type_int;
	else if (match(p, t_char)) dtype = type_char;
	else printf("Warning: return type defaults to int\n");
	/*Validify function declaration, then parse body */
	struct declaration *decl;
	decl = malloc(sizeof(struct declaration));
	decl->initializer = NULL;
	decl->ident = NULL;
	decl->type = NULL;
	if (!parse_declarator(p, decl)) {
		free(decl);
		return 0;
	}
	if (!decl->type) syntax_error(p, "Invalid declarator");
	/*The type must be a function */
	if (decl->type->type != type_fcn) {
		free(decl->ident);
		type_free(decl->type);
		free(decl);
		return 0;
	}

	struct type *decldtype = type_init(type_datatype);
	decldtype->info.data_type = dtype;
	decl->type = types_merge(decl->type, decldtype);
	set_type(get_scope(p), decl->ident, decl->type);
	/*Create function from declaration */
	struct stmt *block;
	if (!(block = parse_block(p))) {
		free(decl->ident);
		type_free(decl->type);
		free(decl);
		return 0;
	}
	struct stmt *fn = func_init(decl->ident, decl->type, block);
	free(decl);
	struct type *ftype = FUNC(fn)->ftype;
	/*lastly, add parameters to block scope */
	for (int i = 0; i < ftype->info.fcn.paramc; i++) {
		char *pn = ftype->info.fcn.paramv[i];
		struct type *pt = ftype->info.fcn.paramt[i];
		set_type(BLOCK(FUNC(fn)->body)->scope, pn, pt);
	}

	return fn;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl $0x3, %esi
callq 0x7c4e
xorl %ebp, %ebp
testq %rax, %rax
jne 0x634b
movq %rbx, %rdi
movl $0x4, %esi
callq 0x7c4e
movl $0x1, %ebp
testq %rax, %rax
jne 0x634b
movq %rbx, %rdi
movl $0x5, %esi
callq 0x7c4e
movl $0x2, %ebp
testq %rax, %rax
jne 0x634b
leaq 0x3360(%rip), %rdi      # 0x96a1
callq 0x2060
movl $0x1, %ebp
movl $0x1, %edi
movl $0x18, %esi
callq 0x20b0
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x60d5
testl %eax, %eax
je 0x6440
movq 0x8(%r14), %r15
testq %r15, %r15
jne 0x6388
leaq 0x330e(%rip), %rsi      # 0x968e
movq %rbx, %rdi
callq 0x7ca4
cmpl $0x3, 0x18(%r15)
jne 0x6430
xorl %edi, %edi
callq 0x7f14
movl %ebp, (%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x7f2e
movq %rax, %r15
movq %rax, 0x8(%r14)
movq %rbx, %rdi
callq 0x7cee
movq (%r14), %r12
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x7e0e
movq %rbx, %rdi
callq 0x765b
movq %r12, %rdi
testq %rax, %rax
je 0x6433
movq %r15, %rsi
movq %rax, %rdx
callq 0x5af8
movq %rax, %rbx
movq %r14, %rdi
callq 0x2030
movq 0x8(%rbx), %rax
movq 0x8(%rax), %r14
cmpl $0x0, (%r14)
jle 0x644a
xorl %r15d, %r15d
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
movq (%rax,%r15,8), %rsi
movq (%rcx,%r15,8), %rdx
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x7e0e
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x63fe
jmp 0x644a
movq (%r14), %rdi
callq 0x2030
movq %r15, %rdi
callq 0x7f4e
movq %r14, %rdi
callq 0x2030
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/checker.c
// Function: type_error
void type_error(struct node *parent, struct type *a, struct type *b)
{
	printf("Incompatable types ");
	printf("\"");
	printf("with types \"");
	print_type(a);
	printf("\" and \"");
	print_type(b);
	printf("\" in expression:\n");
	node_debug(parent);
	printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x3293(%rip), %rdi      # 0x9700
xorl %eax, %eax
callq 0x2080
movl $0x22, %edi
callq 0x2040
leaq 0x328f(%rip), %rdi      # 0x9714
xorl %eax, %eax
callq 0x2080
movq %r15, %rdi
callq 0x815b
leaq 0x3286(%rip), %rdi      # 0x9721
xorl %eax, %eax
callq 0x2080
movq %r14, %rdi
callq 0x815b
leaq 0x3334(%rip), %rdi      # 0x97e5
callq 0x2060
movq %rbx, %rdi
callq 0x26cb
movl $0xa, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/checker.c
// Function: rank
int rank(struct type *a)
{
	if (!a) return 0;
	if (!a->type == type_datatype) return 0;
	enum type_specifier dt = a->info.data_type;
	if (dt==type_char) return 1;
	if (dt==type_int) return 2;
	if (dt==type_long) return 3;

	return 0;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x64da
cmpl $0x0, 0x18(%rdi)
je 0x64db
retq
movl (%rdi), %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x64da
movl %ecx, %eax
leaq 0x3383(%rip), %rcx      # 0x9870
movl (%rcx,%rax,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/checker.c
// Function: implicit_cast
int implicit_cast(struct node **a, struct node **b, int favor)
{
	struct type *ta = TYPE(*a), *tb = TYPE(*b);
	/*Integer promotion*/
	int ra = rank(ta), rb = rank(tb);
	if (ra && rb) {
		if ((ra > rb && favor == NEUTRAL) || favor == LHS) {
			if (favor == LHS && rb > ra) {
				printf("Warning: Possible data loss in implicit cast from ");
				print_type(ta);
				printf(" to ");
				print_type(tb);
				printf("\n");
			}

			return explicit_cast(ta, b);
		} else if ((rb > ra && favor == NEUTRAL) || favor == RHS) {
			printf("Integer promotion\n");
			return explicit_cast(tb, a);
		}
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r12
movq (%rdi), %rax
movq 0x10(%rax), %rax
movq (%rax), %r15
movq (%rsi), %rax
movq 0x10(%rax), %rax
movq (%rax), %rbx
testq %r15, %r15
je 0x6541
xorl %eax, %eax
cmpl $0x0, 0x18(%r15)
movl $0x0, %ecx
jne 0x6545
movl (%r15), %ecx
movb $0x1, %al
cmpl $0x4, %ecx
je 0x6584
cmpl $0x2, %ecx
je 0x6576
cmpl $0x1, %ecx
jne 0x6541
movl $0x2, %ecx
jmp 0x6545
xorl %eax, %eax
xorl %ecx, %ecx
testq %rbx, %rbx
je 0x6550
cmpl $0x0, 0x18(%rbx)
je 0x655e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl (%rbx), %esi
cmpl $0x4, %esi
je 0x658b
cmpl $0x2, %esi
je 0x657d
cmpl $0x1, %esi
jne 0x6550
movl $0x2, %esi
jmp 0x6590
movl $0x1, %ecx
jmp 0x6545
movl $0x1, %esi
jmp 0x6590
movl $0x3, %ecx
jmp 0x6545
movl $0x3, %esi
testb %al, %al
je 0x6550
cmpl %esi, %ecx
seta %al
cmpl $0x3, %edx
sete %dil
testl %edx, %edx
je 0x65d1
andb %al, %dil
jne 0x65d1
cmpl %ecx, %esi
seta %al
cmpl $0x3, %edx
sete %cl
cmpl $0x1, %edx
je 0x65bd
andb %al, %cl
je 0x6550
leaq 0x3232(%rip), %rdi      # 0x97f6
callq 0x2060
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x661b
cmpl %ecx, %esi
setbe %al
testl %edx, %edx
setne %cl
orb %al, %cl
jne 0x6615
leaq 0x3143(%rip), %rdi      # 0x9729
xorl %eax, %eax
callq 0x2080
movq %r15, %rdi
callq 0x815b
leaq 0x3160(%rip), %rdi      # 0x975c
xorl %eax, %eax
callq 0x2080
movq %rbx, %rdi
callq 0x815b
movl $0xa, %edi
callq 0x2040
movq %r15, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x662b
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/checker.c
// Function: explicit_cast
int explicit_cast(struct type *a, struct node **b)
{
	struct node *cast;
	struct type *tb = TYPE(*b);
	int ra = rank(a), rb = rank(tb);
	/*Scalar cast*/
	if (ra && rb) {
		cast = node_init(node_cast, *b);
		TYPE(cast) = type_copy(a);
		*b = cast;
		return 1;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rsi
movq 0x10(%rsi), %rax
movq (%rax), %rax
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x665f
cmpl $0x0, 0x18(%r15)
jne 0x665f
movl (%r15), %ecx
cmpl $0x4, %ecx
ja 0x665f
movb $0x16, %dl
shrb %cl, %dl
jmp 0x6661
xorl %edx, %edx
testq %rax, %rax
je 0x666c
cmpl $0x0, 0x18(%rax)
je 0x667a
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl (%rax), %eax
cmpl $0x4, %eax
ja 0x666c
movl $0x16, %ecx
btl %eax, %ecx
jae 0x666c
testb $0x1, %dl
je 0x666c
movl $0x1, %ebx
movl $0x1, %edi
callq 0x5764
movq %rax, %r12
movq %r15, %rdi
callq 0x7fb8
movq 0x10(%r12), %rcx
movq %rax, (%rcx)
movq %r12, (%r14)
jmp 0x666c
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/lexer.c
// Function: tokenify
struct token **tokenify(char *stream, int *numt)
{
	if (!stream)
		return NULL;
	struct token **tokens = NULL;

	int tlen = 0, numtok = 0, ln = 0;
	char *save = stream, *tok = NULL, *ls = stream;
	enum token_type t;
	while ((t = lex_r(&save, &tlen, &ls, &ln))) {
		tok = malloc(tlen + 1);
		memcpy(tok, save - tlen, tlen);
		tok[tlen] = 0;
		numtok++;
		struct token *token = malloc(sizeof(struct token));
		token->tok = tok, token->type = t;
		token->col = save - ls, token->line = ln;
		if (!tokens)
			tokens = malloc(sizeof(struct token *));
		else
			tokens =
			    realloc(tokens,
				    sizeof(struct token *) * numtok);
		tokens[numtok - 1] = token;
	}
	*numt = numtok;
	return tokens;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x6db4
movq %rsi, %r14
leaq 0x4(%rsp), %rsi
movl %ebx, (%rsi)
movq %rsp, %rcx
movl %ebx, (%rcx)
leaq 0x10(%rsp), %rax
movq %rdi, (%rax)
leaq 0x8(%rsp), %rdx
movq %rdi, (%rdx)
movq %rax, %rdi
callq 0x6dd1
testl %eax, %eax
je 0x6db9
movl %eax, %r15d
movq %r14, 0x18(%rsp)
movl $0x8, %r14d
xorl %ebx, %ebx
xorl %r13d, %r13d
movq %r13, 0x20(%rsp)
movslq 0x4(%rsp), %r12
leaq 0x1(%r12), %rdi
callq 0x2100
movq %rax, %rbp
movq 0x10(%rsp), %r13
movq %r13, %rsi
subq %r12, %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x20f0
movb $0x0, (%rbp,%r12)
movl $0x18, %edi
callq 0x2100
movq %rax, %r12
movq %rbp, (%rax)
movl %r15d, 0x14(%rax)
subl 0x8(%rsp), %r13d
movl %r13d, 0x8(%rax)
movq 0x20(%rsp), %rdi
movl (%rsp), %eax
movl %eax, 0xc(%r12)
testq %rdi, %rdi
je 0x6d73
movq %r14, %rsi
callq 0x2110
jmp 0x6d7d
movl $0x8, %edi
callq 0x2100
movq %rax, %r13
movq %r12, (%rax,%rbx,8)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
callq 0x6dd1
movl %eax, %r15d
addq $0x8, %r14
incq %rbx
testl %eax, %eax
jne 0x6d07
movq 0x18(%rsp), %r14
jmp 0x6dbc
xorl %r13d, %r13d
jmp 0x6dbf
xorl %r13d, %r13d
movl %ebx, (%r14)
movq %r13, %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/frontend/lexer.c
// Function: lex_r
enum token_type lex_r(char **saveptr, int *tlen, char **ls, int *ln)
{
	char *str = *saveptr;
	while (isspace(*str))
		*ln += *str == '\n' ? (*ls = str, 1) : 0, str++;

	enum token_type t = t_none;
	int len = 0;
	size_t ntoken_pairs =
	    (size_t) ((sizeof(token_pairs) / sizeof(struct token_pair)));
	/*Match against static tokens */
	for (unsigned int i = 0; i < ntoken_pairs; i++) {
		if (!strncmp
		    (str, token_pairs[i].match, token_pairs[i].len)) {
			len = token_pairs[i].len;
			t = token_pairs[i].type;
			break;
		}
	}
	/*Check for ident, string, numeric, etc */
	if (t == t_none) {
		if (isdigit(*str)) {
			t = t_numeric;
			while (str[len] && isdigit(str[len]))
				len++;
		} else if (isalpha(*str) || *str == '_') {
			t = t_ident;
			while (str[len]
			       && (isalpha(str[len]) || str[len] == '_'))
				len++;
		}
	}

	*saveptr = str + len;
	*tlen = len;
	return t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq (%rdi), %r15
callq 0x2130
movq (%rax), %rsi
movsbq (%r15), %rbx
movzwl (%rsi,%rbx,2), %r14d
btl $0xd, %r14d
jae 0x6e3b
movl (%r12), %ecx
xorl %edx, %edx
cmpb $0xa, %bl
jne 0x6e21
movq %r15, (%r13)
movq (%rax), %rsi
movl $0x1, %edx
addl %edx, %ecx
movl %ecx, (%r12)
movsbq 0x1(%r15), %rbx
incq %r15
movzwl (%rsi,%rbx,2), %r14d
btl $0xd, %r14d
jb 0x6e0e
movq %rsi, (%rsp)
movl $0x10, %r13d
leaq 0x6c74(%rip), %rbp      # 0xdac0
movq -0x8(%r13,%rbp), %rsi
movl (%r13,%rbp), %r12d
movslq %r12d, %rdx
movq %r15, %rdi
callq 0x2050
testl %eax, %eax
je 0x6e77
addq $0x18, %r13
cmpq $0x340, %r13            # imm = 0x340
jne 0x6e4c
xorl %r12d, %r12d
jmp 0x6e84
movl -0x10(%r13,%rbp), %eax
testl %eax, %eax
jne 0x6f0b
movzwl %r14w, %ecx
btl $0xb, %ecx
jb 0x6eda
cmpb $0x5f, %bl
movq (%rsp), %rsi
je 0x6ea1
xorl %eax, %eax
andl $0x400, %ecx            # imm = 0x400
je 0x6f0b
movslq %r12d, %rcx
movb (%r15,%rcx), %dl
movl $0xc, %eax
testb %dl, %dl
je 0x6f0b
addq %r15, %rcx
incq %rcx
cmpb $0x5f, %dl
je 0x6ecc
movsbq %dl, %rdx
movzwl (%rsi,%rdx,2), %edx
andl $0x400, %edx            # imm = 0x400
je 0x6f0b
incl %r12d
movb (%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0x6eb7
jmp 0x6f0b
movslq %r12d, %rcx
movb (%r15,%rcx), %dl
movl $0x1, %eax
testb %dl, %dl
movq (%rsp), %rsi
je 0x6f0b
addq %r15, %rcx
incq %rcx
movsbq %dl, %rdx
testb $0x8, 0x1(%rsi,%rdx,2)
je 0x6f0b
incl %r12d
movb (%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0x6ef4
movslq %r12d, %rcx
addq %rcx, %r15
movq 0x8(%rsp), %rdx
movq %r15, (%rdx)
movq 0x10(%rsp), %rdx
movl %ecx, (%rdx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/parser.c
// Function: parse_primary
struct expr *parse_primary(struct parser *p)
{
	struct token *t;
	if ((t = match(p, t_ident)))
		return value_ident(t->tok);
	if ((t = match(p, t_numeric)))
		return value_num(t->tok);
	if (match(p, t_lparen)) {
		struct expr *e;
		if ((e = parse_expr(p))) {
			if (!match(p, t_rparen))
				syntax_error(p,
					     "Missing right parentheses");
			return e;
		}
	}
	return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0xc, %esi
callq 0x7c4e
testq %rax, %rax
je 0x6f55
movq (%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5d68
movq %rbx, %rdi
movl $0x1, %esi
callq 0x7c4e
testq %rax, %rax
je 0x6f76
movq (%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5def
movq %rbx, %rdi
movl $0x14, %esi
callq 0x7c4e
testq %rax, %rax
je 0x6fbb
movq %rbx, %rdi
callq 0x7142
testq %rax, %rax
je 0x6fbb
movq %rax, %r14
movq %rbx, %rdi
movl $0x15, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x6fbe
leaq 0x2909(%rip), %rsi      # 0x98ba
movq %rbx, %rdi
callq 0x7ca4
jmp 0x6fbe
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/parser.c
// Function: parse_postfix
struct expr *parse_postfix(struct parser *p)
{
	struct token *t;
	struct expr *e;
	if (!(e = parse_primary(p)))
		return NULL;
	while ((t = match(p, t_inc)) || (t = match(p, t_dec))
	       || (t = match(p, t_lbrack)) || (t = match(p, t_lparen))) {
		if (t->type == t_lbrack) {
			struct expr *sub;
			if (!(sub = parse_expr(p)))
				syntax_error(p,
					     "Invalid array subscript expression");
			if (!match(p, t_rbrack))
				syntax_error(p,
					     "Missing right bracket in subscript expression");
			e = binop_init(o_add, e, sub);
			e = unop_init(o_deref, e);
		} else if (t->type == t_lparen) {
			struct expr *call = call_init(e, NULL, 0);
			struct expr *arg;
			while ((arg=parse_asn_expr(p))) {
				call_addarg(CALL(call), arg);
				if (!match(p, t_comma)) break;
			}
			if (!match(p, t_rparen))
				syntax_error(p, "Missing right parentheses in function call");
			e = call;
		} else {
			e = unop_init(t->type ==
				      t_inc ? o_postinc : o_postdec, e);
		}
	}

	return e;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x6f30
testq %rax, %rax
je 0x712d
movq %rax, %r14
leaq 0x2931(%rip), %r15      # 0x9925
leaq 0x28d9(%rip), %r12      # 0x98d4
leaq 0x28f5(%rip), %r13      # 0x98f7
movq %rbx, %rdi
movl $0x22, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x704e
movq %rbx, %rdi
movl $0x23, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x704e
movq %rbx, %rdi
movl $0x16, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x704e
movq %rbx, %rdi
movl $0x14, %esi
callq 0x7c4e
testq %rax, %rax
je 0x7130
movl 0x14(%rax), %eax
cmpl $0x14, %eax
je 0x70ae
cmpl $0x16, %eax
jne 0x710e
movq %rbx, %rdi
callq 0x7142
movq %rax, %rbp
testq %rax, %rax
jne 0x707a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7ca4
movq %rbx, %rdi
movl $0x17, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x7097
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7ca4
xorl %edi, %edi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x5cb2
movl $0x13, %edi
movq %rax, %rsi
jmp 0x7120
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5b5f
movq %rax, %r14
movq %rbx, %rdi
callq 0x7142
testq %rax, %rax
je 0x70e8
movq 0x8(%r14), %rdi
movq %rax, %rsi
callq 0x5bc4
movq %rbx, %rdi
movl $0x29, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x70bd
movq %rbx, %rdi
movl $0x15, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x7002
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7ca4
jmp 0x7002
xorl %ecx, %ecx
cmpl $0x22, %eax
setne %cl
leal 0x14(,%rcx,2), %edi
movq %r14, %rsi
callq 0x5d15
movq %rax, %r14
jmp 0x7002
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %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/frontend/parser.c
// Function: parse_asn_expr
struct expr *parse_asn_expr(struct parser *p)
{
	struct expr *v;
	struct token *t;
	int s = save(p);
	if ((v = parse_unary(p))) {
		if ((t = match(p, t_equal))) {
			struct expr *rhs;
			if ((rhs = parse_asn_expr(p))) {
				return binop_init(dec_oper(t->tok), v,
						  rhs);
			}
			syntax_error(p,
				     "Missing right hand side in assignment operation");
		}
		node_free(v);
	}
	restore(p, s);
	if ((v = parse_or_expr(p)))
		return v;
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x18(%rdi), %ebp
callq 0x71c9
testq %rax, %rax
je 0x71b6
movq %rax, %r14
movq %rbx, %rdi
movl $0x13, %esi
callq 0x7c4e
testq %rax, %rax
je 0x71ae
movq %rax, %r15
movq %rbx, %rdi
callq 0x7142
testq %rax, %rax
je 0x719f
movq %rax, %r12
movq (%r15), %rdi
callq 0x82e1
movl %eax, %edi
movq %r14, %rsi
movq %r12, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5cb2
leaq 0x27ea(%rip), %rsi      # 0x9990
movq %rbx, %rdi
callq 0x7ca4
movq %r14, %rdi
callq 0x57a0
movl %ebp, 0x18(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7585
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/parser.c
// Function: parse_unary
struct expr *parse_unary(struct parser *p)
{
	struct token *t;
	struct expr *u;
	if ((u = parse_postfix(p)))
		return u;
	/*Ambiguous operators, so specify types manually */
	if ((t = match(p, t_inc)) || (t = match(p, t_dec))) {
		if ((u = parse_unary(p))) {
			return unop_init(t->type ==
					 t_inc ? o_preinc : o_predec, u);
		}
		syntax_error(p, "No unary expression after prefix");
	}
	if ((t = match(p, t_asterisk)) || (t = match(p, t_ampersand))) {
		if ((u = parse_unary(p))) {
			return unop_init(t->type ==
					 t_asterisk ? o_deref : o_ref, u);
		}
	}

	return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x6fce
testq %rax, %rax
je 0x71e2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
movl $0x22, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x7206
movq %rbx, %rdi
movl $0x23, %esi
callq 0x7c4e
testq %rax, %rax
je 0x7238
movq %rax, %r14
movq %rbx, %rdi
callq 0x71c9
testq %rax, %rax
je 0x7229
xorl %ecx, %ecx
cmpl $0x22, 0x14(%r14)
setne %cl
leal 0x15(,%rcx,2), %edi
jmp 0x727a
leaq 0x2720(%rip), %rsi      # 0x9950
movq %rbx, %rdi
callq 0x7ca4
movq %rbx, %rdi
movl $0xf, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x725c
movq %rbx, %rdi
movl $0x11, %esi
callq 0x7c4e
testq %rax, %rax
je 0x7289
movq %rax, %r14
movq %rbx, %rdi
callq 0x71c9
testq %rax, %rax
je 0x7289
xorl %edi, %edi
cmpl $0xf, 0x14(%r14)
sete %dil
orl $0x12, %edi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5d15
xorl %eax, %eax
jmp 0x71da
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/parser.c
// Function: parse_mul_expr
struct expr *parse_mul_expr(struct parser *p)
{
	struct expr *v = parse_unary(p);
	if (!v)
		return NULL;
	struct token *t;
	while ((t = match(p, t_asterisk)) || (t = match(p, t_rslash))) {
		struct expr *v2 = parse_unary(p);
		if (!v2)
			syntax_error(p, "Unexpected token in expression");
		v = binop_init(dec_oper(t->tok), v, v2);
	}
	return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x71c9
testq %rax, %rax
je 0x730d
movq %rax, %r14
leaq 0x26c1(%rip), %r15      # 0x9971
movq %rbx, %rdi
movl $0xf, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x72d4
movq %rbx, %rdi
movl $0x12, %esi
callq 0x7c4e
testq %rax, %rax
je 0x7310
movq %rax, %r12
movq %rbx, %rdi
callq 0x71c9
movq %rax, %r13
testq %rax, %rax
jne 0x72f2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7ca4
movq (%r12), %rdi
callq 0x82e1
movl %eax, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x5cb2
movq %rax, %r14
jmp 0x72b0
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/parser.c
// Function: parse_add_expr
struct expr *parse_add_expr(struct parser *p)
{
	struct expr *v = parse_mul_expr(p);
	if (!v)
		return NULL;
	struct token *t;
	while ((t = match(p, t_plus)) || (t = match(p, t_minus))) {
		struct expr *v2 = parse_mul_expr(p);
		if (!v2)
			syntax_error(p, "Unexpected token in expression");
		v = binop_init(dec_oper(t->tok), v, v2);
	}
	return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x7290
testq %rax, %rax
je 0x739a
movq %rax, %r14
leaq 0x2634(%rip), %r15      # 0x9971
movq %rbx, %rdi
movl $0xd, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x7361
movq %rbx, %rdi
movl $0xe, %esi
callq 0x7c4e
testq %rax, %rax
je 0x739d
movq %rax, %r12
movq %rbx, %rdi
callq 0x7290
movq %rax, %r13
testq %rax, %rax
jne 0x737f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7ca4
movq (%r12), %rdi
callq 0x82e1
movl %eax, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x5cb2
movq %rax, %r14
jmp 0x733d
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/parser.c
// Function: parse_rel_expr
struct expr *parse_rel_expr(struct parser *p)
{
	struct expr *v = parse_add_expr(p);
	if (!v)
		return NULL;
	struct token *t;
	while ((t = match(p, t_gt)) || (t = match(p, t_lt))
	       || (t = match(p, t_lte)) || (t = match(p, t_gte))) {
		struct expr *v2 = parse_add_expr(p);
		if (!v2)
			syntax_error(p, "Unexpected token in expression");
		v = binop_init(dec_oper(t->tok), v, v2);
	}
	return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x731d
testq %rax, %rax
je 0x7452
movq %rax, %r14
leaq 0x25a3(%rip), %r15      # 0x9971
movq %rbx, %rdi
movl $0x1e, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x7416
movq %rbx, %rdi
movl $0x1f, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x7416
movq %rbx, %rdi
movl $0x21, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x7416
movq %rbx, %rdi
movl $0x20, %esi
callq 0x7c4e
testq %rax, %rax
je 0x7455
movq %rax, %r12
movq %rbx, %rdi
callq 0x731d
movq %rax, %r13
testq %rax, %rax
jne 0x7434
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7ca4
movq (%r12), %rdi
callq 0x82e1
movl %eax, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x5cb2
movq %rax, %r14
jmp 0x73ce
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/parser.c
// Function: parse_eq_expr
struct expr *parse_eq_expr(struct parser *p)
{
	struct expr *v = parse_rel_expr(p);
	if (!v)
		return NULL;
	struct token *t;
	while ((t = match(p, t_eq)) || (t = match(p, t_neq))) {
		struct expr *v2 = parse_rel_expr(p);
		if (!v2)
			syntax_error(p, "Unexpected token in expression");
		v = binop_init(dec_oper(t->tok), v, v2);
	}
	return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x73aa
testq %rax, %rax
je 0x74df
movq %rax, %r14
leaq 0x24ef(%rip), %r15      # 0x9971
movq %rbx, %rdi
movl $0x1c, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x74a6
movq %rbx, %rdi
movl $0x1d, %esi
callq 0x7c4e
testq %rax, %rax
je 0x74e2
movq %rax, %r12
movq %rbx, %rdi
callq 0x73aa
movq %rax, %r13
testq %rax, %rax
jne 0x74c4
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7ca4
movq (%r12), %rdi
callq 0x82e1
movl %eax, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x5cb2
movq %rax, %r14
jmp 0x7482
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Mithreindeir[P]ewcc/src/frontend/parser.c
// Function: parse_and_expr
struct expr *parse_and_expr(struct parser *p)
{
	struct expr *v = parse_eq_expr(p);
	if (!v)
		return NULL;
	while (match(p, t_ampersand) && match(p, t_ampersand)) {
		struct expr *v2 = parse_eq_expr(p);
		if (!v2)
			syntax_error(p, "Unexpected token in expression");
		v = binop_init(o_and, v, v2);
	}
	return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x7462
testq %rax, %rax
je 0x7574
movq %rax, %rbx
movq %r14, %rdi
movl $0x11, %esi
callq 0x7c4e
testq %rax, %rax
je 0x7576
leaq 0x2451(%rip), %r15      # 0x9971
movq %r14, %rdi
movl $0x11, %esi
callq 0x7c4e
testq %rax, %rax
je 0x7576
movq %r14, %rdi
callq 0x7462
movq %rax, %r12
testq %rax, %rax
jne 0x754d
movq %r14, %rdi
movq %r15, %rsi
callq 0x7ca4
movl $0xa, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x5cb2
movq %rax, %rbx
movq %r14, %rdi
movl $0x11, %esi
callq 0x7c4e
testq %rax, %rax
jne 0x7520
jmp 0x7576
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq