LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/fpa_gen.c
// Function: subtilis_arm_fpa_if_init
void subtilis_arm_fpa_if_init(subtilis_arm_fp_if_t *fp_if)
{
	double dummy_float = 1.0;
	uint32_t *lower_word = (uint32_t *)((void *)&dummy_float);

	fp_if->max_regs = SUBTILIS_ARM_REG_MAX_FPA_REGS;
	fp_if->max_offset = 1023;
	fp_if->store_type = SUBTILIS_FPA_INSTR_STF;
	fp_if->load_type = SUBTILIS_FPA_INSTR_LDF;

	/* Slightly weird but on ARM FPA the words of a double are big endian */
	fp_if->reverse_fpa_consts = (*lower_word) == 0;
	fp_if->preamble_fn = subtilis_fpa_gen_preamble;
	fp_if->preserve_regs_fn = subtilis_fpa_preserve_regs;
	fp_if->restore_regs_fn = subtilis_fpa_restore_regs;
	fp_if->update_regs_fn = subtilis_fpa_preserve_update;
	fp_if->update_offs_fn = subtilis_fpa_update_offsets;
	fp_if->store_dbl_fn = subtilis_fpa_store_double;
	fp_if->mov_reg_fn = subtilis_fpa_mov_reg;
	fp_if->spill_imm_fn = subtilis_fpa_insert_stran_spill_imm;
	fp_if->stran_imm_fn = subtilis_fpa_insert_stran_imm;
	fp_if->is_fixed_fn = subtilis_fpa_is_fixed;
	fp_if->init_dist_walker_fn = subtilis_init_fpa_dist_walker;
	fp_if->init_used_walker_fn = subtilis_init_fpa_used_walker;
	fp_if->init_real_alloc_fn = subtilis_fpa_alloc_init_walker;
}

