// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/arm_reg_alloc.c
// Function: subtilis_arm_save_regs
void subtilis_arm_save_regs(subtilis_arm_section_t *arm_s,
			    subtilis_error_t *err)
{
	size_t i;
	size_t start;
	size_t end;
	size_t int_regs_used;
	size_t real_regs_used;
	subtilis_arm_call_site_t *call_site;
	subtilis_regs_used_t regs_used_before;
	subtilis_regs_used_t regs_used_after;
	subtilis_arm_mtran_instr_t *mtran;
	subtilis_arm_op_t *op;

	for (i = 0; i < arm_s->call_site_count; i++) {
		call_site = &arm_s->call_sites[i];
		start = arm_s->op_pool->ops[call_site->ldm_site].next;
		end = arm_s->op_pool->ops[call_site->stm_site].prev;

		if (start == SIZE_MAX || end == SIZE_MAX) {
			op = &arm_s->op_pool->ops[call_site->stm_site];
			mtran = &op->op.instr.operands.mtran;
			prv_update_arg_offsets(arm_s, call_site,
					       mtran->reg_list, 0, err);
			if (err->type != SUBTILIS_ERROR_OK)
				return;
			continue;
		}

		subtilis_arm_regs_used_before(
		    arm_s, &arm_s->op_pool->ops[end], call_site->int_args,
		    call_site->real_args, &regs_used_before, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		subtilis_arm_regs_used_after(
		    arm_s, &arm_s->op_pool->ops[start], call_site->int_args,
		    call_site->real_args, &regs_used_after, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		prv_compute_regs_used(arm_s, call_site, regs_used_before,
				      regs_used_after, &int_regs_used,
				      &real_regs_used, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		prv_update_arg_offsets(arm_s, call_site, int_regs_used,
				       real_regs_used, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x40(%rcx), %rax
jae 0x79ff4
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
imulq $0xf8, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
imulq $0x68, (%rcx), %rcx
addq %rcx, %rax
movq 0x58(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
imulq $0x68, 0x8(%rcx), %rcx
addq %rcx, %rax
movq 0x60(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $-0x1, -0x20(%rbp)
je 0x79e9f
cmpq $-0x1, -0x28(%rbp)
jne 0x79efa
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
imulq $0x68, 0x8(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
addq $0x8, %rax
addq $0x8, %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x68(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x10(%rbp), %r8
xorl %eax, %eax
movl %eax, %ecx
callq 0x7a000
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x79ef5
jmp 0x79ff4
jmp 0x79fe3
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rsi
imulq $0x68, -0x28(%rbp), %rax
addq %rax, %rsi
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x10(%rbp), %r9
leaq -0x50(%rbp), %r8
callq 0x79800
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x79f3c
jmp 0x79ff4
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rsi
imulq $0x68, -0x20(%rbp), %rax
addq %rax, %rsi
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x10(%rbp), %r9
leaq -0x60(%rbp), %r8
callq 0x79c30
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x79f7b
jmp 0x79ff4
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rax
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x58(%rbp), %r9
leaq -0x30(%rbp), %r11
leaq -0x38(%rbp), %r10
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x7a1a0
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x79fbd
jmp 0x79ff4
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %r8
callq 0x7a000
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x79fe1
jmp 0x79ff4
jmp 0x79fe3
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x79e2b
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)