	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_i2c
_read_i2c:                              ## @read_i2c
	.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
	movq	(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r8, %r14
	movl	%ecx, %r12d
	movl	%esi, %r13d
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	leaq	-64(%rbp), %rdi
	movq	%rdi, (%rax)
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	$16, %edx
	callq	_memset
	movl	%r13d, -64(%rbp)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, -60(%rbp)
	movl	%r12d, -56(%rbp)
	testl	%r12d, %r12d
	jle	LBB0_7
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$4, %edi
	movl	%r12d, %esi
	callq	_MIN
	movl	%eax, %r13d
	movl	%eax, -56(%rbp)
	movl	16(%r15), %edi
	movq	_SIOCGI2C@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r15), %rdx
	callq	_ioctl
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movslq	%ebx, %rbx
	leaq	(%r14,%rbx,4), %rdi
	movl	-52(%rbp), %esi
	movl	%r13d, %edx
	callq	_memcpy
	addl	%r13d, %ebx
	addl	%r13d, -60(%rbp)
	subl	%r13d, %r12d
	jg	LBB0_3
## %bb.6:
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rax
	movslq	(%rax), %rbx
	movq	%rbx, (%r15)
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_SIOCGI2C,4,2                   ## @SIOCGI2C
	.comm	_errno,4,2                      ## @errno
	.no_dead_strip	_read_i2c
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_i2c
_read_i2c:                              ; @read_i2c
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldr	x0, [x0]
	cbnz	x0, LBB0_7
; %bb.1:
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	ldr	x8, [x19, #8]
	mov	x9, sp
	str	x9, [x8]
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	stp	w23, w22, [sp]
	str	w21, [sp, #8]
	cmp	w21, #1
	b.lt	LBB0_5
; %bb.2:
	mov	w23, #0
Lloh0:
	adrp	x24, _SIOCGI2C@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SIOCGI2C@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #4
	mov	x1, x21
	bl	_MIN
	mov	x22, x0
	str	w0, [sp, #8]
	ldr	w0, [x19, #16]
	ldr	w1, [x24]
	ldr	x2, [x19, #8]
	bl	_ioctl
	cbnz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x0, x20, w23, sxtw #2
	ldr	w1, [sp, #12]
	mov	x2, x22
	bl	_memcpy
	sub	w21, w21, w22
	add	w23, w22, w23
	ldr	w8, [sp, #4]
	add	w8, w8, w22
	str	w8, [sp, #4]
	cmp	w21, #0
	b.gt	LBB0_3
LBB0_5:
	mov	w0, #0
	b	LBB0_7
LBB0_6:
Lloh2:
	adrp	x8, _errno@GOTPAGE
Lloh3:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh4:
	ldrsw	x0, [x8]
	str	x0, [x19]
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
LBB0_7:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_SIOCGI2C,4,2                   ; @SIOCGI2C
	.comm	_errno,4,2                      ; @errno
	.no_dead_strip	_read_i2c
.subsections_via_symbols
