// File: /workspace/github_c_makefile_star2_O2/markdryan[P]subtilis/arch/arm32/arm_sub_section.c
// Function: prv_visit_subsection
static void
prv_visit_subsection(subtilis_arm_subsections_t *sss, subtilis_arm_ss_t *ss,
		     subtilis_arm_ss_link_t *start, subtilis_bitset_t *int_save,
		     subtilis_bitset_t *real_save, subtilis_bitset_t *visited,
		     subtilis_error_t *err)
{
	subtilis_bitset_t int_scratch;
	subtilis_bitset_t real_scratch;
	subtilis_arm_ss_t *next;
	size_t i;
	size_t link;
	size_t label;

	subtilis_bitset_init(&int_scratch);
	subtilis_bitset_init(&real_scratch);

	subtilis_bitset_or(&int_scratch, &start->int_outputs, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_bitset_or(&real_scratch, &start->real_outputs, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_bitset_and(&int_scratch, &ss->int_inputs);
	subtilis_bitset_and(&real_scratch, &ss->real_inputs);
	subtilis_bitset_or(int_save, &int_scratch, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_bitset_or(real_save, &real_scratch, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	for (i = 0; i < ss->num_links; i++) {
		link = ss->links[i].link;
		if (link >= sss->link_count) {
			subtilis_error_set_assertion_failed(err);
			goto cleanup;
		}
		if (subtilis_bitset_isset(visited, link))
			continue;
		subtilis_bitset_set(visited, link, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		label = sss->ss_link_map[link];
		if (label == SIZE_MAX) {
			subtilis_error_set_assertion_failed(err);
			goto cleanup;
		}
		next = &sss->sub_sections[label];
		prv_visit_subsection(sss, next, start, int_save, real_save,
				     visited, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	}

cleanup:

	subtilis_bitset_free(&int_scratch);
	subtilis_bitset_free(&real_scratch);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, 0x8(%rsp)
movq %r8, 0x18(%rsp)
movq %rcx, 0x20(%rsp)
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r15
movq 0x90(%rsp), %rbx
leaq 0x40(%rsp), %r12
movq %r12, %rdi
callq 0x59a08
leaq 0x28(%rsp), %rdi
callq 0x59a08
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x59c39
cmpl $0x0, (%rbx)
jne 0x5aa1b
leaq 0x18(%r13), %rsi
leaq 0x28(%rsp), %rdi
movq %rbx, %rdx
callq 0x59c39
cmpl $0x0, (%rbx)
jne 0x5aa1b
leaq 0x18(%rbp), %rsi
leaq 0x40(%rsp), %r12
movq %r12, %rdi
callq 0x59bd1
leaq 0x30(%rbp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x59bd1
movq 0x20(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x59c39
cmpl $0x0, (%rbx)
jne 0x5aa1b
leaq 0x28(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq %rbx, %rdx
callq 0x59c39
cmpl $0x0, (%rbx)
jne 0x5aa1b
leaq 0xa8(%rbp), %rax
movq %rax, 0x10(%rsp)
xorl %eax, %eax
cmpq 0x128(%rbp), %rax
jae 0x5aa1b
movq %rax, %r14
movq 0x10(%rsp), %rax
movq (%rax), %r12
cmpq 0x18(%r15), %r12
jae 0x5a9fd
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x59b05
testb %al, %al
jne 0x5a9ec
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x59a32
cmpl $0x0, (%rbx)
jne 0x5aa1b
movq 0x28(%r15), %rax
movq (%rax,%r12,8), %rax
cmpq $-0x1, %rax
je 0x5aa04
imulq $0x130, %rax, %rsi      # imm = 0x130
addq (%r15), %rsi
movq %rbx, (%rsp)
movq %r15, %rdi
movq %r13, %rdx
movq 0x20(%rsp), %rcx
movq 0x18(%rsp), %r8
movq 0x8(%rsp), %r9
callq 0x5a896
cmpl $0x0, (%rbx)
jne 0x5aa1b
movq %r14, %rax
incq %rax
addq $0x70, 0x10(%rsp)
jmp 0x5a96d
movl $0x108, %ecx            # imm = 0x108
jmp 0x5aa09
movl $0x112, %ecx            # imm = 0x112
leaq 0x15ec7(%rip), %rdx     # 0x708d7
pushq $0xf
popq %rsi
movq %rbx, %rdi
callq 0x1429e
leaq 0x40(%rsp), %rdi
callq 0x59db2
leaq 0x28(%rsp), %rdi
callq 0x59db2
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq