	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function octeon_i2c_hlc_write
_octeon_i2c_hlc_write:                  ## @octeon_i2c_hlc_write
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_octeon_i2c_hlc_enable
	movq	%r14, %rdi
	callq	_octeon_i2c_hlc_int_clear
	movq	_SW_TWSI_V@GOTPCREL(%rip), %rax
	movq	_SW_TWSI_SOVR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	(%r15), %eax
	movl	4(%r15), %r13d
	leal	-1(%rax), %edx
	movq	_SW_TWSI_SIZE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%edx, %edi
	shll	%cl, %edi
	orl	%esi, %edi
	andl	$127, %r13d
	movq	_SW_TWSI_ADDR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r13d
	orl	%edi, %r13d
	movq	_I2C_M_TEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 8(%r15)
	jne	LBB0_1
## %bb.2:
	movq	_SW_TWSI_OP_7@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_1:
	movq	_SW_TWSI_OP_10@GOTPCREL(%rip), %rcx
LBB0_3:
	orl	(%rcx), %r13d
	testl	%eax, %eax
	jle	LBB0_17
## %bb.4:
	cmpl	$3, %edx
	movl	$3, %esi
	cmovbl	%edx, %esi
	movq	16(%r15), %rcx
	orl	-8(%rcx,%rax,8), %r13d
	testl	%esi, %esi
	je	LBB0_5
## %bb.6:
	movl	-16(%rcx,%rax,8), %edx
	shll	$8, %edx
	orl	%edx, %r13d
	cmpl	$1, %esi
	jne	LBB0_8
## %bb.7:
	leaq	-3(%rax), %rcx
	cmpl	$5, %eax
	jge	LBB0_12
	jmp	LBB0_17
LBB0_5:
	leaq	-2(%rax), %rcx
	cmpl	$5, %eax
	jge	LBB0_12
	jmp	LBB0_17
LBB0_8:
	movl	-24(%rcx,%rax,8), %edx
	shll	$16, %edx
	orl	%edx, %r13d
	cmpl	$2, %esi
	jne	LBB0_10
## %bb.9:
	leaq	-4(%rax), %rcx
	cmpl	$5, %eax
	jge	LBB0_12
	jmp	LBB0_17
LBB0_10:
	movl	-32(%rcx,%rax,8), %ecx
	shll	$24, %ecx
	orl	%ecx, %r13d
	leaq	-5(%rax), %rcx
	cmpl	$5, %eax
	jl	LBB0_17
LBB0_12:
	addl	$-5, %eax
	cmpl	$3, %eax
	movl	$3, %edx
	cmovbl	%eax, %edx
	movq	16(%r15), %rax
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,8), %r15d
	testl	%edx, %edx
	je	LBB0_16
## %bb.13:
	movl	-8(%rax,%rcx,8), %esi
	shll	$8, %esi
	orl	%esi, %r15d
	cmpl	$1, %edx
	je	LBB0_16
## %bb.14:
	movl	-16(%rax,%rcx,8), %esi
	shll	$16, %esi
	orl	%esi, %r15d
	cmpl	$2, %edx
	je	LBB0_16
## %bb.15:
	movl	-24(%rax,%rcx,8), %eax
	shll	$24, %eax
	orl	%eax, %r15d
LBB0_16:
	movq	(%r14), %r12
	movq	%r14, %rdi
	callq	_SW_TWSI_EXT
	addq	%rax, %r12
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_octeon_i2c_writeq_flush
LBB0_17:
	movq	(%r14), %rbx
	movq	%r14, %rdi
	callq	_SW_TWSI
	addq	%rax, %rbx
	movl	%r13d, %edi
	movq	%rbx, %rsi
	callq	_octeon_i2c_writeq_flush
	movq	%r14, %rdi
	callq	_octeon_i2c_hlc_wait
	testl	%eax, %eax
	jne	LBB0_19
## %bb.18:
	movq	(%r14), %rbx
	movq	%r14, %rdi
	callq	_SW_TWSI
	addq	%rax, %rbx
	movq	%rbx, %rdi
	callq	___raw_readq
	movl	%eax, %ecx
	movq	_SW_TWSI_R@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	testl	%ecx, (%rdx)
	je	LBB0_20
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	%r14, %rdi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_octeon_i2c_check_status        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SW_TWSI_V,4,2                  ## @SW_TWSI_V
	.comm	_SW_TWSI_SOVR,4,2               ## @SW_TWSI_SOVR
	.comm	_SW_TWSI_SIZE_SHIFT,4,2         ## @SW_TWSI_SIZE_SHIFT
	.comm	_SW_TWSI_ADDR_SHIFT,4,2         ## @SW_TWSI_ADDR_SHIFT
	.comm	_I2C_M_TEN,4,2                  ## @I2C_M_TEN
	.comm	_SW_TWSI_OP_10,4,2              ## @SW_TWSI_OP_10
	.comm	_SW_TWSI_OP_7,4,2               ## @SW_TWSI_OP_7
	.comm	_SW_TWSI_R,4,2                  ## @SW_TWSI_R
	.no_dead_strip	_octeon_i2c_hlc_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function octeon_i2c_hlc_write
_octeon_i2c_hlc_write:                  ; @octeon_i2c_hlc_write
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
	bl	_octeon_i2c_hlc_enable
	mov	x0, x19
	bl	_octeon_i2c_hlc_int_clear
