// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x4(%rcx)
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x4(%rcx)
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x4(%rcx)
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
movl $0x3, %edx
callq 0x5920
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movl $0x2, %edx
callq 0x6d10
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x6b70
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x8(%rbp), %rsi
movl $0x3, %edx
callq 0x5920
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rsi
movl $0x3, %edx
callq 0x5920
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x6b70
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movl $0x3, %edx
callq 0x5920
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x6b70
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rdi
addq $0x8, %rdi
movl -0x18(%rbp), %esi
callq 0x6bc0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl -0x1c(%rbp), %esi
callq 0x6bc0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rdi
addq $0x8, %rdi
movl -0x18(%rbp), %esi
callq 0x6bc0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl -0x1c(%rbp), %esi
callq 0x6bc0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x624d
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x6d70
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x6d70
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)