// Assembly:
movq $0x8, (%rdi)
movl $0x3ff, 0x8(%rdi)       # imm = 0x3FF
movabsq $0x1e0000001f, %rax     # imm = 0x1E0000001F
movq %rax, 0x18(%rdi)
movb $0x1, 0xc(%rdi)
leaq -0x48e(%rip), %rax      # 0x6c691
movq %rax, 0x20(%rdi)
leaq -0x24b(%rip), %rax      # 0x6c8df
movq %rax, 0x28(%rdi)
leaq -0x1f5(%rip), %rax      # 0x6c940
movq %rax, 0x30(%rdi)
leaq -0x19b(%rip), %rax      # 0x6c9a5
movq %rax, 0x38(%rdi)
leaq -0xf9(%rip), %rax       # 0x6ca52
movq %rax, 0x40(%rdi)
leaq -0xd7(%rip), %rax       # 0x6ca7f
movq %rax, 0x48(%rdi)
leaq -0x87(%rip), %rax       # 0x6cada
movq %rax, 0x50(%rdi)
leaq -0xf701(%rip), %rax     # 0x5d46b
movq %rax, 0x58(%rdi)
leaq -0xf64f(%rip), %rax     # 0x5d528
movq %rax, 0x60(%rdi)
leaq -0xfd56(%rip), %rax     # 0x5ce2c
movq %rax, 0x68(%rdi)
leaq 0x953(%rip), %rax       # 0x6d4e0
movq %rax, 0x70(%rdi)
leaq 0xe75(%rip), %rax       # 0x6da0d
movq %rax, 0x78(%rdi)
leaq 0x5d(%rip), %rax        # 0x6cc00
movq %rax, 0x80(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/fpa_gen.c
// Function: prv_cmp_simple
static void prv_cmp_simple(subtilis_ir_section_t *s, size_t start,
			   void *user_data, subtilis_arm_instr_type_t itype,
			   subtilis_arm_ccode_type_t ccode,
			   subtilis_error_t *err)
{
	subtilis_arm_reg_t op1;
	subtilis_arm_reg_t op2;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *ir_op = &s->ops[start]->op.instr;

	op1 = subtilis_arm_ir_to_freg(ir_op->operands[1].reg);
	op2 = subtilis_arm_ir_to_freg(ir_op->operands[2].reg);

	subtilis_fpa_add_cmp(arm_s, itype, ccode, op1, op2, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %r12
movq 0x18(%r12), %rdi
callq 0x4f57d
movq %rax, %r15
movq 0x20(%r12), %rdi
callq 0x4f57d
movq %r14, %rdi
movl $0x40, %esi
movl $0xe, %edx
movq %r15, %rcx
movq %rax, %r8
movq %rbx, %r9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5d40b
nop
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/fpa_alloc.c
// Function: subtilis_fpa_alloc_init_walker
void subtilis_fpa_alloc_init_walker(subtlis_arm_walker_t *walker,
				    void *user_data)
{
	walker->fpa_data_monadic_fn = prv_alloc_fpa_data_monadic_instr;
	walker->fpa_data_dyadic_fn = prv_alloc_fpa_data_dyadic_instr;
	walker->fpa_stran_fn = prv_alloc_fpa_stran_instr;
	walker->fpa_tran_fn = prv_alloc_fpa_tran_instr;
	walker->fpa_cmp_fn = prv_alloc_fpa_cmp_instr;
	walker->fpa_ldrc_fn = prv_alloc_fpa_ldrc_instr;
	walker->fpa_cptran_fn = prv_alloc_fpa_cptran_instr;
	walker->vfp_stran_fn = prv_alloc_vfp_stran_instr;
	walker->vfp_copy_fn = prv_alloc_vfp_copy_instr;
	walker->vfp_ldrc_fn = prv_alloc_vfp_ldrc_instr;
	walker->vfp_tran_fn = prv_alloc_vfp_tran_instr;
	walker->vfp_tran_dbl_fn = prv_alloc_vfp_tran_dbl_instr;
	walker->vfp_cptran_fn = prv_alloc_vfp_cptran_instr;
	walker->vfp_data_fn = prv_alloc_vfp_data_instr;
	walker->vfp_cmp_fn = prv_alloc_vfp_cmp_instr;
	walker->vfp_sqrt_fn = prv_alloc_vfp_sqrt_instr;
	walker->vfp_sysreg_fn = prv_alloc_vfp_sysreg_instr;
}

// Assembly:
leaq 0xe8(%rip), %rax        # 0x6ccef
movq %rax, 0x80(%rdi)
leaq 0x1c1(%rip), %rax       # 0x6cdd6
movq %rax, 0x88(%rdi)
leaq 0x2f8(%rip), %rax       # 0x6cf1b
movq %rax, 0x90(%rdi)
leaq 0x463(%rip), %rax       # 0x6d094
movq %rax, 0x98(%rdi)
leaq 0x5cb(%rip), %rax       # 0x6d20a
movq %rax, 0xa0(%rdi)
leaq 0x6c3(%rip), %rax       # 0x6d310
movq %rax, 0xa8(%rdi)
leaq 0x6dd(%rip), %rax       # 0x6d338
movq %rax, 0xb0(%rdi)
leaq 0x77a(%rip), %rax       # 0x6d3e3
movq %rax, 0xb8(%rdi)
leaq 0x785(%rip), %rax       # 0x6d3fc
movq %rax, 0xc0(%rdi)
leaq 0x790(%rip), %rax       # 0x6d415
movq %rax, 0xc8(%rdi)
leaq 0x79b(%rip), %rax       # 0x6d42e
movq %rax, 0xd0(%rdi)
leaq 0x7a6(%rip), %rax       # 0x6d447
movq %rax, 0xd8(%rdi)
leaq 0x7b1(%rip), %rax       # 0x6d460
movq %rax, 0xe0(%rdi)
leaq 0x7bc(%rip), %rax       # 0x6d479
movq %rax, 0xe8(%rdi)
leaq 0x7c7(%rip), %rax       # 0x6d492
movq %rax, 0xf0(%rdi)
leaq 0x7d2(%rip), %rax       # 0x6d4ab
movq %rax, 0xf8(%rdi)
leaq 0x7dd(%rip), %rax       # 0x6d4c4
movq %rax, 0x100(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/fpa_alloc.c
// Function: prv_alloc_fpa_data_monadic_instr
static void prv_alloc_fpa_data_monadic_instr(void *user_data,
					     subtilis_arm_op_t *op,
					     subtilis_arm_instr_type_t type,
					     subtilis_fpa_data_instr_t *instr,
					     subtilis_error_t *err)
{
	size_t vreg_op2;
	int dist_op2 = -1;
	subtilis_arm_reg_ud_t *ud = user_data;

	if (!instr->immediate) {
		vreg_op2 = instr->op2.reg;
		(void)subtilis_arm_reg_alloc_ensure(
		    ud, op, ud->int_regs, ud->real_regs, &instr->op2.reg, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		dist_op2 = subtilis_arm_reg_alloc_calculate_dist(
		    ud, vreg_op2, op, &ud->real_regs->dist_walker,
		    ud->real_regs);
		if (dist_op2 == -1)
			ud->real_regs->phys_to_virt[instr->op2.reg] = INT_MAX;
	}

	subtilis_arm_reg_alloc_alloc_fp_dest(ud, op, &instr->dest, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* Need to check for useless moves */

	if (!instr->immediate &&
	    ((type != SUBTILIS_FPA_INSTR_MVF) || instr->op2.reg != instr->dest))
		ud->real_regs->next[instr->op2.reg] = dist_op2;

	ud->instr_count++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r14
movl %edx, 0x4(%rsp)
movq %rsi, %r12
movq %rdi, %rbx
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpb $0x0, 0x20(%rcx)
je 0x6cd5c
leaq 0x10(%r14), %rdx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x53417
cmpl $0x0, (%r15)
jne 0x6cd83
cmpb $0x0, 0x20(%r14)
jne 0x6cd56
cmpl $0x21, 0x4(%rsp)
jne 0x6cd46
movq 0x28(%r14), %rax
cmpq 0x10(%r14), %rax
je 0x6cd56
movq 0x10(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x28(%r14), %rcx
movl %r13d, (%rax,%rcx,4)
incq 0x20(%rbx)
jmp 0x6cd83
leaq 0x28(%r14), %rbp
movq 0x28(%r14), %r13
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %r8
movq %r15, %r9
callq 0x5315a
cmpl $0x0, (%r15)
je 0x6cd92
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x52f08
movl %eax, %r13d
cmpl $-0x1, %eax
jne 0x6cd16
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rax
movq (%rbp), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x6cd16
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/fpa_alloc.c
// Function: prv_alloc_fpa_data_dyadic_instr
static void prv_alloc_fpa_data_dyadic_instr(void *user_data,
					    subtilis_arm_op_t *op,
					    subtilis_arm_instr_type_t type,
					    subtilis_fpa_data_instr_t *instr,
					    subtilis_error_t *err)
{
	int dist_op1;
	int dist_op2 = -1;
	size_t vreg_op1;
	size_t vreg_op2;
	subtilis_arm_reg_ud_t *ud = user_data;

	vreg_op1 = instr->op1;
	(void)subtilis_arm_reg_alloc_ensure(ud, op, ud->int_regs, ud->real_regs,
					    &instr->op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (!instr->immediate) {
		vreg_op2 = instr->op2.reg;
		(void)subtilis_arm_reg_alloc_ensure(
		    ud, op, ud->int_regs, ud->real_regs, &instr->op2.reg, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		dist_op2 = subtilis_arm_reg_alloc_calculate_dist(
		    ud, vreg_op2, op, &ud->real_regs->dist_walker,
		    ud->real_regs);

		if (dist_op2 == -1)
			ud->real_regs->phys_to_virt[instr->op2.reg] = INT_MAX;
	}

	dist_op1 = subtilis_arm_reg_alloc_calculate_dist(
	    ud, vreg_op1, op, &ud->real_regs->dist_walker, ud->real_regs);
	if (dist_op1 == -1)
		ud->real_regs->phys_to_virt[instr->op1] = INT_MAX;

	subtilis_arm_reg_alloc_alloc_fp_dest(ud, op, &instr->dest, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	ud->real_regs->next[instr->op1] = dist_op1;
	if (!instr->immediate)
		ud->real_regs->next[instr->op2.reg] = dist_op2;

	ud->instr_count++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movq %rcx, %r14
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x18(%rcx), %r13
movq 0x18(%rcx), %rbp
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rcx
movq %r13, %r8
movq %r15, %r9
callq 0x5315a
cmpl $0x0, (%r15)
jne 0x6cec6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpb $0x0, 0x20(%r14)
je 0x6ce98
movl %eax, 0x8(%rsp)
movq 0x10(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x52f08
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x6ce59
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rax
movq (%r13), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
leaq 0x10(%r14), %rdx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x53417
cmpl $0x0, (%r15)
jne 0x6cec6
movq 0x10(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x18(%r14), %rcx
movl %ebp, (%rax,%rcx,4)
cmpb $0x0, 0x20(%r14)
jne 0x6ce92
movq 0x28(%r14), %rcx
movl 0x8(%rsp), %edx
movl %edx, (%rax,%rcx,4)
incq 0x20(%rbx)
jmp 0x6cec6
leaq 0x28(%r14), %r8
movq 0x28(%r14), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r8, 0x10(%rsp)
movq %r15, %r9
callq 0x5315a
cmpl $0x0, (%r15)
je 0x6ced5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
callq 0x52f08
cmpl $-0x1, %eax
jne 0x6ce21
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movq $0x7fffffff, (%rax,%rcx,8) # imm = 0x7FFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x6ce21
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/fpa_alloc.c
// Function: prv_alloc_fpa_cmp_instr
static void prv_alloc_fpa_cmp_instr(void *user_data, subtilis_arm_op_t *op,
				    subtilis_arm_instr_type_t type,
				    subtilis_fpa_cmp_instr_t *instr,
				    subtilis_error_t *err)
{
	int dist_dest;
	int dist_op2;
	size_t vreg_dest;
	size_t vreg_op2;
	subtilis_arm_reg_ud_t *ud = user_data;

	vreg_dest = instr->dest;
	(void)subtilis_arm_reg_alloc_ensure(ud, op, ud->int_regs, ud->real_regs,
					    &instr->dest, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	if (!instr->immediate) {
		vreg_op2 = instr->op2.reg;
		(void)subtilis_arm_reg_alloc_ensure(
		    ud, op, ud->int_regs, ud->real_regs, &instr->op2.reg, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		dist_op2 = subtilis_arm_reg_alloc_calculate_dist(
		    ud, vreg_op2, op, &ud->real_regs->dist_walker,
		    ud->real_regs);
		if (dist_op2 == -1)
			ud->real_regs->phys_to_virt[instr->op2.reg] = INT_MAX;
		ud->real_regs->next[instr->op2.reg] = dist_op2;
	}

	dist_dest = subtilis_arm_reg_alloc_calculate_dist(
	    ud, vreg_dest, op, &ud->real_regs->dist_walker, ud->real_regs);
	if (dist_dest == -1)
		ud->real_regs->phys_to_virt[instr->dest] = INT_MAX;
	ud->real_regs->next[instr->dest] = dist_dest;

	ud->instr_count++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbp
movq %rcx, %r13
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rcx), %r14
movq 0x8(%rcx), %r12
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rcx
movq %r14, %r8
movq %rbp, %r9
callq 0x5315a
cmpl $0x0, (%rbp)
jne 0x6d301
cmpb $0x0, 0x10(%r13)
jne 0x6d2be
movq 0x18(%r13), %rax
movq %rax, (%rsp)
addq $0x18, %r13
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %r8
movq %rbp, %r9
callq 0x5315a
cmpl $0x0, (%rbp)
jne 0x6d301
movq 0x10(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
callq 0x52f08
cmpl $-0x1, %eax
jne 0x6d2af
movq 0x10(%rbx), %rcx
movq 0x8(%rcx), %rcx
movq (%r13), %rdx
movq $0x7fffffff, (%rcx,%rdx,8) # imm = 0x7FFFFFFF
movq 0x10(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq (%r13), %rdx
movl %eax, (%rcx,%rdx,4)
movq 0x10(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x52f08
cmpl $-0x1, %eax
jne 0x6d2ef
movq 0x10(%rbx), %rcx
movq 0x8(%rcx), %rcx
movq (%r14), %rdx
movq $0x7fffffff, (%rcx,%rdx,8) # imm = 0x7FFFFFFF
movq 0x10(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq (%r14), %rdx
movl %eax, (%rcx,%rdx,4)
incq 0x20(%rbx)
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/fpa_alloc.c
// Function: prv_alloc_fpa_cptran_instr
static void prv_alloc_fpa_cptran_instr(void *user_data, subtilis_arm_op_t *op,
				       subtilis_arm_instr_type_t type,
				       subtilis_fpa_cptran_instr_t *instr,
				       subtilis_error_t *err)
{
	subtilis_arm_reg_ud_t *ud = user_data;
	size_t vreg_dest;
	bool fixed_reg_dest;
	int dist_dest;

	if (type == SUBTILIS_FPA_INSTR_RFS) {
		subtilis_arm_reg_alloc_alloc_dest(ud, op, &instr->dest, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	} else {
		vreg_dest = instr->dest;
		fixed_reg_dest = subtilis_arm_reg_alloc_ensure(
		    ud, op, ud->int_regs, ud->int_regs, &instr->dest, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		if (!fixed_reg_dest) {
			dist_dest = subtilis_arm_reg_alloc_calculate_dist(
			    ud, vreg_dest, op, &ud->int_regs->dist_walker,
			    ud->int_regs);
			if (dist_dest == -1)
				ud->int_regs->phys_to_virt[instr->dest] =
				    INT_MAX;

			ud->int_regs->next[instr->dest] = dist_dest;
		}
	}

	ud->instr_count++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %r12
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %rbx
addq $0x8, %r14
cmpl $0x45, %edx
jne 0x6d370
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0x5336c
cmpl $0x0, (%r12)
jne 0x6d3d9
jmp 0x6d3d5
movq (%r14), %r13
movq 0x8(%rbx), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %rcx, %rdx
movq %r14, %r8
movq %r12, %r9
callq 0x5315a
cmpl $0x0, (%r12)
jne 0x6d3d9
testb %al, %al
jne 0x6d3d5
movq 0x8(%rbx), %r8
leaq 0x90(%r8), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x52f08
cmpl $-0x1, %eax
jne 0x6d3c7
movq 0x8(%rbx), %rcx
movq 0x8(%rcx), %rcx
movq (%r14), %rdx
movq $0x7fffffff, (%rcx,%rdx,8) # imm = 0x7FFFFFFF
movq 0x8(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq (%r14), %rdx
movl %eax, (%rcx,%rdx,4)
incq 0x20(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_fpa_dist.c
// Function: prv_dist_fpa_data_monadic_instr
static void prv_dist_fpa_data_monadic_instr(void *user_data,
					    subtilis_arm_op_t *op,
					    subtilis_arm_instr_type_t type,
					    subtilis_fpa_data_instr_t *instr,
					    subtilis_error_t *err)
{
	subtilis_dist_data_t *ud = user_data;

	if (!instr->immediate && ud->reg_num == instr->op2.reg) {
		subtilis_error_set_walker_failed(err);
		return;
	}

	if (instr->dest == ud->reg_num) {
		ud->last_used = -1;
		subtilis_error_set_walker_failed(err);
		return;
	}

	ud->last_used++;
}

// Assembly:
cmpb $0x0, 0x20(%rcx)
jne 0x6d72a
movq (%rdi), %rax
cmpq 0x28(%rcx), %rax
jne 0x6d72a
leaq 0x98f0(%rip), %rdx      # 0x77008
movq %r8, %rdi
movl $0x1f, %esi
movl $0xc9, %ecx
jmp 0x145f4
movq 0x10(%rcx), %rax
cmpq (%rdi), %rax
jne 0x6d753
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
leaq 0x98c7(%rip), %rdx      # 0x77008
movq %r8, %rdi
movl $0x1f, %esi
movl $0xcf, %ecx
jmp 0x145f4
incl 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/arch/arm32/arm_fpa_dist.c
// Function: prv_dist_fpa_cmp_instr
static void prv_dist_fpa_cmp_instr(void *user_data, subtilis_arm_op_t *op,
				   subtilis_arm_instr_type_t type,
				   subtilis_fpa_cmp_instr_t *instr,
				   subtilis_error_t *err)
{
	subtilis_dist_data_t *ud = user_data;

	if (instr->dest == ud->reg_num) {
		subtilis_error_set_walker_failed(err);
		return;
	}

	if (!instr->immediate && instr->op2.reg == ud->reg_num) {
		subtilis_error_set_walker_failed(err);
		return;
	}

	ud->last_used++;
}

// Assembly:
movq (%rdi), %rax
cmpq %rax, 0x8(%rcx)
jne 0x6d89c
leaq 0x977e(%rip), %rdx      # 0x77008
movq %r8, %rdi
movl $0x1f, %esi
movl $0x114, %ecx            # imm = 0x114
jmp 0x145f4
cmpb $0x0, 0x10(%rcx)
jne 0x6d8c1
cmpq %rax, 0x18(%rcx)
jne 0x6d8c1
leaq 0x9759(%rip), %rdx      # 0x77008
movq %r8, %rdi
movl $0x1f, %esi
movl $0x119, %ecx            # imm = 0x119
jmp 0x145f4
incl 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos/riscos_arm2.c
// Function: subtilis_riscos_arm_gcol_tint
void subtilis_riscos_arm_gcol_tint(subtilis_ir_section_t *s, size_t start,
				   void *user_data, subtilis_error_t *err)
{
	size_t col;
	size_t tint;
	subtilis_arm_reg_t dest;
	subtilis_arm_reg_t op2;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *gcol = &s->ops[start]->op.instr;
	const size_t vdu = 256 + 0x20000;

	col = subtilis_arm_ir_to_arm_reg(gcol->operands[1].reg);
	tint = subtilis_arm_ir_to_arm_reg(gcol->operands[2].reg);

	/* read_mask = 0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_AL, vdu + 18, 0, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	dest = 0;
	op2 = subtilis_arm_ir_to_arm_reg(gcol->operands[0].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_VC, false, dest, op2,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_WriteC */
	/* read_mask = 0x1 = r0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_VC, 0 + 0x20000, 1, 0,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	dest = 0;

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_VC, false, dest, col,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_WriteC */
	/* read_mask = 0x1 = r0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_VC, 0 + 0x20000, 1, 0,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	prv_do_tint(arm_s, col, tint, 2, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %rbp
movq 0x18(%rbp), %rdi
callq 0x4eff7
movq %rax, %r12
movq 0x20(%rbp), %rdi
callq 0x4eff7
movq %rax, %r13
movl $0x20112, %edx          # imm = 0x20112
movq %r14, %rdi
movl $0xe, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6ddc5
movq 0x10(%rbp), %rdi
callq 0x4eff7
movq %rbx, (%rsp)
movq %r14, %rdi
movl $0xd, %esi
movl $0x7, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6ddc5
movl $0x20000, %edx          # imm = 0x20000
movq %r14, %rdi
movl $0x7, %esi
movl $0x1, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6ddc5
movq %rbx, (%rsp)
movq %r14, %rdi
movl $0xd, %esi
movl $0x7, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6ddc5
movl $0x20000, %edx          # imm = 0x20000
movq %r14, %rdi
movl $0x7, %esi
movl $0x1, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6ddc5
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl $0x2, %ecx
movq %rbx, %r8
callq 0x6e08b
cmpl $0x0, (%rbx)
je 0x6ddd4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6ed7d
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos/riscos_arm2.c
// Function: subtilis_riscos_tcol_tint
void subtilis_riscos_tcol_tint(subtilis_ir_section_t *s, size_t start,
			       void *user_data, subtilis_error_t *err)
{
	size_t col;
	size_t tint;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *tcol = &s->ops[start]->op.instr;

	col = subtilis_arm_ir_to_arm_reg(tcol->operands[0].reg);
	tint = subtilis_arm_ir_to_arm_reg(tcol->operands[1].reg);

	/* read_mask = 0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_AL, 256 + 17 + 0x20000,
			     0, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_VC, false, 0, col,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_WriteC */
	/* read_mask = 0x1 = r0 */
	/* write_mask = 0 */

	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_VC, 0 + 0x20000, 1, 0,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	prv_do_tint(arm_s, col, tint, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %r13
movq 0x10(%r13), %rdi
callq 0x4eff7
movq %rax, %r12
movq 0x18(%r13), %rdi
callq 0x4eff7
movq %rax, %r13
movl $0x20111, %edx          # imm = 0x20111
movq %r14, %rdi
movl $0xe, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6deaf
movq %rbx, (%rsp)
movq %r14, %rdi
movl $0xd, %esi
movl $0x7, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6deaf
movl $0x20000, %edx          # imm = 0x20000
movq %r14, %rdi
movl $0x7, %esi
movl $0x1, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6deaf
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x6e08b
cmpl $0x0, (%rbx)
je 0x6debd
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x6ed7d
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos/riscos_arm2.c
// Function: subtilis_riscos_arm2_syscall
void subtilis_riscos_arm2_syscall(subtilis_ir_section_t *s, size_t start,
				  void *user_data, subtilis_error_t *err)
{
	size_t flags_reg;
	subtilis_arm_instr_t *instr;
	subtilis_arm_data_instr_t *datai;
	subtilis_ir_sys_call_t *sys_call = &s->ops[start]->op.sys_call;
	subtilis_arm_section_t *arm_s = user_data;

	subtilis_riscos_arm_syscall(s, start, user_data,
				    subtilis_riscos_swi_list,
				    subtilis_riscos_known_swis, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	if (sys_call->flags_reg != SIZE_MAX) {
		if (sys_call->flags_local)
			flags_reg =
			    subtilis_arm_ir_to_arm_reg(sys_call->flags_reg);
		else
			flags_reg =
			    subtilis_arm_ir_to_arm_reg(arm_s->reg_counter++);
		subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_AL, false,
					 flags_reg, 15, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;

		instr = subtilis_arm_section_add_instr(
		    arm_s, SUBTILIS_ARM_INSTR_MOV, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		datai = &instr->operands.data;
		datai->ccode = SUBTILIS_ARM_CCODE_AL;
		datai->status = false;
		datai->dest = flags_reg;
		datai->op2.type = SUBTILIS_ARM_OP2_SHIFTED;
		datai->op2.op.shift.reg = flags_reg;
		datai->op2.op.shift.shift_reg = false;
		datai->op2.op.shift.shift.integer = 28;
		datai->op2.op.shift.type = SUBTILIS_ARM_SHIFT_LSR;

		if (!sys_call->flags_local)
			subtilis_arm_add_stran_imm(
			    arm_s, SUBTILIS_ARM_INSTR_STR,
			    SUBTILIS_ARM_CCODE_AL, flags_reg,
			    subtilis_arm_ir_to_arm_reg(sys_call->flags_reg), 0,
			    false, err);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %r12
leaq 0xa04b(%rip), %rax      # 0x77f40
movq (%rax), %r8
leaq 0x35cf1(%rip), %rcx     # 0xa3bf0
movq %rbx, %r9
callq 0x70a77
cmpl $0x0, (%rbx)
je 0x6df18
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x18(%r12), %rdi
cmpq $-0x1, %rdi
je 0x6df0c
cmpb $0x0, 0x20(%r12)
jne 0x6df35
movq (%r14), %rdi
leaq 0x1(%rdi), %rax
movq %rax, (%r14)
callq 0x4eff7
movq %rax, %r15
subq $0x8, %rsp
movl $0xf, %r9d
movq %r14, %rdi
movl $0xd, %esi
movl $0xe, %edx
xorl %ecx, %ecx
movq %rax, %r8
pushq %rbx
callq 0x5060d
addq $0x10, %rsp
cmpl $0x0, (%rbx)
jne 0x6df0c
movq %r14, %rdi
movl $0xd, %esi
movq %rbx, %rdx
callq 0x4f73a
cmpl $0x0, (%rbx)
jne 0x6df0c
movl $0xe, 0x8(%rax)
xorl %ecx, %ecx
movb %cl, 0xc(%rax)
movq %r15, 0x10(%rax)
movl $0x2, %edx
movl %edx, 0x20(%rax)
movq %r15, 0x28(%rax)
movb %cl, 0x40(%rax)
movl $0x1c, 0x38(%rax)
movl %edx, 0x30(%rax)
cmpb %cl, 0x20(%r12)
jne 0x6df0c
movq 0x18(%r12), %rdi
callq 0x4eff7
movq %r14, %rdi
movl $0x13, %esi
movl $0xe, %edx
movq %r15, %rcx
movq %rax, %r8
xorl %r9d, %r9d
pushq %rbx
pushq $0x0
callq 0x5067b
addq $0x18, %rsp
jmp 0x6df10
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos/riscos_arm2.c
// Function: subtilis_riscos_arm2_sys_trans
size_t subtilis_riscos_arm2_sys_trans(const char *call_name)
{
	size_t *found;
	size_t error_bit = 0;

	if (call_name[0] == 'X') {
		call_name++;
		error_bit = 0x20000;
	}

	found = bsearch(call_name, &subtilis_riscos_swi_index[0],
			subtilis_riscos_known_swis, sizeof(*found),
			prv_sys_string_lookup);

	if (!found)
		return SIZE_MAX;

	return subtilis_riscos_swi_list[*found].num | error_bit;
}

// Assembly:
pushq %rbx
movb (%rdi), %bl
xorl %eax, %eax
cmpb $0x58, %bl
sete %al
addq %rax, %rdi
leaq 0x9f49(%rip), %rax      # 0x77f40
movq (%rax), %rdx
leaq 0x9f4f(%rip), %rsi      # 0x77f50
leaq 0x39(%rip), %r8         # 0x6e041
movl $0x8, %ecx
callq 0x122a0
testq %rax, %rax
je 0x6e038
xorl %ecx, %ecx
cmpb $0x58, %bl
sete %cl
shll $0x11, %ecx
movq (%rax), %rax
leaq (%rax,%rax,2), %rax
leaq 0x35bc0(%rip), %rdx     # 0xa3bf0
movl (%rdx,%rax,8), %eax
orq %rcx, %rax
jmp 0x6e03f
movq $-0x1, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos_common/riscos_arm.c
// Function: subtilis_riscos_arm_printstr
void subtilis_riscos_arm_printstr(subtilis_ir_section_t *s, size_t start,
				  void *user_data, subtilis_error_t *err)
{
	subtilis_arm_reg_t op2;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *printi = &s->ops[start]->op.instr;

	op2 = subtilis_arm_ir_to_arm_reg(printi->operands[0].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_AL, false, 0, op2,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	op2 = subtilis_arm_ir_to_arm_reg(printi->operands[1].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_AL, false, 1, op2,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_WriteN */
	/* read_mask = 0x3 = r0, r1 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_AL, 0x46 + 0x20000, 0x3,
			     0x0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %r12
movq 0x10(%r12), %rdi
callq 0x4eff7
movq %rbx, (%rsp)
movq %r14, %rdi
movl $0xd, %esi
movl $0xe, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6ee5b
movq 0x18(%r12), %rdi
callq 0x4eff7
movq %rbx, (%rsp)
movl $0x1, %r8d
movq %r14, %rdi
movl $0xd, %esi
movl $0xe, %edx
xorl %ecx, %ecx
movq %rax, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6ee5b
movl $0x20046, %edx          # imm = 0x20046
movq %r14, %rdi
movl $0xe, %esi
movl $0x3, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
je 0x6ee67
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6ed7d
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos_common/riscos_arm.c
// Function: subtilis_riscos_arm_modei32
void subtilis_riscos_arm_modei32(subtilis_ir_section_t *s, size_t start,
				 void *user_data, subtilis_error_t *err)
{
	subtilis_arm_reg_t dest;
	subtilis_arm_reg_t op2;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *modei = &s->ops[start]->op.instr;
	const size_t vdu = 256 + 0x20000;

	dest = 0;
	op2 = subtilis_arm_ir_to_arm_reg(modei->operands[0].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_AL, false, dest, op2,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* read_mask = 0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_AL, vdu + 22, 0, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_WriteC */
	/* read_mask = 0x1 = r0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_VC, 0 + 0x20000, 1, 0,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %rax
movq 0x10(%rax), %rdi
callq 0x4eff7
movq %rbx, (%rsp)
movq %r14, %rdi
movl $0xd, %esi
movl $0xe, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6ef34
movl $0x20116, %edx          # imm = 0x20116
movq %r14, %rdi
movl $0xe, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6ef34
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6ed7d
cmpl $0x0, (%rbx)
jne 0x6ef34
movl $0x20000, %edx          # imm = 0x20000
movq %r14, %rdi
movl $0x7, %esi
movl $0x1, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
je 0x6ef3e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x6ed7d
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos_common/riscos_arm.c
// Function: subtilis_riscos_arm_plot
void subtilis_riscos_arm_plot(subtilis_ir_section_t *s, size_t start,
			      void *user_data, subtilis_error_t *err)
{
	subtilis_arm_reg_t dest;
	subtilis_arm_reg_t op2;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *plot = &s->ops[start]->op.instr;
	const size_t os_plot = 0x45 + 0x20000;

	dest = 0;
	op2 = subtilis_arm_ir_to_arm_reg(plot->operands[0].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_AL, false, dest, op2,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	dest = 1;
	op2 = subtilis_arm_ir_to_arm_reg(plot->operands[1].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_AL, false, dest, op2,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	dest = 2;
	op2 = subtilis_arm_ir_to_arm_reg(plot->operands[2].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_AL, false, dest, op2,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_Plot */
	/* read_mask = 0x7 = r0, r1, r2 */
	/* write_mask = 0x7 = r0, r1, r2 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_AL, os_plot, 0x7, 0x7,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %r12
movq 0x10(%r12), %rdi
callq 0x4eff7
movq %rbx, (%rsp)
movq %r14, %rdi
movl $0xd, %esi
movl $0xe, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6f024
movq 0x18(%r12), %rdi
callq 0x4eff7
movq %rbx, (%rsp)
movl $0x1, %r8d
movq %r14, %rdi
movl $0xd, %esi
movl $0xe, %edx
xorl %ecx, %ecx
movq %rax, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6f024
movq 0x20(%r12), %rdi
callq 0x4eff7
movq %rbx, (%rsp)
movl $0x2, %r8d
movq %r14, %rdi
movl $0xd, %esi
movl $0xe, %edx
xorl %ecx, %ecx
movq %rax, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6f024
movl $0x20045, %edx          # imm = 0x20045
movq %r14, %rdi
movl $0xe, %esi
movl $0x7, %ecx
movl $0x7, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
je 0x6f030
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6ed7d
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos_common/riscos_arm.c
// Function: prv_pos
static void prv_pos(subtilis_ir_section_t *s, size_t start, void *user_data,
		    size_t src_reg, subtilis_error_t *err)
{
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *pos = &s->ops[start]->op.instr;
	subtilis_arm_reg_t dest;

	subtilis_arm_add_mov_imm(arm_s, SUBTILIS_ARM_CCODE_AL, false, 0, 134,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_Byte */
	/* read_mask = 1 = r0  */
	/* write_mask = 6 = r1, r2 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_AL, 0x6 + 0x20000, 1, 6,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	dest = subtilis_arm_ir_to_arm_reg(pos->operands[0].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_VC, false, dest,
				 src_reg, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %r13
movq %rdx, %rdi
movl $0xd, %esi
movl $0xf, %edx
movl $0xe, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rbx
pushq $0x86
callq 0x50249
addq $0x10, %rsp
cmpl $0x0, (%rbx)
jne 0x6f100
movl $0x20006, %edx          # imm = 0x20006
movq %r15, %rdi
movl $0xe, %esi
movl $0x1, %ecx
movl $0x6, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6f100
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6ed7d
cmpl $0x0, (%rbx)
jne 0x6f100
movq 0x10(%r13), %rdi
callq 0x4eff7
subq $0x8, %rsp
movq %r15, %rdi
movl $0xd, %esi
movl $0x7, %edx
xorl %ecx, %ecx
movq %rax, %r8
movq %r14, %r9
pushq %rbx
callq 0x5060d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos_common/riscos_arm.c
// Function: subtilis_riscos_arm_at
void subtilis_riscos_arm_at(subtilis_ir_section_t *s, size_t start,
			    void *user_data, subtilis_error_t *err)
{
	subtilis_arm_reg_t dest;
	subtilis_arm_reg_t op2;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *at = &s->ops[start]->op.instr;
	const size_t os_tab = 256 + 31 + 0x20000;

	/* vdu 31 */
	/* read_mask = 0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_AL, os_tab, 0, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	dest = 0;
	op2 = subtilis_arm_ir_to_arm_reg(at->operands[0].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_AL, false, dest, op2,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_WriteC */
	/* read_mask = 0x1 = r0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_VC, 0 + 0x20000, 1, 0,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	dest = 0;
	op2 = subtilis_arm_ir_to_arm_reg(at->operands[1].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_VC, false, dest, op2,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_WriteC */
	/* read_mask = 0x1 = r0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_VC, 0 + 0x20000, 1, 0,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;
	subtilis_riscos_handle_graphics_error(arm_s, s, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %r12
movl $0x2011f, %edx          # imm = 0x2011F
movq %r14, %rdi
movl $0xe, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6f208
movq 0x10(%r12), %rdi
callq 0x4eff7
movq %rbx, (%rsp)
movq %r14, %rdi
movl $0xd, %esi
movl $0xe, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6f208
movl $0x20000, %edx          # imm = 0x20000
movq %r14, %rdi
movl $0x7, %esi
movl $0x1, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6f208
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6ed7d
cmpl $0x0, (%rbx)
jne 0x6f208
movq 0x18(%r12), %rdi
callq 0x4eff7
movq %rbx, (%rsp)
movq %r14, %rdi
movl $0xd, %esi
movl $0x7, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6f208
movl $0x20000, %edx          # imm = 0x20000
movq %r14, %rdi
movl $0x7, %esi
movl $0x1, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
je 0x6f214
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6ed7d
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos_common/riscos_arm.c
// Function: subtilis_riscos_arm_gcol
void subtilis_riscos_arm_gcol(subtilis_ir_section_t *s, size_t start,
			      void *user_data, subtilis_error_t *err)
{
	subtilis_arm_reg_t dest;
	subtilis_arm_reg_t op2;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *gcol = &s->ops[start]->op.instr;
	const size_t vdu = 256 + 0x20000;

	/* read_mask = 0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_AL, vdu + 18, 0, 0, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	dest = 0;
	op2 = subtilis_arm_ir_to_arm_reg(gcol->operands[0].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_VC, false, dest, op2,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_WriteC */
	/* read_mask = 0x1 = r0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_VC, 0 + 0x20000, 1, 0,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	dest = 0;
	op2 = subtilis_arm_ir_to_arm_reg(gcol->operands[1].reg);

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_VC, false, dest, op2,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_WriteC */
	/* read_mask = 0x1 = r0 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_VC, 0 + 0x20000, 1, 0,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %r12
movl $0x20112, %edx          # imm = 0x20112
movq %r14, %rdi
movl $0xe, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6f335
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6ed7d
cmpl $0x0, (%rbx)
jne 0x6f335
movq 0x10(%r12), %rdi
callq 0x4eff7
movq %rbx, (%rsp)
movq %r14, %rdi
movl $0xd, %esi
movl $0x7, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6f335
movl $0x20000, %edx          # imm = 0x20000
movq %r14, %rdi
movl $0x7, %esi
movl $0x1, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6f335
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6ed7d
cmpl $0x0, (%rbx)
jne 0x6f335
movq 0x18(%r12), %rdi
callq 0x4eff7
movq %rbx, (%rsp)
movq %r14, %rdi
movl $0xd, %esi
movl $0x7, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x5060d
cmpl $0x0, (%rbx)
jne 0x6f335
movl $0x20000, %edx          # imm = 0x20000
movq %r14, %rdi
movl $0x7, %esi
movl $0x1, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
je 0x6f341
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6ed7d
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos_common/riscos_arm.c
// Function: subtilis_riscos_arm_gettime
void subtilis_riscos_arm_gettime(subtilis_ir_section_t *s, size_t start,
				 void *user_data, subtilis_error_t *err)
{
	subtilis_arm_reg_t one;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *origin = &s->ops[start]->op.instr;
	size_t ir_dest = origin->operands[0].reg;
	subtilis_arm_reg_t dest = subtilis_arm_ir_to_arm_reg(ir_dest);

	/*
	 * TOOD: Need to check for stack overflow.
	 */

	subtilis_arm_add_data_imm(arm_s, SUBTILIS_ARM_INSTR_SUB,
				  SUBTILIS_ARM_CCODE_AL, false, 1, 13, 8, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_arm_add_mov_imm(arm_s, SUBTILIS_ARM_CCODE_AL, false, 0, 1,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_Word */
	/* read_mask = 0x3 = r0, r1 */
	/* write_mask = 0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_AL, 0x07 + 0x20000, 3, 0,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	one = subtilis_arm_ir_to_arm_reg(arm_s->reg_counter++);
	subtilis_arm_gen_sete_load_reg(arm_s, s, SUBTILIS_ARM_CCODE_VS, one,
				       err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_arm_add_stran_imm(arm_s, SUBTILIS_ARM_INSTR_LDR,
				   SUBTILIS_ARM_CCODE_VC, dest, 1, 0, false,
				   err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r12
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %rax
movq 0x10(%rax), %rdi
callq 0x4eff7
movq %rax, %r15
movl $0x1, %r8d
movl $0xd, %r9d
movq %r14, %rdi
movl $0x2, %esi
movl $0xe, %edx
xorl %ecx, %ecx
pushq %rbx
pushq $0x8
callq 0x503c6
addq $0x10, %rsp
cmpl $0x0, (%rbx)
jne 0x6f58c
movq %r14, %rdi
movl $0xd, %esi
movl $0xf, %edx
movl $0xe, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rbx
pushq $0x1
callq 0x50249
addq $0x10, %rsp
cmpl $0x0, (%rbx)
jne 0x6f58c
movl $0x20007, %edx          # imm = 0x20007
movq %r14, %rdi
movl $0xe, %esi
movl $0x3, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
jne 0x6f58c
movq (%r14), %rdi
leaq 0x1(%rdi), %rax
movq %rax, (%r14)
callq 0x4eff7
movq %r14, %rdi
movq %r12, %rsi
movl $0x6, %edx
movq %rax, %rcx
movq %rbx, %r8
callq 0x526e6
cmpl $0x0, (%rbx)
je 0x6f598
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x1, %r8d
movq %r14, %rdi
movl $0x12, %esi
movl $0x7, %edx
movq %r15, %rcx
xorl %r9d, %r9d
pushq %rbx
pushq $0x0
callq 0x5067b
addq $0x18, %rsp
jmp 0x6f590
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos_common/riscos_arm.c
// Function: subtilis_riscos_arm_wait
void subtilis_riscos_arm_wait(subtilis_ir_section_t *s, size_t start,
			      void *user_data, subtilis_error_t *err)
{
	subtilis_arm_section_t *arm_s = user_data;

	subtilis_arm_add_mov_imm(arm_s, SUBTILIS_ARM_CCODE_AL, false, 0, 19,
				 err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	/* OS_Byte */
	/* read_mask = 1 = r0  */
	/* write_mask = 6 = r1, r2 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_AL, 0x6 + 0x20000, 1, 6,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_riscos_handle_graphics_error(arm_s, s, err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, %r14
movq %rdx, %rdi
movl $0xd, %esi
movl $0xf, %edx
movl $0xe, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rbx
pushq $0x13
callq 0x50249
addq $0x10, %rsp
cmpl $0x0, (%rbx)
jne 0x6f733
movl $0x20006, %edx          # imm = 0x20006
movq %r15, %rdi
movl $0xe, %esi
movl $0x1, %ecx
movl $0x6, %r8d
movq %rbx, %r9
callq 0x505b2
cmpl $0x0, (%rbx)
je 0x6f739
popq %rbx
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x6ed7d
// File: /workspace/github_c_makefile_star2_O1/markdryan[P]subtilis/backends/riscos_common/riscos_arm.c
// Function: subtilis_riscos_arm_get
void subtilis_riscos_arm_get(subtilis_ir_section_t *s, size_t start,
			     void *user_data, subtilis_error_t *err)
{
	subtilis_arm_reg_t one;
	subtilis_arm_section_t *arm_s = user_data;
	subtilis_ir_inst_t *get = &s->ops[start]->op.instr;
	size_t ir_dest = get->operands[0].reg;
	subtilis_arm_reg_t dest = subtilis_arm_ir_to_arm_reg(ir_dest);

	/* OS_ReadC */
	/* read_mask = 0 */
	/* write_mask = 1 = r0 */
	subtilis_arm_add_swi(arm_s, SUBTILIS_ARM_CCODE_AL, 0x4 + 0x20000, 0, 1,
			     err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	one = subtilis_arm_ir_to_arm_reg(arm_s->reg_counter++);
	subtilis_arm_gen_sete_load_reg(arm_s, s, SUBTILIS_ARM_CCODE_VS, one,
				       err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_VC, false, dest, 0,
				 err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r12
movq 0x48(%rdi), %rax
movq (%rax,%rsi,8), %rax
movq 0x10(%rax), %rdi
callq 0x4eff7
movq %rax, %r15
movl $0x20004, %edx          # imm = 0x20004
movq %rbx, %rdi
movl $0xe, %esi
xorl %ecx, %ecx
movl $0x1, %r8d
movq %r14, %r9
callq 0x505b2
cmpl $0x0, (%r14)
jne 0x6f7dd
movq (%rbx), %rdi
leaq 0x1(%rdi), %rax
movq %rax, (%rbx)
callq 0x4eff7
movq %rbx, %rdi
movq %r12, %rsi
movl $0x6, %edx
movq %rax, %rcx
movq %r14, %r8
callq 0x526e6
cmpl $0x0, (%r14)
jne 0x6f7dd
movq %r14, (%rsp)
movq %rbx, %rdi
movl $0xd, %esi
movl $0x7, %edx
xorl %ecx, %ecx
movq %r15, %r8
xorl %r9d, %r9d
callq 0x5060d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq