	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max77693_led_brightness_set
_max77693_led_brightness_set:           ## @max77693_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, %r12d
	callq	_lcdev_to_flcdev
	movq	%rax, %rdi
	callq	_flcdev_to_sub_led
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_sub_led_to_led
	movq	%rax, %r14
	movl	(%rbx), %r15d
	movq	%rax, %rdi
	callq	_mutex_lock
	testl	%r12d, %r12d
	je	LBB0_1
## %bb.3:
	movq	_TORCH_IOUT_STEP@GOTPCREL(%rip), %rax
	imull	(%rax), %r12d
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_max77693_set_torch_current
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movl	%r15d, %edi
	callq	_MODE_TORCH
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_max77693_add_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_8
## %bb.6:
	movq	8(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_7
LBB0_1:
	movl	%r15d, %edi
	callq	_MODE_TORCH
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_max77693_clear_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_8
## %bb.2:
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_7
LBB0_4:
	movl	%eax, %ebx
	movq	8(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
LBB0_7:
	movl	%ebx, %edx
	callq	_dev_dbg
LBB0_8:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to clear torch mode (%d)\n"

	.comm	_TORCH_IOUT_STEP,4,2            ## @TORCH_IOUT_STEP
L_.str.1:                               ## @.str.1
	.asciz	"Failed to set torch current (%d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to set torch mode (%d)\n"

	.no_dead_strip	_max77693_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 max77693_led_brightness_set
_max77693_led_brightness_set:           ; @max77693_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	_lcdev_to_flcdev
	bl	_flcdev_to_sub_led
	mov	x21, x0
	bl	_sub_led_to_led
	mov	x19, x0
	ldr	w21, [x21]
	bl	_mutex_lock
	cbz	w20, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _TORCH_IOUT_STEP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TORCH_IOUT_STEP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mul	w2, w8, w20
	mov	x0, x19
	mov	x1, x21
	bl	_max77693_set_torch_current
	tbnz	w0, #31, LBB0_6
; %bb.2:
	mov	x0, x21
	bl	_MODE_TORCH
	mov	x1, x0
	mov	x0, x19
	bl	_max77693_add_mode
	mov	x20, x0
	tbz	w0, #31, LBB0_8
; %bb.3:
	ldr	x0, [x19, #8]
Lloh3:
	adrp	x1, l_.str.2@PAGE
Lloh4:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_4:
	mov	x0, x21
	bl	_MODE_TORCH
	mov	x1, x0
	mov	x0, x19
	bl	_max77693_clear_mode
	mov	x20, x0
	tbz	w0, #31, LBB0_8
; %bb.5:
	ldr	x0, [x19, #8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
	mov	x20, x0
	ldr	x0, [x19, #8]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x2, x20
	bl	_dev_dbg
LBB0_8:
	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
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to clear torch mode (%d)\n"

	.comm	_TORCH_IOUT_STEP,4,2            ; @TORCH_IOUT_STEP
l_.str.1:                               ; @.str.1
	.asciz	"Failed to set torch current (%d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to set torch mode (%d)\n"

	.no_dead_strip	_max77693_led_brightness_set
.subsections_via_symbols
