// File: /workspace/github_c_makefile_star2_O3/markdryan[P]subtilis/arch/arm32/arm_reg_alloc.c
// Function: prv_init_arm_reg_ud
static void prv_init_arm_reg_ud(subtilis_arm_reg_ud_t *ud,
				subtilis_arm_section_t *arm_s,
				subtilis_error_t *err)
{
	size_t max_int_regs;
	size_t max_real_regs;

	subtilis_arm_section_max_regs(arm_s, &max_int_regs, &max_real_regs);

	if (!arm_s->fp_if) {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	ud->int_regs = prv_new_regs(
	    max_int_regs, SUBTILIS_ARM_REG_MAX_INT_REGS,
	    SUBTILIS_ARM_INT_VIRT_REG_START, sizeof(int32_t),
	    arm_s->stype->int_regs, 4095, subtilis_arm_insert_stran_spill_imm,
	    subtilis_arm_insert_stran_imm, SUBTILIS_ARM_INSTR_STR,
	    SUBTILIS_ARM_INSTR_LDR, subtilis_arm_is_fixed, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	ud->real_regs = prv_new_regs(
	    max_real_regs, arm_s->fp_if->max_regs, arm_s->fp_if->max_regs,
	    sizeof(double), arm_s->stype->fp_regs, arm_s->fp_if->max_offset,
	    arm_s->fp_if->spill_imm_fn, arm_s->fp_if->stran_imm_fn,
	    arm_s->fp_if->store_type, arm_s->fp_if->load_type,
	    arm_s->fp_if->is_fixed_fn, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		prv_free_regs(ud->int_regs);
		return;
	}

	ud->instr_count = 0;
	ud->arm_s = arm_s;
	ud->ss_terminators = NULL;
	ud->current_ss = 0;
	ud->max_ss = 0;

	subtilis_init_int_dist_walker(&ud->int_regs->dist_walker,
				      &ud->dist_data);
	arm_s->fp_if->init_dist_walker_fn(&ud->real_regs->dist_walker,
					  &ud->dist_data);
	subtilis_init_int_used_walker(&ud->int_regs->used_walker,
				      &ud->dist_data);
	arm_s->fp_if->init_used_walker_fn(&ud->real_regs->used_walker,
					  &ud->dist_data);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x4f0be
cmpq $0x0, 0xc0(%r14)
je 0x539a5
movq 0x10(%rsp), %rdi
movq 0xa0(%r14), %rax
movq 0x158(%rax), %r8
leaq -0x4aa1(%rip), %rax     # 0x4ee50
leaq -0x30d7(%rip), %r10     # 0x50821
leaq -0x3181(%rip), %r11     # 0x5077e
movl $0xb, %esi
movl $0x10, %edx
movl $0x4, %ecx
movl $0xfff, %r9d            # imm = 0xFFF
pushq %r15
pushq %rax
pushq $0x12
pushq $0x13
pushq %r10
pushq %r11
callq 0x5533a
addq $0x30, %rsp
movq %rax, 0x8(%rbx)
cmpl $0x0, (%r15)
jne 0x539be
movq 0x8(%rsp), %rdi
movq 0xa0(%r14), %rax
movq 0xc0(%r14), %rcx
movq (%rcx), %rdx
movq 0x160(%rax), %r8
movl 0x8(%rcx), %r9d
movups 0x58(%rcx), %xmm0
movl 0x18(%rcx), %eax
movl 0x1c(%rcx), %esi
movq 0x68(%rcx), %rcx
subq $0x30, %rsp
movq %r15, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movl %esi, 0x18(%rsp)
movl %eax, 0x10(%rsp)
movups %xmm0, (%rsp)
movl $0x8, %ecx
movq %rdx, %rsi
callq 0x5533a
addq $0x30, %rsp
movq %rax, 0x10(%rbx)
cmpl $0x0, (%r15)
je 0x539ca
movq 0x8(%rbx), %rdi
callq 0x558ba
jmp 0x539be
leaq 0x22284(%rip), %rdx     # 0x75c30
movq %r15, %rdi
movl $0xf, %esi
movl $0x1ea, %ecx            # imm = 0x1EA
callq 0x145a4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movq %r14, 0x18(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
movq %rax, 0x48(%rbx)
movl $0x90, %r15d
movq 0x8(%rbx), %rdi
addq %r15, %rdi
leaq 0x28(%rbx), %r12
movq %r12, %rsi
callq 0x55fd4
movq 0xc0(%r14), %rax
addq 0x10(%rbx), %r15
movq %r15, %rdi
movq %r12, %rsi
callq *0x70(%rax)
movl $0x1b8, %r15d           # imm = 0x1B8
movq 0x8(%rbx), %rdi
addq %r15, %rdi
movq %r12, %rsi
callq 0x5681c
movq 0xc0(%r14), %rax
addq 0x10(%rbx), %r15
movq %r15, %rdi
movq %r12, %rsi
callq *0x78(%rax)
jmp 0x539be