// File: /workspace/github_c_makefile_star2_O2/markdryan[P]subtilis/arch/arm32/arm_sub_section.c
// Function: subtilis_arm_subsections_dump
void subtilis_arm_subsections_dump(subtilis_arm_subsections_t *sss,
				   subtilis_arm_section_t *arm_s)
{
	size_t i;
	size_t j;
	size_t ptr;
	subtilis_arm_ss_t *ss;
	subtilis_arm_op_t *op;
	subtilis_error_t err;

	subtilis_error_init(&err);

	printf("Combined must Save Int: ");
	subtilis_bitset_dump(&sss->int_save);
	printf("Combined Must Save Real: ");
	subtilis_bitset_dump(&sss->real_save);
	printf("\n");

	for (i = 0; i < sss->count; i++) {
		ss = &sss->sub_sections[i];
		printf("\nSubsection %zu:\n", i);
		printf("------------------------------\n");
		printf("Size %zu\n", ss->size);
		printf("Int Inputs: ");
		subtilis_bitset_dump(&ss->int_inputs);
		printf("\n");
		printf("Real Inputs: ");
		subtilis_bitset_dump(&ss->real_inputs);
		printf("\n");
		printf("Links: ");
		for (j = 0; j < ss->num_links; j++) {
			printf("\t%zu\n", ss->links[j].link);
			printf("\tInt Outputs: ");
			subtilis_bitset_dump(&ss->links[j].int_outputs);
			printf("\tReal Outputs: ");
			subtilis_bitset_dump(&ss->links[j].real_outputs);
			printf("\tMust Save Int: ");
			subtilis_bitset_dump(&ss->links[j].int_save);
			printf("\tMust Save Real: ");
			subtilis_bitset_dump(&ss->links[j].real_save);
			op = &arm_s->op_pool->ops[ss->links[j].op];
			printf("\tOP ptr %zu: ", ss->links[j].op);
			if (op->type == SUBTILIS_ARM_OP_LABEL)
				printf("label_%zu\n", op->op.label);
			else
				subtilis_arm_instr_dump(&op->op.instr);
			printf("\n");
		}
		printf("\n");
		printf("------------------------------\n");
		printf("\n");
		ptr = ss->start;
		while (ptr != SIZE_MAX) {
			op = &arm_s->op_pool->ops[ptr];
			if (op->type == SUBTILIS_ARM_OP_LABEL)
				printf("label_%zu\n", op->op.label);
			else
				subtilis_arm_instr_dump(&op->op.instr);
			if (ptr == ss->end)
				break;

			ptr = op->next;
		}
		printf("\n");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc28, %rsp            # imm = 0xC28
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1c(%rsp), %rdi
callq 0x140a4
leaq 0x15e8e(%rip), %rdi     # 0x708f4
xorl %eax, %eax
callq 0x12110
leaq 0x30(%r14), %rdi
callq 0x59d20
leaq 0x15e90(%rip), %rdi     # 0x7090d
xorl %eax, %eax
callq 0x12110
leaq 0x48(%r14), %rdi
callq 0x59d20
pushq $0xa
popq %rdi
callq 0x12030
movq $0x0, (%rsp)
xorl %esi, %esi
movq %r14, 0x8(%rsp)
cmpq 0x8(%r14), %rsi
jae 0x5acb5
movq (%r14), %r13
imulq $0x130, %rsi, %r15      # imm = 0x130
leaq (%r15,%r13), %r14
leaq 0x15e64(%rip), %rdi     # 0x70927
movq %rsi, 0x10(%rsp)
xorl %eax, %eax
callq 0x12110
leaq 0x15ee6(%rip), %rdi     # 0x709bc
callq 0x12080
leaq (%r15,%r13), %r12
addq $0x18, %r12
movq -0x18(%r12), %rsi
leaq 0x15e4a(%rip), %rdi     # 0x70939
xorl %eax, %eax
callq 0x12110
leaq 0x15e46(%rip), %rdi     # 0x70943
xorl %eax, %eax
callq 0x12110
movq %r12, %rdi
callq 0x59d20
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x12030
leaq 0x15e33(%rip), %rdi     # 0x70950
xorl %eax, %eax
callq 0x12110
leaq (%r15,%r13), %rdi
addq $0x30, %rdi
callq 0x59d20
movl %ebp, %edi
callq 0x12030
leaq 0x15e1f(%rip), %rdi     # 0x7095e
xorl %eax, %eax
callq 0x12110
addq (%rsp), %r13
xorl %r15d, %r15d
cmpq 0x128(%r14), %r15
jae 0x5ac2b
leaq 0x48(%r13), %r12
movq 0xa8(%r13), %rsi
leaq 0x15dfa(%rip), %rdi     # 0x70966
xorl %eax, %eax
callq 0x12110
leaq 0x15df2(%rip), %rdi     # 0x7096c
xorl %eax, %eax
callq 0x12110
movq %r12, %rdi
callq 0x59d20
leaq 0x15deb(%rip), %rdi     # 0x7097b
xorl %eax, %eax
callq 0x12110
leaq 0x60(%r13), %rdi
callq 0x59d20
leaq 0x15de4(%rip), %rdi     # 0x7098b
xorl %eax, %eax
callq 0x12110
leaq 0x78(%r13), %rdi
callq 0x59d20
leaq 0x15dde(%rip), %rdi     # 0x7099c
xorl %eax, %eax
callq 0x12110
leaq 0x90(%r13), %rdi
callq 0x59d20
movq 0x38(%rbx), %rax
movq (%rax), %r12
movq 0xb0(%r13), %rsi
imulq $0x68, %rsi, %rbp
leaq 0x15dc4(%rip), %rdi     # 0x709ae
xorl %eax, %eax
callq 0x12110
leaq (%r12,%rbp), %rdi
addq $0x8, %rdi
cmpl $0x1, -0x8(%rdi)
jne 0x5ac12
movq (%rdi), %rsi
leaq 0x15acf(%rip), %rdi     # 0x706d8
xorl %eax, %eax
callq 0x12110
jmp 0x5ac17
callq 0x58abf
pushq $0xa
popq %rdi
callq 0x12030
incq %r15
addq $0x70, %r13
jmp 0x5ab4d
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x12030
leaq 0x15d80(%rip), %rdi     # 0x709bc
callq 0x12080
movl %ebp, %edi
callq 0x12030
leaq 0x8(%r14), %r15
movq (%r15), %r12
cmpq $-0x1, %r12
je 0x5ac93
movq 0x38(%rbx), %rax
movq (%rax), %r15
imulq $0x68, %r12, %r13
leaq (%r15,%r13), %rdi
addq $0x8, %rdi
cmpl $0x1, -0x8(%rdi)
jne 0x5ac81
movq (%rdi), %rsi
leaq 0x15a60(%rip), %rdi     # 0x706d8
xorl %eax, %eax
callq 0x12110
jmp 0x5ac86
callq 0x58abf
addq %r13, %r15
addq $0x58, %r15
cmpq 0x10(%r14), %r12
jne 0x5ac4c
pushq $0xa
popq %rdi
callq 0x12030
movq 0x10(%rsp), %rsi
incq %rsi
addq $0x130, (%rsp)          # imm = 0x130
movq 0x8(%rsp), %r14
jmp 0x5aaa4
addq $0xc28, %rsp            # imm = 0xC28
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop