	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_read
_i2c_read:                              ## @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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r12
	movl	%edx, %r14d
	movq	%rsi, %rbx
	callq	_device_get_softc
	movq	%rax, %r13
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	callq	_vf_i2c_dbg
	movl	$0, (%r12)
	movq	%r13, %rdi
	callq	_mtx_lock
	testl	%r14d, %r14d
	je	LBB0_5
## %bb.1:
	cmpl	$1, %r14d
	jne	LBB0_3
## %bb.2:
	movq	_IBCR_IBIE@GOTPCREL(%rip), %rax
	movq	_IBCR_MSSL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_IBCR_NOACK@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_IBCR_MSSL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_IBCR_IBIE@GOTPCREL(%rip), %rax
LBB0_4:
	movq	_I2C_IBCR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %edx
	movq	%r13, %rdi
	callq	_WRITE1
	movq	_I2C_IBDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_READ1
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_DELAY
LBB0_5:
	cmpl	%r14d, (%r12)
	jge	LBB0_16
## %bb.6:
	leal	-2(%r14), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	leal	-1(%r14), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_I2C_IBDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_READ1
	movb	%al, (%rbx)
	incq	%rbx
	movl	(%r12), %eax
	incl	%eax
	movl	%eax, (%r12)
	cmpl	%r14d, %eax
	jge	LBB0_16
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_wait_for_icf
	testl	%eax, %eax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r12), %eax
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_I2C_IBCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IBCR_MSSL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_IBCR_IBIE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_IBCR_NOACK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r13, %rdi
	callq	_WRITE1
	movl	(%r12), %eax
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_I2C_IBCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IBCR_NOACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_IBCR_IBIE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r13, %rdi
	callq	_WRITE1
	jmp	LBB0_15
LBB0_16:
	movq	%r13, %rdi
	callq	_mtx_unlock
	movq	_IIC_NOERR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_17
LBB0_8:
	movl	%eax, %r15d
	movq	%r13, %rdi
	callq	_mtx_unlock
LBB0_17:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c read\n"

	.comm	_I2C_IBCR,4,2                   ## @I2C_IBCR
	.comm	_IBCR_IBIE,4,2                  ## @IBCR_IBIE
	.comm	_IBCR_MSSL,4,2                  ## @IBCR_MSSL
	.comm	_IBCR_NOACK,4,2                 ## @IBCR_NOACK
	.comm	_I2C_IBDR,4,2                   ## @I2C_IBDR
	.comm	_IIC_NOERR,4,2                  ## @IIC_NOERR
	.no_dead_strip	_i2c_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_read
_i2c_read:                              ; @i2c_read
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	bl	_device_get_softc
	mov	x23, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_vf_i2c_dbg
	str	wzr, [x20]
	mov	x0, x23
	bl	_mtx_lock
	cbz	w21, LBB0_5
; %bb.1:
	cmp	w21, #1
	b.ne	LBB0_3
; %bb.2:
Lloh2:
	adrp	x8, _IBCR_IBIE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IBCR_IBIE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _IBCR_MSSL@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IBCR_MSSL@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _IBCR_NOACK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IBCR_NOACK@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh10:
	adrp	x8, _IBCR_MSSL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IBCR_MSSL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _IBCR_IBIE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IBCR_IBIE@GOTPAGEOFF]
LBB0_4:
Lloh15:
	adrp	x10, _I2C_IBCR@GOTPAGE
Lloh16:
	ldr	x10, [x10, _I2C_IBCR@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x10]
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x23
	bl	_WRITE1
Lloh18:
	adrp	x8, _I2C_IBDR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _I2C_IBDR@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_READ1
	mov	w0, #1000
	bl	_DELAY
LBB0_5:
	ldr	w8, [x20]
	cmp	w8, w21
	b.ge	LBB0_15
; %bb.6:
	sub	w27, w21, #2
	sub	w28, w21, #1
Lloh21:
	adrp	x25, _IBCR_IBIE@GOTPAGE
Lloh22:
	ldr	x25, [x25, _IBCR_IBIE@GOTPAGEOFF]
Lloh23:
	adrp	x26, _IBCR_NOACK@GOTPAGE
Lloh24:
	ldr	x26, [x26, _IBCR_NOACK@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
Lloh25:
	adrp	x8, _I2C_IBDR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _I2C_IBDR@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_READ1
	strb	w0, [x22], #1
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
	cmp	w8, w21
	b.ge	LBB0_15
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_wait_for_icf
	cbnz	w0, LBB0_16
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x20]
	cbz	w19, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	w8, w27
	b.ne	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
Lloh28:
	adrp	x8, _I2C_IBCR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _I2C_IBCR@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	ldr	w8, [x25]
Lloh31:
	adrp	x9, _IBCR_MSSL@GOTPAGE
Lloh32:
	ldr	x9, [x9, _IBCR_MSSL@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x26]
	orr	w2, w8, w9
	mov	x0, x23
	bl	_WRITE1
	ldr	w8, [x20]
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=1
	cbz	w19, LBB0_7
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	w8, w28
	b.ne	LBB0_7
; %bb.14:                               ;   in Loop: Header=BB0_8 Depth=1
Lloh34:
	adrp	x8, _I2C_IBCR@GOTPAGE
Lloh35:
	ldr	x8, [x8, _I2C_IBCR@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	ldr	w8, [x25]
	ldr	w9, [x26]
	orr	w2, w9, w8
	mov	x0, x23
	bl	_WRITE1
	b	LBB0_7
LBB0_15:
	mov	x0, x23
	bl	_mtx_unlock
Lloh37:
	adrp	x8, _IIC_NOERR@GOTPAGE
Lloh38:
	ldr	x8, [x8, _IIC_NOERR@GOTPAGEOFF]
Lloh39:
	ldr	w24, [x8]
	b	LBB0_17
LBB0_16:
	mov	x24, x0
	mov	x0, x23
	bl	_mtx_unlock
LBB0_17:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c read\n"

	.comm	_I2C_IBCR,4,2                   ; @I2C_IBCR
	.comm	_IBCR_IBIE,4,2                  ; @IBCR_IBIE
	.comm	_IBCR_MSSL,4,2                  ; @IBCR_MSSL
	.comm	_IBCR_NOACK,4,2                 ; @IBCR_NOACK
	.comm	_I2C_IBDR,4,2                   ; @I2C_IBDR
	.comm	_IIC_NOERR,4,2                  ; @IIC_NOERR
	.no_dead_strip	_i2c_read
.subsections_via_symbols
