LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/reference_type.c
// Function: subtilis_reference_type_memcpy_dest
void subtilis_reference_type_memcpy_dest(subtilis_parser_t *p, size_t dest_reg,
					 size_t src_reg, size_t size_reg,
					 subtilis_error_t *err)
{
	subtilis_ir_arg_t *args;
	char *name = NULL;
	static const char memcpy[] = "_memcpy";

	name = malloc(sizeof(memcpy));
	if (!name) {
		subtilis_error_set_oom(err);
		return;
	}
	strcpy(name, memcpy);

	args = malloc(sizeof(*args) * 3);
	if (!args) {
		free(name);
		subtilis_error_set_oom(err);
		return;
	}

	args[0].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[0].reg = dest_reg;
	args[1].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[1].reg = src_reg;
	args[2].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[2].reg = size_reg;

	(void)subtilis_exp_add_call(p, name, SUBTILIS_BUILTINS_MEMCPY, NULL,
				    args, &subtilis_type_void, 3, true, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
movl $0x8, %edi
callq 0x121d0
testq %rax, %rax
je 0x4d8c3
movq %rax, %r12
movabsq $0x7970636d656d5f, %rax # imm = 0x7970636D656D5F
movq %rax, (%r12)
movl $0x48, %edi
callq 0x121d0
testq %rax, %rax
je 0x4d8d9
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %rbp, 0x8(%rax)
movl %ecx, 0x18(%rax)
movq %r13, 0x20(%rax)
movl %ecx, 0x30(%rax)
movq %r15, 0x38(%rax)
subq $0x8, %rsp
leaq 0x27436(%rip), %r9      # 0x74cd0
movq %r14, %rdi
movq %r12, %rsi
movl $0x2, %edx
xorl %ecx, %ecx
movq %rax, %r8
pushq %rbx
pushq $0x1
pushq $0x3
callq 0x2b507
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x281ec(%rip), %rdx     # 0x75ab6
movq %rbx, %rdi
movl $0x1, %esi
movl $0x214, %ecx            # imm = 0x214
jmp 0x4d8f5
movq %r12, %rdi
callq 0x122c0
leaq 0x281ce(%rip), %rdx     # 0x75ab6
movq %rbx, %rdi
movl $0x1, %esi
movl $0x21c, %ecx            # imm = 0x21C
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145f4
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/reference_type.c
// Function: subtilis_reference_type_raw_alloc
size_t subtilis_reference_type_raw_alloc(subtilis_parser_t *p, size_t size_reg,
					 subtilis_error_t *err)
{
	subtilis_ir_operand_t op;
	subtilis_exp_t *e;
	subtilis_ir_operand_t size_op;

	size_op.reg = size_reg;

	if (p->backend.caps & SUBTILIS_BACKEND_HAVE_ALLOC) {
		op.reg = subtilis_ir_section_add_instr2(
		    p->current, SUBTILIS_OP_INSTR_ALLOC, size_op, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return SIZE_MAX;

		subtilis_exp_handle_errors(p, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return SIZE_MAX;
	} else {
		e = subtilis_parser_call_1_arg_fn(
		    p, "_alloc", size_reg, SUBTILIS_BUILTINS_ALLOC,
		    SUBTILIS_IR_REG_TYPE_INTEGER, &subtilis_type_integer, true,
		    err);
		if (err->type != SUBTILIS_ERROR_OK)
			return SIZE_MAX;
		op.reg = e->exp.ir_op.reg;
		subtilis_exp_delete(e);
	}

	return op.reg;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %r15
testb $0x10, 0x8(%rdi)
jne 0x4db2a
leaq 0x27709(%rip), %rsi     # 0x751f8
leaq 0x26e02(%rip), %r9      # 0x748f8
movq %r15, %rdi
movl $0x6, %ecx
xorl %r8d, %r8d
pushq %rbx
pushq $0x1
callq 0x1e9b2
addq $0x10, %rsp
movq $-0x1, %r14
cmpl $0x0, (%rbx)
jne 0x4db61
movq 0x148(%rax), %r14
movq %rax, %rdi
callq 0x2b4c3
jmp 0x4db61
movq 0x48(%r15), %rdi
movl $0x76, %esi
movq %rbx, %rcx
callq 0x2c189
movq $-0x1, %r14
cmpl $0x0, (%rbx)
jne 0x4db61
movq %rax, %r12
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2b37c
xorl %r14d, %r14d
cmpl (%rbx), %r14d
sbbq %r14, %r14
orq %r12, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/reference_type.c
// Function: subtilis_reference_type_alloc
size_t subtilis_reference_type_alloc(subtilis_parser_t *p,
				     const subtilis_type_t *type, size_t loc,
				     size_t store_reg, size_t size_reg,
				     bool push, subtilis_error_t *err)
{
	subtilis_ir_operand_t op;
	subtilis_ir_operand_t op1;
	subtilis_ir_operand_t size_op;
	subtilis_ir_operand_t store_op;

	size_op.reg = size_reg;
	store_op.reg = store_reg;

	op1.integer = loc + SUBTIILIS_REFERENCE_SIZE_OFF;
	subtilis_ir_section_add_instr_reg(p->current,
					  SUBTILIS_OP_INSTR_STOREO_I32, size_op,
					  store_op, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	subtilis_reference_type_set_orig_size(p, store_reg, loc, size_op.reg,
					      err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	op1.integer = loc + SUBTIILIS_REFERENCE_DATA_OFF;
	op.reg = subtilis_reference_type_raw_alloc(p, size_reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	if (push) {
		subtilis_reference_type_push_reference(p, type, store_reg, loc,
						       err);
		if (err->type != SUBTILIS_ERROR_OK)
			return SIZE_MAX;
	}

	subtilis_ir_section_add_instr_reg(
	    p->current, SUBTILIS_OP_INSTR_STOREO_I32, op, store_op, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	op1.integer = loc + SUBTIILIS_REFERENCE_HEAP_OFF;
	subtilis_ir_section_add_instr_reg(
	    p->current, SUBTILIS_OP_INSTR_STOREO_I32, op, store_op, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return SIZE_MAX;

	return op.reg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0xc(%rsp)
movq %r8, %rbp
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r13
movq 0x50(%rsp), %rbx
movq 0x48(%rdi), %rdi
movl %r15d, %r8d
movl $0x17, %esi
movq %rbp, %rdx
movq %rbx, %r9
callq 0x2c0c2
movq $-0x1, %rax
cmpl $0x0, (%rbx)
jne 0x4de77
movq %r14, 0x10(%rsp)
leal 0xc(%r15), %r8d
movq 0x48(%r13), %rdi
movl $0x17, %esi
movq %rbp, %rdx
movq %r12, %rcx
movq %rbx, %r9
callq 0x2c0c2
cmpl $0x0, (%rbx)
jne 0x4de70
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x4dad1
cmpl $0x0, (%rbx)
je 0x4de86
movq $-0x1, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbp
cmpb $0x0, 0xc(%rsp)
je 0x4deab
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %rbx, %r8
callq 0x4d4ea
cmpl $0x0, (%rbx)
jne 0x4de70
leaq 0x4(%r15), %rax
movq 0x48(%r13), %rdi
movl %eax, %r8d
movl $0x17, %esi
movq %rbp, %rdx
movq %r12, %rcx
movq %rbx, %r9
callq 0x2c0c2
cmpl $0x0, (%rbx)
movq $-0x1, %rax
jne 0x4de77
addl $0x8, %r15d
movq 0x48(%r13), %rdi
movl $0x17, %esi
movq %rbp, %rdx
movq %r12, %rcx
movq %r15, %r8
movq %rbx, %r9
callq 0x2c0c2
xorl %eax, %eax
cmpl (%rbx), %eax
sbbq %rax, %rax
orq %rbp, %rax
jmp 0x4de77
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/reference_type.c
// Function: subtilis_reference_type_pop_and_deref
void subtilis_reference_type_pop_and_deref(subtilis_parser_t *p,
					   subtilis_error_t *err)
{
	size_t reg;
	subtilis_ir_operand_t op2;
	subtilis_ir_operand_t dest;
	size_t fn_addr;
	subtilis_ir_arg_t *ir_args = malloc(sizeof(*ir_args));

	if (!ir_args) {
		subtilis_error_set_oom(err);
		return;
	}

	fn_addr = subtilis_ir_section_add_instr1(
	    p->current, SUBTILIS_OP_INSTR_POP_I32, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	reg = subtilis_ir_section_add_instr1(p->current,
					     SUBTILIS_OP_INSTR_POP_I32, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	ir_args[0].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	ir_args[0].reg = reg;
	ir_args[0].nop = SIZE_MAX;

	subtilis_ir_section_add_call_ptr(p->current, 1, ir_args, fn_addr, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (p->current->cleanup_stack == SIZE_MAX) {
		subtilis_error_set_assertion_failed(err);
		return;
	}

	/*
	 * TODO: The part of the register allocator that preserves
	 * live registers between basic blocks can't handle the case
	 * when an instruction uses the same register for both source
	 * and destination.  Ultimately, all that code is going to dissapear
	 * when we have a global register allocator, so for now we're just
	 * going to live with it.
	 */

	/*
	 * H'mm, I think I may have fixed this so
	 * this comment may no longer be valid.
	 */

	op2.integer = 1;
	dest.reg = p->current->cleanup_stack;
	op2.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_SUBI_I32, dest, op2, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_ir_section_add_instr_no_reg2(p->current, SUBTILIS_OP_INSTR_MOV,
					      dest, op2, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x18, %edi
callq 0x121d0
testq %rax, %rax
je 0x4e8c7
movq %rax, %r15
movq 0x48(%r14), %rdi
movl $0x7c, %esi
movq %rbx, %rdx
callq 0x2c193
cmpl $0x0, (%rbx)
jne 0x4e8bb
movq %rax, %r12
movq 0x48(%r14), %rdi
movl $0x7c, %esi
movq %rbx, %rdx
callq 0x2c193
cmpl $0x0, (%rbx)
jne 0x4e8bb
movl $0x0, (%r15)
movq %rax, 0x8(%r15)
movq $-0x1, 0x10(%r15)
movq 0x48(%r14), %rdi
movl $0x1, %esi
movq %r15, %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x2d3a8
cmpl $0x0, (%rbx)
je 0x4e8eb
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x271e8(%rip), %rdx     # 0x75ab6
movq %rbx, %rdi
movl $0x1, %esi
movl $0x540, %ecx            # imm = 0x540
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x145f4
movq 0x48(%r14), %rdi
movq 0xb8(%rdi), %r15
cmpq $-0x1, %r15
je 0x4e938
movl $0x1, %ecx
movl $0xb, %esi
movq %r15, %rdx
movq %rbx, %r8
callq 0x2c00f
cmpl $0x0, (%rbx)
jne 0x4e8bb
movq 0x48(%r14), %rdi
movl $0x1d, %esi
movq %r15, %rdx
movq %rax, %rcx
movq %rbx, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2c1ac
leaq 0x27177(%rip), %rdx     # 0x75ab6
movq %rbx, %rdi
movl $0xf, %esi
movl $0x557, %ecx            # imm = 0x557
jmp 0x4e8db
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/frontend/reference_type.c
// Function: subtilis_reference_deallocate_refs
void subtilis_reference_deallocate_refs(subtilis_parser_t *p,
					subtilis_ir_operand_t load_reg,
					subtilis_symbol_table_t *st,
					size_t level, subtilis_error_t *err)
{
	size_t i;
	const subtilis_symbol_t *s;
	subtilis_symbol_level_t *l = &st->levels[level];

	for (i = 0; i < l->size; i++) {
		s = l->symbols[i];
		if (!subtilis_type_if_is_reference(&s->t) || s->no_rc)
			continue;

		subtilis_reference_type_pop_and_deref(p, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	}
}

// Assembly:
leaq (%rcx,%rcx,2), %rax
cmpq $0x0, (%rdx,%rax,8)
je 0x4e9af
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rdi, %r14
leaq (%rdx,%rax,8), %r15
xorl %r12d, %r12d
movq 0x10(%r15), %rax
movq (%rax,%r12,8), %r13
leaq 0x8(%r13), %rdi
callq 0x37833
testb %al, %al
je 0x4e99e
cmpb $0x0, 0x2a9(%r13)
jne 0x4e99e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4e83d
cmpl $0x0, (%rbx)
jne 0x4e9a6
incq %r12
cmpq (%r15), %r12
jb 0x4e96f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_op_pool_new
subtilis_arm_op_pool_t *subtilis_arm_op_pool_new(subtilis_error_t *err)
{
	subtilis_arm_op_pool_t *pool = malloc(sizeof(subtilis_arm_op_pool_t));

	if (!pool) {
		subtilis_error_set_oom(err);
		return NULL;
	}
	pool->len = 0;
	pool->max_len = 0;
	pool->ops = NULL;
	return pool;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x18, %edi
callq 0x121d0
testq %rax, %rax
je 0x4eebf
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
popq %rbx
retq
leaq 0x26cd2(%rip), %rdx     # 0x75b98
movq %rbx, %rdi
movl $0x1, %esi
movl $0x37, %ecx
callq 0x145f4
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_op_pool_delete
void subtilis_arm_op_pool_delete(subtilis_arm_op_pool_t *pool)
{
	size_t i;

	if (pool) {
		for (i = 0; i < pool->len; i++)
			if (pool->ops[i].type == SUBTILIS_ARM_OP_STRING)
				free(pool->ops[i].op.str);
		free(pool->ops);
		free(pool);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x4ef38
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x4ef23
movl $0x8, %r14d
xorl %r15d, %r15d
movq (%rbx), %rax
cmpl $0x8, -0x8(%rax,%r14)
jne 0x4ef16
movq (%rax,%r14), %rdi
callq 0x122c0
incq %r15
addq $0x68, %r14
cmpq 0x8(%rbx), %r15
jb 0x4ef02
movq (%rbx), %rdi
callq 0x122c0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x122c0
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_op_pool_alloc
size_t subtilis_arm_op_pool_alloc(subtilis_arm_op_pool_t *pool,
				  subtilis_error_t *err)
{
	subtilis_arm_op_t *new_ops;
	size_t new_max;
	size_t new_op;

	new_op = pool->len;
	if (new_op < pool->max_len) {
		pool->len++;
		return new_op;
	}

	if (pool->max_len > SIZE_MAX - SUBTILIS_CONFIG_PROGRAM_GRAN) {
		subtilis_error_set_oom(err);
		return SIZE_MAX;
	}

	new_max = pool->max_len + SUBTILIS_CONFIG_PROGRAM_GRAN;
	new_ops = realloc(pool->ops, new_max * sizeof(subtilis_arm_op_t));
	if (!new_ops) {
		subtilis_error_set_oom(err);
		return SIZE_MAX;
	}
	pool->max_len = new_max;
	pool->ops = new_ops;
	pool->len++;
	return new_op;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x8(%rdi), %rbx
movq 0x10(%rdi), %r12
cmpq %r12, %rbx
jae 0x4ef5b
leaq 0x1(%rbx), %rax
movq %rax, 0x8(%r15)
jmp 0x4efc2
movq %rsi, %r14
cmpq $-0x1000, %r12          # imm = 0xF000
jb 0x4ef7d
leaq 0x26c2a(%rip), %rdx     # 0x75b98
movq %r14, %rdi
movl $0x1, %esi
movl $0x5d, %ecx
jmp 0x4efb6
addq $0x1000, %r12           # imm = 0x1000
movq (%r15), %rdi
imulq $0x68, %r12, %rsi
callq 0x12210
testq %rax, %rax
je 0x4efa2
movq %r12, 0x10(%r15)
movq %rax, (%r15)
incq 0x8(%r15)
jmp 0x4efc2
leaq 0x26bef(%rip), %rdx     # 0x75b98
movq %r14, %rdi
movl $0x1, %esi
movl $0x64, %ecx
callq 0x145f4
movq $-0x1, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_section_new
subtilis_arm_section_t *subtilis_arm_section_new(subtilis_arm_op_pool_t *pool,
						 subtilis_type_section_t *stype,
						 size_t reg_counter,
						 size_t freg_counter,
						 size_t label_counter,
						 size_t locals,
						 const subtilis_settings_t *set,
						 const subtilis_arm_fp_if_t *fp,
						 int32_t start_address,
						 subtilis_error_t *err)
/* clang-format on */

{
	subtilis_arm_section_t *s = calloc(1, sizeof(*s));

	if (!s) {
		subtilis_error_set_oom(err);
		return NULL;
	}
	s->stype = subtilis_type_section_dup(stype);
	s->reg_counter = reg_counter;
	s->freg_counter = freg_counter;
	s->label_counter = label_counter;
	s->first_op = SIZE_MAX;
	s->last_op = SIZE_MAX;
	s->locals = locals;
	s->op_pool = pool;
	s->settings = set;
	s->fp_if = fp;
	s->no_cleanup_label = s->label_counter++;
	s->start_address = start_address;

	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %r12
movl $0x1, %edi
movl $0xc8, %esi
callq 0x12150
testq %rax, %rax
je 0x4f0d0
movq %rax, %r14
movq %r15, %rdi
callq 0x2fe72
movq %rax, 0xa0(%r14)
movq %rbp, (%r14)
movq %r13, 0x8(%r14)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x20(%r14)
movq (%rsp), %rax
movq %rax, 0x30(%r14)
movq %r12, 0x38(%r14)
movq 0x40(%rsp), %rax
movq %rax, 0xa8(%r14)
movq 0x48(%rsp), %rax
movq %rax, 0xc0(%r14)
leaq 0x1(%rbx), %rax
movq %rax, 0x10(%r14)
movq %rbx, 0xb0(%r14)
movl 0x50(%rsp), %eax
movl %eax, 0xb8(%r14)
jmp 0x4f0ee
movq 0x58(%rsp), %rdi
leaq 0x26abc(%rip), %rdx     # 0x75b98
movl $0x1, %esi
movl $0x88, %ecx
callq 0x145f4
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_section_max_regs
void subtilis_arm_section_max_regs(subtilis_arm_section_t *s, size_t *int_regs,
				   size_t *real_regs)
{
	*int_regs = subtilis_arm_ir_to_arm_reg(s->reg_counter);
	if (*int_regs < SUBTILIS_ARM_INT_VIRT_REG_START)
		*int_regs = SUBTILIS_ARM_INT_VIRT_REG_START;
	*real_regs = subtilis_arm_ir_to_real_reg(s, s->freg_counter);
}

// Assembly:
movq (%rdi), %rax
leaq -0x1(%rax), %rcx
cmpq $0x3, %rcx
jae 0x4f11b
leaq 0x26a6c(%rip), %rcx     # 0x75b80
movq -0x8(%rcx,%rax,8), %rax
jmp 0x4f11f
addq $0xc, %rax
cmpq $0x11, %rax
movl $0x10, %ecx
cmovaeq %rax, %rcx
movq %rcx, (%rsi)
movq 0xc0(%rdi), %rax
movq (%rax), %rax
addq 0x8(%rdi), %rax
movq %rax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_section_delete
void subtilis_arm_section_delete(subtilis_arm_section_t *s)
{
	if (!s)
		return;

	subtilis_type_section_delete(s->stype);
	free(s->ret_sites);
	free(s->call_sites);
	prv_free_constants(&s->constants);
	free(s);
}

// Assembly:
testq %rdi, %rdi
je 0x4f186
pushq %rbx
movq %rdi, %rbx
movq 0xa0(%rdi), %rdi
callq 0x2f7d2
movq 0x98(%rbx), %rdi
callq 0x122c0
movq 0x50(%rbx), %rdi
callq 0x122c0
movq 0x58(%rbx), %rdi
callq 0x122c0
movq 0x70(%rbx), %rdi
callq 0x122c0
movq %rbx, %rdi
popq %rbx
jmp 0x122c0
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_section_add_call_site
void subtilis_arm_section_add_call_site(subtilis_arm_section_t *s,
					size_t stm_site, size_t ldm_site,
					size_t stf_site, size_t ldf_site,
					size_t int_args, size_t real_args,
					size_t op, size_t *int_arg_ops,
					size_t *real_arg_ops,
					subtilis_error_t *err)
/* clang-format on */

{
	size_t new_max;
	subtilis_arm_call_site_t *site;
	subtilis_arm_call_site_t *new_call_sites;
	size_t i;

	if (s->call_site_count == s->max_call_site_count) {
		new_max = s->call_site_count + SUBTILIS_CONFIG_PROC_GRAN;
		new_call_sites =
		    realloc(s->call_sites, new_max * sizeof(*new_call_sites));
		if (!new_call_sites) {
			subtilis_error_set_oom(err);
			return;
		}
		s->call_sites = new_call_sites;
		s->max_call_site_count = new_max;
	}
	site = &s->call_sites[s->call_site_count++];
	site->stm_site = stm_site;
	site->ldm_site = ldm_site;
	site->stf_site = stf_site;
	site->ldf_site = ldf_site;
	site->int_args = int_args;
	site->real_args = real_args;
	site->call_site = op;

	if (int_args > 4)
		for (i = 0; i < int_args - 4; i++)
			site->int_arg_ops[i] = int_arg_ops[i];

	if (real_args > 4)
		for (i = 0; i < real_args - 4; i++)
			site->real_arg_ops[i] = real_arg_ops[i];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %rdi, %rbp
movq 0x88(%rsp), %r14
movq 0x80(%rsp), %r12
movq 0x78(%rsp), %r9
movq 0x70(%rsp), %r15
movq 0x40(%rdi), %r13
cmpq 0x48(%rdi), %r13
jne 0x4f223
movq %rsi, 0x10(%rsp)
movq %r9, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x30(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x40, %r13
movq 0x50(%rbp), %rdi
imulq $0xf8, %r13, %rsi
callq 0x12210
testq %rax, %rax
je 0x4f2b0
movq %rax, 0x50(%rbp)
movq %r13, 0x48(%rbp)
movq 0x30(%rsp), %r8
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %r9
movq 0x10(%rsp), %rsi
movq 0x40(%rbp), %rax
movq 0x50(%rbp), %r10
leaq 0x1(%rax), %rdi
movq %rdi, 0x40(%rbp)
imulq $0xf8, %rax, %rdi
leaq (%r10,%rdi), %rax
movq %rsi, 0x8(%r10,%rdi)
movq %rdx, (%r10,%rdi)
movq %rcx, 0x18(%r10,%rdi)
movq %r8, 0x10(%r10,%rdi)
movq %rbx, 0x20(%r10,%rdi)
movq %r15, 0x28(%r10,%rdi)
movq %r9, 0x30(%r10,%rdi)
cmpq $0x5, %rbx
jb 0x4f27f
addq $-0x4, %rbx
je 0x4f27f
xorl %ecx, %ecx
movq (%r12,%rcx,8), %rdx
movq %rdx, 0x38(%rax,%rcx,8)
incq %rcx
cmpq %rcx, %rbx
jne 0x4f26e
cmpq $0x5, %r15
jb 0x4f2a1
addq $-0x4, %r15
je 0x4f2a1
xorl %ecx, %ecx
movq (%r14,%rcx,8), %rdx
movq %rdx, 0x98(%rax,%rcx,8)
incq %rcx
cmpq %rcx, %r15
jne 0x4f28d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x268e1(%rip), %rdx     # 0x75b98
movq 0x8(%rsp), %rdi
movl $0x1, %esi
movl $0xd3, %ecx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145f4
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_section_add_ret_site
void subtilis_arm_section_add_ret_site(subtilis_arm_section_t *s, size_t op,
				       subtilis_error_t *err)
{
	size_t new_max;
	size_t *new_ret_sites;

	if (s->ret_site_count == s->max_ret_site_count) {
		new_max = s->ret_site_count + SUBTILIS_CONFIG_PROC_GRAN;
		new_ret_sites =
		    realloc(s->ret_sites, new_max * sizeof(*new_ret_sites));
		if (!new_ret_sites) {
			subtilis_error_set_oom(err);
			return;
		}
		s->ret_sites = new_ret_sites;
		s->max_ret_site_count = new_max;
	}
	s->ret_sites[s->ret_site_count++] = op;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x88(%rdi), %r12
cmpq 0x90(%rdi), %r12
jne 0x4f325
movq %rdx, %r15
movq 0x98(%r14), %rdi
leaq 0x200(,%r12,8), %rsi
callq 0x12210
testq %rax, %rax
je 0x4f34e
addq $0x40, %r12
movq %rax, 0x98(%r14)
movq %r12, 0x90(%r14)
movq 0x88(%r14), %rax
movq 0x98(%r14), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x88(%r14)
movq %rbx, (%rcx,%rax,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x26843(%rip), %rdx     # 0x75b98
movq %r15, %rdi
movl $0x1, %esi
movl $0xf6, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x145f4
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_prog_new
subtilis_arm_prog_t *subtilis_arm_prog_new(size_t max_sections,
					   subtilis_arm_op_pool_t *op_pool,
					   subtilis_string_pool_t *string_pool,
					   subtilis_constant_pool_t *cnst_pool,
					   const subtilis_settings_t *settings,
					   const subtilis_arm_fp_if_t *fp_if,
					   int32_t start_address,
					   subtilis_error_t *err)
/* clang-format on */

{
	subtilis_arm_prog_t *arm_p = malloc(sizeof(*arm_p));

	if (!arm_p) {
		subtilis_error_set_oom(err);
		return NULL;
	}

	arm_p->sections = malloc(sizeof(*arm_p->sections) * max_sections);
	if (!arm_p->sections) {
		subtilis_error_set_oom(err);
		goto cleanup;
	}

	arm_p->num_sections = 0;
	arm_p->max_sections = max_sections;
	arm_p->op_pool = op_pool;
	arm_p->string_pool = subtilis_string_pool_clone(string_pool);
	arm_p->constant_pool = subtilis_constant_pool_clone(cnst_pool);

	arm_p->settings = settings;
	arm_p->fp_if = fp_if;
	arm_p->start_address = start_address;

	return arm_p;

cleanup:
	subtilis_arm_prog_delete(arm_p);
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
movq 0x58(%rsp), %r15
movl $0x48, %edi
callq 0x121d0
testq %rax, %rax
je 0x4f407
movq %rax, %rbx
leaq (,%r14,8), %rdi
callq 0x121d0
movq %rax, (%rbx)
testq %rax, %rax
je 0x4f422
movl 0x50(%rsp), %r15d
movq $0x0, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movq %rbp, 0x28(%rbx)
movq %r13, %rdi
callq 0x2f20e
movq %rax, 0x18(%rbx)
movq %r12, %rdi
callq 0x2ef47
movq %rax, 0x20(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rbx)
movl %r15d, 0x38(%rbx)
jmp 0x4f447
leaq 0x2678a(%rip), %rdx     # 0x75b98
movq %r15, %rdi
movl $0x1, %esi
movl $0x10e, %ecx            # imm = 0x10E
callq 0x145f4
jmp 0x4f445
leaq 0x2676f(%rip), %rdx     # 0x75b98
movq 0x58(%rsp), %rdi
movl $0x1, %esi
movl $0x114, %ecx            # imm = 0x114
callq 0x145f4
movq %rbx, %rdi
callq 0x4f459
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_prog_delete
void subtilis_arm_prog_delete(subtilis_arm_prog_t *prog)
{
	size_t i;

	if (!prog)
		return;

	if (prog->sections) {
		for (i = 0; i < prog->num_sections; i++)
			subtilis_arm_section_delete(prog->sections[i]);
		free(prog->sections);
	}
	subtilis_constant_pool_delete(prog->constant_pool);
	subtilis_string_pool_delete(prog->string_pool);
	free(prog);
}

// Assembly:
testq %rdi, %rdi
je 0x4f4b3
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x4f492
cmpq $0x0, 0x8(%rbx)
je 0x4f48a
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x4f141
incq %r14
cmpq 0x8(%rbx), %r14
jb 0x4f475
movq (%rbx), %rdi
callq 0x122c0
movq 0x20(%rbx), %rdi
callq 0x2ef4f
movq 0x18(%rbx), %rdi
callq 0x2f34d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x122c0
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_prog_section_new
subtilis_arm_section_t *
subtilis_arm_prog_section_new(subtilis_arm_prog_t *prog,
			      subtilis_type_section_t *stype,
			      size_t reg_counter, size_t freg_counter,
			      size_t label_counter, size_t locals,
			      subtilis_error_t *err)
/* clang-format on */
{
	subtilis_arm_section_t *arm_s;

	if (prog->num_sections == prog->max_sections) {
		subtilis_error_set_assertion_failed(err);
		return NULL;
	}

	arm_s = subtilis_arm_section_new(
	    prog->op_pool, stype, reg_counter, freg_counter, label_counter,
	    locals, prog->settings, prog->fp_if, prog->start_address, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	prog->sections[prog->num_sections++] = arm_s;
	return arm_s;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x20(%rsp), %r14
movq 0x8(%rdi), %rax
cmpq 0x10(%rdi), %rax
jne 0x4f4e2
leaq 0x266ca(%rip), %rdx     # 0x75b98
movq %r14, %rdi
movl $0xf, %esi
movl $0x135, %ecx            # imm = 0x135
callq 0x145f4
jmp 0x4f504
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
movl 0x38(%rbx), %eax
pushq %r14
pushq %rax
pushq 0x40(%rbx)
pushq 0x30(%rbx)
callq 0x4f03b
addq $0x20, %rsp
cmpl $0x0, (%r14)
je 0x4f50e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x8(%rbx)
movq %rax, (%rcx,%rdx,8)
jmp 0x4f506
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_prog_append_section
void subtilis_arm_prog_append_section(subtilis_arm_prog_t *prog,
				      subtilis_arm_section_t *arm_s,
				      subtilis_error_t *err)
{
	if (prog->num_sections == prog->max_sections) {
		subtilis_arm_section_delete(arm_s);
		subtilis_error_set_assertion_failed(err);
		return;
	}

	prog->sections[prog->num_sections++] = arm_s;
}

// Assembly:
movq 0x8(%rdi), %rax
cmpq 0x10(%rdi), %rax
jne 0x4f553
pushq %rbx
movq %rdx, %rbx
movq %rsi, %rdi
callq 0x4f141
leaq 0x26658(%rip), %rdx     # 0x75b98
movq %rbx, %rdi
movl $0xf, %esi
movl $0x149, %ecx            # imm = 0x149
popq %rbx
jmp 0x145f4
movq (%rdi), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%rdi)
movq %rsi, (%rcx,%rax,8)
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_section_add_label
void subtilis_arm_section_add_label(subtilis_arm_section_t *s, size_t label,
				    subtilis_error_t *err)
{
	subtilis_arm_op_t *op;

	op = prv_append_op(s, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	op->type = SUBTILIS_ARM_OP_LABEL;
	op->op.label = label;
	s->label_counter++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x4f5b7
cmpl $0x0, (%r15)
jne 0x4f5b1
movl $0x1, (%rax)
movq %r14, 0x8(%rax)
incq 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: prv_append_op
static subtilis_arm_op_t *prv_append_op(subtilis_arm_section_t *s,
					subtilis_error_t *err)
{
	size_t ptr;
	subtilis_arm_op_t *op;
	size_t prev = s->last_op;

	ptr = subtilis_arm_op_pool_alloc(s->op_pool, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;
	op = &s->op_pool->ops[ptr];
	memset(op, 0, sizeof(*op));
	op->next = SIZE_MAX;
	op->prev = prev;
	if (s->first_op == SIZE_MAX)
		s->first_op = ptr;
	else
		s->op_pool->ops[s->last_op].next = ptr;
	s->last_op = ptr;
	s->len++;

	return op;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %r15
movq 0x38(%rdi), %rdi
callq 0x4ef39
cmpl $0x0, (%r14)
je 0x4f5d9
xorl %eax, %eax
jmp 0x4f643
movq %rax, %rcx
movq 0x38(%rbx), %rax
movq (%rax), %rax
imulq $0x68, %rcx, %rdx
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rax,%rdx)
movups %xmm0, 0x40(%rax,%rdx)
movups %xmm0, 0x30(%rax,%rdx)
movups %xmm0, 0x20(%rax,%rdx)
movups %xmm0, 0x10(%rax,%rdx)
movups %xmm0, (%rax,%rdx)
movq $-0x1, 0x58(%rax,%rdx)
movq %r15, 0x60(%rax,%rdx)
cmpq $-0x1, 0x20(%rbx)
je 0x4f631
movq 0x38(%rbx), %rsi
movq (%rsi), %rsi
imulq $0x68, 0x28(%rbx), %rdi
addq %rdi, %rsi
addq $0x58, %rsi
jmp 0x4f635
leaq 0x20(%rbx), %rsi
addq %rdx, %rax
movq %rcx, (%rsi)
movq %rcx, 0x28(%rbx)
incq 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_section_insert_label
void subtilis_arm_section_insert_label(subtilis_arm_section_t *s, size_t label,
				       subtilis_arm_op_t *pos,
				       subtilis_error_t *err)
{
	subtilis_arm_op_t *op;

	op = prv_insert_op(s, pos, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	op->type = SUBTILIS_ARM_OP_LABEL;
	op->op.label = label;
	s->label_counter++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x4f67c
cmpl $0x0, (%r15)
jne 0x4f676
movl $0x1, (%rax)
movq %r14, 0x8(%rax)
incq 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: prv_insert_op
static subtilis_arm_op_t *prv_insert_op(subtilis_arm_section_t *s,
					subtilis_arm_op_t *pos,
					subtilis_error_t *err)
{
	size_t ptr;
	size_t old_ptr;
	subtilis_arm_op_t *op;

	/*
	 * We need to figure out the pointer before we do the alloc,
	 * as the alloc may invalidate pos.
	 */

	if (pos->prev == SIZE_MAX)
		old_ptr = s->first_op;
	else
		old_ptr = s->op_pool->ops[pos->prev].next;

	ptr = subtilis_arm_op_pool_alloc(s->op_pool, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	/*
	 * pos may have been invalidated by the alloc.
	 */

	pos = &s->op_pool->ops[old_ptr];
	op = &s->op_pool->ops[ptr];
	memset(op, 0, sizeof(*op));
	op->next = old_ptr;
	op->prev = pos->prev;
	s->op_pool->ops[pos->prev].next = ptr;
	pos->prev = ptr;

	if (old_ptr == s->first_op)
		s->first_op = ptr;
	s->len++;

	return op;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq 0x60(%rsi), %rax
cmpq $-0x1, %rax
je 0x4f6a5
movq 0x38(%rbx), %rcx
movq (%rcx), %rcx
imulq $0x68, %rax, %rax
addq %rcx, %rax
addq $0x58, %rax
jmp 0x4f6a9
leaq 0x20(%rbx), %rax
movq (%rax), %r15
movq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0x4ef39
cmpl $0x0, (%r14)
je 0x4f6c2
xorl %eax, %eax
jmp 0x4f734
movq %rax, %rcx
movq 0x38(%rbx), %rax
movq (%rax), %rax
imulq $0x68, %rcx, %rdx
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rax,%rdx)
movups %xmm0, 0x40(%rax,%rdx)
movups %xmm0, 0x30(%rax,%rdx)
movups %xmm0, 0x20(%rax,%rdx)
movups %xmm0, 0x10(%rax,%rdx)
movups %xmm0, (%rax,%rdx)
movq $0x0, 0x60(%rax,%rdx)
movq %r15, 0x58(%rax,%rdx)
imulq $0x68, %r15, %rsi
movq 0x60(%rax,%rsi), %rdi
movq %rdi, 0x60(%rax,%rdx)
movq 0x38(%rbx), %rdi
movq (%rdi), %rdi
imulq $0x68, 0x60(%rax,%rsi), %r8
movq %rcx, 0x58(%rdi,%r8)
movq %rcx, 0x60(%rax,%rsi)
cmpq 0x20(%rbx), %r15
jne 0x4f72d
movq %rcx, 0x20(%rbx)
addq %rdx, %rax
incq 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_section_add_instr
subtilis_arm_instr_t *
subtilis_arm_section_add_instr(subtilis_arm_section_t *s,
			       subtilis_arm_instr_type_t type,
			       subtilis_error_t *err)
{
	subtilis_arm_op_t *op;

	op = prv_append_op(s, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	op->type = SUBTILIS_ARM_OP_INSTR;
	op->op.instr.type = type;
	return &op->op.instr;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebx
movq %rdx, %rsi
callq 0x4f5b7
cmpl $0x0, (%r14)
je 0x4f755
xorl %eax, %eax
jmp 0x4f765
movq %rax, %rcx
movl $0x0, (%rax)
addq $0x8, %rax
movl %ebx, 0x8(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_section_insert_instr
subtilis_arm_instr_t *
subtilis_arm_section_insert_instr(subtilis_arm_section_t *s,
				  subtilis_arm_op_t *pos,
				  subtilis_arm_instr_type_t type,
				  subtilis_error_t *err)
/* clang-format on */
{
	subtilis_arm_op_t *op;

	op = prv_insert_op(s, pos, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	op->type = SUBTILIS_ARM_OP_INSTR;
	op->op.instr.type = type;
	return &op->op.instr;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movl %edx, %ebx
movq %rcx, %rdx
callq 0x4f67c
cmpl $0x0, (%r14)
je 0x4f788
xorl %eax, %eax
jmp 0x4f798
movq %rax, %rcx
movl $0x0, (%rax)
addq $0x8, %rax
movl %ebx, 0x8(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_section_dup_instr
subtilis_arm_instr_t *subtilis_arm_section_dup_instr(subtilis_arm_section_t *s,
						     subtilis_error_t *err)
{
	subtilis_arm_op_t *src;
	subtilis_arm_op_t *op;

	if (s->len == 0) {
		subtilis_error_set_assertion_failed(err);
		return NULL;
	}

	src = &s->op_pool->ops[s->last_op];
	op = prv_append_op(s, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	*op = *src;
	op->next = SIZE_MAX;

	return &op->op.instr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
cmpq $0x0, 0x18(%rdi)
je 0x4f7ea
movq 0x28(%rdi), %r15
movq 0x38(%rdi), %rax
movq (%rax), %r14
movq %rbx, %rsi
callq 0x4f5b7
cmpl $0x0, (%rbx)
jne 0x4f803
imulq $0x68, %r15, %rcx
addq %rcx, %r14
movl $0xd, %ecx
movq %rax, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq $-0x1, 0x58(%rax)
addq $0x8, %rax
jmp 0x4f805
leaq 0x263a7(%rip), %rdx     # 0x75b98
movq %rbx, %rdi
movl $0xf, %esi
movl $0x24a, %ecx            # imm = 0x24A
callq 0x145f4
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_encode_nearest
uint32_t subtilis_arm_encode_nearest(int32_t num, subtilis_error_t *err)
{
	bool can_encode;
	uint32_t encoded;
	size_t i;
	size_t new_num;
	size_t mask;
	size_t shift;

	can_encode = subtilis_arm_encode_imm(num, &encoded);
	if (can_encode)
		return encoded;

	if (((uint32_t)num) >= ((uint32_t)0xff000000)) {
		subtilis_error_set_assertion_failed(err);
		return 0;
	}

	/* First first bit that's set */

	for (i = 31; i > 7; i--)
		if (num & (1 << i))
			break;

	if (i == 7) {
		subtilis_error_set_assertion_failed(err);
		return 0;
	}

	shift = i - 7;

	if (shift & 1)
		shift++;
	mask = 0xff << shift;
	new_num = (((uint32_t)num) & mask) + (1 << shift);
	can_encode = subtilis_arm_encode_imm(new_num, &encoded);
	if (!can_encode) {
		subtilis_error_set_assertion_failed(err);
		return 0;
	}

	return encoded;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4(%rsp), %rsi
callq 0x4f8d1
testb %al, %al
je 0x4f82a
movl 0x4(%rsp), %eax
jmp 0x4f8ca
cmpl $0xfeffffff, %ebp       # imm = 0xFEFFFFFF
jbe 0x4f848
leaq 0x2635f(%rip), %rdx     # 0x75b98
movq %rbx, %rdi
movl $0xf, %esi
movl $0x287, %ecx            # imm = 0x287
jmp 0x4f8c3
movl $0x1f, %eax
btl %eax, %ebp
jb 0x4f860
decq %rax
cmpq $0x7, %rax
ja 0x4f84d
movl $0x7, %eax
cmpq $0x7, %rax
jne 0x4f87c
leaq 0x2632b(%rip), %rdx     # 0x75b98
movq %rbx, %rdi
movl $0xf, %esi
movl $0x292, %ecx            # imm = 0x292
jmp 0x4f8c3
leaq -0x7(%rax), %rdx
addb $-0x6, %al
testb $0x1, %dl
movzbl %al, %ecx
cmovel %edx, %ecx
movl $0xff, %eax
shll %cl, %eax
andl %ebp, %eax
movl $0x1, %edi
shll %cl, %edi
addl %eax, %edi
leaq 0x4(%rsp), %rsi
callq 0x4f8d1
testb %al, %al
jne 0x4f821
leaq 0x262e2(%rip), %rdx     # 0x75b98
movq %rbx, %rdi
movl $0xf, %esi
movl $0x29e, %ecx            # imm = 0x29E
callq 0x145f4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_encode_imm
bool subtilis_arm_encode_imm(int32_t num, uint32_t *encoded)
{
	size_t i;
	uint32_t imm = (uint32_t)num;

	if (imm == 0) {
		*encoded = 0;
		return true;
	}

	for (i = 0; i < sizeof(subitlis_arm_imm_mask) / sizeof(uint32_t); i++) {
		if ((imm & ~subitlis_arm_imm_mask[i]) == 0)
			break;
	}
	if (i == sizeof(subitlis_arm_imm_mask) / sizeof(uint32_t))
		return false;

	prv_encode_imm(imm, i, encoded);

	return true;
}

// Assembly:
movq %rsi, %rdx
testl %edi, %edi
je 0x4f906
pushq %rax
leaq 0x26260(%rip), %rax     # 0x75b40
xorl %esi, %esi
movl (%rax), %ecx
notl %ecx
testl %edi, %ecx
je 0x4f8fc
incq %rsi
addq $0x4, %rax
cmpq $0x10, %rsi
jne 0x4f8e2
movl $0x10, %esi
cmpq $0x10, %rsi
jne 0x4f90f
xorl %eax, %eax
jmp 0x4f916
movl $0x0, (%rdx)
movb $0x1, %al
retq
callq 0x4f91b
movb $0x1, %al
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_encode_lvl2_imm
bool subtilis_arm_encode_lvl2_imm(int32_t num, uint32_t *encoded1,
				  uint32_t *encoded2)
{
	size_t i;
	uint32_t rem;
	uint32_t imm = (uint32_t)num;

	for (i = 0; i < sizeof(subitlis_arm_imm_mask) / sizeof(uint32_t); i++) {
		rem = imm & ~subitlis_arm_imm_mask[i];
		if (subtilis_arm_encode_imm(rem, encoded2))
			break;
	}
	if (i == sizeof(subitlis_arm_imm_mask) / sizeof(uint32_t))
		return false;

	prv_encode_imm(imm - rem, i, encoded1);

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x261d3(%rip), %r13     # 0x75b40
xorl %r14d, %r14d
movl (%r13), %r15d
notl %r15d
andl %ebp, %r15d
movl %r15d, %edi
movq %r12, %rsi
callq 0x4f8d1
testb %al, %al
jne 0x4f99c
incq %r14
addq $0x4, %r13
cmpq $0x10, %r14
jne 0x4f970
movl $0x10, %r14d
cmpq $0x10, %r14
je 0x4f9b2
subl %r15d, %ebp
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4f91b
cmpq $0x10, %r14
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_arm_insert_data_imm_ldr
size_t subtilis_arm_insert_data_imm_ldr(subtilis_arm_section_t *s,
					subtilis_arm_op_t *current,
					subtilis_arm_ccode_type_t ccode,
					subtilis_arm_reg_t dest, int32_t op2,
					subtilis_error_t *err)
{
	subtilis_arm_ldrc_instr_t *ldrc;
	subtilis_arm_instr_t *instr;
	size_t label = s->label_counter++;

	prv_add_ui32_constant(s, label, (uint32_t)op2, false, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return 0;

	instr = subtilis_arm_section_insert_instr(s, current,
						  SUBTILIS_ARM_INSTR_LDRC, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return 0;

	ldrc = &instr->operands.ldrc;
	ldrc->ccode = ccode;
	ldrc->dest = dest;
	ldrc->label = label;
	ldrc->link_time = false;
	return label;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %r13
movq 0x10(%rdi), %rbx
leaq 0x1(%rbx), %rax
movq %rax, 0x10(%rdi)
movq %rbx, %rsi
movl %r8d, %edx
xorl %ecx, %ecx
movq %r9, %r8
callq 0x4fa5a
cmpl $0x0, (%r15)
jne 0x4fa35
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4f67c
cmpl $0x0, (%r15)
je 0x4fa1b
xorl %ecx, %ecx
jmp 0x4fa2f
movl $0x0, (%rax)
movq %rax, %rcx
addq $0x8, %rcx
movl $0x18, 0x8(%rax)
cmpl $0x0, (%r15)
je 0x4fa49
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, 0x8(%rcx)
movq %r14, 0x10(%rcx)
movq %rbx, 0x18(%rcx)
movb $0x0, 0x20(%rcx)
jmp 0x4fa37
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: prv_add_ui32_constant
static void prv_add_ui32_constant(subtilis_arm_section_t *s, size_t label,
				  uint32_t num, bool link_time,
				  subtilis_error_t *err)
{
	subtilis_arm_ui32_constant_t *c;
	subtilis_arm_ui32_constant_t *new_constants;
	size_t new_max;

	if (s->constants.ui32_count == s->constants.max_ui32) {
		new_max = s->constants.max_ui32 + 64;
		new_constants =
		    realloc(s->constants.ui32,
			    new_max * sizeof(subtilis_arm_ui32_constant_t));
		if (!new_constants) {
			subtilis_error_set_oom(err);
			return;
		}
		s->constants.max_ui32 = new_max;
		s->constants.ui32 = new_constants;
	}
	c = &s->constants.ui32[s->constants.ui32_count++];
	c->integer = num;
	c->label = label;
	c->link_time = link_time;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movq 0x68(%rdi), %r13
cmpq %r13, 0x60(%rdi)
jne 0x4faa2
movq %r8, %r12
movq 0x58(%r15), %rdi
leaq 0x200(,%r13,8), %rax
leaq (%rax,%rax,2), %rsi
callq 0x12210
testq %rax, %rax
je 0x4fad1
addq $0x40, %r13
movq %r13, 0x68(%r15)
movq %rax, 0x58(%r15)
movq 0x58(%r15), %rax
movq 0x60(%r15), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x60(%r15)
leaq (%rcx,%rcx,2), %rcx
movl %ebp, (%rax,%rcx,8)
movq %r14, 0x8(%rax,%rcx,8)
movb %bl, 0x10(%rax,%rcx,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x260c0(%rip), %rdx     # 0x75b98
movq %r12, %rdi
movl $0x1, %esi
movl $0x214, %ecx            # imm = 0x214
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145f4
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_add_explicit_ldr
size_t subtilis_add_explicit_ldr(subtilis_arm_section_t *s,
				 subtilis_arm_ccode_type_t ccode,
				 subtilis_arm_reg_t dest, int32_t op2,
				 bool link_time, subtilis_error_t *err)
{
	subtilis_arm_ldrc_instr_t *ldrc;
	subtilis_arm_instr_t *instr;
	size_t label = s->label_counter++;

	prv_add_ui32_constant(s, label, (uint32_t)op2, link_time, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return 0;

	instr = subtilis_arm_section_add_instr(s, SUBTILIS_ARM_INSTR_LDRC, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return 0;

	ldrc = &instr->operands.ldrc;
	ldrc->ccode = ccode;
	ldrc->dest = dest;
	ldrc->label = label;
	ldrc->link_time = link_time;

	return label;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r12
movl %r8d, %ebp
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r13
movq 0x10(%rdi), %rbx
leaq 0x1(%rbx), %rax
movq %rax, 0x10(%rdi)
movq %rbx, %rsi
movl %ecx, %edx
movl %r8d, %ecx
movq %r9, %r8
callq 0x4fa5a
cmpl $0x0, (%r12)
jne 0x4fb66
movq %r13, %rdi
movq %r12, %rsi
callq 0x4f5b7
cmpl $0x0, (%r12)
je 0x4fb4b
xorl %ecx, %ecx
jmp 0x4fb5f
movl $0x0, (%rax)
movq %rax, %rcx
addq $0x8, %rcx
movl $0x18, 0x8(%rax)
cmpl $0x0, (%r12)
je 0x4fb7a
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r15d, 0x8(%rcx)
movq %r14, 0x10(%rcx)
movq %rbx, 0x18(%rcx)
movb %bpl, 0x20(%rcx)
jmp 0x4fb68
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_add_adr
void subtilis_add_adr(subtilis_arm_section_t *s,
		      subtilis_arm_ccode_type_t ccode, subtilis_arm_reg_t dest,
		      size_t label, subtilis_error_t *err)
{
	subtilis_arm_adr_instr_t *adr;
	subtilis_arm_instr_t *instr;

	instr = subtilis_arm_section_add_instr(s, SUBTILIS_ARM_INSTR_ADR, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	adr = &instr->operands.adr;
	adr->ccode = ccode;
	adr->dest = dest;
	adr->label = label;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %r8, %rsi
callq 0x4f5b7
cmpl $0x0, (%r15)
je 0x4fbb0
xorl %ecx, %ecx
jmp 0x4fbc4
movl $0x0, (%rax)
movq %rax, %rcx
addq $0x8, %rcx
movl $0x1b, 0x8(%rax)
cmpl $0x0, (%r15)
jne 0x4fbd5
movl %ebp, 0x8(%rcx)
movq %r14, 0x10(%rcx)
movq %rbx, 0x18(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_add_ldrp
void subtilis_add_ldrp(subtilis_arm_section_t *s,
		       subtilis_arm_ccode_type_t ccode, subtilis_arm_reg_t dest,
		       size_t section_label, size_t constant_label,
		       subtilis_error_t *err)
{
	subtilis_arm_ldrp_instr_t *ldrp;
	subtilis_arm_instr_t *instr;

	prv_add_ui32_constant(s, constant_label, (uint32_t)0, false, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	instr = subtilis_arm_section_add_instr(s, SUBTILIS_ARM_INSTR_LDRP, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	ldrp = &instr->operands.ldrp;
	ldrp->ccode = ccode;
	ldrp->dest = dest;
	ldrp->section_label = section_label;
	ldrp->constant_label = constant_label;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r12
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r13
movq %r8, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r9, %r8
callq 0x4fa5a
cmpl $0x0, (%r12)
jne 0x4fc52
movq %r13, %rdi
movq %r12, %rsi
callq 0x4f5b7
cmpl $0x0, (%r12)
je 0x4fc28
xorl %ecx, %ecx
jmp 0x4fc3c
movl $0x0, (%rax)
movq %rax, %rcx
addq $0x8, %rcx
movl $0x19, 0x8(%rax)
cmpl $0x0, (%r12)
jne 0x4fc52
movl %ebp, 0x8(%rcx)
movq %r15, 0x10(%rcx)
movq %r14, 0x18(%rcx)
movq %rbx, 0x20(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_core.c
// Function: subtilis_add_data_imm_ldr_datai
size_t subtilis_add_data_imm_ldr_datai(subtilis_arm_section_t *s,
				       subtilis_arm_instr_type_t itype,
				       subtilis_arm_ccode_type_t ccode,
				       bool status, subtilis_arm_reg_t dest,
				       subtilis_arm_reg_t op1, int32_t op2,
				       subtilis_error_t *err)
{
	subtilis_arm_data_instr_t *datai;
	subtilis_arm_instr_t *instr;
	subtilis_arm_reg_t ldr_dest;
	size_t label;

	ldr_dest = subtilis_arm_acquire_new_reg(s);

	label = prv_add_data_imm_ldr(s, ccode, ldr_dest, op2, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return 0;

	instr = subtilis_arm_section_add_instr(s, itype, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return 0;

	datai = &instr->operands.data;
	datai->status = status;
	datai->op2.type = SUBTILIS_ARM_OP2_REG;
	datai->ccode = ccode;
	datai->dest = dest;
	datai->op1 = op1;
	datai->op2.op.reg = ldr_dest;
	return label;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movl %ecx, 0x4(%rsp)
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
movq 0x58(%rsp), %r13
movl 0x50(%rsp), %ecx
movq (%rdi), %r12
leaq 0x1(%r12), %rax
movq %rax, (%rdi)
leaq -0x1(%r12), %rax
cmpq $0x3, %rax
jae 0x4fcb2
leaq 0x25ed5(%rip), %rax     # 0x75b80
movq -0x8(%rax,%r12,8), %r12
jmp 0x4fcb6
addq $0xc, %r12
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %r13, %r8
callq 0x4fd3b
cmpl $0x0, (%r13)
jne 0x4fcfe
movq %rax, %rbx
movq %r15, %rdi
movq %r13, %rsi
callq 0x4f5b7
cmpl $0x0, (%r13)
je 0x4fce6
xorl %ecx, %ecx
jmp 0x4fcf7
movl $0x0, (%rax)
movq %rax, %rcx
addq $0x8, %rcx
movl %r14d, 0x8(%rax)
cmpl $0x0, (%r13)
je 0x4fd12
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rsp), %eax
movb %al, 0xc(%rcx)
movl $0x0, 0x20(%rcx)
movl %ebp, 0x8(%rcx)
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rcx)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rcx)
movq %r12, 0x28(%rcx)
jmp 0x4fd00