// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/arm_mem.c
// Function: subtilis_arm_mem_memseti8
void subtilis_arm_mem_memseti8(subtilis_ir_section_t *s,
			       subtilis_arm_section_t *arm_s,
			       subtilis_error_t *err)
{
	subtilis_arm_br_instr_t *br;
	subtilis_arm_instr_t *instr;
	subtilis_arm_data_instr_t *datai;
	subtilis_arm_stran_instr_t *stran;
	const size_t base_reg = 0;
	const size_t size_reg = 1;
	const size_t val = 2;
	const size_t end_reg = 11;
	size_t tiny_label = arm_s->label_counter++;
	size_t finish_label = arm_s->label_counter++;
	size_t start_tiny_loop = arm_s->label_counter++;

	subtilis_arm_add_cmp_imm(arm_s, SUBTILIS_ARM_INSTR_CMP,
				 SUBTILIS_ARM_CCODE_AL, size_reg, 4, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	instr =
	    subtilis_arm_section_add_instr(arm_s, SUBTILIS_ARM_INSTR_B, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	br = &instr->operands.br;
	br->ccode = SUBTILIS_ARM_CCODE_LT;
	br->link = false;
	br->link_type = SUBTILIS_ARM_BR_LINK_VOID;
	br->target.label = tiny_label;

	instr =
	    subtilis_arm_section_add_instr(arm_s, SUBTILIS_ARM_INSTR_ORR, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	datai = &instr->operands.data;
	datai->status = false;
	datai->ccode = SUBTILIS_ARM_CCODE_AL;
	datai->dest = val;
	datai->op1 = val;
	datai->op2.type = SUBTILIS_ARM_OP2_SHIFTED;
	datai->op2.op.shift.shift_reg = false;
	datai->op2.op.shift.reg = val;
	datai->op2.op.shift.type = SUBTILIS_ARM_SHIFT_LSL;
	datai->op2.op.shift.shift.integer = 16;

	instr =
	    subtilis_arm_section_add_instr(arm_s, SUBTILIS_ARM_INSTR_ORR, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	datai = &instr->operands.data;
	datai->status = false;
	datai->ccode = SUBTILIS_ARM_CCODE_AL;
	datai->dest = val;
	datai->op1 = val;
	datai->op2.type = SUBTILIS_ARM_OP2_SHIFTED;
	datai->op2.op.shift.shift_reg = false;
	datai->op2.op.shift.reg = val;
	datai->op2.op.shift.type = SUBTILIS_ARM_SHIFT_LSL;
	datai->op2.op.shift.shift.integer = 8;

	instr =
	    subtilis_arm_section_add_instr(arm_s, SUBTILIS_ARM_INSTR_ADD, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	datai = &instr->operands.data;
	datai->status = false;
	datai->ccode = SUBTILIS_ARM_CCODE_AL;
	datai->dest = end_reg;
	datai->op1 = base_reg;
	datai->op2.type = SUBTILIS_ARM_OP2_REG;
	datai->op2.op.reg = size_reg;

	instr =
	    subtilis_arm_section_add_instr(arm_s, SUBTILIS_ARM_INSTR_BIC, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	datai = &instr->operands.data;
	datai->status = false;
	datai->ccode = SUBTILIS_ARM_CCODE_AL;
	datai->dest = end_reg;
	datai->op1 = end_reg;
	datai->op2.type = SUBTILIS_ARM_OP2_I32;
	datai->op2.op.integer = 3;

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

	instr =
	    subtilis_arm_section_add_instr(arm_s, SUBTILIS_ARM_INSTR_AND, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	datai = &instr->operands.data;
	datai->status = false;
	datai->ccode = SUBTILIS_ARM_CCODE_AL;
	datai->dest = size_reg;
	datai->op1 = size_reg;
	datai->op2.type = SUBTILIS_ARM_OP2_I32;
	datai->op2.op.integer = 3;

	subtilis_arm_section_add_label(arm_s, tiny_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	instr =
	    subtilis_arm_section_add_instr(arm_s, SUBTILIS_ARM_INSTR_ADD, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	datai = &instr->operands.data;
	datai->status = false;
	datai->ccode = SUBTILIS_ARM_CCODE_AL;
	datai->dest = end_reg;
	datai->op1 = base_reg;
	datai->op2.type = SUBTILIS_ARM_OP2_REG;
	datai->op2.op.reg = size_reg;

	subtilis_arm_section_add_label(arm_s, start_tiny_loop, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_arm_add_cmp(arm_s, SUBTILIS_ARM_INSTR_CMP,
			     SUBTILIS_ARM_CCODE_AL, base_reg, end_reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	instr =
	    subtilis_arm_section_add_instr(arm_s, SUBTILIS_ARM_INSTR_B, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	br = &instr->operands.br;
	br->ccode = SUBTILIS_ARM_CCODE_GE;
	br->link = false;
	br->link_type = SUBTILIS_ARM_BR_LINK_VOID;
	br->target.label = finish_label;

	instr =
	    subtilis_arm_section_add_instr(arm_s, SUBTILIS_ARM_INSTR_STR, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	stran = &instr->operands.stran;
	stran->ccode = SUBTILIS_ARM_CCODE_AL;
	stran->dest = val;
	stran->base = base_reg;
	stran->offset.type = SUBTILIS_ARM_OP2_I32;
	stran->offset.op.integer = 1;
	stran->pre_indexed = false;
	stran->write_back = true;
	stran->subtract = false;
	stran->byte = true;

	instr =
	    subtilis_arm_section_add_instr(arm_s, SUBTILIS_ARM_INSTR_B, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	br = &instr->operands.br;
	br->ccode = SUBTILIS_ARM_CCODE_AL;
	br->link = false;
	br->link_type = SUBTILIS_ARM_BR_LINK_VOID;
	br->target.label = start_tiny_loop;

	subtilis_arm_section_add_label(arm_s, finish_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_arm_add_mov_reg(arm_s, SUBTILIS_ARM_CCODE_AL, false, 15, 14,
				 err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x1, -0x48(%rbp)
movq $0x2, -0x50(%rbp)
movq $0xb, -0x58(%rbp)
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x10(%rcx)
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x10(%rcx)
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x10(%rcx)
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %r9
movl $0xa, %esi
movl $0xe, %edx
movl $0x1, %ecx
movl $0x4, %r8d
callq 0x72620
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8aecc
jmp 0x8b40a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x16, %esi
callq 0x70b50
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8aef0
jmp 0x8b40a
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl $0xb, (%rax)
movq -0x20(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x60(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0xc, %esi
callq 0x70b50
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8af49
jmp 0x8b40a
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x30(%rbp), %rax
movl $0xe, (%rax)
movq -0x30(%rbp), %rax
movq $0x2, 0x8(%rax)
movq -0x30(%rbp), %rax
movq $0x2, 0x10(%rax)
movq -0x30(%rbp), %rax
movl $0x2, 0x18(%rax)
movq -0x30(%rbp), %rax
movb $0x0, 0x38(%rax)
movq -0x30(%rbp), %rax
movq $0x2, 0x20(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x30(%rbp), %rax
movl $0x10, 0x30(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0xc, %esi
callq 0x70b50
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8afd8
jmp 0x8b40a
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x30(%rbp), %rax
movl $0xe, (%rax)
movq -0x30(%rbp), %rax
movq $0x2, 0x8(%rax)
movq -0x30(%rbp), %rax
movq $0x2, 0x10(%rax)
movq -0x30(%rbp), %rax
movl $0x2, 0x18(%rax)
movq -0x30(%rbp), %rax
movb $0x0, 0x38(%rax)
movq -0x30(%rbp), %rax
movq $0x2, 0x20(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x30(%rbp), %rax
movl $0x8, 0x30(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x4, %esi
callq 0x70b50
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b067
jmp 0x8b40a
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x30(%rbp), %rax
movl $0xe, (%rax)
movq -0x30(%rbp), %rax
movq $0xb, 0x8(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x30(%rbp), %rax
movq $0x1, 0x20(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0xe, %esi
callq 0x70b50
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b0d8
jmp 0x8b40a
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x30(%rbp), %rax
movl $0xe, (%rax)
movq -0x30(%rbp), %rax
movq $0xb, 0x8(%rax)
movq -0x30(%rbp), %rax
movq $0xb, 0x10(%rax)
movq -0x30(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x30(%rbp), %rax
movl $0x3, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8a9f0
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b143
jmp 0x8b40a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x70b50
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b164
jmp 0x8b40a
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x30(%rbp), %rax
movl $0xe, (%rax)
movq -0x30(%rbp), %rax
movq $0x1, 0x8(%rax)
movq -0x30(%rbp), %rax
movq $0x1, 0x10(%rax)
movq -0x30(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x30(%rbp), %rax
movl $0x3, 0x20(%rax)
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x70850
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b1cf
jmp 0x8b40a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x4, %esi
callq 0x70b50
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b1f3
jmp 0x8b40a
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x30(%rbp), %rax
movl $0xe, (%rax)
movq -0x30(%rbp), %rax
movq $0xb, 0x8(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x30(%rbp), %rax
movq $0x1, 0x20(%rax)
movq -0x10(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x70850
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b25f
jmp 0x8b40a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %r9
movl $0xa, %esi
movl $0xe, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0xb, %r8d
callq 0x72710
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b28e
jmp 0x8b40a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x16, %esi
callq 0x70b50
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b2b2
jmp 0x8b40a
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl $0xa, (%rax)
movq -0x20(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x68(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x13, %esi
callq 0x70b50
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b30b
jmp 0x8b40a
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl $0xe, (%rax)
movq -0x38(%rbp), %rax
movq $0x2, 0x8(%rax)
movq -0x38(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x38(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x38(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x38(%rbp), %rax
movb $0x0, 0x40(%rax)
movq -0x38(%rbp), %rax
movb $0x1, 0x41(%rax)
movq -0x38(%rbp), %rax
movb $0x0, 0x42(%rax)
movq -0x38(%rbp), %rax
movb $0x1, 0x43(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x16, %esi
callq 0x70b50
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b390
jmp 0x8b40a
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl $0xe, (%rax)
movq -0x20(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x70(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x70850
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x8b3e1
jmp 0x8b40a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl $0xd, %esi
movl $0xe, %edx
xorl %ecx, %ecx
movl $0xf, %r8d
movl $0xe, %r9d
movq %rax, (%rsp)
callq 0x71fa0
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)