	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function go7007_usb_i2c_master_xfer
_go7007_usb_i2c_master_xfer:            ## @go7007_usb_i2c_master_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r13
	callq	_i2c_get_adapdata
	movq	%rax, %r12
	movq	8(%rax), %rax
	xorl	%r14d, %r14d
	movq	_STATUS_SHUTDOWN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movl	%r14d, %ebx
	jmp	LBB0_21
LBB0_2:
	movq	(%r12), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movq	16(%r12), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	testl	%ebx, %ebx
	jle	LBB0_20
## %bb.3:
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	4(%rcx), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	leaq	12(%rcx), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movl	%ebx, -76(%rbp)                 ## 4-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=1
	incl	%r15d
	movl	%r15d, %r12d
	movl	-76(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%ebx, %r15d
	jge	LBB0_19
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	leal	1(%r12), %r15d
	movslq	%r12d, %rax
	leaq	(%rax,%rax,2), %r14
	cmpl	%ebx, %r15d
	jge	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r13,%r14,8), %eax
	movslq	%r15d, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	cmpl	(%r13,%rcx,8), %eax
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r13,%r14,8)
	je	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	leaq	(,%r14,8), %rax
	addq	%r13, %rax
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%r13,%r14,8)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	movabsq	$4294967297, %rcx               ## imm = 0x100000001
	movq	%rcx, (%r8)
	movl	(%rax), %eax
	addl	%eax, %eax
	movl	%eax, 8(%r8)
	movl	8(%r13,%r14,8), %eax
	movl	%eax, 12(%r8)
	movl	$4, %r9d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	$0, (%rbx)
	movl	8(%r13,%r14,8), %ecx
	incl	%ecx
	movl	%ecx, 4(%rbx)
	movl	(%rax), %eax
	addl	%eax, %eax
	movl	%eax, 8(%rbx)
	movq	16(%r13,%r14,8), %rsi
	movl	8(%r13,%r14,8), %edx
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_memcpy
	movslq	8(%r13,%r14,8), %rax
	movq	%rbx, %r8
	leal	4(%rax), %r9d
	movl	$0, 12(%rbx,%rax,4)
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%r12d, %r15d
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movl	$0, (%rsp)
	movq	%r12, %rdi
	movl	$36, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_go7007_usb_vendor_request
	testq	%rax, %rax
	js	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	movslq	%r15d, %rax
	leaq	(%rax,%rax,2), %rbx
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r13,%rbx,8)
	je	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	8(%r13,%rbx,8), %edx
	incl	%edx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_memset
	movl	8(%r13,%rbx,8), %r9d
	incl	%r9d
	movl	$1, (%rsp)
	movq	%r12, %rdi
	movl	$37, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%r14, %r8
	callq	_go7007_usb_vendor_request
	testq	%rax, %rax
	js	LBB0_14
## %bb.17:                              ##   in Loop: Header=BB0_4 Depth=1
	leaq	8(,%rbx,8), %rax
	addq	%r13, %rax
	movq	16(%r13,%rbx,8), %rdi
	movl	(%rax), %edx
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	callq	_memcpy
	jmp	LBB0_18
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	testl	%eax, 4(%r13,%rcx,8)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	(,%r14,8), %rax
	addq	%r13, %rax
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movl	$1, (%r12)
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movl	8(%r13,%r14,8), %ecx
	incl	%ecx
	movl	%ecx, 4(%r12)
	movl	(%rax), %eax
	addl	%eax, %eax
	movl	%eax, 8(%r12)
	movq	16(%r13,%r14,8), %rsi
	movl	8(%r13,%r14,8), %edx
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_memcpy
	movslq	8(%r13,%r14,8), %rax
	movq	%r12, %r8
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%r13,%rcx,8), %ecx
	leal	4(%rax), %r9d
	movl	%ecx, 12(%r12,%rax,4)
	jmp	LBB0_13
