	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov511_i2c_write_internal
_ov511_i2c_write_internal:              ## @ov511_i2c_write_internal
	.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	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rsi
	movl	$5, %edi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	callq	_PDEBUG
	movq	_OV511_I2C_RETRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_R511_I2C_CTL@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	_R51x_I2C_SADDR_3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_reg_w
	testl	%eax, %eax
	js	LBB0_11
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_R51x_I2C_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_reg_w
	testl	%eax, %eax
	js	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_reg_w
	testl	%eax, %eax
	js	LBB0_11
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_reg_r
	testl	%eax, %eax
	jle	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%eax, %ecx
	andl	$1, %ecx
	je	LBB0_4
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	testl	%eax, %eax
	js	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	testb	$2, %al
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	-1(%r12), %eax
	testl	%r12d, %r12d
	movl	%eax, %r12d
	jg	LBB0_1
## %bb.10:
	leaq	L_.str.1(%rip), %rdi
	callq	_err
	movl	$-1, %eax
	jmp	LBB0_11
LBB0_8:
	xorl	%eax, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"0x%02X:0x%02X"

	.comm	_OV511_I2C_RETRIES,4,2          ## @OV511_I2C_RETRIES
	.comm	_R51x_I2C_SADDR_3,4,2           ## @R51x_I2C_SADDR_3
	.comm	_R51x_I2C_DATA,4,2              ## @R51x_I2C_DATA
	.comm	_R511_I2C_CTL,4,2               ## @R511_I2C_CTL
L_.str.1:                               ## @.str.1
	.asciz	"i2c write retries exhausted"

	.no_dead_strip	_ov511_i2c_write_internal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov511_i2c_write_internal
_ov511_i2c_write_internal:              ; @ov511_i2c_write_internal
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #5
	mov	x2, x20
	mov	x3, x19
	bl	_PDEBUG
Lloh2:
	adrp	x8, _OV511_I2C_RETRIES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OV511_I2C_RETRIES@GOTPAGEOFF]
Lloh4:
	ldr	w22, [x8]
Lloh5:
	adrp	x23, _R51x_I2C_SADDR_3@GOTPAGE
Lloh6:
	ldr	x23, [x23, _R51x_I2C_SADDR_3@GOTPAGEOFF]
Lloh7:
	adrp	x24, _R51x_I2C_DATA@GOTPAGE
Lloh8:
	ldr	x24, [x24, _R51x_I2C_DATA@GOTPAGEOFF]
Lloh9:
	adrp	x25, _R511_I2C_CTL@GOTPAGE
Lloh10:
	ldr	x25, [x25, _R511_I2C_CTL@GOTPAGEOFF]
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	ldr	w1, [x23]
	mov	x0, x21
	mov	x2, x20
	bl	_reg_w
	tbnz	w0, #31, LBB0_10
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w1, [x24]
	mov	x0, x21
	mov	x2, x19
	bl	_reg_w
	tbnz	w0, #31, LBB0_10
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w1, [x25]
	mov	x0, x21
	mov	w2, #1
	bl	_reg_w
	tbnz	w0, #31, LBB0_10
LBB0_4:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x25]
	mov	x0, x21
	bl	_reg_r
	and	w8, w0, #0x1
	cmp	w0, #1
	ccmp	w8, #0, #0, ge
	b.eq	LBB0_4
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	tbnz	w0, #31, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	tbz	w0, #1, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	sub	w8, w22, #1
	cmp	w22, #0
	mov	x22, x8
	b.gt	LBB0_1
; %bb.8:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_err
	mov	w0, #-1
	b	LBB0_10
LBB0_9:
	mov	w0, #0
LBB0_10:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"0x%02X:0x%02X"

	.comm	_OV511_I2C_RETRIES,4,2          ; @OV511_I2C_RETRIES
	.comm	_R51x_I2C_SADDR_3,4,2           ; @R51x_I2C_SADDR_3
	.comm	_R51x_I2C_DATA,4,2              ; @R51x_I2C_DATA
	.comm	_R511_I2C_CTL,4,2               ; @R511_I2C_CTL
l_.str.1:                               ; @.str.1
	.asciz	"i2c write retries exhausted"

	.no_dead_strip	_ov511_i2c_write_internal
.subsections_via_symbols
