	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov511_i2c_r
_ov511_i2c_r:                           ## @ov511_i2c_r
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	$6, %r13d
	movq	_R511_I2C_CTL@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movq	_R51x_I2C_SADDR_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_reg_w
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	$3, %edx
	callq	_reg_w
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_reg_r
	movl	%eax, %ebx
	testl	%eax, %eax
	jle	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	movl	%ebx, %eax
	andl	$1, %eax
	je	LBB0_2
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	testl	%ebx, %ebx
	js	LBB0_18
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	testb	$2, %bl
	je	LBB0_6
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	$16, %edx
	callq	_reg_w
	subl	$1, %r13d
	jae	LBB0_1
## %bb.15:
	movq	_D_USBI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_16
LBB0_6:
	movl	$6, %r13d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	$5, %edx
	callq	_reg_w
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_reg_r
	movl	%eax, %ebx
	testl	%eax, %eax
	jle	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	movl	%ebx, %eax
	andl	$1, %eax
	je	LBB0_8
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	testl	%ebx, %ebx
	js	LBB0_18
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	testb	$2, %bl
	je	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	$16, %edx
	callq	_reg_w
	subl	$1, %r13d
	jae	LBB0_7
## %bb.13:
	movq	_D_USBI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
LBB0_16:
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_gspca_dbg
	movl	$-1, %ebx
	jmp	LBB0_18
LBB0_17:
	movq	_R51x_I2C_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_reg_r
	movl	%eax, %ebx
	movq	_D_USBI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	movl	%r14d, %ecx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_gspca_dbg
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	$5, %edx
	callq	_reg_w
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_R51x_I2C_SADDR_2,4,2           ## @R51x_I2C_SADDR_2
	.comm	_R511_I2C_CTL,4,2               ## @R511_I2C_CTL
	.comm	_D_USBI,4,2                     ## @D_USBI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c write retries exhausted\n"

L_.str.1:                               ## @.str.1
	.asciz	"i2c read retries exhausted\n"

	.comm	_R51x_I2C_DATA,4,2              ## @R51x_I2C_DATA
L_.str.2:                               ## @.str.2
	.asciz	"ov511_i2c_r %02x %02x\n"

	.no_dead_strip	_ov511_i2c_r
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov511_i2c_r
_ov511_i2c_r:                           ; @ov511_i2c_r
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	mov	w8, #6
Lloh0:
	adrp	x23, _R51x_I2C_SADDR_2@GOTPAGE
Lloh1:
	ldr	x23, [x23, _R51x_I2C_SADDR_2@GOTPAGEOFF]
Lloh2:
	adrp	x22, _R511_I2C_CTL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _R511_I2C_CTL@GOTPAGEOFF]
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
	mov	x24, x8
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x20
	bl	_reg_w
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #3
	bl	_reg_w
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x22]
	mov	x0, x19
	bl	_reg_r
	and	w8, w0, #0x1
	cmp	w0, #1
	ccmp	w8, #0, #0, ge
	b.eq	LBB0_2
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x21, x0
	tbnz	w0, #31, LBB0_16
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	tbz	w21, #1, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #16
	bl	_reg_w
	sub	w8, w24, #1
	cbnz	w24, LBB0_1
; %bb.6:
Lloh4:
	adrp	x8, _D_USBI@GOTPAGE
Lloh5:
	ldr	x8, [x8, _D_USBI@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x2, l_.str@PAGE
Lloh8:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_14
LBB0_7:
	mov	w8, #6
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	mov	x23, x8
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #5
	bl	_reg_w
LBB0_9:                                 ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x22]
	mov	x0, x19
	bl	_reg_r
	and	w8, w0, #0x1
	cmp	w0, #1
	ccmp	w8, #0, #0, ge
	b.eq	LBB0_9
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x21, x0
	tbnz	w0, #31, LBB0_16
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	tbz	w21, #1, LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #16
	bl	_reg_w
	sub	w8, w23, #1
	cbnz	w23, LBB0_8
; %bb.13:
Lloh9:
	adrp	x8, _D_USBI@GOTPAGE
Lloh10:
	ldr	x8, [x8, _D_USBI@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x2, l_.str.1@PAGE
Lloh13:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_14:
	mov	x0, x19
	bl	_gspca_dbg
	mov	w21, #-1
	b	LBB0_16
LBB0_15:
Lloh14:
	adrp	x8, _R51x_I2C_DATA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _R51x_I2C_DATA@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_reg_r
	mov	x21, x0
Lloh17:
	adrp	x8, _D_USBI@GOTPAGE
Lloh18:
	ldr	x8, [x8, _D_USBI@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	stp	x20, x21, [sp]
Lloh20:
	adrp	x2, l_.str.2@PAGE
Lloh21:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_gspca_dbg
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #5
	bl	_reg_w
LBB0_16:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_R51x_I2C_SADDR_2,4,2           ; @R51x_I2C_SADDR_2
	.comm	_R511_I2C_CTL,4,2               ; @R511_I2C_CTL
	.comm	_D_USBI,4,2                     ; @D_USBI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c write retries exhausted\n"

l_.str.1:                               ; @.str.1
	.asciz	"i2c read retries exhausted\n"

	.comm	_R51x_I2C_DATA,4,2              ; @R51x_I2C_DATA
l_.str.2:                               ; @.str.2
	.asciz	"ov511_i2c_r %02x %02x\n"

	.no_dead_strip	_ov511_i2c_r
.subsections_via_symbols
