	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max77693_setup
_max77693_setup:                        ## @max77693_setup
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r15
	cmpq	$0, (%rdi)
	movq	_FLED1@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movq	%r13, %r15
	movq	16(%r13), %rax
	movq	_FLED2@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rcx
	addq	(%rax,%rbx,8), %rcx
	movq	%rcx, -64(%rbp,%rbx,8)
	movl	%ebx, %r13d
	jmp	LBB0_5
LBB0_2:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_max77693_fled_used
	movq	_FLED2@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	movq	%rsi, %rbx
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_FLED1@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_4:
	movq	%r12, %rdi
	callq	_max77693_fled_used
	testq	%rax, %rax
	movq	(%r14), %rax
	movq	_FLED1@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%r13, %r15
	movq	16(%r13), %rdx
	movq	(%rdx,%rcx,8), %rsi
	movq	%rsi, -64(%rbp,%rcx,8)
	movq	(%rdx,%rax,8), %rdx
	movq	%rdx, -64(%rbp,%rax,8)
	movl	%eax, %r13d
	cmovel	%ecx, %r13d
	cmpl	%r13d, %ebx
	jg	LBB0_10
LBB0_5:
	movslq	%ebx, %rax
	incl	%r13d
	leaq	-64(,%rax,8), %r14
	addq	%rbp, %r14
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_max77693_set_flash_current
	testl	%eax, %eax
	js	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	incl	%ebx
	addq	$8, %r14
	cmpl	%ebx, %r13d
	jne	LBB0_7
LBB0_10:
	movq	_TORCH_TMR_NO_TIMER@GOTPCREL(%rip), %rax
	movq	_MAX77693_LED_TRIG_TYPE_LEVEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_MAX77693_LED_REG_ITORCHTIMER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_8
## %bb.11:
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	jle	LBB0_12
## %bb.13:
	callq	_max77693_led_vsys_to_reg
	movl	%eax, %edx
	movq	_MAX_FLASH1_MAX_FL_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	jmp	LBB0_14
LBB0_12:
	xorl	%edx, %edx
LBB0_14:
	movq	_MAX77693_LED_REG_MAX_FLASH1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_8
## %bb.15:
	movq	_MAX77693_LED_REG_MAX_FLASH2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_8
## %bb.16:
	movl	8(%r15), %eax
	movq	_MAX77693_LED_BOOST_FIXED@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_17
## %bb.18:
	movq	_FLASH_BOOST_FIXED@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_19
LBB0_17:
	leal	(%rax,%rax), %r14d
	orl	%eax, %r14d
LBB0_19:
	movq	_FLED1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_max77693_fled_used
	testq	%rax, %rax
	je	LBB0_22
## %bb.20:
	movq	_FLED2@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_max77693_fled_used
	testq	%rax, %rax
	je	LBB0_22
## %bb.21:
	movq	_FLASH_BOOST_LEDNUM_2@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
LBB0_22:
	movq	_MAX77693_LED_REG_VOUT_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_8
## %bb.23:
	movl	12(%r15), %edi
	callq	_max77693_led_vout_to_reg
	movq	_MAX77693_LED_REG_VOUT_FLASH1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_8
## %bb.24:
	movq	_MODE_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_26
## %bb.25:
	movq	%r12, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_max77693_set_mode_reg          ## TAILCALL
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_26
## %bb.9:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FLED1,8,3                      ## @FLED1
	.comm	_FLED2,8,3                      ## @FLED2
	.comm	_TORCH_TMR_NO_TIMER,4,2         ## @TORCH_TMR_NO_TIMER
	.comm	_MAX77693_LED_TRIG_TYPE_LEVEL,4,2 ## @MAX77693_LED_TRIG_TYPE_LEVEL
	.comm	_MAX77693_LED_REG_ITORCHTIMER,4,2 ## @MAX77693_LED_REG_ITORCHTIMER
	.comm	_MAX_FLASH1_MAX_FL_EN,4,2       ## @MAX_FLASH1_MAX_FL_EN
	.comm	_MAX77693_LED_REG_MAX_FLASH1,4,2 ## @MAX77693_LED_REG_MAX_FLASH1
	.comm	_MAX77693_LED_REG_MAX_FLASH2,4,2 ## @MAX77693_LED_REG_MAX_FLASH2
	.comm	_MAX77693_LED_BOOST_FIXED,4,2   ## @MAX77693_LED_BOOST_FIXED
	.comm	_FLASH_BOOST_FIXED,4,2          ## @FLASH_BOOST_FIXED
	.comm	_FLASH_BOOST_LEDNUM_2,4,2       ## @FLASH_BOOST_LEDNUM_2
	.comm	_MAX77693_LED_REG_VOUT_CNTL,4,2 ## @MAX77693_LED_REG_VOUT_CNTL
	.comm	_MAX77693_LED_REG_VOUT_FLASH1,4,2 ## @MAX77693_LED_REG_VOUT_FLASH1
	.comm	_MODE_OFF,4,2                   ## @MODE_OFF
	.no_dead_strip	_max77693_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max77693_setup
