// File: /workspace/github_c_makefile_star2_O3/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 0x143b4
leaq 0x17cab(%rip), %rdi     # 0x76984
xorl %eax, %eax
callq 0x12110
leaq 0x30(%r14), %rdi
callq 0x5dea2
leaq 0x17cad(%rip), %rdi     # 0x7699d
xorl %eax, %eax
callq 0x12110
leaq 0x48(%r14), %rdi
callq 0x5dea2
movl $0xa, %edi
callq 0x12030
cmpq $0x0, 0x8(%r14)
je 0x5ef4f
leaq 0x17d30(%rip), %r15     # 0x76a4c
movq $0x0, (%rsp)
xorl %esi, %esi
movq %r14, 0x8(%rsp)
movq (%r14), %r14
imulq $0x130, %rsi, %rbp      # imm = 0x130
leaq (%r14,%rbp), %r12
leaq 0x17c77(%rip), %rdi     # 0x769b7
movq %rsi, 0x10(%rsp)
xorl %eax, %eax
callq 0x12110
movq %r15, %rdi
callq 0x12080
leaq (%r14,%rbp), %r13
addq $0x18, %r13
movq -0x18(%r13), %rsi
leaq 0x17c62(%rip), %rdi     # 0x769c9
xorl %eax, %eax
callq 0x12110
leaq 0x17c5e(%rip), %rdi     # 0x769d3
xorl %eax, %eax
callq 0x12110
movq %r13, %rdi
callq 0x5dea2
movl $0xa, %edi
callq 0x12030
leaq 0x17c4b(%rip), %rdi     # 0x769e0
xorl %eax, %eax
callq 0x12110
leaq (%r14,%rbp), %r13
addq $0x30, %r13
movq %r13, %rdi
callq 0x5dea2
movl $0xa, %edi
callq 0x12030
leaq 0x17c31(%rip), %rdi     # 0x769ee
xorl %eax, %eax
callq 0x12110
cmpq $0x0, 0xf8(%r13)
je 0x5eeb4
addq (%rsp), %r14
xorl %ebp, %ebp
leaq 0x48(%r14), %r13
movq 0xa8(%r14), %rsi
leaq 0x17c0c(%rip), %rdi     # 0x769f6
xorl %eax, %eax
callq 0x12110
leaq 0x17c04(%rip), %rdi     # 0x769fc
xorl %eax, %eax
callq 0x12110
movq %r13, %rdi
callq 0x5dea2
leaq 0x17bfd(%rip), %rdi     # 0x76a0b
xorl %eax, %eax
callq 0x12110
leaq 0x60(%r14), %rdi
callq 0x5dea2
leaq 0x17bf6(%rip), %rdi     # 0x76a1b
xorl %eax, %eax
callq 0x12110
leaq 0x78(%r14), %rdi
callq 0x5dea2
leaq 0x17bf0(%rip), %rdi     # 0x76a2c
xorl %eax, %eax
callq 0x12110
leaq 0x90(%r14), %rdi
callq 0x5dea2
movq 0x38(%rbx), %rax
movq (%rax), %r13
movq 0xb0(%r14), %rsi
imulq $0x68, %rsi, %r15
leaq 0x17bd6(%rip), %rdi     # 0x76a3e
xorl %eax, %eax
callq 0x12110
leaq (%r15,%r13), %rdi
addq $0x8, %rdi
cmpl $0x1, -0x8(%rdi)
jne 0x5ee90
movq (%rdi), %rsi
leaq 0x178e1(%rip), %rdi     # 0x76768
xorl %eax, %eax
callq 0x12110
jmp 0x5ee95
callq 0x5cba7
movl $0xa, %edi
callq 0x12030
incq %rbp
addq $0x70, %r14
cmpq 0x128(%r12), %rbp
jb 0x5edd8
movl $0xa, %edi
callq 0x12030
leaq 0x17b87(%rip), %r15     # 0x76a4c
movq %r15, %rdi
callq 0x12080
movl $0xa, %edi
callq 0x12030
movq 0x8(%r12), %r14
cmpq $-0x1, %r14
je 0x5ef26
movq 0x38(%rbx), %rax
movq (%rax), %r13
imulq $0x68, %r14, %rbp
leaq 0x8(,%rbp), %rdi
addq %r13, %rdi
cmpl $0x1, -0x8(%rdi)
jne 0x5ef11
movq (%rdi), %rsi
leaq 0x17860(%rip), %rdi     # 0x76768
xorl %eax, %eax
callq 0x12110
jmp 0x5ef16
callq 0x5cba7
cmpq 0x10(%r12), %r14
je 0x5ef26
addq %rbp, %r13
movq 0x58(%r13), %r14
jmp 0x5eedc
movl $0xa, %edi
callq 0x12030
movq 0x10(%rsp), %rsi
incq %rsi
addq $0x130, (%rsp)          # imm = 0x130
movq 0x8(%rsp), %r14
cmpq 0x8(%r14), %rsi
jb 0x5ed2b
addq $0xc28, %rsp            # imm = 0xC28
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)