	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_read
_ivtv_read:                             ## @ivtv_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
                                        ## kill: def $esi killed $esi def $rsi
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_1
## %bb.2:
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rdi, %r12
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	leal	(%rsi,%rsi), %eax
	orb	$1, %al
	xorl	%ecx, %ecx
	movzbl	%al, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_ivtv_start
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_4
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	callq	_ivtv_stop
	testl	%r14d, %r14d
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	leal	1(%rcx), %eax
	cmpl	$7, %ecx
	movl	%eax, %ecx
	jb	LBB0_3
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_ivtv_sendbyte
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %r13d
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leaq	(%r15,%r13), %rsi
	decq	%rsi
	xorl	%edx, %edx
	cmpq	%r13, %rbx
	sete	%dl
	movq	%r12, %rdi
	callq	_ivtv_readbyte
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	leaq	1(%r13), %rax
	cmpq	%rbx, %r13
	movq	%rax, %r13
	jb	LBB0_7
	jmp	LBB0_9
LBB0_11:
	testl	%r14d, %r14d
	je	LBB0_13
## %bb.12:
	movzbl	-56(%rbp), %esi                 ## 1-byte Folded Reload
	leaq	L_.str(%rip), %rdi
	callq	_IVTV_DEBUG_I2C
	jmp	LBB0_13
LBB0_1:
	xorl	%r14d, %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c read from %x failed\n"

	.no_dead_strip	_ivtv_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtv_read
_ivtv_read:                             ; @ivtv_read
	.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
Lloh0:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_12
; %bb.1:
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
	mov	w25, #0
	mov	w8, #1
	bfi	w8, w1, #1, #8
	and	w23, w8, #0xff
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	mov	x0, x22
	bl	_ivtv_start
	mov	x24, x0
	cbnz	w0, LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x22
	mov	x1, x23
	bl	_ivtv_sendbyte
	mov	x24, x0
	cbnz	w0, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	cbz	x20, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w26, #1
LBB0_6:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x8, x21, x26
	sub	x1, x8, #1
	cmp	x20, x26
	cset	w2, eq
	mov	x0, x22
	bl	_ivtv_readbyte
	cmp	w0, #0
	ccmp	x26, x20, #2, eq
	add	x26, x26, #1
	b.lo	LBB0_6
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x24, x0
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x22
	bl	_ivtv_stop
	cbz	w24, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w8, w25, #1
	cmp	w25, #7
	mov	x25, x8
	b.lo	LBB0_2
LBB0_10:
	cbz	w24, LBB0_13
; %bb.11:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_IVTV_DEBUG_I2C
	b	LBB0_13
LBB0_12:
	mov	w24, #0
LBB0_13:
	mov	x0, x24
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c read from %x failed\n"

	.no_dead_strip	_ivtv_read
.subsections_via_symbols
