// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/arm_encode.c
// Function: prv_check_pool_adj
static void prv_check_pool_adj(subtilis_arm_encode_ud_t *ud, size_t adj,
			       subtilis_error_t *err)
{
	uint32_t word = 0;
	bool pool_needed = false;
	size_t pool_end = (ud->int_const_count * 4) +
			  (ud->real_const_count * 8) + ud->bytes_written + adj;

	/* We need to leave one word for the branch statement. */

	pool_needed =
	    (ud->ldrc_real != SIZE_MAX) && ((pool_end - ud->ldrc_real) >= 1020);
	if (!pool_needed)
		pool_needed = (ud->ldrc_int != SIZE_MAX) &&
			      ((pool_end - ud->ldrc_int) >= 4092);

	if (!pool_needed)
		return;

	/* We add a B instruction to jump over the pool */

	word |= SUBTILIS_ARM_CCODE_AL << 28;
	word |= 0x5 << 25;
	prv_add_back_patch(ud, SUBTILIS_ARM_ENCODE_BP_TYPE_BRANCH,
			   ud->max_labels, ud->bytes_written, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	prv_ensure_code(ud, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	prv_add_word(ud, word, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* Now we write the constants */

	prv_flush_constants(ud, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* Finally, we add the label for the branch */

	prv_encode_label(ud, NULL, ud->max_labels, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	ud->max_labels++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movb $0x0, -0x1d(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
shlq $0x2, %rax
movq -0x8(%rbp), %rcx
movq 0x60(%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
addq 0x30(%rcx), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq $-0x1, 0x88(%rcx)
movb %al, -0x29(%rbp)
je 0x81cb8
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
subq 0x88(%rcx), %rax
cmpq $0x3fc, %rax            # imm = 0x3FC
setae %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
andb $0x1, %al
movb %al, -0x1d(%rbp)
testb $0x1, -0x1d(%rbp)
jne 0x81cfc
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq $-0x1, 0x90(%rcx)
movb %al, -0x2a(%rbp)
je 0x81cf4
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
subq 0x90(%rcx), %rax
cmpq $0xffc, %rax            # imm = 0xFFC
setae %al
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %al
andb $0x1, %al
movb %al, -0x1d(%rbp)
testb $0x1, -0x1d(%rbp)
jne 0x81d07
jmp 0x81dc6
movl -0x1c(%rbp), %eax
orl $0xe0000000, %eax       # imm = 0xE0000000
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
orl $0xa000000, %eax        # imm = 0xA000000
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x18(%rbp), %r8
xorl %esi, %esi
callq 0x81dd0
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x81d47
jmp 0x81dc6
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x81b90
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x81d5f
jmp 0x81dc6
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x81bc0
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x81d7a
jmp 0x81dc6
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x81410
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x81d92
jmp 0x81dc6
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x7e3e0
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x81db6
jmp 0x81dc6
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)