	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sn9c102_i2c_try_raw_read       ## -- Begin function sn9c102_i2c_try_raw_read
	.p2align	4, 0x90
_sn9c102_i2c_try_raw_read:              ## @sn9c102_i2c_try_raw_read
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
                                        ## kill: def $r8d killed $r8d def $r8
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	(%rdi), %r13
	movq	(%rsi), %rax
	movq	_SN9C102_I2C_2WIRES@GOTPCREL(%rip), %rbx
	xorl	%esi, %esi
	cmpq	(%rbx), %rax
	sete	%sil
	movq	_SN9C102_I2C_400KHZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	andl	8(%r14), %eax
	movq	8(%rdi), %r15
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	setne	%bl
	shll	$7, %esi
	leal	(%rsi,%rbx), %eax
	addl	$16, %eax
	movl	%eax, (%r13)
	movl	%edx, 4(%r13)
	movl	%ecx, 8(%r13)
	movl	$16, 28(%r13)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_SN9C102_CTRL_TIMEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	subq	$8, %rsp
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	$8, %edx
	movl	$65, %ecx
	movl	$8, %r8d
	xorl	%r9d, %r9d
	pushq	%rbx
	pushq	$8
	pushq	%r13
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %ebx
	sarl	$31, %ebx
	andl	%eax, %ebx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_sn9c102_i2c_wait
	movq	%rax, %r12
	addl	%ebx, %r12d
	movq	(%r14), %rax
	xorl	%ecx, %ecx
	movq	_SN9C102_I2C_2WIRES@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	sete	%cl
	shll	$7, %ecx
	movq	_SN9C102_I2C_400KHZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edx, %edx
	andl	8(%r14), %eax
	setne	%dl
	movq	-56(%rbp), %rax                 ## 8-byte Reload
                                        ## kill: def $eax killed $eax killed $rax def $rax
	shll	$4, %eax
	orl	%ecx, %eax
	addl	%edx, %eax
	addl	$2, %eax
	movl	%eax, (%r13)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%r13)
	movl	$16, 28(%r13)
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_SN9C102_CTRL_TIMEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	subq	$8, %rsp
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	$8, %edx
	movl	$65, %ecx
	movl	$8, %r8d
	xorl	%r9d, %r9d
	pushq	%rbx
	pushq	$8
	pushq	%r13
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %r15d
	sarl	$31, %r15d
	andl	%eax, %r15d
	addl	%r12d, %r15d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_sn9c102_i2c_wait
	movq	%rax, %r12
	addl	%r15d, %r12d
	movq	%r14, %r15
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	movq	_SN9C102_CTRL_TIMEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	subq	$8, %rsp
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	movl	$193, %ecx
	movl	$10, %r8d
	xorl	%r9d, %r9d
	pushq	%r10
	pushq	$5
	pushq	%r13
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %ebx
	sarl	$31, %ebx
	andl	%eax, %ebx
	addl	%r12d, %ebx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_sn9c102_i2c_detect_read_error
	movq	%rax, %r14
	movl	16(%r13), %edx
	leaq	L_.str(%rip), %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_PDBGG
	addl	%ebx, %r14d
	jne	LBB0_1
## %bb.2:
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	testq	%rsi, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_9
## %bb.3:
	testl	%edi, %edi
	jle	LBB0_9
## %bb.4:
	leal	-1(%rdi), %ecx
	cmpl	$4, %ecx
	movl	$4, %eax
	cmovbl	%ecx, %eax
	movl	16(%r13), %edx
	movslq	%ecx, %rcx
	movl	%edx, (%rsi,%rcx,4)
	testl	%eax, %eax
	je	LBB0_9
## %bb.5:
	incl	%eax
	movl	12(%r13), %ecx
	leal	-2(%rdi), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rsi,%rdx,4)
	cmpl	$2, %eax
	je	LBB0_9
## %bb.6:
	movl	8(%r13), %ecx
	leal	-3(%rdi), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rsi,%rdx,4)
	cmpl	$3, %eax
	je	LBB0_9
## %bb.7:
	movl	4(%r13), %ecx
	leal	-4(%rdi), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rsi,%rdx,4)
	cmpl	$4, %eax
	je	LBB0_9
## %bb.8:
	movl	(%r13), %eax
	addl	$-5, %edi
	movslq	%edi, %rcx
	movl	%eax, (%rsi,%rcx,4)
LBB0_9:
	movl	16(%r13), %eax
	jmp	LBB0_10
LBB0_1:
	movl	12(%r15), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	$3, %edi
	callq	_DBG
	movl	$-1, %eax
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SN9C102_I2C_2WIRES,8,3         ## @SN9C102_I2C_2WIRES
	.comm	_SN9C102_I2C_400KHZ,4,2         ## @SN9C102_I2C_400KHZ
	.comm	_SN9C102_CTRL_TIMEOUT,4,2       ## @SN9C102_CTRL_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"I2C read: address 0x%02X, first read byte: 0x%02X"

L_.str.1:                               ## @.str.1
	.asciz	"I2C read failed for %s image sensor"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sn9c102_i2c_try_raw_read       ; -- Begin function sn9c102_i2c_try_raw_read
	.p2align	2
