// File: /workspace/github_c_makefile_star2_O2/markdryan[P]subtilis/arch/arm32/arm_reg_alloc.c
// Function: prv_init_sub_section_links
static void prv_init_sub_section_links(subtilis_arm_reg_ud_t *ud,
				       subtilis_arm_ss_t *ss,
				       subtilis_arm_prespilt_offsets_t *offsets,
				       size_t ss_index, subtilis_error_t *err)
{
	subtilis_arm_ss_link_t *link;
	subtilis_arm_op_t *op;
	subtilis_arm_ccode_type_t ccode;

	if (ss->num_links == 0)
		return;

	if (ss->num_links == 1) {
		link = &ss->links[0];
		op = &ud->arm_s->op_pool->ops[link->op];
		ud->ss_terminators[ss_index] = op;
		ccode = SUBTILIS_ARM_CCODE_AL;
		prv_sub_section_int_links(ud, &link->int_save, ccode, offsets,
					  op, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		prv_sub_section_real_links(ud, &link->real_save, ccode, offsets,
					   op, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		return;
	}

	if (ss->num_links != 2) {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	prv_init_two_links(ud, ss, offsets, ss_index, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x128(%rsi), %rax
testq %rax, %rax
je 0x522f9
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
cmpq $0x2, %rax
je 0x520a3
cmpq $0x1, %rax
jne 0x522a1
movq 0x18(%r15), %rax
movq 0x38(%r15), %rcx
movq 0x38(%rax), %rax
imulq $0x68, 0xb0(%r12), %rbp
addq (%rax), %rbp
movq %rbp, (%rcx,%r13,8)
leaq 0x78(%r12), %rsi
pushq $0xe
popq %rdx
movq %r15, %rdi
movq %r14, %rcx
movq %rbp, %r8
movq %rbx, %r9
callq 0x52308
cmpl $0x0, (%rbx)
jne 0x522f9
addq $0x90, %r12
pushq $0xe
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
movq %rbp, %r8
movq %rbx, %r9
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x523dc
leaq 0x18(%rsp), %rdi
callq 0x59a08
movq %rsp, %rdi
callq 0x59a08
leaq 0x30(%rsp), %rdi
callq 0x59a08
movq 0x18(%r15), %rax
movq 0x38(%r15), %rsi
movq 0x38(%rax), %rax
movq (%rax), %rax
imulq $0x68, 0xb0(%r12), %rdx
imulq $0x68, 0x120(%r12), %rcx
addq %rax, %rcx
movq %rcx, (%rsi,%r13,8)
cmpl $0x0, (%rax,%rdx)
jne 0x522c6
addq %rdx, %rax
cmpl $0x16, 0x8(%rax)
jne 0x522c6
cmpl $0x1, (%rcx)
jne 0x522c6
movl 0x10(%rax), %ebp
leaq 0x78(%r12), %rdi
leaq 0xe8(%r12), %rsi
leaq 0x18(%rsp), %rdx
movq %rsp, %rcx
leaq 0x30(%rsp), %r8
movq %rbx, %r9
callq 0x52541
cmpl $0x0, (%rbx)
jne 0x522dd
movq 0x18(%r15), %rax
movq 0x38(%rax), %rax
imulq $0x68, 0xb0(%r12), %r8
addq (%rax), %r8
leaq 0x18(%rsp), %rsi
pushq $0xe
popq %rdx
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r9
callq 0x52308
cmpl $0x0, (%rbx)
jne 0x522dd
movq 0x18(%r15), %rax
movq 0x38(%rax), %rax
imulq $0x68, 0xb0(%r12), %r8
addq (%rax), %r8
movq %rsp, %rsi
movq %r15, %rdi
movl %ebp, %edx
movq %r14, %rcx
movq %rbx, %r9
callq 0x52308
cmpl $0x0, (%rbx)
jne 0x522dd
movq 0x18(%r15), %rax
movq 0x38(%rax), %rax
imulq $0x68, 0x120(%r12), %r8
addq (%rax), %r8
leaq 0x30(%rsp), %rsi
pushq $0xe
popq %rdx
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r9
callq 0x52308
cmpl $0x0, (%rbx)
jne 0x522dd
leaq 0x18(%rsp), %rdi
callq 0x59a16
movq %rsp, %rdi
callq 0x59a16
leaq 0x30(%rsp), %r13
movq %r13, %rdi
callq 0x59a16
leaq 0x90(%r12), %rdi
leaq 0x100(%r12), %rsi
leaq 0x18(%rsp), %rdx
movq %rsp, %rcx
movq %r13, %r8
movq %rbx, %r9
callq 0x52541
cmpl $0x0, (%rbx)
jne 0x522dd
movq 0x18(%r15), %rax
movq 0x38(%rax), %rax
imulq $0x68, 0xb0(%r12), %r8
addq (%rax), %r8
leaq 0x18(%rsp), %rsi
pushq $0xe
popq %rdx
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r9
callq 0x523dc
cmpl $0x0, (%rbx)
jne 0x522dd
movq 0x18(%r15), %rax
movq 0x38(%rax), %rax
imulq $0x68, 0xb0(%r12), %r8
addq (%rax), %r8
movq %rsp, %rsi
movq %r15, %rdi
movl %ebp, %edx
movq %r14, %rcx
movq %rbx, %r9
callq 0x523dc
cmpl $0x0, (%rbx)
jne 0x522dd
movq 0x18(%r15), %rax
movq 0x38(%rax), %rax
imulq $0x68, 0x120(%r12), %r8
addq (%rax), %r8
leaq 0x30(%rsp), %rsi
pushq $0xe
popq %rdx
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r9
callq 0x523dc
jmp 0x522dd
leaq 0x1d903(%rip), %rdx     # 0x6fbab
pushq $0xf
popq %rsi
movq %rbx, %rdi
movl $0x6f1, %ecx            # imm = 0x6F1
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1429e
leaq 0x1d8de(%rip), %rdx     # 0x6fbab
pushq $0xf
popq %rsi
movq %rbx, %rdi
movl $0x690, %ecx            # imm = 0x690
callq 0x1429e
leaq 0x30(%rsp), %rdi
callq 0x59db2
movq %rsp, %rdi
callq 0x59db2
leaq 0x18(%rsp), %rdi
callq 0x59db2
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq