	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wm8350_led_set
_wm8350_led_set:                        ## @wm8350_led_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, %r14d
	callq	_to_wm8350_led
	movq	%rax, %rbx
	movl	%r14d, (%rax)
	leaq	16(%rax), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	(%rbx), %eax
	movq	_LED_OFF@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_1
## %bb.3:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wm8350_led_disable             ## TAILCALL
LBB0_1:
	imull	4(%rbx), %eax
	movq	_LED_FULL@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	_isink_cur@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	xorl	%edi, %edi
	cmpl	%eax, %r15d
	setge	%dil
	callq	_BUG_ON
	movl	12(%rbx), %edi
	movq	(%r12), %rax
	movslq	%r15d, %r15
	movl	(%rax,%r15,4), %edx
	movl	%edx, %esi
	callq	_regulator_set_current_limit
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	movl	%eax, %r14d
	movl	8(%rbx), %edi
	movq	(%r12), %rax
	movl	(%rax,%r15,4), %edx
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %ecx
	callq	_dev_err
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wm8350_led_enable              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_LED_OFF,4,2                    ## @LED_OFF
	.comm	_LED_FULL,4,2                   ## @LED_FULL
	.comm	_isink_cur,8,3                  ## @isink_cur
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to set %duA: %d\n"

	.no_dead_strip	_wm8350_led_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wm8350_led_set
_wm8350_led_set:                        ; @wm8350_led_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_wm8350_led
	mov	x19, x0
	str	w20, [x0]
	add	x20, x0, #16
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _LED_OFF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LED_OFF@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	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
	b	_wm8350_led_disable
LBB0_2:
	ldr	w9, [x19, #4]
	mul	w8, w9, w8
Lloh3:
	adrp	x9, _LED_FULL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LED_FULL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	sdiv	w21, w8, w9
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh6:
	adrp	x22, _isink_cur@GOTPAGE
Lloh7:
	ldr	x22, [x22, _isink_cur@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w21, w0
	cset	w0, ge
	bl	_BUG_ON
	ldr	w0, [x19, #12]
	ldr	x8, [x22]
	ldr	w1, [x8, w21, sxtw #2]
	mov	x2, x1
	bl	_regulator_set_current_limit
	cbz	w0, LBB0_4
; %bb.3:
	mov	x20, x0
	sxtw	x8, w21
	ldr	w0, [x19, #8]
	ldr	x9, [x22]
	ldr	w2, [x9, x8, lsl #2]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x20
	bl	_dev_err
	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
LBB0_4:
	mov	x0, x19
	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
	b	_wm8350_led_enable
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_LED_OFF,4,2                    ; @LED_OFF
	.comm	_LED_FULL,4,2                   ; @LED_FULL
	.comm	_isink_cur,8,3                  ; @isink_cur
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to set %duA: %d\n"

	.no_dead_strip	_wm8350_led_set
.subsections_via_symbols
