	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lm3601x_brightness_set
_lm3601x_brightness_set:                ## @lm3601x_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	callq	_lcdev_to_flcdev
	movq	%rax, %rdi
	callq	_fled_cdev_to_led
	movq	%rax, %r13
	leaq	8(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	callq	_lm3601x_read_faults
	testl	%eax, %eax
	js	LBB0_9
## %bb.1:
	movq	(%r13), %rax
	movq	_LM3601X_LED_TORCH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.3:
	movq	_LM3601X_MODE_TORCH@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_LM3601X_MODE_IR_DRV@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %r12d
	movq	_LED_OFF@GOTPCREL(%rip), %rax
	movl	12(%r13), %edi
	cmpl	%r15d, (%rax)
	jne	LBB0_6
## %bb.5:
	movq	_LM3601X_ENABLE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	jmp	LBB0_8
LBB0_6:
	movq	_LM3601X_LED_TORCH_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_9
## %bb.7:
	movl	12(%r13), %edi
	movq	_LM3601X_ENABLE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_LM3601X_MODE_TORCH@GOTPCREL(%rip), %rax
	movq	_LM3601X_MODE_IR_DRV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	%r12d, %ecx
LBB0_8:
	callq	_regmap_update_bits
LBB0_9:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LM3601X_LED_TORCH,8,3          ## @LM3601X_LED_TORCH
	.comm	_LM3601X_MODE_TORCH,4,2         ## @LM3601X_MODE_TORCH
	.comm	_LM3601X_MODE_IR_DRV,4,2        ## @LM3601X_MODE_IR_DRV
	.comm	_LED_OFF,4,2                    ## @LED_OFF
	.comm	_LM3601X_ENABLE_REG,4,2         ## @LM3601X_ENABLE_REG
	.comm	_LM3601X_LED_TORCH_REG,4,2      ## @LM3601X_LED_TORCH_REG
	.no_dead_strip	_lm3601x_brightness_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lm3601x_brightness_set
_lm3601x_brightness_set:                ; @lm3601x_brightness_set
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	bl	_lcdev_to_flcdev
	bl	_fled_cdev_to_led
	mov	x21, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x21
	bl	_lm3601x_read_faults
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _LM3601X_LED_TORCH@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LM3601X_LED_TORCH@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x24, _LM3601X_MODE_TORCH@GOTPAGE
Lloh4:
	ldr	x24, [x24, _LM3601X_MODE_TORCH@GOTPAGEOFF]
Lloh5:
	adrp	x25, _LM3601X_MODE_IR_DRV@GOTPAGE
Lloh6:
	ldr	x25, [x25, _LM3601X_MODE_IR_DRV@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x24, x25, eq
	ldr	w22, [x8]
Lloh7:
	adrp	x8, _LED_OFF@GOTPAGE
Lloh8:
	ldr	x8, [x8, _LED_OFF@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	ldr	w0, [x21, #12]
	cmp	w8, w20
	b.ne	LBB0_3
; %bb.2:
Lloh10:
	adrp	x8, _LM3601X_ENABLE_REG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _LM3601X_ENABLE_REG@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x2, x22
	mov	x3, x20
	b	LBB0_5
LBB0_3:
Lloh13:
	adrp	x8, _LM3601X_LED_TORCH_REG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LM3601X_LED_TORCH_REG@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_regmap_write
	tbnz	w0, #31, LBB0_6
; %bb.4:
	ldr	w0, [x21, #12]
Lloh16:
	adrp	x8, _LM3601X_ENABLE_REG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LM3601X_ENABLE_REG@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w2, w9, w8
	mov	x3, x22
LBB0_5:
	bl	_regmap_update_bits
LBB0_6:
	mov	x23, x0
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_LM3601X_LED_TORCH,8,3          ; @LM3601X_LED_TORCH
	.comm	_LM3601X_MODE_TORCH,4,2         ; @LM3601X_MODE_TORCH
	.comm	_LM3601X_MODE_IR_DRV,4,2        ; @LM3601X_MODE_IR_DRV
	.comm	_LED_OFF,4,2                    ; @LED_OFF
	.comm	_LM3601X_ENABLE_REG,4,2         ; @LM3601X_ENABLE_REG
	.comm	_LM3601X_LED_TORCH_REG,4,2      ; @LM3601X_LED_TORCH_REG
	.no_dead_strip	_lm3601x_brightness_set
.subsections_via_symbols
