// File: /workspace/github_c_makefile_star2_O1/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 0x55a77
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
cmpq $0x2, %rax
je 0x55815
cmpq $0x1, %rax
jne 0x55a1b
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
movq %r15, %rdi
movl $0xe, %edx
movq %r14, %rcx
movq %rbp, %r8
movq %rbx, %r9
callq 0x55a86
cmpl $0x0, (%rbx)
jne 0x55a77
addq $0x90, %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0xe, %edx
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 0x55b71
leaq 0x18(%rsp), %rdi
callq 0x5db30
movq %rsp, %rdi
callq 0x5db30
leaq 0x30(%rsp), %rdi
callq 0x5db30
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 0x55a42
addq %rdx, %rax
cmpl $0x16, 0x8(%rax)
jne 0x55a42
cmpl $0x1, (%rcx)
jne 0x55a42
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 0x55cf0
cmpl $0x0, (%rbx)
jne 0x55a5b
movq 0x18(%r15), %rax
movq 0x38(%rax), %rax
imulq $0x68, 0xb0(%r12), %r8
addq (%rax), %r8
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
movl $0xe, %edx
movq %r14, %rcx
movq %rbx, %r9
callq 0x55a86
cmpl $0x0, (%rbx)
jne 0x55a5b
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 0x55a86
cmpl $0x0, (%rbx)
jne 0x55a5b
movq 0x18(%r15), %rax
movq 0x38(%rax), %rax
imulq $0x68, 0x120(%r12), %r8
addq (%rax), %r8
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
movl $0xe, %edx
movq %r14, %rcx
movq %rbx, %r9
callq 0x55a86
cmpl $0x0, (%rbx)
jne 0x55a5b
leaq 0x18(%rsp), %rdi
callq 0x5db41
movq %rsp, %rdi
callq 0x5db41
leaq 0x30(%rsp), %r13
movq %r13, %rdi
callq 0x5db41
leaq 0x90(%r12), %rdi
leaq 0x100(%r12), %rsi
leaq 0x18(%rsp), %rdx
movq %rsp, %rcx
movq %r13, %r8
movq %rbx, %r9
callq 0x55cf0
cmpl $0x0, (%rbx)
jne 0x55a5b
movq 0x18(%r15), %rax
movq 0x38(%rax), %rax
imulq $0x68, 0xb0(%r12), %r8
addq (%rax), %r8
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
movl $0xe, %edx
movq %r14, %rcx
movq %rbx, %r9
callq 0x55b71
cmpl $0x0, (%rbx)
jne 0x55a5b
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 0x55b71
cmpl $0x0, (%rbx)
jne 0x55a5b
movq 0x18(%r15), %rax
movq 0x38(%rax), %rax
imulq $0x68, 0x120(%r12), %r8
addq (%rax), %r8
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
movl $0xe, %edx
movq %r14, %rcx
movq %rbx, %r9
callq 0x55b71
jmp 0x55a5b
leaq 0x201b9(%rip), %rdx     # 0x75bdb
movq %rbx, %rdi
movl $0xf, %esi
movl $0x6f1, %ecx            # imm = 0x6F1
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145f4
leaq 0x20192(%rip), %rdx     # 0x75bdb
movq %rbx, %rdi
movl $0xf, %esi
movl $0x690, %ecx            # imm = 0x690
callq 0x145f4
leaq 0x30(%rsp), %rdi
callq 0x5df40
movq %rsp, %rdi
callq 0x5df40
leaq 0x18(%rsp), %rdi
callq 0x5df40
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq