	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ttusb2_i2c_xfer
_ttusb2_i2c_xfer:                       ## @ttusb2_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	%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
	movl	%edx, %r13d
	movq	%rsi, %r12
	callq	_i2c_get_adapdata
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	cmpl	$3, %r13d
	jl	LBB0_7
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_warn
	jmp	LBB0_4
LBB0_1:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_30
LBB0_7:
	testl	%r13d, %r13d
	jle	LBB0_8
LBB0_4:
	xorl	%edx, %edx
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_5 Depth=1
	movslq	%r14d, %rax
	leaq	(%rax,%rax,2), %rax
	movq	%rbx, %r12
	movq	16(%rbx,%rax,8), %rdi
	movl	4(%rbx,%rax,8), %edx
	leaq	_ttusb2_i2c_xfer.ibuf+12(%rip), %rsi
	callq	_memcpy
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	addl	$2, %eax
	movl	%eax, %r14d
	movl	-44(%rbp), %r13d                ## 4-byte Reload
LBB0_28:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%r14d, %edx
	cmpl	%r13d, %r14d
	jge	LBB0_29
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leal	1(%rdx), %r14d
	cmpl	%r13d, %r14d
	jge	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movslq	%r14d, %rax
	leaq	(%rax,%rax,2), %rax
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	testl	%ebx, (%r12,%rax,8)
	setne	%al
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movslq	%edx, %rcx
	leaq	(%rcx,%rcx,2), %r15
	movl	4(%r12,%r15,8), %esi
	leal	-238(%rsi), %ecx
	cmpl	$-242, %ecx
	jbe	LBB0_11
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	movzbl	%al, %r13d
	andl	(%r12,%r15,8), %ebx
	testl	%r13d, %r13d
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	movslq	%r14d, %rax
	leaq	(%rax,%rax,2), %rax
	movl	4(%r12,%rax,8), %esi
	leal	-238(%rsi), %eax
	cmpl	$-242, %eax
	jbe	LBB0_15
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	leaq	(%r12,%r15,8), %rdi
	addq	$4, %rdi
	movl	8(%r12,%r15,8), %eax
	addl	%eax, %eax
	movl	%ebx, %ecx
	orl	%r13d, %ecx
	orl	%eax, %ecx
	movl	%ecx, _ttusb2_i2c_xfer.obuf(%rip)
	testl	%ebx, %ebx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	je	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	$0, _ttusb2_i2c_xfer.obuf+4(%rip)
	movq	%rdi, %rax
	testl	%r13d, %r13d
	jne	LBB0_19
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	(%rdi), %eax
	movl	%eax, _ttusb2_i2c_xfer.obuf+4(%rip)
	xorl	%eax, %eax
	testl	%r13d, %r13d
	je	LBB0_21
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=1
	movslq	%r14d, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%r12,%rax,8), %rax
	addq	$4, %rax
LBB0_20:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	(%rax), %eax
LBB0_21:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, _ttusb2_i2c_xfer.obuf+8(%rip)
	movq	%r12, %rbx
	movq	16(%r12,%r15,8), %rsi
	movq	%rdi, %r12
	movl	(%rdi), %edx
	leaq	_ttusb2_i2c_xfer.obuf+12(%rip), %rdi
	callq	_memcpy
	movq	_CMD_I2C_XFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	_ttusb2_i2c_xfer.obuf+4(%rip), %ecx
	addl	$3, %ecx
	movl	_ttusb2_i2c_xfer.obuf+8(%rip), %r9d
	addl	$3, %r9d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	_ttusb2_i2c_xfer.obuf(%rip), %rdx
	leaq	_ttusb2_i2c_xfer.ibuf(%rip), %r8
	callq	_ttusb2_msg
	testq	%rax, %rax
	js	LBB0_22
## %bb.23:                              ##   in Loop: Header=BB0_5 Depth=1
	testl	%r13d, %r13d
	jne	LBB0_24
## %bb.25:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	je	LBB0_26
## %bb.27:                              ##   in Loop: Header=BB0_5 Depth=1
	leaq	(%rbx,%r15,8), %rax
	addq	$16, %rax
	movq	(%rax), %rdi
	movl	(%r12), %edx
	movq	%rbx, %r12
	leaq	_ttusb2_i2c_xfer.ibuf+12(%rip), %rsi
	callq	_memcpy
	jmp	LBB0_28
LBB0_26:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %r12
	jmp	LBB0_28
LBB0_11:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_12
LBB0_22:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_err
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, %r14d
	jmp	LBB0_29
LBB0_8:
	xorl	%r14d, %r14d
	jmp	LBB0_29
LBB0_15:
	leaq	L_.str.2(%rip), %rdi
LBB0_12:
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	movq	%rdx, %rbx
	callq	_err
	movl	%ebx, %r14d
LBB0_29:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
LBB0_30:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_ttusb2_i2c_xfer.obuf,240,4 ## @ttusb2_i2c_xfer.obuf
.zerofill __DATA,__bss,_ttusb2_i2c_xfer.ibuf,240,4 ## @ttusb2_i2c_xfer.ibuf
	.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."

	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
L_.str.1:                               ## @.str.1
	.asciz	"i2c wr len=%d too high"

L_.str.2:                               ## @.str.2
	.asciz	"i2c rd len=%d too high"

	.comm	_CMD_I2C_XFER,4,2               ## @CMD_I2C_XFER
L_.str.3:                               ## @.str.3
	.asciz	"i2c transfer failed."

	.no_dead_strip	_ttusb2_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ttusb2_i2c_xfer
_ttusb2_i2c_xfer:                       ; @ttusb2_i2c_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	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
	.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	x20, x2
	mov	x21, x1
	bl	_i2c_get_adapdata
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	bl	_mutex_lock_interruptible
	tbnz	x0, #63, LBB0_3
; %bb.1:
	cmp	w20, #3
	b.lt	LBB0_4
; %bb.2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warn
	b	LBB0_5
LBB0_3:
Lloh2:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_30
LBB0_4:
	cmp	w20, #1
	b.lt	LBB0_26
LBB0_5:
	mov	w26, #0
	mov	w27, #24
Lloh5:
	adrp	x23, _ttusb2_i2c_xfer.obuf@PAGE
Lloh6:
	add	x23, x23, _ttusb2_i2c_xfer.obuf@PAGEOFF
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	smaddl	x8, w22, w27, x21
	ldr	x0, [x8, #16]
	ldr	w2, [x8, #4]
Lloh7:
	adrp	x1, _ttusb2_i2c_xfer.ibuf@PAGE+12
Lloh8:
	add	x1, x1, _ttusb2_i2c_xfer.ibuf@PAGEOFF+12
	bl	_memcpy
	add	w22, w26, #2
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x26, x22
	cmp	w22, w20
	b.ge	LBB0_29
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	sxtw	x8, w26
	add	x22, x8, #1
	cmp	w22, w20
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mul	x9, x22, x27
	ldr	w10, [x21, x9]
Lloh9:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh10:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w10
	cset	w25, ne
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w25, #0
Lloh12:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh13:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	mul	x10, x8, x27
	add	x24, x21, x10
	ldr	w11, [x24, #4]!
	sub	w12, w11, #238
	cmn	w12, #242
	b.ls	LBB0_24
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w10, [x21, x10]
	cbz	w25, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	smaddl	x11, w22, w27, x21
	ldr	w11, [x11, #4]
	sub	w12, w11, #238
	cmn	w12, #242
	b.ls	LBB0_27
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	madd	x11, x8, x27, x21
	ldr	w11, [x11, #8]
	and	w28, w9, w10
	orr	w9, w28, w25
	orr	w9, w9, w11, lsl #1
	adrp	x10, _ttusb2_i2c_xfer.obuf@PAGE
	str	w9, [x10, _ttusb2_i2c_xfer.obuf@PAGEOFF]
	cbz	w28, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_8 Depth=1
	adrp	x9, _ttusb2_i2c_xfer.obuf@PAGE+4
	str	wzr, [x9, _ttusb2_i2c_xfer.obuf@PAGEOFF+4]
	mov	x9, x24
	cbnz	w25, LBB0_17
	b	LBB0_18
LBB0_16:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w9, [x24]
	adrp	x10, _ttusb2_i2c_xfer.obuf@PAGE+4
	str	w9, [x10, _ttusb2_i2c_xfer.obuf@PAGEOFF+4]
	tbz	w25, #0, LBB0_23
LBB0_17:                                ;   in Loop: Header=BB0_8 Depth=1
	smaddl	x9, w22, w27, x21
	add	x9, x9, #4
LBB0_18:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w9, [x9]
LBB0_19:                                ;   in Loop: Header=BB0_8 Depth=1
	str	w9, [x23, #8]
	madd	x19, x8, x27, x21
	ldr	x1, [x19, #16]!
	ldr	w2, [x24]
	add	x0, x23, #12
	bl	_memcpy
Lloh15:
	adrp	x8, _CMD_I2C_XFER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CMD_I2C_XFER@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	ldp	w8, w9, [x23, #4]
	add	w3, w8, #3
	add	w5, w9, #3
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x2, x23
Lloh18:
	adrp	x4, _ttusb2_i2c_xfer.ibuf@PAGE
Lloh19:
	add	x4, x4, _ttusb2_i2c_xfer.ibuf@PAGEOFF
	bl	_ttusb2_msg
	tbnz	x0, #63, LBB0_25
; %bb.20:                               ;   in Loop: Header=BB0_8 Depth=1
	cbnz	w25, LBB0_6
; %bb.21:                               ;   in Loop: Header=BB0_8 Depth=1
	cbz	w28, LBB0_7
; %bb.22:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [x19]
	ldr	w2, [x24]
Lloh20:
	adrp	x1, _ttusb2_i2c_xfer.ibuf@PAGE+12
Lloh21:
	add	x1, x1, _ttusb2_i2c_xfer.ibuf@PAGEOFF+12
	bl	_memcpy
	b	LBB0_7
LBB0_23:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w9, #0
	b	LBB0_19
LBB0_24:
	str	x11, [sp]
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_28
LBB0_25:
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_28
LBB0_26:
	mov	w22, #0
	b	LBB0_29
LBB0_27:
	str	x11, [sp]
Lloh26:
	adrp	x0, l_.str.2@PAGE
Lloh27:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_28:
	bl	_err
	mov	x22, x26
LBB0_29:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_mutex_unlock
LBB0_30:
	mov	x0, x22
	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
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_ttusb2_i2c_xfer.obuf,240,2 ; @ttusb2_i2c_xfer.obuf
.zerofill __DATA,__bss,_ttusb2_i2c_xfer.ibuf,240,2 ; @ttusb2_i2c_xfer.ibuf
	.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."

	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
l_.str.1:                               ; @.str.1
	.asciz	"i2c wr len=%d too high"

l_.str.2:                               ; @.str.2
	.asciz	"i2c rd len=%d too high"

	.comm	_CMD_I2C_XFER,4,2               ; @CMD_I2C_XFER
l_.str.3:                               ; @.str.3
	.asciz	"i2c transfer failed."

	.no_dead_strip	_ttusb2_i2c_xfer
.subsections_via_symbols