_max77693_setup:                        ; @max77693_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldp	x8, x20, [x0]
Lloh3:
	adrp	x23, _FLED1@GOTPAGE
Lloh4:
	ldr	x23, [x23, _FLED1@GOTPAGEOFF]
	ldr	x22, [x23]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x21, #16]
	lsl	x9, x22, #3
	ldr	x10, [x8, x9]
Lloh5:
	adrp	x11, _FLED2@GOTPAGE
Lloh6:
	ldr	x11, [x11, _FLED2@GOTPAGEOFF]
Lloh7:
	ldr	x11, [x11]
	ldr	x8, [x8, x11, lsl #3]
	add	x8, x8, x10
	add	x10, sp, #8
	str	x8, [x10, x9]
	mov	x8, x22
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	mov	x1, x22
	bl	_max77693_fled_used
	ldr	x8, [x23]
Lloh8:
	adrp	x24, _FLED2@GOTPAGE
Lloh9:
	ldr	x24, [x24, _FLED2@GOTPAGEOFF]
	ldr	x1, [x24]
	cmp	x0, #0
	csel	x22, x1, x8, eq
	mov	x0, x19
	bl	_max77693_fled_used
	ldr	x9, [x24]
	ldr	x10, [x23]
	cmp	x0, #0
	csel	w8, w10, w9, eq
	ldr	x11, [x21, #16]
	lsl	x10, x10, #3
	ldr	x12, [x11, x10]
	add	x13, sp, #8
	str	x12, [x13, x10]
	lsl	x9, x9, #3
	ldr	x10, [x11, x9]
	str	x10, [x13, x9]
	cmp	w22, w8
	b.gt	LBB0_6
LBB0_3:
	add	w24, w8, #1
	add	x8, sp, #8
	add	x25, x8, w22, sxtw #3
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x25]
	mov	x0, x19
	mov	x1, x22
	bl	_max77693_set_flash_current
	tbnz	w0, #31, LBB0_19
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w22, w22, #1
	add	x25, x25, #8
	cmp	w24, w22
	b.ne	LBB0_4
LBB0_6:
Lloh10:
	adrp	x8, _TORCH_TMR_NO_TIMER@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TORCH_TMR_NO_TIMER@GOTPAGEOFF]
Lloh12:
	adrp	x9, _MAX77693_LED_TRIG_TYPE_LEVEL@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MAX77693_LED_TRIG_TYPE_LEVEL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh16:
	adrp	x8, _MAX77693_LED_REG_ITORCHTIMER@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MAX77693_LED_REG_ITORCHTIMER@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_regmap_write
	tbnz	w0, #31, LBB0_19
; %bb.7:
	ldr	x0, [x21]
	cmp	x0, #1
	b.lt	LBB0_9
; %bb.8:
	bl	_max77693_led_vsys_to_reg
Lloh19:
	adrp	x8, _MAX_FLASH1_MAX_FL_EN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MAX_FLASH1_MAX_FL_EN@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	orr	w2, w8, w0
	b	LBB0_10
LBB0_9:
	mov	w2, #0
LBB0_10:
Lloh22:
	adrp	x8, _MAX77693_LED_REG_MAX_FLASH1@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MAX77693_LED_REG_MAX_FLASH1@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_regmap_write
	tbnz	w0, #31, LBB0_19
; %bb.11:
Lloh25:
	adrp	x8, _MAX77693_LED_REG_MAX_FLASH2@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MAX77693_LED_REG_MAX_FLASH2@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_regmap_write
	tbnz	w0, #31, LBB0_19