Lloh0:
	adrp	x8, _SW_TWSI_V@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SW_TWSI_V@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SW_TWSI_SOVR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SW_TWSI_SOVR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w10, w9, w8
Lloh6:
	adrp	x8, _I2C_M_TEN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _I2C_M_TEN@GOTPAGEOFF]
	ldp	w13, w9, [x21, #4]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x11, _SW_TWSI_OP_7@GOTPAGE
Lloh10:
	ldr	x11, [x11, _SW_TWSI_OP_7@GOTPAGEOFF]
Lloh11:
	adrp	x12, _SW_TWSI_OP_10@GOTPAGE
Lloh12:
	ldr	x12, [x12, _SW_TWSI_OP_10@GOTPAGEOFF]
	tst	w8, w9
	csel	x11, x11, x12, eq
Lloh13:
	adrp	x8, _SW_TWSI_SIZE_SHIFT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SW_TWSI_SIZE_SHIFT@GOTPAGEOFF]
Lloh15:
	ldr	w12, [x8]
	ldr	w8, [x21]
	subs	w9, w8, #1
	lsl	w12, w9, w12
	orr	w10, w10, w12
Lloh16:
	adrp	x12, _SW_TWSI_ADDR_SHIFT@GOTPAGE
Lloh17:
	ldr	x12, [x12, _SW_TWSI_ADDR_SHIFT@GOTPAGEOFF]
	and	w13, w13, #0x7f
Lloh18:
	ldr	w12, [x12]
	lsl	w12, w13, w12
	orr	w10, w10, w12
	ldr	w11, [x11]
	orr	w20, w10, w11
	b.lt	LBB0_11
; %bb.1:
	ldr	x10, [x21, #16]
	mov	w11, #3
	cmp	w9, #3
	csel	w11, w9, w11, lo
	add	x9, x10, x8, lsl #3
	ldur	w9, [x9, #-8]
	orr	w20, w20, w9
	sub	x9, x8, #2
	cbz	w11, LBB0_5
; %bb.2:
	ldr	x9, [x10, x9, lsl #3]
	orr	w20, w20, w9, lsl #8
	sub	x9, x8, #3
	cmp	w11, #1
	b.eq	LBB0_5
; %bb.3:
	ldr	x9, [x10, x9, lsl #3]
	orr	w20, w20, w9, lsl #16
	sub	x9, x8, #4
	cmp	w11, #2
	b.eq	LBB0_5
; %bb.4:
	ldr	x9, [x10, x9, lsl #3]
	orr	w20, w20, w9, lsl #24
	sub	x9, x8, #5
LBB0_5:
	cmp	w8, #5
	b.lt	LBB0_11
; %bb.6:
	ldr	x10, [x21, #16]
	sub	w8, w8, #5
	mov	w11, #3
	cmp	w8, #3
	csel	w8, w8, w11, lo
	sbfiz	x11, x9, #3, #32
	ldr	w21, [x10, x11]
	cbz	w8, LBB0_10
; %bb.7:
	sxtw	x9, w9
	add	x11, x10, x9, lsl #3
	ldur	w12, [x11, #-8]
	orr	w21, w21, w12, lsl #8
	cmp	w8, #1
	b.eq	LBB0_10
; %bb.8:
	ldur	w11, [x11, #-16]
	orr	w21, w21, w11, lsl #16
	cmp	w8, #2
	b.eq	LBB0_10
; %bb.9:
	add	x8, x10, x9, lsl #3
	ldur	w8, [x8, #-24]
	orr	w21, w21, w8, lsl #24
LBB0_10:
	ldr	x22, [x19]
	mov	x0, x19
	bl	_SW_TWSI_EXT
	add	x1, x0, x22
	mov	x0, x21
	bl	_octeon_i2c_writeq_flush
LBB0_11:
	ldr	x21, [x19]
	mov	x0, x19
	bl	_SW_TWSI
	add	x1, x0, x21
	mov	x0, x20
	bl	_octeon_i2c_writeq_flush
	mov	x0, x19
	bl	_octeon_i2c_hlc_wait
	cbnz	w0, LBB0_14
; %bb.12:
	ldr	x20, [x19]
	mov	x0, x19
	bl	_SW_TWSI
	add	x0, x0, x20
	bl	___raw_readq
Lloh19:
	adrp	x8, _SW_TWSI_R@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SW_TWSI_R@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_15
; %bb.13:
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_15:
	mov	x0, x19
	mov	w1, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_octeon_i2c_check_status
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_SW_TWSI_V,4,2                  ; @SW_TWSI_V
	.comm	_SW_TWSI_SOVR,4,2               ; @SW_TWSI_SOVR
	.comm	_SW_TWSI_SIZE_SHIFT,4,2         ; @SW_TWSI_SIZE_SHIFT
	.comm	_SW_TWSI_ADDR_SHIFT,4,2         ; @SW_TWSI_ADDR_SHIFT
	.comm	_I2C_M_TEN,4,2                  ; @I2C_M_TEN
	.comm	_SW_TWSI_OP_10,4,2              ; @SW_TWSI_OP_10
	.comm	_SW_TWSI_OP_7,4,2               ; @SW_TWSI_OP_7
	.comm	_SW_TWSI_R,4,2                  ; @SW_TWSI_R
	.no_dead_strip	_octeon_i2c_hlc_write
.subsections_via_symbols
