	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_write
_i2c_write:                             ## @i2c_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
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r15
	movq	%rdi, %r13
	xorl	%ebx, %ebx
	decl	%edx
	je	LBB0_3
## %bb.4:
	movl	%edx, %r12d
	xorl	%ebx, %ebx
	movq	_PSC_SMBTXRX@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%r15,%rbx), %edx
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_WR
	movq	%r13, %rdi
	callq	_wait_ack
	testq	%rax, %rax
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_5
## %bb.7:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_3:
	xorl	%r12d, %r12d
LBB0_8:
	movzbl	(%r15,%r12), %edx
	movq	_PSC_SMBTXRX_STP@GOTPCREL(%rip), %rax
	orq	(%rax), %rdx
	movq	_PSC_SMBTXRX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_WR
	movq	%r13, %rdi
	callq	_wait_master_done
	testq	%rax, %rax
	je	LBB0_10
LBB0_9:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PSC_SMBTXRX,4,2                ## @PSC_SMBTXRX
	.comm	_EIO,4,2                        ## @EIO
	.comm	_PSC_SMBTXRX_STP,8,3            ## @PSC_SMBTXRX_STP
	.no_dead_strip	_i2c_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_write
_i2c_write:                             ; @i2c_write
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	cbz	w2, LBB0_5
; %bb.1:
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _PSC_SMBTXRX@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PSC_SMBTXRX@GOTPAGEOFF]
	subs	w22, w2, #1
	b.eq	LBB0_6
; %bb.2:
	mov	x23, x22
	mov	x24, x20
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w2, [x24]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_WR
	mov	x0, x19
	bl	_wait_ack
	cbnz	x0, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x24, x24, #1
	subs	x23, x23, #1
	b.ne	LBB0_3
	b	LBB0_7
LBB0_5:
	mov	w0, #0
	b	LBB0_9
LBB0_6:
	mov	x22, #0
LBB0_7:
	ldrb	w8, [x20, x22]
Lloh2:
	adrp	x9, _PSC_SMBTXRX_STP@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PSC_SMBTXRX_STP@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	orr	x2, x9, x8
	ldr	w1, [x21]
	mov	x0, x19
	bl	_WR
	mov	x0, x19
	bl	_wait_master_done
	cbz	x0, LBB0_9
LBB0_8:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PSC_SMBTXRX,4,2                ; @PSC_SMBTXRX
	.comm	_EIO,4,2                        ; @EIO
	.comm	_PSC_SMBTXRX_STP,8,3            ; @PSC_SMBTXRX_STP
	.no_dead_strip	_i2c_write
.subsections_via_symbols
