	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ca8210_spi_exchange
_ca8210_spi_exchange:                   ## @ca8210_spi_exchange
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	(%rcx), %r14
	movq	_SPI_SYN@GOTPCREL(%rip), %rax
	testq	%rdx, %rdx
	je	LBB0_3
## %bb.1:
	movl	(%rax), %eax
	andl	(%r15), %eax
	je	LBB0_3
## %bb.2:
	leaq	8(%r14), %rdi
	callq	_reinit_completion
	movq	%rbx, (%r14)
LBB0_3:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	12(%r14), %r12
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_interruptible_timeout
	movq	%rax, %rbx
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%rbx, %rax
	jne	LBB0_10
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	testl	%ebx, %ebx
	jns	LBB0_13
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_reinit_completion
	movl	16(%r14), %edi
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_ca8210_spi_transfer
	testl	%eax, %eax
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_12
## %bb.6:
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_20
## %bb.7:
	movq	_SPI_SYN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r15), %eax
	je	LBB0_20
## %bb.8:
	leaq	8(%r14), %rdi
	callq	_complete
	jmp	LBB0_20
LBB0_10:
	testq	%rbx, %rbx
	movl	$0, %ebx
	je	LBB0_11
LBB0_13:
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_20
## %bb.14:
	movq	_SPI_SYN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r15), %eax
	je	LBB0_20
## %bb.15:
	leaq	8(%r14), %r15
	movq	_CA8210_SYNC_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_interruptible_timeout
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	%rax, %rcx
	jne	LBB0_17
## %bb.16:
	movl	%eax, %ebx
	jmp	LBB0_20
LBB0_17:
	testq	%rax, %rax
	jne	LBB0_20
## %bb.18:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_19
LBB0_11:
	leaq	L_.str.1(%rip), %rsi
LBB0_19:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	movq	_ETIME@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_20:
	movq	$0, (%r14)
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPI_SYN,4,2                    ## @SPI_SYN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"spi write failed, returned %d\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ERESTARTSYS,8,3                ## @ERESTARTSYS
L_.str.1:                               ## @.str.1
	.asciz	"SPI downstream transfer timed out!\n"

	.comm	_ETIME,4,2                      ## @ETIME
	.comm	_CA8210_SYNC_TIMEOUT,4,2        ## @CA8210_SYNC_TIMEOUT
L_.str.2:                               ## @.str.2
	.asciz	"Synchronous confirm timeout\n"

	.no_dead_strip	_ca8210_spi_exchange
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ca8210_spi_exchange
_ca8210_spi_exchange:                   ; @ca8210_spi_exchange
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x3
	mov	x22, x2
	mov	x23, x1
	mov	x21, x0
	ldr	x26, [x3]
Lloh0:
	adrp	x9, _SPI_SYN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SPI_SYN@GOTPAGEOFF]
	cbz	x2, LBB0_3
; %bb.1:
	ldr	w8, [x21]
	ldr	w9, [x9]
	and	w8, w9, w8
	cbz	w8, LBB0_3
; %bb.2:
	add	x0, x26, #8
	bl	_reinit_completion
	str	x22, [x26]
LBB0_3:
	add	x24, x26, #12
Lloh2:
	adrp	x28, _ERESTARTSYS@GOTPAGE
Lloh3:
	ldr	x28, [x28, _ERESTARTSYS@GOTPAGEOFF]
Lloh4:
	adrp	x27, _EBUSY@GOTPAGE
Lloh5:
	ldr	x27, [x27, _EBUSY@GOTPAGEOFF]
Lloh6:
	adrp	x25, l_.str@PAGE
Lloh7:
	add	x25, x25, l_.str@PAGEOFF
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	w0, #1000
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x24
	bl	_wait_for_completion_interruptible_timeout
	mov	x20, x0
	ldr	x8, [x28]
	cmn	x0, x8
	b.ne	LBB0_11
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	tbz	w20, #31, LBB0_13
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_reinit_completion
	ldr	w0, [x26, #16]
	mov	x1, x21
	mov	x2, x23
	bl	_ca8210_spi_transfer
	cbz	w0, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x20, x0
	mov	x0, x19
	mov	x1, x25
	mov	x2, x20
	bl	_dev_warn
	ldr	w8, [x27]
	cmn	w20, w8
	b.eq	LBB0_5
; %bb.8:
	cbz	x22, LBB0_21
; %bb.9:
	ldr	w8, [x21]
Lloh8:
	adrp	x9, _SPI_SYN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SPI_SYN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	and	w8, w9, w8
	cbz	w8, LBB0_21
; %bb.10:
	add	x0, x26, #8
	bl	_complete
	b	LBB0_21
LBB0_11:
	cbz	x20, LBB0_19
; %bb.12:
	mov	w20, #0
LBB0_13:
	cbz	x22, LBB0_21
; %bb.14:
	ldr	w8, [x21]
Lloh11:
	adrp	x9, _SPI_SYN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SPI_SYN@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	and	w8, w9, w8
	cbz	w8, LBB0_21
; %bb.15:
	add	x21, x26, #8
Lloh14:
	adrp	x8, _CA8210_SYNC_TIMEOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CA8210_SYNC_TIMEOUT@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x21
	bl	_wait_for_completion_interruptible_timeout
	ldr	x8, [x28]
	cmn	x0, x8
	b.ne	LBB0_17
; %bb.16:
	mov	x20, x0
	b	LBB0_21
LBB0_17:
	cbnz	x0, LBB0_21
; %bb.18:
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_20
LBB0_19:
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_20:
	mov	x0, x19
	bl	_dev_err
Lloh21:
	adrp	x8, _ETIME@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_21:
	str	xzr, [x26]
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_SPI_SYN,4,2                    ; @SPI_SYN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"spi write failed, returned %d\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ERESTARTSYS,8,3                ; @ERESTARTSYS
l_.str.1:                               ; @.str.1
	.asciz	"SPI downstream transfer timed out!\n"

	.comm	_ETIME,4,2                      ; @ETIME
	.comm	_CA8210_SYNC_TIMEOUT,4,2        ; @CA8210_SYNC_TIMEOUT
l_.str.2:                               ; @.str.2
	.asciz	"Synchronous confirm timeout\n"

	.no_dead_strip	_ca8210_spi_exchange
.subsections_via_symbols
