	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aat1290_led_brightness_set
_aat1290_led_brightness_set:            ## @aat1290_led_brightness_set
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	callq	_led_cdev_to_fled_cdev
	movq	%rax, %rdi
	callq	_fled_cdev_to_led
	movq	%rax, %rbx
	movq	%rax, %r14
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	testl	%r15d, %r15d
	je	LBB0_1
## %bb.2:
	cmpl	$0, (%rbx)
	jne	LBB0_4
## %bb.3:
	movq	_AAT1290_MM_CURRENT_RATIO_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AAT1290_MM_TO_FL_1_92@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_aat1290_as2cwire_write
	movl	$1, (%rbx)
LBB0_4:
	movq	_AAT1290_MOVIE_MODE_CURRENT_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AAT1290_MAX_MM_CURR_PERCENT_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	subl	%r15d, %edx
	movq	%rbx, %rdi
	callq	_aat1290_as2cwire_write
	movq	_AAT1290_MOVIE_MODE_CONFIG_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AAT1290_MOVIE_MODE_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_aat1290_as2cwire_write
	jmp	LBB0_5
LBB0_1:
	movl	12(%rbx), %edi
	xorl	%esi, %esi
	callq	_gpiod_direction_output
	movl	8(%rbx), %edi
	xorl	%esi, %esi
	callq	_gpiod_direction_output
	movl	$0, (%rbx)
LBB0_5:
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AAT1290_MM_CURRENT_RATIO_ADDR,4,2 ## @AAT1290_MM_CURRENT_RATIO_ADDR
	.comm	_AAT1290_MM_TO_FL_1_92,4,2      ## @AAT1290_MM_TO_FL_1_92
	.comm	_AAT1290_MOVIE_MODE_CURRENT_ADDR,4,2 ## @AAT1290_MOVIE_MODE_CURRENT_ADDR
	.comm	_AAT1290_MAX_MM_CURR_PERCENT_0,4,2 ## @AAT1290_MAX_MM_CURR_PERCENT_0
	.comm	_AAT1290_MOVIE_MODE_CONFIG_ADDR,4,2 ## @AAT1290_MOVIE_MODE_CONFIG_ADDR
	.comm	_AAT1290_MOVIE_MODE_ON,4,2      ## @AAT1290_MOVIE_MODE_ON
	.no_dead_strip	_aat1290_led_brightness_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aat1290_led_brightness_set
_aat1290_led_brightness_set:            ; @aat1290_led_brightness_set
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x1
	bl	_led_cdev_to_fled_cdev
	bl	_fled_cdev_to_led
	mov	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	cbz	w21, LBB0_4
; %bb.1:
	ldr	w8, [x20]
	cbnz	w8, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _AAT1290_MM_CURRENT_RATIO_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AAT1290_MM_CURRENT_RATIO_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _AAT1290_MM_TO_FL_1_92@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AAT1290_MM_TO_FL_1_92@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_aat1290_as2cwire_write
	mov	w8, #1
	str	w8, [x20]
LBB0_3:
Lloh6:
	adrp	x8, _AAT1290_MOVIE_MODE_CURRENT_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AAT1290_MOVIE_MODE_CURRENT_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _AAT1290_MAX_MM_CURR_PERCENT_0@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AAT1290_MAX_MM_CURR_PERCENT_0@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	sub	w2, w8, w21
	mov	x0, x20
	bl	_aat1290_as2cwire_write
Lloh12:
	adrp	x8, _AAT1290_MOVIE_MODE_CONFIG_ADDR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AAT1290_MOVIE_MODE_CONFIG_ADDR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _AAT1290_MOVIE_MODE_ON@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AAT1290_MOVIE_MODE_ON@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_aat1290_as2cwire_write
	b	LBB0_5
LBB0_4:
	ldr	w0, [x20, #12]
	mov	w1, #0
	bl	_gpiod_direction_output
	ldr	w0, [x20, #8]
	mov	w1, #0
	bl	_gpiod_direction_output
	str	wzr, [x20]
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AAT1290_MM_CURRENT_RATIO_ADDR,4,2 ; @AAT1290_MM_CURRENT_RATIO_ADDR
	.comm	_AAT1290_MM_TO_FL_1_92,4,2      ; @AAT1290_MM_TO_FL_1_92
	.comm	_AAT1290_MOVIE_MODE_CURRENT_ADDR,4,2 ; @AAT1290_MOVIE_MODE_CURRENT_ADDR
	.comm	_AAT1290_MAX_MM_CURR_PERCENT_0,4,2 ; @AAT1290_MAX_MM_CURR_PERCENT_0
	.comm	_AAT1290_MOVIE_MODE_CONFIG_ADDR,4,2 ; @AAT1290_MOVIE_MODE_CONFIG_ADDR
	.comm	_AAT1290_MOVIE_MODE_ON,4,2      ; @AAT1290_MOVIE_MODE_ON
	.no_dead_strip	_aat1290_led_brightness_set
.subsections_via_symbols
