	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function regulator_led_brightness_set
_regulator_led_brightness_set:          ## @regulator_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	callq	_to_regulator_led
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_mutex_lock
	movq	_LED_OFF@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_regulator_led_disable
	xorl	%r14d, %r14d
	jmp	LBB0_6
LBB0_2:
	xorl	%r14d, %r14d
	cmpl	$2, 4(%rbx)
	jl	LBB0_5
## %bb.3:
	movl	12(%rbx), %edi
	movl	%r15d, %esi
	callq	_led_regulator_get_voltage
	movl	%eax, %r12d
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_dev_dbg
	movl	12(%rbx), %edi
	movl	%r12d, %esi
	movl	%r12d, %edx
	callq	_regulator_set_voltage
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r15d
	movl	8(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_dev_err
	movl	%r15d, %r14d
LBB0_5:
	movq	%rbx, %rdi
	callq	_regulator_led_enable
LBB0_6:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LED_OFF,4,2                    ## @LED_OFF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"brightness: %d voltage: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to set voltage %d: %d\n"

	.no_dead_strip	_regulator_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 regulator_led_brightness_set
_regulator_led_brightness_set:          ; @regulator_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	x20, x1
	bl	_to_regulator_led
	mov	x19, x0
	bl	_mutex_lock
Lloh0:
	adrp	x8, _LED_OFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LED_OFF@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_regulator_led_disable
	mov	w20, #0
	b	LBB0_7
LBB0_2:
	ldr	w8, [x19, #4]
	cmp	w8, #2
	b.lt	LBB0_5
; %bb.3:
	ldr	w0, [x19, #12]
	mov	x1, x20
	bl	_led_regulator_get_voltage
	mov	x21, x0
	ldr	w0, [x19, #8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	mov	x3, x21
	bl	_dev_dbg
	ldr	w0, [x19, #12]
	mov	x1, x21
	mov	x2, x21
	bl	_regulator_set_voltage
	mov	x20, x0
	cbz	w0, LBB0_6
; %bb.4:
	ldr	w0, [x19, #8]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	mov	x3, x20
	bl	_dev_err
	b	LBB0_6
LBB0_5:
	mov	w20, #0
LBB0_6:
	mov	x0, x19
	bl	_regulator_led_enable
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_LED_OFF,4,2                    ; @LED_OFF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"brightness: %d voltage: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to set voltage %d: %d\n"

	.no_dead_strip	_regulator_led_brightness_set
.subsections_via_symbols
