	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function I2CRead
_I2CRead:                               ## @I2CRead
	.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	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	_SAA7146_I2C_STATUS@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_saaread
	testb	$60, %al
	je	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	callq	_I2CWipe
LBB0_2:
	movl	$1000, %ebx                     ## imm = 0x3E8
	movq	_SAA7146_I2C_BUSY@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_saaread
	testl	%eax, (%r15)
	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	%r13, %rdi
	callq	_I2CWipe
LBB0_6:
	movzbl	%r12b, %edi
	movl	%edi, %eax
	andl	$-2, %eax
	shll	$24, %eax
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_8
## %bb.7:
	shll	$8, %edi
	movzbl	-44(%rbp), %ecx                 ## 1-byte Folded Reload
	shll	$16, %ecx
	orl	%eax, %edi
	orl	%ecx, %edi
	orl	$493, %edi                      ## imm = 0x1ED
	jmp	LBB0_9
LBB0_8:
	shll	$16, %edi
	orl	%eax, %edi
	orl	$65777, %edi                    ## imm = 0x100F1
LBB0_9:
	movq	_SAA7146_I2C_TRANSFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_saawrite
	movq	_SAA7146_MC2_UPLD_I2C@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%eax, %edi
	shll	$16, %edi
	orl	%eax, %edi
	movq	_SAA7146_MC2@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_saawrite
	movl	$1000, %ebx                     ## imm = 0x3E8
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_saaread
	testl	%eax, (%r13)
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	xorl	%eax, %eax
	callq	_schedule
	decl	%ebx
	jne	LBB0_10
LBB0_12:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_saaread
	testl	%eax, (%r15)
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	xorl	%eax, %eax
	callq	_schedule
	incl	%r13d
	cmpl	$1000, %r13d                    ## imm = 0x3E8
	jne	LBB0_13
## %bb.15:
	movl	$1000, %r13d                    ## imm = 0x3E8
LBB0_16:
	movl	(%r14), %edi
	callq	_saaread
	movq	_SAA7146_I2C_ERR@GOTPCREL(%rip), %rcx
	movl	$-1, %r14d
	testl	%eax, (%rcx)
	jne	LBB0_30
## %bb.17:
	cmpl	$1000, %r13d                    ## imm = 0x3E8
	jne	LBB0_19
## %bb.18:
	leaq	L_.str(%rip), %rdi
	callq	_printk
LBB0_19:
	movq	_SAA7146_I2C_TRANSFER@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	$65, %edi
	callq	_saawrite
	movq	_SAA7146_MC2_UPLD_I2C@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %edi
	shll	$16, %edi
	orl	%eax, %edi
	movl	(%r12), %esi
	callq	_saawrite
	movl	$1000, %ebx                     ## imm = 0x3E8
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_saaread
	movq	_SAA7146_MC2_UPLD_I2C@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	xorl	%eax, %eax
	callq	_schedule
	decl	%ebx
	jne	LBB0_20
LBB0_22:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	callq	_saaread
	testl	%eax, (%r15)
	je	LBB0_26
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=1
	xorl	%eax, %eax
	callq	_schedule
	incl	%ebx
	cmpl	$1000, %ebx                     ## imm = 0x3E8
	jne	LBB0_23
## %bb.25:
	movl	$1000, %ebx                     ## imm = 0x3E8
LBB0_26:
	movl	(%r13), %edi
	callq	_saaread
	movq	_SAA7146_I2C_ERR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_30
## %bb.27:
	cmpl	$1000, %ebx                     ## imm = 0x3E8
	jne	LBB0_29
## %bb.28:
	leaq	L_.str.1(%rip), %rdi
	callq	_printk
LBB0_29:
	movl	(%r13), %edi
	callq	_saaread
	movl	%eax, %r14d
	shrl	$24, %r14d
LBB0_30:
	movl	%r14d, %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
	.comm	_SAA7146_I2C_ERR,4,2            ## @SAA7146_I2C_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c setup read timeout\n"

