	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lp5523_selftest
_lp5523_selftest:                       ## @lp5523_selftest
	.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	%rdx, -56(%rbp)                 ## 8-byte Spill
	callq	_to_i2c_client
	movl	%eax, %edi
	callq	_i2c_get_clientdata
	movq	%rax, %r15
	movq	8(%rax), %rbx
	movq	8(%rbx), %r14
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	_LP5523_REG_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_lp55xx_read
	testl	%eax, %eax
	js	LBB0_21
## %bb.1:
	movq	(%r14), %rax
	movq	_LP55XX_CLOCK_EXT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	_LP5523_EXT_CLK_USED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, -48(%rbp)
	je	LBB0_21
LBB0_3:
	movq	_LP5523_REG_LED_TEST_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_LP5523_EN_LEDTEST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	$16, %edx
	movq	%rbx, %rdi
	callq	_lp55xx_write
	movl	$3000, %edi                     ## imm = 0xBB8
	movl	$6000, %esi                     ## imm = 0x1770
	callq	_usleep_range
	movq	_LP5523_REG_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_lp55xx_read
	testl	%eax, %eax
	js	LBB0_21
## %bb.4:
	movq	_LP5523_LEDTEST_DONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, -48(%rbp)
	jne	LBB0_6
## %bb.5:
	movl	$3000, %edi                     ## imm = 0xBB8
	movl	$6000, %esi                     ## imm = 0x1770
	callq	_usleep_range
LBB0_6:
	movq	_LP5523_REG_LED_TEST_ADC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_lp55xx_read
	testl	%eax, %eax
	js	LBB0_21
## %bb.7:
	decq	-64(%rbp)
	movq	_LP5523_MAX_LEDS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_20