_sn9c102_i2c_try_raw_read:              ; @sn9c102_i2c_try_raw_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	str	x5, [sp, #16]                   ; 8-byte Folded Spill
	mov	x27, x4
	str	w3, [sp, #28]                   ; 4-byte Folded Spill
	mov	x26, x2
	mov	x22, x1
	mov	x24, x0
	ldp	x21, x25, [x0]
	ldr	x8, [x1]
Lloh0:
	adrp	x28, _SN9C102_I2C_2WIRES@GOTPAGE
Lloh1:
	ldr	x28, [x28, _SN9C102_I2C_2WIRES@GOTPAGEOFF]
	ldr	x9, [x28]
	ldr	w10, [x1, #8]
Lloh2:
	adrp	x11, _SN9C102_I2C_400KHZ@GOTPAGE
Lloh3:
	ldr	x11, [x11, _SN9C102_I2C_400KHZ@GOTPAGEOFF]
Lloh4:
	ldr	w11, [x11]
	tst	w11, w10
	cset	w10, ne
	cmp	x8, x9
	mov	w20, #16
	mov	w8, #144
	csel	w8, w8, w20, eq
	orr	w8, w8, w10
	stp	w8, w2, [x21]
	str	w3, [x21, #8]
	str	w20, [x21, #28]
	mov	x0, x25
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
Lloh5:
	adrp	x19, _SN9C102_CTRL_TIMEOUT@GOTPAGE
Lloh6:
	ldr	x19, [x19, _SN9C102_CTRL_TIMEOUT@GOTPAGEOFF]
	ldr	w8, [x19]
	str	w8, [sp]
	mov	x0, x25
	mov	w2, #8
	mov	w3, #65
	mov	w4, #8
	mov	w5, #0
	mov	x6, x21
	mov	w7, #8
	bl	_usb_control_msg
	cmp	w0, #0
	csel	w23, w0, wzr, lt
	mov	x0, x24
	mov	x1, x22
	bl	_sn9c102_i2c_wait
	add	w23, w23, w0
	ldr	x8, [x22]
	ldr	x9, [x28]
	cmp	x8, x9
	cset	w8, eq
	ldr	w9, [x22, #8]
Lloh7:
	adrp	x10, _SN9C102_I2C_400KHZ@GOTPAGE
Lloh8:
	ldr	x10, [x10, _SN9C102_I2C_400KHZ@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	tst	w10, w9
	cset	w9, ne
	lsl	w10, w27, #4
	orr	w8, w10, w8, lsl #7
	orr	w8, w8, w9
	orr	w8, w8, #0x2
	stp	w8, w26, [x21]
	str	w20, [x21, #28]
	mov	x0, x25
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
	ldr	w8, [x19]
	mov	x20, x19
	str	w8, [sp]
	mov	x0, x25
	mov	w2, #8
	mov	w3, #65
	mov	w4, #8
	mov	w5, #0
	mov	x6, x21
	mov	w7, #8
	bl	_usb_control_msg
	cmp	w0, #0
	csel	w8, w0, wzr, lt
	add	w19, w23, w8
	mov	x0, x24
	mov	x1, x22
	bl	_sn9c102_i2c_wait
	add	w19, w19, w0
	mov	x0, x25
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
	ldr	w8, [x20]
	str	w8, [sp]
	mov	x0, x25
	mov	w2, #0
	mov	w3, #193
	mov	w4, #10
	mov	w5, #0
	mov	x6, x21
	mov	w7, #5
	bl	_usb_control_msg
	cmp	w0, #0
	csel	w8, w0, wzr, lt
	add	w19, w19, w8
	mov	x0, x24
	mov	x1, x22
	bl	_sn9c102_i2c_detect_read_error
	mov	x24, x0
	ldr	w2, [x21, #16]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	ldr	w1, [sp, #28]                   ; 4-byte Folded Reload
	bl	_PDBGG
	cmn	w19, w24
	b.ne	LBB0_9
; %bb.1:
	ldr	x11, [sp, #16]                  ; 8-byte Folded Reload
	cbz	x11, LBB0_8
; %bb.2:
	subs	w8, w27, #1
	b.lt	LBB0_8
; %bb.3:
	mov	w9, #4
	cmp	w8, #4
	csel	w9, w8, w9, lo
	ldr	w10, [x21, #16]
	str	w10, [x11, w8, sxtw #2]
	cbz	w9, LBB0_8
; %bb.4:
	add	w8, w9, #1
	ldr	w9, [x21, #12]
	sub	w10, w27, #2
	str	w9, [x11, w10, sxtw #2]
	cmp	w8, #2
	b.eq	LBB0_8
; %bb.5:
	ldr	w9, [x21, #8]
	sub	w10, w27, #3
	str	w9, [x11, w10, sxtw #2]
	cmp	w8, #3
	b.eq	LBB0_8
; %bb.6:
	ldr	w9, [x21, #4]
	sub	w10, w27, #4
	str	w9, [x11, w10, sxtw #2]
	cmp	w8, #4
	b.eq	LBB0_8
; %bb.7:
	ldr	w8, [x21]
	sub	w9, w27, #5
	str	w8, [x11, w9, sxtw #2]
LBB0_8:
	ldr	w0, [x21, #16]
	b	LBB0_10
LBB0_9:
	ldr	w2, [x22, #12]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #3
	bl	_DBG
	mov	w0, #-1
LBB0_10:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SN9C102_I2C_2WIRES,8,3         ; @SN9C102_I2C_2WIRES
	.comm	_SN9C102_I2C_400KHZ,4,2         ; @SN9C102_I2C_400KHZ
	.comm	_SN9C102_CTRL_TIMEOUT,4,2       ; @SN9C102_CTRL_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"I2C read: address 0x%02X, first read byte: 0x%02X"

l_.str.1:                               ; @.str.1
	.asciz	"I2C read failed for %s image sensor"

.subsections_via_symbols