; %bb.12:
	ldr	w8, [x21, #8]
Lloh28:
	adrp	x9, _MAX77693_LED_BOOST_FIXED@GOTPAGE
Lloh29:
	ldr	x9, [x9, _MAX77693_LED_BOOST_FIXED@GOTPAGEOFF]
Lloh30:
	adrp	x10, _FLASH_BOOST_FIXED@GOTPAGE
Lloh31:
	ldr	x10, [x10, _FLASH_BOOST_FIXED@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
Lloh33:
	ldr	w10, [x10]
	orr	w11, w8, w8, lsl #1
	cmp	w8, w9
	csel	w22, w10, w11, eq
	ldr	x1, [x23]
	mov	x0, x19
	bl	_max77693_fled_used
	cbz	x0, LBB0_15
; %bb.13:
Lloh34:
	adrp	x8, _FLED2@GOTPAGE
Lloh35:
	ldr	x8, [x8, _FLED2@GOTPAGEOFF]
Lloh36:
	ldr	x1, [x8]
	mov	x0, x19
	bl	_max77693_fled_used
	cbz	x0, LBB0_15
; %bb.14:
Lloh37:
	adrp	x8, _FLASH_BOOST_LEDNUM_2@GOTPAGE
Lloh38:
	ldr	x8, [x8, _FLASH_BOOST_LEDNUM_2@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	orr	w22, w8, w22
LBB0_15:
Lloh40:
	adrp	x8, _MAX77693_LED_REG_VOUT_CNTL@GOTPAGE
Lloh41:
	ldr	x8, [x8, _MAX77693_LED_REG_VOUT_CNTL@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x22
	bl	_regmap_write
	tbnz	w0, #31, LBB0_19
; %bb.16:
	ldr	w0, [x21, #12]
	bl	_max77693_led_vout_to_reg
	mov	x2, x0
Lloh43:
	adrp	x8, _MAX77693_LED_REG_VOUT_FLASH1@GOTPAGE
Lloh44:
	ldr	x8, [x8, _MAX77693_LED_REG_VOUT_FLASH1@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_regmap_write
	tbnz	w0, #31, LBB0_19
; %bb.17:
Lloh46:
	adrp	x8, _MODE_OFF@GOTPAGE
Lloh47:
	ldr	x8, [x8, _MODE_OFF@GOTPAGEOFF]
Lloh48:
	ldr	w1, [x8]
	ldr	x8, [sp, #24]
Lloh49:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh50:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh51:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.18:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_max77693_set_mode_reg
LBB0_19:
	ldr	x8, [sp, #24]
Lloh52:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh53:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh54:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.20:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh32
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_FLED1,8,3                      ; @FLED1
	.comm	_FLED2,8,3                      ; @FLED2
	.comm	_TORCH_TMR_NO_TIMER,4,2         ; @TORCH_TMR_NO_TIMER
	.comm	_MAX77693_LED_TRIG_TYPE_LEVEL,4,2 ; @MAX77693_LED_TRIG_TYPE_LEVEL
	.comm	_MAX77693_LED_REG_ITORCHTIMER,4,2 ; @MAX77693_LED_REG_ITORCHTIMER
	.comm	_MAX_FLASH1_MAX_FL_EN,4,2       ; @MAX_FLASH1_MAX_FL_EN
	.comm	_MAX77693_LED_REG_MAX_FLASH1,4,2 ; @MAX77693_LED_REG_MAX_FLASH1
	.comm	_MAX77693_LED_REG_MAX_FLASH2,4,2 ; @MAX77693_LED_REG_MAX_FLASH2
	.comm	_MAX77693_LED_BOOST_FIXED,4,2   ; @MAX77693_LED_BOOST_FIXED
	.comm	_FLASH_BOOST_FIXED,4,2          ; @FLASH_BOOST_FIXED
	.comm	_FLASH_BOOST_LEDNUM_2,4,2       ; @FLASH_BOOST_LEDNUM_2
	.comm	_MAX77693_LED_REG_VOUT_CNTL,4,2 ; @MAX77693_LED_REG_VOUT_CNTL
	.comm	_MAX77693_LED_REG_VOUT_FLASH1,4,2 ; @MAX77693_LED_REG_VOUT_FLASH1
	.comm	_MODE_OFF,4,2                   ; @MODE_OFF
	.no_dead_strip	_max77693_setup
.subsections_via_symbols