## %bb.8:
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	movslq	%r12d, %r12
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r12), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_sprintf
	addl	%eax, %r12d
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	_LP5523_REG_LED_PWM_BASE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_lp55xx_write
	movq	_LP5523_REG_LED_CURRENT_BASE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r13, %rsi
	movl	(%r15), %edx
	movq	%rbx, %rdi
	callq	_lp55xx_write
	addq	$16, %r15
	movq	_LP5523_MAX_LEDS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_18:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%r13
	movslq	%eax, %rcx
	cmpq	%rcx, %r13
	jge	LBB0_19
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rcx
	movl	(%rcx,%r13,4), %edx
	testl	%edx, %edx
	je	LBB0_18
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_LP5523_REG_LED_CURRENT_BASE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r13, %rsi
	movq	%rbx, %rdi
	callq	_lp55xx_write
	movq	_LP5523_REG_LED_PWM_BASE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r13, %rsi
	movq	%rbx, %rdi
	movl	$255, %edx
	callq	_lp55xx_write
	movl	$2000, %edi                     ## imm = 0x7D0
	movl	$4000, %esi                     ## imm = 0xFA0
	callq	_usleep_range
	movq	_LP5523_REG_LED_TEST_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_LP5523_EN_LEDTEST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	%r13d, %edx
	movq	%rbx, %rdi
	callq	_lp55xx_write
	movl	$3000, %edi                     ## imm = 0xBB8
	movl	$6000, %esi                     ## imm = 0x1770
	callq	_usleep_range
	movq	_LP5523_REG_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	leaq	-48(%rbp), %rdx
	callq	_lp55xx_read
	testl	%eax, %eax
	js	LBB0_21
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_LP5523_LEDTEST_DONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, -48(%rbp)
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	$3000, %edi                     ## imm = 0xBB8
	movl	$6000, %esi                     ## imm = 0x1770
	callq	_usleep_range
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	_LP5523_REG_LED_TEST_ADC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	leaq	-72(%rbp), %rdx
	callq	_lp55xx_read
	testl	%eax, %eax
	js	LBB0_21
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-72(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jge	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_LP5523_ADC_SHORTCIRC_LIM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_17
	jmp	LBB0_16
LBB0_21:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movw	$10, 4(%rax)
	movl	$1279869254, (%rax)             ## imm = 0x4C494146
	movl	$5, %r12d
LBB0_22:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	testl	%r12d, %r12d
	jne	LBB0_22
LBB0_20:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$674639, (%rax)                 ## imm = 0xA4B4F
	movl	$3, %r12d
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_LP5523_REG_STATUS,4,2          ## @LP5523_REG_STATUS
	.comm	_LP55XX_CLOCK_EXT,8,3           ## @LP55XX_CLOCK_EXT
	.comm	_LP5523_EXT_CLK_USED,8,3        ## @LP5523_EXT_CLK_USED
	.comm	_LP5523_REG_LED_TEST_CTRL,8,3   ## @LP5523_REG_LED_TEST_CTRL
	.comm	_LP5523_EN_LEDTEST,4,2          ## @LP5523_EN_LEDTEST
	.comm	_LP5523_LEDTEST_DONE,8,3        ## @LP5523_LEDTEST_DONE
	.comm	_LP5523_REG_LED_TEST_ADC,4,2    ## @LP5523_REG_LED_TEST_ADC
	.comm	_LP5523_MAX_LEDS,4,2            ## @LP5523_MAX_LEDS
	.comm	_LP5523_REG_LED_CURRENT_BASE,8,3 ## @LP5523_REG_LED_CURRENT_BASE
	.comm	_LP5523_REG_LED_PWM_BASE,8,3    ## @LP5523_REG_LED_PWM_BASE
	.comm	_LP5523_ADC_SHORTCIRC_LIM,8,3   ## @LP5523_ADC_SHORTCIRC_LIM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LED %d FAIL\n"

L_.str.2:                               ## @.str.2
	.asciz	"FAIL\n"

	.no_dead_strip	_lp5523_selftest
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lp5523_selftest
_lp5523_selftest:                       ; @lp5523_selftest
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	bl	_to_i2c_client
	bl	_i2c_get_clientdata
	mov	x21, x0
	ldr	x20, [x0, #8]
	ldr	x24, [x20, #8]
	mov	x0, x20
	bl	_mutex_lock
Lloh0:
	adrp	x25, _LP5523_REG_STATUS@GOTPAGE
Lloh1:
	ldr	x25, [x25, _LP5523_REG_STATUS@GOTPAGEOFF]
	ldr	w1, [x25]
	add	x2, sp, #24
	mov	x0, x20
	bl	_lp55xx_read
	tbnz	w0, #31, LBB0_19
; %bb.1:
	ldr	x8, [x24]
Lloh2:
	adrp	x9, _LP55XX_CLOCK_EXT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _LP55XX_CLOCK_EXT@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	x8, [sp, #24]
Lloh5:
	adrp	x9, _LP5523_EXT_CLK_USED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _LP5523_EXT_CLK_USED@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	tst	x9, x8
	b.eq	LBB0_19
LBB0_3:
Lloh8:
	adrp	x8, _LP5523_REG_LED_TEST_CTRL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LP5523_REG_LED_TEST_CTRL@GOTPAGEOFF]
Lloh10:
	ldr	x1, [x8]
Lloh11:
	adrp	x27, _LP5523_EN_LEDTEST@GOTPAGE
Lloh12:
	ldr	x27, [x27, _LP5523_EN_LEDTEST@GOTPAGEOFF]
	ldr	w8, [x27]
	orr	w2, w8, #0x10
	mov	x0, x20
	bl	_lp55xx_write
	mov	w0, #3000
	mov	w1, #6000
	bl	_usleep_range
	ldr	w1, [x25]
	add	x2, sp, #24
	mov	x0, x20
	bl	_lp55xx_read
	tbnz	w0, #31, LBB0_19
; %bb.4:
	ldr	x8, [sp, #24]
Lloh13:
	adrp	x9, _LP5523_LEDTEST_DONE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _LP5523_LEDTEST_DONE@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	tst	x9, x8
	b.ne	LBB0_6
; %bb.5:
	mov	w0, #3000
	mov	w1, #6000
	bl	_usleep_range
LBB0_6:
Lloh16:
	adrp	x8, _LP5523_REG_LED_TEST_ADC@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LP5523_REG_LED_TEST_ADC@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x20
	bl	_lp55xx_read
	tbnz	w0, #31, LBB0_19
; %bb.7:
	ldr	x8, [sp, #8]
	sub	x8, x8, #1
	str	x8, [sp, #8]
Lloh19:
	adrp	x8, _LP5523_MAX_LEDS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _LP5523_MAX_LEDS@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.8:
	mov	x28, #0
	mov	w22, #0
Lloh22:
	adrp	x23, _LP5523_REG_LED_CURRENT_BASE@GOTPAGE
Lloh23:
	ldr	x23, [x23, _LP5523_REG_LED_CURRENT_BASE@GOTPAGEOFF]
Lloh24:
	adrp	x26, _LP5523_REG_LED_PWM_BASE@GOTPAGE
Lloh25:
	ldr	x26, [x26, _LP5523_REG_LED_PWM_BASE@GOTPAGEOFF]
	b	LBB0_12
LBB0_9:                                 ;   in Loop: Header=BB0_12 Depth=1
	add	x0, x19, w22, sxtw
	str	x28, [sp]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	bl	_sprintf
	add	w22, w0, w22
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x26]
	add	x1, x28, x8
	mov	x0, x20
	mov	w2, #0
	bl	_lp55xx_write
	ldr	x8, [x23]
	add	x1, x28, x8
	ldr	w2, [x21], #16
	mov	x0, x20
	bl	_lp55xx_write
Lloh28:
	adrp	x8, _LP5523_MAX_LEDS@GOTPAGE
Lloh29:
	ldr	x8, [x8, _LP5523_MAX_LEDS@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x28, x28, #1
	cmp	x28, w8, sxtw
	b.ge	LBB0_21
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x24, #8]
	ldr	w2, [x9, x28, lsl #2]
	cbz	w2, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x23]
	add	x1, x28, x8
	mov	x0, x20
	bl	_lp55xx_write
	ldr	x8, [x26]
	add	x1, x28, x8
	mov	x0, x20
	mov	w2, #255
	bl	_lp55xx_write
	mov	w0, #2000
	mov	w1, #4000
	bl	_usleep_range
Lloh31:
	adrp	x8, _LP5523_REG_LED_TEST_CTRL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _LP5523_REG_LED_TEST_CTRL@GOTPAGEOFF]
Lloh33:
	ldr	x1, [x8]
	ldr	w8, [x27]
	orr	w2, w8, w28
	mov	x0, x20
	bl	_lp55xx_write
	mov	w0, #3000
	mov	w1, #6000
	bl	_usleep_range
	ldr	w1, [x25]
	add	x2, sp, #24
	mov	x0, x20
	bl	_lp55xx_read
	tbnz	w0, #31, LBB0_19
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [sp, #24]
Lloh34:
	adrp	x9, _LP5523_LEDTEST_DONE@GOTPAGE
Lloh35:
	ldr	x9, [x9, _LP5523_LEDTEST_DONE@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	tst	x9, x8
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	w0, #3000
	mov	w1, #6000
	bl	_usleep_range
LBB0_16:                                ;   in Loop: Header=BB0_12 Depth=1
Lloh37:
	adrp	x8, _LP5523_REG_LED_TEST_ADC@GOTPAGE
Lloh38:
	ldr	x8, [x8, _LP5523_REG_LED_TEST_ADC@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	x0, x20
	bl	_lp55xx_read
	tbnz	w0, #31, LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_12 Depth=1
	ldp	x9, x8, [sp, #8]
	cmp	x8, x9
	b.ge	LBB0_9
; %bb.18:                               ;   in Loop: Header=BB0_12 Depth=1
Lloh40:
	adrp	x9, _LP5523_ADC_SHORTCIRC_LIM@GOTPAGE
Lloh41:
	ldr	x9, [x9, _LP5523_ADC_SHORTCIRC_LIM@GOTPAGEOFF]
Lloh42:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_10
	b	LBB0_9
LBB0_19:
	mov	w8, #10
	strh	w8, [x19, #4]
	mov	w8, #16710
	movk	w8, #19529, lsl #16
	str	w8, [x19]
	mov	w22, #5
LBB0_20:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_21:
	cbnz	w22, LBB0_20
LBB0_22:
	mov	w8, #19279
	movk	w8, #10, lsl #16
	str	w8, [x19]
	mov	w22, #3
	b	LBB0_20
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_LP5523_REG_STATUS,4,2          ; @LP5523_REG_STATUS
	.comm	_LP55XX_CLOCK_EXT,8,3           ; @LP55XX_CLOCK_EXT
	.comm	_LP5523_EXT_CLK_USED,8,3        ; @LP5523_EXT_CLK_USED
	.comm	_LP5523_REG_LED_TEST_CTRL,8,3   ; @LP5523_REG_LED_TEST_CTRL
	.comm	_LP5523_EN_LEDTEST,4,2          ; @LP5523_EN_LEDTEST
	.comm	_LP5523_LEDTEST_DONE,8,3        ; @LP5523_LEDTEST_DONE
	.comm	_LP5523_REG_LED_TEST_ADC,4,2    ; @LP5523_REG_LED_TEST_ADC
	.comm	_LP5523_MAX_LEDS,4,2            ; @LP5523_MAX_LEDS
	.comm	_LP5523_REG_LED_CURRENT_BASE,8,3 ; @LP5523_REG_LED_CURRENT_BASE
	.comm	_LP5523_REG_LED_PWM_BASE,8,3    ; @LP5523_REG_LED_PWM_BASE
	.comm	_LP5523_ADC_SHORTCIRC_LIM,8,3   ; @LP5523_ADC_SHORTCIRC_LIM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LED %d FAIL\n"

l_.str.2:                               ; @.str.2
	.asciz	"FAIL\n"

	.no_dead_strip	_lp5523_selftest
.subsections_via_symbols
