	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function af9015_i2c_xfer
_af9015_i2c_xfer:                       ## @af9015_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	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -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	_d_to_priv
	movslq	(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_1
## %bb.2:
	movq	_I2C_M_RD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	xorl	%r9d, %r9d
	movl	$0, %edi
	movl	$0, %esi
	testl	%edx, 4(%rbx)
	jne	LBB0_8
## %bb.3:
	cmpl	$2, %ecx
	je	LBB0_6
## %bb.4:
	cmpl	$1, %ecx
	jne	LBB0_7
## %bb.5:
	movq	8(%rbx), %rdx
	movslq	(%rdx), %r9
	movl	$1, %esi
	xorl	%edi, %edi
	jmp	LBB0_8
LBB0_1:
	xorl	%r9d, %r9d
	xorl	%edi, %edi
	xorl	%esi, %esi
LBB0_8:
	movq	(%r14), %r12
	cmpl	$2, %r15d
	je	LBB0_18
## %bb.9:
	cmpl	$1, %r15d
	jne	LBB0_32
## %bb.10:
	movq	_I2C_M_RD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, 4(%rbx)
	je	LBB0_11
## %bb.28:
	cmpl	$62, %ecx
	jge	LBB0_12
## %bb.29:
	movq	16(%rbx), %r8
	movq	(%rax), %rax
	cmpq	(%rax), %r8
	jne	LBB0_31
## %bb.30:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_18:
	movq	_I2C_M_RD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, 4(%rbx)
	je	LBB0_19
LBB0_32:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_dev_dbg
	testl	%ebx, %ebx
	jne	LBB0_34
	jmp	LBB0_35
LBB0_11:
	cmpl	$22, %ecx
	jge	LBB0_12
## %bb.14:
	movq	16(%rbx), %r8
	movq	(%rax), %rax
	cmpq	(%rax), %r8
	jne	LBB0_15
## %bb.16:
	movq	_WRITE_MEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_19:
	testl	%edx, 28(%rbx)
	je	LBB0_32
## %bb.20:
	cmpl	$3, %ecx
	jg	LBB0_12
## %bb.21:
	movslq	24(%rbx), %rcx
	cmpq	$62, %rcx
	jl	LBB0_22
LBB0_12:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_13:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_34
LBB0_6:
	movq	8(%rbx), %rdx
	movl	(%rdx), %esi
	shll	$8, %esi
	orl	4(%rdx), %esi
	movslq	%esi, %r9
	movl	$2, %esi
	xorl	%edi, %edi
	jmp	LBB0_8
LBB0_7:
	movq	8(%rbx), %rdx
	movl	(%rdx), %esi
	shll	$8, %esi
	orl	4(%rdx), %esi
	movslq	%esi, %r9
	movslq	8(%rdx), %rdi
	movl	$3, %esi
	jmp	LBB0_8
LBB0_31:
	movq	_READ_I2C@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	%r8, -88(%rbp)
	movq	%r9, -48(%rbp)
	movq	%rdi, -80(%rbp)
	movq	%rsi, -72(%rbp)
	movq	%rcx, -64(%rbp)
	movq	8(%rbx), %rax
	jmp	LBB0_26
LBB0_15:
	movq	_WRITE_I2C@GOTPCREL(%rip), %rax
LBB0_17:
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	%r8, -88(%rbp)
	movq	%r9, -48(%rbp)
	movq	%rdi, -80(%rbp)
	movq	%rsi, -72(%rbp)
	subq	%rsi, %rcx
	movq	%rcx, -64(%rbp)
	shlq	$2, %rsi
	addq	8(%rbx), %rsi
	movq	%rsi, -56(%rbp)
	jmp	LBB0_27
LBB0_22:
	movq	16(%rbx), %r8
	movq	(%rax), %rax
	cmpq	(%rax), %r8
	jne	LBB0_23
## %bb.24:
	movq	_READ_MEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_23:
	movq	_READ_I2C@GOTPCREL(%rip), %rax
LBB0_25:
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	%r8, -88(%rbp)
	movq	%r9, -48(%rbp)
	movq	%rdi, -80(%rbp)
	movq	%rsi, -72(%rbp)
	movq	%rcx, -64(%rbp)
	movq	32(%rbx), %rax
LBB0_26:
	movq	%rax, -56(%rbp)
LBB0_27:
	leaq	-88(%rbp), %rsi
	movq	%r14, %rdi
	callq	_af9015_ctrl_msg
	movl	%eax, %ebx
	testl	%ebx, %ebx
	je	LBB0_35
LBB0_34:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_dev_dbg
	movl	%ebx, %r15d
LBB0_35:
	movl	%r15d, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_WRITE_MEMORY,8,3               ## @WRITE_MEMORY
	.comm	_WRITE_I2C,8,3                  ## @WRITE_I2C
	.comm	_READ_MEMORY,8,3                ## @READ_MEMORY
	.comm	_READ_I2C,8,3                   ## @READ_I2C
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown msg, num %u\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed %d\n"

	.no_dead_strip	_af9015_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function af9015_i2c_xfer
_af9015_i2c_xfer:                       ; @af9015_i2c_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x20, x2
	mov	x22, x1
	bl	_i2c_get_adapdata
	mov	x21, x0
	bl	_d_to_priv
	ldr	x19, [x21]
	ldrsw	x8, [x22]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	w9, [x22, #4]
Lloh0:
	adrp	x10, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x10, [x10, _I2C_M_RD@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_11
LBB0_2:
	mov	x9, #0
	mov	x10, #0
	mov	x11, #0
LBB0_3:
	cmp	w20, #2
	b.eq	LBB0_9
; %bb.4:
	cmp	w20, #1
	b.ne	LBB0_10
; %bb.5:
	ldr	w12, [x22, #4]
Lloh3:
	adrp	x13, _I2C_M_RD@GOTPAGE
Lloh4:
	ldr	x13, [x13, _I2C_M_RD@GOTPAGEOFF]
Lloh5:
	ldr	w13, [x13]
	tst	w13, w12
	b.eq	LBB0_14
; %bb.6:
	cmp	w8, #62
	b.ge	LBB0_19
; %bb.7:
	ldr	x12, [x22, #16]
	ldr	x13, [x0]
	ldr	x13, [x13]
	cmp	x12, x13
	b.ne	LBB0_23
; %bb.8:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_20
LBB0_9:
	ldr	w13, [x22, #4]
Lloh8:
	adrp	x12, _I2C_M_RD@GOTPAGE
Lloh9:
	ldr	x12, [x12, _I2C_M_RD@GOTPAGEOFF]
Lloh10:
	ldr	w12, [x12]
	tst	w12, w13
	b.eq	LBB0_16
LBB0_10:
Lloh11:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w21, w8
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_dbg
	cbnz	w21, LBB0_26
	b	LBB0_27
LBB0_11:
	cmp	w8, #2
	b.eq	LBB0_21
; %bb.12:
	cmp	w8, #1
	b.ne	LBB0_22
; %bb.13:
	mov	x10, #0
	ldr	x9, [x22, #8]
	ldrsw	x9, [x9]
	mov	w11, #1
	b	LBB0_3
LBB0_14:
	cmp	w8, #22
	b.ge	LBB0_19
; %bb.15:
	ldr	x12, [x0]
	ldr	x12, [x12]
Lloh16:
	adrp	x13, _WRITE_MEMORY@GOTPAGE
Lloh17:
	ldr	x13, [x13, _WRITE_MEMORY@GOTPAGEOFF]
Lloh18:
	adrp	x14, _WRITE_I2C@GOTPAGE
Lloh19:
	ldr	x14, [x14, _WRITE_I2C@GOTPAGEOFF]
	ldp	x16, x15, [x22, #8]
	cmp	x15, x12
	csel	x12, x13, x14, eq
	ldr	x12, [x12]
	str	x12, [sp, #56]
	stp	x15, x10, [sp, #8]
	sub	x8, x8, x11
	stp	x11, x8, [sp, #24]
	add	x8, x16, x11, lsl #2
	b	LBB0_25
LBB0_16:
	ldr	w13, [x22, #28]
	tst	w13, w12
	b.eq	LBB0_10
; %bb.17:
	cmp	w8, #3
	b.gt	LBB0_19
; %bb.18:
	ldrsw	x8, [x22, #24]
	cmp	w8, #62
	b.lt	LBB0_24
LBB0_19:
Lloh20:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_26
LBB0_21:
	mov	x10, #0
	ldr	x9, [x22, #8]
	ldp	w11, w9, [x9]
	orr	w9, w9, w11, lsl #8
	sxtw	x9, w9
	mov	w11, #2
	b	LBB0_3
LBB0_22:
	ldr	x10, [x22, #8]
	ldp	w9, w11, [x10]
	orr	w9, w11, w9, lsl #8
	sxtw	x9, w9
	ldrsw	x10, [x10, #8]
	mov	w11, #3
	b	LBB0_3
LBB0_23:
Lloh22:
	adrp	x13, _READ_I2C@GOTPAGE
Lloh23:
	ldr	x13, [x13, _READ_I2C@GOTPAGEOFF]
Lloh24:
	ldr	x13, [x13]
	str	x13, [sp, #56]
	stp	x12, x10, [sp, #8]
	stp	x11, x8, [sp, #24]
	ldr	x8, [x22, #8]
	b	LBB0_25
LBB0_24:
	ldr	x12, [x22, #16]
	ldr	x13, [x0]
Lloh25:
	adrp	x14, _READ_MEMORY@GOTPAGE
Lloh26:
	ldr	x14, [x14, _READ_MEMORY@GOTPAGEOFF]
Lloh27:
	adrp	x15, _READ_I2C@GOTPAGE
Lloh28:
	ldr	x15, [x15, _READ_I2C@GOTPAGEOFF]
	ldr	x13, [x13]
	cmp	x12, x13
	csel	x13, x14, x15, eq
	ldr	x13, [x13]
	str	x13, [sp, #56]
	stp	x12, x10, [sp, #8]
	stp	x11, x8, [sp, #24]
	ldr	x8, [x22, #32]
LBB0_25:
	stp	x8, x9, [sp, #40]
	add	x1, sp, #8
	mov	x0, x21
	bl	_af9015_ctrl_msg
	mov	x21, x0
	cbz	w21, LBB0_27
LBB0_26:
Lloh29:
	adrp	x1, l_.str.1@PAGE
Lloh30:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_dbg
	mov	x20, x21
LBB0_27:
	mov	x0, x20
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_WRITE_MEMORY,8,3               ; @WRITE_MEMORY
	.comm	_WRITE_I2C,8,3                  ; @WRITE_I2C
	.comm	_READ_MEMORY,8,3                ; @READ_MEMORY
	.comm	_READ_I2C,8,3                   ; @READ_I2C
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown msg, num %u\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed %d\n"

	.no_dead_strip	_af9015_i2c_xfer
.subsections_via_symbols
