	.file	"extr_backlight.c___pmac_backlight_set_legacy_brightness.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	__pmac_backlight_set_legacy_brightness, @function
__pmac_backlight_set_legacy_brightness:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, edi
	lea	rdi, pmac_backlight_mutex[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	r12d, DWORD PTR ENXIO[rip]
	call	mutex_lock@PLT
	mov	rdi, QWORD PTR pmac_backlight[rip]
	neg	r12d
	test	rdi, rdi
	je	.L3
	mov	esi, DWORD PTR 4[rdi]
	mov	edx, DWORD PTR OLD_BACKLIGHT_MAX[rip]
	lea	eax, 1[rsi]
	lea	ecx, 1[rdx]
	imul	eax, ebx
	cdq
	idiv	ecx
	cmp	esi, eax
	jl	.L9
	test	eax, eax
	mov	edx, 0
	cmovs	eax, edx
	mov	DWORD PTR [rdi], eax
.L5:
	call	backlight_update_status@PLT
	xor	r12d, r12d
.L3:
	lea	rdi, pmac_backlight_mutex[rip]
	call	mutex_unlock@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	DWORD PTR [rdi], esi
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	__pmac_backlight_set_legacy_brightness, .-__pmac_backlight_set_legacy_brightness
	.comm	pmac_backlight_mutex,4,4
	.comm	pmac_backlight,8,8
	.comm	OLD_BACKLIGHT_MAX,4,4
	.comm	ENXIO,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_backlight.c___pmac_backlight_set_legacy_brightness.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	__pmac_backlight_set_legacy_brightness, %function
__pmac_backlight_set_legacy_brightness:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L10
	push	{r4, r5, r6, lr}
	mov	r6, r0
	ldr	r0, .L10+4
	ldr	r5, [r3]
	bl	mutex_lock
	ldr	r3, .L10+8
	ldr	r4, [r3]
	cmp	r4, #0
	rsbeq	r5, r5, #0
	beq	.L3
	ldr	r3, .L10+12
	ldr	r5, [r4, #4]
	ldr	r1, [r3]
	add	r0, r5, #1
	mul	r0, r6, r0
	add	r1, r1, #1
	bl	__aeabi_idiv
	cmp	r5, r0
	strlt	r5, [r4]
	bge	.L9
.L5:
	mov	r0, r4
	bl	backlight_update_status
	mov	r5, #0
.L3:
	ldr	r0, .L10+4
	bl	mutex_unlock
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L9:
	cmp	r0, #0
	movlt	r3, #0
	strge	r0, [r4]
	strlt	r3, [r4]
	b	.L5
.L11:
	.align	2
.L10:
	.word	ENXIO
	.word	pmac_backlight_mutex
	.word	pmac_backlight
	.word	OLD_BACKLIGHT_MAX
	.size	__pmac_backlight_set_legacy_brightness, .-__pmac_backlight_set_legacy_brightness
	.comm	pmac_backlight_mutex,4,4
	.comm	pmac_backlight,4,4
	.comm	OLD_BACKLIGHT_MAX,4,4
	.comm	ENXIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
