	.file	"extr_w100fb.c_w100fb_set_par.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	w100fb_set_par, @function
w100fb_set_par:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rbp, QWORD PTR 56[rdi]
	mov	rax, QWORD PTR 40[rdi]
	mov	rdx, QWORD PTR 48[rdi]
	cmp	QWORD PTR 0[rbp], rax
	jne	.L2
	cmp	QWORD PTR 8[rbp], rdx
	je	.L3
.L2:
	mov	QWORD PTR 8[rbp], rdx
	xor	ecx, ecx
	lea	rdx, 8[rbp]
	mov	rsi, rbp
	mov	QWORD PTR 0[rbp], rax
	mov	rdi, rbp
	call	w100fb_get_mode@PLT
	mov	rdi, r12
	mov	DWORD PTR 32[rbp], eax
	mov	eax, DWORD PTR FB_VISUAL_TRUECOLOR[rip]
	mov	QWORD PTR 24[r12], 0
	mov	DWORD PTR 32[r12], eax
	movsx	rax, DWORD PTR BITS_PER_PIXEL[rip]
	mov	QWORD PTR 16[r12], 0
	imul	rax, QWORD PTR 0[rbp]
	mov	rdx, rax
	lea	rax, 7[rax]
	test	rdx, rdx
	cmovns	rax, rdx
	sar	rax, 3
	mov	DWORD PTR 8[r12], eax
	call	mutex_lock@PLT
	mov	eax, DWORD PTR MEM_INT_SIZE[rip]
	movsx	rdx, DWORD PTR BITS_PER_PIXEL[rip]
	lea	ecx, 1[rax]
	mov	rax, QWORD PTR 0[rbp]
	imul	rax, QWORD PTR 8[rbp]
	imul	rax, rdx
	lea	rdx, 7[rax]
	test	rax, rax
	cmovs	rax, rdx
	movsx	rdx, ecx
	sar	rax, 3
	cmp	rax, rdx
	jg	.L8
	mov	DWORD PTR 16[rbp], 0
	mov	DWORD PTR 12[r12], ecx
.L5:
	mov	rdi, r12
	call	mutex_unlock@PLT
	mov	rdi, rbp
	call	w100fb_activate_var@PLT
.L3:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	rax, QWORD PTR 24[rbp]
	mov	DWORD PTR 16[rbp], 1
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR [rax]
	add	eax, 1
	mov	DWORD PTR 12[r12], eax
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	w100fb_set_par, .-w100fb_set_par
	.comm	MEM_INT_SIZE,4,4
	.comm	FB_VISUAL_TRUECOLOR,4,4
	.comm	BITS_PER_PIXEL,4,4
	.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_w100fb.c_w100fb_set_par.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	w100fb_set_par, %function
w100fb_set_par:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r5, [r0, #32]
	ldr	r3, [r0, #24]
	ldr	r2, [r5]
	mov	r4, r0
	cmp	r2, r3
	ldr	r1, [r0, #28]
	bne	.L2
	ldr	r2, [r5, #4]
	cmp	r2, r1
	beq	.L3
.L2:
	mov	r2, r5
	ldr	r6, .L8
	str	r3, [r5]
	mov	r0, r5
	str	r1, [r2, #4]!
	mov	r3, #0
	mov	r1, r5
	bl	w100fb_get_mode
	ldr	r3, [r5]
	ldr	r2, [r6]
	mov	r7, #0
	mul	r3, r2, r3
	cmp	r3, #0
	add	r2, r3, #7
	movlt	r3, r2
	ldr	r2, .L8+4
	asr	r3, r3, #3
	ldr	r2, [r2]
	str	r0, [r5, #16]
	str	r3, [r4, #4]
	str	r2, [r4, #20]
	mov	r0, r4
	str	r7, [r4, #16]
	str	r7, [r4, #12]
	bl	mutex_lock
	ldr	r3, [r5]
	ldr	r1, [r5, #4]
	ldr	r2, [r6]
	mul	r3, r1, r3
	mul	r3, r2, r3
	add	r2, r3, #7
	cmp	r3, r7
	movlt	r3, r2
	ldr	r2, .L8+8
	mov	r0, r4
	ldr	r2, [r2]
	add	r2, r2, #1
	cmp	r2, r3, asr #3
	movlt	r2, #1
	ldrlt	r3, [r5, #12]
	strlt	r2, [r5, #8]
	ldrlt	r3, [r3]
	strge	r7, [r5, #8]
	ldrlt	r3, [r3]
	strge	r2, [r4, #8]
	addlt	r3, r3, r2
	strlt	r3, [r4, #8]
	bl	mutex_unlock
	mov	r0, r5
	bl	w100fb_activate_var
.L3:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	.align	2
.L8:
	.word	BITS_PER_PIXEL
	.word	FB_VISUAL_TRUECOLOR
	.word	MEM_INT_SIZE
	.size	w100fb_set_par, .-w100fb_set_par
	.comm	MEM_INT_SIZE,4,4
	.comm	FB_VISUAL_TRUECOLOR,4,4
	.comm	BITS_PER_PIXEL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
