	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function af9005_i2c_xfer
_af9005_i2c_xfer:                       ## @af9005_i2c_xfer
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	callq	_i2c_get_adapdata
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	cmpl	$3, %r15d
	jl	LBB0_5
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_warn
	jmp	LBB0_4
LBB0_1:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_5:
	cmpl	$2, %r15d
	jne	LBB0_4
## %bb.6:
	movq	8(%rbx), %rax
	movl	(%rax), %edx
	movl	16(%rbx), %esi
	movq	32(%rbx), %rcx
	movq	%r14, %rdi
	movl	$1, %r8d
	callq	_af9005_i2c_read
	testl	%eax, %eax
	movl	$2, %ebx
	jmp	LBB0_7
LBB0_4:
	movq	(%rbx), %r8
	movq	8(%rbx), %rcx
	movl	(%rcx), %edx
	movl	16(%rbx), %esi
	addq	$4, %rcx
	decq	%r8
	movq	%r14, %rdi
	callq	_af9005_i2c_write
	testl	%eax, %eax
	movl	$1, %ebx
LBB0_7:
	cmovnel	%eax, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"more than 2 i2c messages at a time is not handled yet. TODO."

	.no_dead_strip	_af9005_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function af9005_i2c_xfer
_af9005_i2c_xfer:                       ; @af9005_i2c_xfer
	.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	x21, x2
	mov	x20, x1
	bl	_i2c_get_adapdata
	mov	x19, x0
	bl	_mutex_lock_interruptible
	tbnz	x0, #63, LBB0_3
; %bb.1:
	cmp	w21, #3
	b.lt	LBB0_4
; %bb.2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warn
	b	LBB0_6
LBB0_3:
Lloh2:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_8
LBB0_4:
	cmp	w21, #2
	b.ne	LBB0_6
; %bb.5:
	ldr	x8, [x20, #8]
	ldr	w2, [x8]
	ldr	w1, [x20, #16]
	ldr	x3, [x20, #32]
	mov	x0, x19
	mov	w4, #1
	bl	_af9005_i2c_read
	mov	w8, #2
	cmp	w0, #0
	csel	w20, w8, w0, eq
	b	LBB0_7
LBB0_6:
	ldp	x8, x3, [x20]
	ldr	w2, [x3], #4
	ldr	w1, [x20, #16]
	sub	x4, x8, #1
	mov	x0, x19
	bl	_af9005_i2c_write
	cmp	w0, #0
	csinc	w20, w0, wzr, ne
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_8:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"more than 2 i2c messages at a time is not handled yet. TODO."

	.no_dead_strip	_af9005_i2c_xfer
.subsections_via_symbols
