// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/arm_dump.c
// Function: prv_dump_flags_instr
static void prv_dump_flags_instr(void *user_data, subtilis_arm_op_t *op,
				 subtilis_arm_instr_type_t type,
				 subtilis_arm_flags_instr_t *instr,
				 subtilis_error_t *err)
{
	const char *flags_reg;
	char fields[5];
	size_t field_count = 0;

	printf("\t%s", instr_desc[type]);
	if (instr->ccode != SUBTILIS_ARM_CCODE_AL)
		printf("%s", ccode_desc[instr->ccode]);
	flags_reg =
	    instr->flag_reg == SUBTILIS_ARM_FLAGS_CPSR ? "CPSR" : "SPSR";

	if (type == SUBTILIS_ARM_INSTR_MSR) {
		if (instr->fields & SUBTILIS_ARM_FLAGS_FIELD_CONTROL)
			fields[field_count++] = 'c';
		if (instr->fields & SUBTILIS_ARM_FLAGS_FIELD_EXTENSION)
			fields[field_count++] = 'x';
		if (instr->fields & SUBTILIS_ARM_FLAGS_FIELD_STATUS)
			fields[field_count++] = 's';
		if (instr->fields & SUBTILIS_ARM_FLAGS_FIELD_FLAGS)
			fields[field_count++] = 'f';
		fields[field_count] = 0;
		if (instr->op2_reg)
			printf(" %s_%s, R%zu\n", flags_reg, fields,
			       instr->op.reg);
		else
			printf(" %s_%s, #%" PRIu32 "\n", flags_reg, fields,
			       instr->op.integer);
	} else {
		printf(" R%zu, %s\n", instr->op.reg, flags_reg);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x40(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %ecx
leaq 0x4a561(%rip), %rax     # 0xcf760
movq (%rax,%rcx,8), %rsi
leaq 0x25c8c(%rip), %rdi     # 0xaae96
movb $0x0, %al
callq 0x120f0
movq -0x20(%rbp), %rax
cmpl $0xe, (%rax)
je 0x8523b
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, %ecx
leaq 0x4aa97(%rip), %rax     # 0xcfcc0
movq (%rax,%rcx,8), %rsi
leaq 0x25c63(%rip), %rdi     # 0xaae97
movb $0x0, %al
callq 0x120f0
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0x2903b(%rip), %rax     # 0xae284
leaq 0x28406(%rip), %rcx     # 0xad656
cmpl $0x0, %edx
cmoveq %rcx, %rax
movq %rax, -0x30(%rbp)
cmpl $0x1c, -0x14(%rbp)
jne 0x8534b
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x8528a
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb $0x63, -0x35(%rbp,%rax)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x20000, %eax          # imm = 0x20000
cmpl $0x0, %eax
je 0x852af
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb $0x78, -0x35(%rbp,%rax)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
je 0x852d4
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb $0x73, -0x35(%rbp,%rax)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x80000, %eax          # imm = 0x80000
cmpl $0x0, %eax
je 0x852f9
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movb $0x66, -0x35(%rbp,%rax)
movq -0x40(%rbp), %rax
movb $0x0, -0x35(%rbp,%rax)
movq -0x20(%rbp), %rax
testb $0x1, 0xc(%rax)
je 0x8532c
movq -0x30(%rbp), %rsi
leaq -0x35(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
leaq 0x28338(%rip), %rdi     # 0xad65b
movb $0x0, %al
callq 0x120f0
jmp 0x85349
movq -0x30(%rbp), %rsi
leaq -0x35(%rbp), %rdx
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0x28327(%rip), %rdi     # 0xad669
movb $0x0, %al
callq 0x120f0
jmp 0x85365
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x30(%rbp), %rdx
leaq 0x28318(%rip), %rdi     # 0xad676
movb $0x0, %al
callq 0x120f0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)