	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function octeon_i2c_read
_octeon_i2c_read:                       ## @octeon_i2c_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
	movl	%r8d, -52(%rbp)                 ## 4-byte Spill
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rdi, %rbx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	(%rcx), %r15d
	addl	%esi, %esi
	incl	%esi
	callq	_octeon_i2c_data_write
	movq	_TWSI_CTL_ENAB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_octeon_i2c_ctl_write
	movq	%rbx, %rdi
	callq	_octeon_i2c_wait
	testl	%eax, %eax
	jne	LBB0_15
## %bb.1:
	xorl	%r13d, %r13d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_octeon_i2c_check_status
	movl	%eax, -44(%rbp)
	testl	%eax, %eax
	je	LBB0_2
LBB0_15:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	xorl	%r14d, %r14d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	-48(%rbp), %r15d                ## 4-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_octeon_i2c_check_status
	movl	%eax, -44(%rbp)
	movq	%r12, %r14
	testl	%eax, %eax
	jne	LBB0_15
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%r15d, %rax
	cmpq	%rax, %r14
	jge	LBB0_14
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	setne	%al
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	%r15d, %ecx
	leaq	1(%r14), %r12
	testq	%r14, %r14
	sete	%r15b
	andb	%al, %r15b
	movl	$1, %eax
	cmovnel	%r13d, %eax
	cmpq	%rcx, %r12
	cmovel	%eax, %r13d
	xorl	%esi, %esi
	testl	%r13d, %r13d
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_TWSI_CTL_AAK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_TWSI_CTL_ENAB@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_octeon_i2c_ctl_write
	movq	%rbx, %rdi
	callq	_octeon_i2c_wait
	movl	%eax, -44(%rbp)
	testl	%eax, %eax
	jne	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	leaq	-44(%rbp), %rsi
	callq	_octeon_i2c_data_read
	movq	%rax, %rcx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rcx, (%rax,%r14,8)
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jne	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	testb	%r15b, %r15b
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_I2C_SMBUS_BLOCK_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	incq	%rax
	cmpq	%rax, %rcx
	jg	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	addl	%ecx, %r15d
	jmp	LBB0_13
LBB0_14:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_11:
	movq	_EPROTO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_TWSI_CTL_ENAB,4,2              ## @TWSI_CTL_ENAB
	.comm	_TWSI_CTL_AAK,4,2               ## @TWSI_CTL_AAK
	.comm	_I2C_SMBUS_BLOCK_MAX,8,3        ## @I2C_SMBUS_BLOCK_MAX
	.comm	_EPROTO,4,2                     ## @EPROTO
	.no_dead_strip	_octeon_i2c_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function octeon_i2c_read
_octeon_i2c_read:                       ; @octeon_i2c_read
	.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, x4
	mov	x19, x3
	mov	x21, x2
	mov	x22, x0
	ldr	w24, [x3]
	mov	w8, #1
	bfi	w8, w1, #1, #31
	mov	x1, x8
	bl	_octeon_i2c_data_write
Lloh0:
	adrp	x25, _TWSI_CTL_ENAB@GOTPAGE
Lloh1:
	ldr	x25, [x25, _TWSI_CTL_ENAB@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x22
	bl	_octeon_i2c_ctl_write
	mov	x0, x22
	bl	_octeon_i2c_wait
	cbnz	w0, LBB0_2
; %bb.1:
	mov	x0, x22
	mov	w1, #0
	bl	_octeon_i2c_check_status
	str	w0, [sp, #12]
	cbz	w0, LBB0_3
LBB0_2:
	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
LBB0_3:
	mov	x26, #0
	mov	w23, #0
Lloh2:
	adrp	x27, _TWSI_CTL_AAK@GOTPAGE
Lloh3:
	ldr	x27, [x27, _TWSI_CTL_AAK@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	x1, x23
	bl	_octeon_i2c_check_status
	str	w0, [sp, #12]
	add	x26, x26, #1
	cbnz	w0, LBB0_2
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x26, w24, sxtw
	b.ge	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w20, #0
	cset	w8, ne
	add	x9, x26, #1
	cmp	x26, #0
	cset	w10, eq
	ands	w28, w8, w10
	csinc	w8, w23, wzr, ne
	cmp	x9, w24, uxtw
	csel	w23, w8, w23, eq
	ldr	w8, [x25]
	ldr	w9, [x27]
	cmp	w23, #0
	csel	w9, w9, wzr, eq
	orr	w1, w8, w9
	mov	x0, x22
	bl	_octeon_i2c_ctl_write
	mov	x0, x22
	bl	_octeon_i2c_wait
	str	w0, [sp, #12]
	cbnz	w0, LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x1, sp, #12
	mov	x0, x22
	bl	_octeon_i2c_data_read
	mov	x8, x0
	str	x0, [x21, x26, lsl #3]
	ldr	w0, [sp, #12]
	cbnz	w0, LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	tbz	w28, #0, LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh4:
	adrp	x9, _I2C_SMBUS_BLOCK_MAX@GOTPAGE
Lloh5:
	ldr	x9, [x9, _I2C_SMBUS_BLOCK_MAX@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	add	x9, x9, #1
	cmp	x8, x9
	b.gt	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	add	w24, w24, w8
	b	LBB0_4
LBB0_11:
	mov	w0, #0
	str	w24, [x19]
	b	LBB0_2
LBB0_12:
Lloh7:
	adrp	x8, _EPROTO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EPROTO@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_TWSI_CTL_ENAB,4,2              ; @TWSI_CTL_ENAB
	.comm	_TWSI_CTL_AAK,4,2               ; @TWSI_CTL_AAK
	.comm	_I2C_SMBUS_BLOCK_MAX,8,3        ; @I2C_SMBUS_BLOCK_MAX
	.comm	_EPROTO,4,2                     ; @EPROTO
	.no_dead_strip	_octeon_i2c_read
.subsections_via_symbols