L_.str.1:                               ## @.str.1
	.asciz	"i2c read timeout\n"

	.no_dead_strip	_I2CRead
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function I2CRead
_I2CRead:                               ; @I2CRead
	.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, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x24, _SAA7146_I2C_STATUS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SAA7146_I2C_STATUS@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_saaread
	tst	w0, #0x3c
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x22
	bl	_I2CWipe
LBB0_2:
	mov	w25, #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, [x24]
	bl	_saaread
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_schedule
	subs	w25, w25, #1
	b.ne	LBB0_3
; %bb.5:
	mov	x0, x22
	bl	_I2CWipe
LBB0_6:
	lsl	w8, w21, #24
	and	w8, w8, #0xfe000000
	orr	w9, w8, w21, lsl #16
	mov	w10, #241
	movk	w10, #1, lsl #16
	orr	w9, w9, w10
	orr	w8, w8, w21, lsl #8
	orr	w8, w8, w20, lsl #16
	mov	w10, #493
	orr	w8, w8, w10
	cmp	w19, #0
	csel	w0, w9, w8, eq
Lloh4:
	adrp	x19, _SAA7146_I2C_TRANSFER@GOTPAGE
Lloh5:
	ldr	x19, [x19, _SAA7146_I2C_TRANSFER@GOTPAGEOFF]
	ldr	w1, [x19]
	bl	_saawrite
Lloh6:
	adrp	x20, _SAA7146_MC2_UPLD_I2C@GOTPAGE
Lloh7:
	ldr	x20, [x20, _SAA7146_MC2_UPLD_I2C@GOTPAGEOFF]
	ldr	w8, [x20]
	orr	w0, w8, w8, lsl #16
Lloh8:
	adrp	x21, _SAA7146_MC2@GOTPAGE
Lloh9:
	ldr	x21, [x21, _SAA7146_MC2@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_saawrite
	mov	w22, #1000
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_saaread
	ldr	w8, [x20]
	tst	w8, w0
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_schedule
	subs	w22, w22, #1
	b.ne	LBB0_7
LBB0_9:
	mov	w25, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24]
	bl	_saaread
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	bl	_schedule
	add	w25, w25, #1
	cmp	w25, #1000
	b.ne	LBB0_10
LBB0_12:
	ldr	w0, [x24]
	bl	_saaread
Lloh10:
	adrp	x22, _SAA7146_I2C_ERR@GOTPAGE
Lloh11:
	ldr	x22, [x22, _SAA7146_I2C_ERR@GOTPAGEOFF]
	ldr	w8, [x22]
	tst	w8, w0
	b.ne	LBB0_22
; %bb.13:
	cmp	w25, #1000
	b.ne	LBB0_15
; %bb.14:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
LBB0_15:
	ldr	w1, [x19]
	mov	w0, #65
	bl	_saawrite
	ldr	w8, [x20]
	orr	w0, w8, w8, lsl #16
	ldr	w1, [x21]
	bl	_saawrite
	mov	w24, #1000
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_saaread
	ldr	w8, [x20]
	tst	w8, w0
	b.ne	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	bl	_schedule
	subs	w24, w24, #1
	b.ne	LBB0_16
LBB0_18:
	mov	w20, #0
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	bl	_saaread
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	bl	_schedule
	add	w20, w20, #1
	cmp	w20, #1000
	b.ne	LBB0_19
LBB0_21:
	ldr	w0, [x19]
	bl	_saaread
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_24
LBB0_22:
	mov	w0, #-1
LBB0_23:
	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
LBB0_24:
	cmp	w20, #1000
	b.ne	LBB0_26
; %bb.25:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printk
LBB0_26:
	ldr	w0, [x19]
	bl	_saaread
	lsr	w0, w0, #24
	b	LBB0_23
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.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
	.comm	_SAA7146_I2C_ERR,4,2            ; @SAA7146_I2C_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c setup read timeout\n"

l_.str.1:                               ; @.str.1
	.asciz	"i2c read timeout\n"

	.no_dead_strip	_I2CRead
.subsections_via_symbols