LBB0_14:
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
LBB0_19:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
LBB0_20:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_21:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_STATUS_SHUTDOWN,8,3            ## @STATUS_SHUTDOWN
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.no_dead_strip	_go7007_usb_i2c_master_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function go7007_usb_i2c_master_xfer
_go7007_usb_i2c_master_xfer:            ; @go7007_usb_i2c_master_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	d9, d8, [sp, #32]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x19, x2
	mov	x20, x1
	bl	_i2c_get_adapdata
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _STATUS_SHUTDOWN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STATUS_SHUTDOWN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_21
LBB0_2:
	mov	x22, x0
	ldr	x23, [x0]
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
	ldr	x24, [x0, #16]
	mov	x0, x24
	bl	_mutex_lock
	cmp	w19, #1
	b.lt	LBB0_20
; %bb.3:
	str	x24, [sp, #16]                  ; 8-byte Folded Spill
	mov	w26, #0
	neg	w8, w21
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	add	x24, x23, #4
	add	x8, x23, #12
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	mov	w27, #24
Lloh9:
	adrp	x28, _I2C_M_RD@GOTPAGE
Lloh10:
	ldr	x28, [x28, _I2C_M_RD@GOTPAGEOFF]
	movi.2s	v8, #1
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w26, w21, #1
	cmp	w26, w19
	b.ge	LBB0_19
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sxtw	x8, w26
	add	x21, x8, #1
	cmp	w21, w19
	b.ge	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	madd	x9, x8, x27, x20
	ldr	w10, [x9]
	mul	x11, x21, x27
	ldr	w11, [x20, x11]
	cmp	w10, w11
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	madd	x10, x8, x27, x20
	ldr	w11, [x10, #4]
	ldr	w10, [x28]
	tst	w10, w11
	b.eq	LBB0_16
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	madd	x9, x8, x27, x20
	ldr	w10, [x9, #4]
	ldr	w11, [x28]
	tst	w11, w10
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	str	d8, [x23]
	ldr	w9, [x9]
	lsl	w9, w9, #1
	str	w9, [x23, #8]
	madd	x8, x8, x27, x20
	ldr	w8, [x8, #8]
	str	w8, [x23, #12]
	mov	w5, #4
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	str	wzr, [x23]
	madd	x21, x8, x27, x20
	ldr	w8, [x21, #8]
	add	w8, w8, #1
	str	w8, [x23, #4]
	ldr	w8, [x9]
	lsl	w8, w8, #1
	str	w8, [x23, #8]
	ldr	x1, [x21, #16]
	ldr	w2, [x21, #8]
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	bl	_memcpy
	ldr	w8, [x21, #8]
	add	w9, w8, #3
	add	w5, w8, #4
	str	wzr, [x23, w9, sxtw #2]
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x26
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	w1, #36
	mov	w2, #0
	mov	w3, #0
	mov	x4, x23
	mov	w6, #0
	bl	_go7007_usb_vendor_request
	tbnz	x0, #63, LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	smaddl	x8, w21, w27, x20
	ldr	w8, [x8, #4]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x8, x21
	sxtw	x26, w8
	madd	x25, x26, x27, x20
	ldr	w8, [x25, #8]!
	add	w2, w8, #1
	mov	x0, x23
	mov	w1, #0
	bl	_memset
	ldr	w8, [x25]
	add	w5, w8, #1
	mov	x0, x22
	mov	w1, #37
	mov	w2, #0
	mov	w3, #0
	mov	x4, x23
	mov	w6, #1
	bl	_go7007_usb_vendor_request
	tbnz	x0, #63, LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
	madd	x8, x26, x27, x20
	ldr	x0, [x8, #16]
	ldr	w2, [x25]
	mov	x1, x24
	bl	_memcpy
	b	LBB0_4
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	madd	x11, x21, x27, x20
	ldr	w11, [x11, #4]
	tst	w11, w10
	b.eq	LBB0_8
; %bb.17:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	w10, #1
	str	w10, [x23]
	madd	x25, x8, x27, x20
	ldr	w8, [x25, #8]
	add	w8, w8, #1
	str	w8, [x23, #4]
	ldr	w8, [x9]
	lsl	w8, w8, #1
	str	w8, [x23, #8]
	ldr	x1, [x25, #16]
	ldr	w2, [x25, #8]
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	bl	_memcpy
	ldr	w8, [x25, #8]
	add	w9, w8, #3
	madd	x10, x21, x27, x20
	ldr	w10, [x10, #8]
	add	w5, w8, #4
	str	w10, [x23, w9, sxtw #2]
	b	LBB0_12
LBB0_18:
	ldr	w19, [sp, #12]                  ; 4-byte Folded Reload
LBB0_19:
	ldr	x24, [sp, #16]                  ; 8-byte Folded Reload
LBB0_20:
	mov	x0, x24
	bl	_mutex_unlock
LBB0_21:
	mov	x0, x19
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #32]               ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_STATUS_SHUTDOWN,8,3            ; @STATUS_SHUTDOWN
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.no_dead_strip	_go7007_usb_i2c_master_xfer
.subsections_via_symbols
