	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function I2CWrite
_I2CWrite:                              ## @I2CWrite
	.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	%r8d, %r14d
	movq	%rdi, %r15
	movq	_SAA7146_I2C_STATUS@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_saaread
	testb	$60, %al
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_I2CWipe
LBB0_2:
	movl	$1000, %ebx                     ## imm = 0x3E8
	movq	_SAA7146_I2C_BUSY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_saaread
	testl	%eax, (%r13)
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_schedule
	decl	%ebx
	jne	LBB0_3
## %bb.5:
	movq	%r15, %rdi
	callq	_I2CWipe
LBB0_6:
	testl	%r14d, %r14d
	movl	$209, %eax
	movl	$229, %edi
	cmovel	%eax, %edi
	movq	_SAA7146_I2C_TRANSFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_saawrite
	movq	_SAA7146_MC2_UPLD_I2C@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %edi
	shll	$16, %edi
	orl	%eax, %edi
	movq	_SAA7146_MC2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_saawrite
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SAA7146_I2C_STATUS,4,2         ## @SAA7146_I2C_STATUS
	.comm	_SAA7146_I2C_BUSY,4,2           ## @SAA7146_I2C_BUSY
	.comm	_SAA7146_I2C_TRANSFER,4,2       ## @SAA7146_I2C_TRANSFER
	.comm	_SAA7146_MC2_UPLD_I2C,4,2       ## @SAA7146_MC2_UPLD_I2C
	.comm	_SAA7146_MC2,4,2                ## @SAA7146_MC2
	.no_dead_strip	_I2CWrite
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function I2CWrite
_I2CWrite:                              ; @I2CWrite
	.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
	mov	x19, x4
	mov	x20, x0
Lloh0:
	adrp	x21, _SAA7146_I2C_STATUS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SAA7146_I2C_STATUS@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_saaread
	tst	w0, #0x3c
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_I2CWipe
LBB0_2:
	mov	w22, #1000
Lloh2:
	adrp	x23, _SAA7146_I2C_BUSY@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SAA7146_I2C_BUSY@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_saaread
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_schedule
	subs	w22, w22, #1
	b.ne	LBB0_3
; %bb.5:
	mov	x0, x20
	bl	_I2CWipe
LBB0_6:
	mov	w8, #229
	mov	w9, #209
	cmp	w19, #0
	csel	w0, w9, w8, eq
Lloh4:
	adrp	x8, _SAA7146_I2C_TRANSFER@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SAA7146_I2C_TRANSFER@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	bl	_saawrite
Lloh7:
	adrp	x8, _SAA7146_MC2_UPLD_I2C@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SAA7146_MC2_UPLD_I2C@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	orr	w0, w8, w8, lsl #16
Lloh10:
	adrp	x8, _SAA7146_MC2@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SAA7146_MC2@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_saawrite
	mov	w0, #0
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_SAA7146_I2C_STATUS,4,2         ; @SAA7146_I2C_STATUS
	.comm	_SAA7146_I2C_BUSY,4,2           ; @SAA7146_I2C_BUSY
	.comm	_SAA7146_I2C_TRANSFER,4,2       ; @SAA7146_I2C_TRANSFER
	.comm	_SAA7146_MC2_UPLD_I2C,4,2       ; @SAA7146_MC2_UPLD_I2C
	.comm	_SAA7146_MC2,4,2                ; @SAA7146_MC2
	.no_dead_strip	_I2CWrite
.subsections_via_symbols
