// File: /workspace/github_c_makefile_star2_O1/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:
cmpq $0x0, 0x40(%rdi)
je 0x55238
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r8
movq %rdi, %r14
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %rsi, 0x8(%rsp)
movq 0x38(%r14), %rax
movq 0x50(%r14), %rbx
leaq (%rbx,%r15), %r9
movq (%rax), %rsi
imulq $0x68, (%rbx,%r15), %rax
movq 0x58(%rsi,%rax), %r12
imulq $0x68, 0x8(%rbx,%r15), %rax
cmpq $-0x1, %r12
je 0x55191
movq 0x60(%rsi,%rax), %rcx
cmpq $-0x1, %rcx
je 0x55191
movq %r9, 0x10(%rsp)
imulq $0x68, %rcx, %rax
addq %rax, %rsi
movq 0x20(%rbx,%r15), %rdx
movq 0x28(%rbx,%r15), %rcx
movq %r14, %rdi
leaq 0x28(%rsp), %r8
movq 0x8(%rsp), %r9
callq 0x54c15
movq 0x8(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x5522a
movq 0x38(%r14), %rax
imulq $0x68, %r12, %rsi
addq (%rax), %rsi
movq 0x20(%rbx,%r15), %rdx
movq 0x28(%rbx,%r15), %rcx
movq %r14, %rdi
leaq 0x18(%rsp), %r8
movq 0x8(%rsp), %r9
callq 0x54f0e
movq 0x8(%rsp), %r8
cmpl $0x0, (%r8)
jne 0x5522a
movq 0x30(%rsp), %rax
movq 0x18(%rsp), %rdx
movq 0x38(%r14), %rcx
movq (%rcx), %rsi
andq 0x28(%rsp), %rdx
imulq $0x68, 0x8(%rbx,%r15), %rdi
orq 0x20(%rsi,%rdi), %rdx
imulq $0x68, 0x30(%rbx,%r15), %rcx
movl 0x18(%rsi,%rcx), %ecx
movq %rdx, %r13
andq $-0x2, %r13
cmpl $0x1, %ecx
cmovneq %rdx, %r13
movq 0x20(%rsp), %rdx
movq %r13, 0x20(%rsi,%rdi)
imulq $0x68, (%rbx,%r15), %rdi
orq %r13, 0x20(%rsi,%rdi)
cmpq $0x7fffffff, 0x10(%rbx,%r15) # imm = 0x7FFFFFFF
jne 0x551a2
xorl %r12d, %r12d
jmp 0x551f2
addq %rax, %rsi
movq 0x20(%rsi), %rdx
movq %r14, %rdi
movq %r9, %rsi
xorl %ecx, %ecx
jmp 0x55206
andq %rax, %rdx
movq %rdx, %r12
andq $-0x2, %r12
cmpl $0x2, %ecx
cmovneq %rdx, %r12
movq 0xc0(%r14), %rax
testq %rax, %rax
je 0x551d4
movq 0x28(%rbx,%r15), %rdx
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rcx
callq *0x38(%rax)
jmp 0x551ed
movq %r8, %rdi
movl $0xf, %esi
leaq 0x209f8(%rip), %rdx     # 0x75bdb
movl $0x8ff, %ecx            # imm = 0x8FF
callq 0x145f4
movq 0x8(%rsp), %r8
cmpl $0x0, (%r8)
jne 0x5522a
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x55239
movq 0x8(%rsp), %r8
cmpl $0x0, (%r8)
jne 0x5522a
incq %rbp
addq $0xf8, %r15
cmpq 0x40(%r14), %rbp
jb 0x55090
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq