	.file	"extr_sa1100fb.c_sa1100fb_setpalettereg.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sa1100fb_setpalettereg, @function
sa1100fb_setpalettereg:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	eax, 1
	movsx	rbp, edi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	cmp	DWORD PTR [r9], ebp
	jle	.L1
	sar	edx, 8
	mov	ebx, ecx
	sar	esi, 4
	sar	ebx, 12
	and	edx, 240
	and	esi, 3840
	and	ebx, 15
	or	ebx, edx
	or	ebx, esi
	test	ebp, ebp
	je	.L8
.L3:
	mov	rax, QWORD PTR 8[r9]
	mov	DWORD PTR [rax+rbp*4], ebx
	xor	eax, eax
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	lea	rdi, 16[r9]
	mov	QWORD PTR 8[rsp], r9
	call	palette_pbs@PLT
	mov	r9, QWORD PTR 8[rsp]
	or	ebx, eax
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	sa1100fb_setpalettereg, .-sa1100fb_setpalettereg
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_sa1100fb.c_sa1100fb_setpalettereg.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sa1100fb_setpalettereg, %function
sa1100fb_setpalettereg:
	@ args = 8, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r5, r0
	ldr	r6, [sp, #20]
	ldr	r0, [r6]
	cmp	r0, r5
	ble	.L4
	asr	r2, r2, #8
	and	r2, r2, #240
	asr	r1, r1, #4
	lsl	r3, r3, #16
	and	r1, r1, #3840
	orr	r4, r2, r3, lsr #28
	cmp	r5, #0
	orr	r4, r4, r1
	beq	.L7
.L3:
	ldr	r3, [r6, #4]
	mov	r0, #0
	str	r4, [r3, r5, lsl #2]
	pop	{r4, r5, r6, pc}
.L4:
	mov	r0, #1
	pop	{r4, r5, r6, pc}
.L7:
	add	r0, r6, #8
	bl	palette_pbs
	orr	r4, r4, r0
	b	.L3
	.size	sa1100fb_setpalettereg, .-sa1100fb_setpalettereg
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
