	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function anx78xx_aux_wait
_anx78xx_aux_wait:                      ## @anx78xx_aux_wait
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_jiffies@GOTPCREL(%rip), %r15
	movl	(%r15), %r12d
	movq	_AUX_WAIT_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_anx78xx_aux_op_finished
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	leal	(%r12,%rbx), %eax
	incl	%eax
	movslq	%eax, %rbx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movq	%rbx, %rsi
	callq	_time_after
	testq	%rax, %rax
	jne	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movq	%r14, %rdi
	callq	_anx78xx_aux_op_finished
	testl	%eax, %eax
	je	LBB0_2
	jmp	LBB0_6
LBB0_3:
	movq	%r14, %rdi
	callq	_anx78xx_aux_op_finished
	testl	%eax, %eax
	je	LBB0_4
LBB0_6:
	movq	(%r14), %rax
	movq	_I2C_IDX_TX_P0@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edi
	movq	_SP_AUX_CH_STATUS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movl	-36(%rbp), %esi
	movq	_SP_AUX_STATUS@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_9
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_11:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_7:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_12
LBB0_9:
	xorl	%ebx, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_AUX_WAIT_TIMEOUT_MS,4,2        ## @AUX_WAIT_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timed out waiting AUX to finish\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_I2C_IDX_TX_P0,8,3              ## @I2C_IDX_TX_P0
	.comm	_SP_AUX_CH_STATUS_REG,4,2       ## @SP_AUX_CH_STATUS_REG
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read from AUX channel: %d\n"

	.comm	_SP_AUX_STATUS,4,2              ## @SP_AUX_STATUS
L_.str.2:                               ## @.str.2
	.asciz	"Failed to wait for AUX channel (status: %02x)\n"

	.no_dead_strip	_anx78xx_aux_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function anx78xx_aux_wait
_anx78xx_aux_wait:                      ; @anx78xx_aux_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
Lloh0:
	adrp	x21, _jiffies@GOTPAGE
Lloh1:
	ldr	x21, [x21, _jiffies@GOTPAGEOFF]
	ldr	w22, [x21]
Lloh2:
	adrp	x8, _AUX_WAIT_TIMEOUT_MS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AUX_WAIT_TIMEOUT_MS@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x20, x0
	mov	x0, x19
	bl	_anx78xx_aux_op_finished
	cbnz	w0, LBB0_5
; %bb.1:
	add	w8, w22, w20
	add	w8, w8, #1
	sxtw	x20, w8
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	mov	x1, x20
	bl	_time_after
	cbnz	x0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	mov	x0, x19
	bl	_anx78xx_aux_op_finished
	cbz	w0, LBB0_2
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_anx78xx_aux_op_finished
	cbz	w0, LBB0_12
LBB0_5:
	ldr	x8, [x19]
Lloh5:
	adrp	x9, _I2C_IDX_TX_P0@GOTPAGE
Lloh6:
	ldr	x9, [x9, _I2C_IDX_TX_P0@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	ldr	w0, [x8, x9, lsl #2]
Lloh8:
	adrp	x8, _SP_AUX_CH_STATUS_REG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SP_AUX_CH_STATUS_REG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_9
; %bb.6:
	ldr	w8, [sp, #12]
Lloh11:
	adrp	x9, _SP_AUX_STATUS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SP_AUX_STATUS@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.7:
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_8:
	bl	_DRM_ERROR
Lloh16:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_11
LBB0_9:
	mov	x19, x0
	str	x19, [sp]
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_11
LBB0_10:
	mov	w19, #0
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_12:
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_AUX_WAIT_TIMEOUT_MS,4,2        ; @AUX_WAIT_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timed out waiting AUX to finish\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_I2C_IDX_TX_P0,8,3              ; @I2C_IDX_TX_P0
	.comm	_SP_AUX_CH_STATUS_REG,4,2       ; @SP_AUX_CH_STATUS_REG
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read from AUX channel: %d\n"

	.comm	_SP_AUX_STATUS,4,2              ; @SP_AUX_STATUS
l_.str.2:                               ; @.str.2
	.asciz	"Failed to wait for AUX channel (status: %02x)\n"

	.no_dead_strip	_anx78xx_aux_wait
.subsections_via_symbols
