	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i2c_readReg                    ## -- Begin function i2c_readReg
	.p2align	4, 0x90
_i2c_readReg:                           ## @i2c_readReg
	.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, %r15d
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r14
	movl	%esi, %r12d
	movl	%edi, %r13d
	movl	%r8d, %esi
	callq	_i2c_start
	testq	%rax, %rax
	js	LBB0_8
## %bb.1:
	movl	%r12d, %edi
	movl	%r15d, %esi
	callq	_i2c_write
	testq	%rax, %rax
	js	LBB0_8
## %bb.2:
	orl	$1, %r13d
	movl	%r13d, %edi
	movl	%r15d, %esi
	callq	_i2c_start
	movq	%rax, %rbx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leal	-1(%rcx), %eax
	cmpl	$2, %ecx
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jl	LBB0_9
## %bb.3:
	testq	%rbx, %rbx
	js	LBB0_9
## %bb.4:
	movl	%eax, %r13d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	callq	_i2c_read_ack
	movq	%rax, %rbx
	testq	%rax, %rax
	js	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, (%r14,%r12,4)
	incq	%r12
	cmpq	%r13, %r12
	jb	LBB0_5
	jmp	LBB0_10
LBB0_8:
	movq	%rax, %rbx
LBB0_12:
	xorl	%eax, %eax
	callq	_i2c_stop
	testq	%rbx, %rbx
	js	LBB0_14
## %bb.13:
	movq	_I2C_STATUS_SUCCESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_14:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	testq	%rbx, %rbx
	js	LBB0_12
LBB0_10:
	movl	%r15d, %edi
	callq	_i2c_read_nack
	movq	%rax, %rbx
	testq	%rax, %rax
	js	LBB0_12
## %bb.11:
	movslq	-44(%rbp), %rax                 ## 4-byte Folded Reload
	movl	%ebx, (%r14,%rax,4)
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_STATUS_SUCCESS,8,3         ## @I2C_STATUS_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i2c_readReg                    ; -- Begin function i2c_readReg
	.p2align	2
_i2c_readReg:                           ; @i2c_readReg
	.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	x20, x4
	mov	x22, x3
	mov	x19, x2
	mov	x24, x1
	mov	x23, x0
	mov	x1, x4
	bl	_i2c_start
	tbnz	x0, #63, LBB0_7
; %bb.1:
	mov	x0, x24
	mov	x1, x20
	bl	_i2c_write
	tbnz	x0, #63, LBB0_7
; %bb.2:
	orr	w0, w23, #0x1
	mov	x1, x20
	bl	_i2c_start
	mov	x21, x0
	sub	w23, w22, #1
	cmp	w22, #2
	b.lt	LBB0_9
; %bb.3:
	tbnz	x21, #63, LBB0_9
; %bb.4:
	mov	x22, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_i2c_read_ack
	mov	x21, x0
	tbnz	x0, #63, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	str	w21, [x19, x22, lsl #2]
	add	x22, x22, #1
	cmp	x22, x23
	b.lo	LBB0_5
	b	LBB0_10
LBB0_7:
	mov	x21, x0
LBB0_8:
	bl	_i2c_stop
Lloh0:
	adrp	x8, _I2C_STATUS_SUCCESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I2C_STATUS_SUCCESS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x21, #0
	csel	x0, x21, x8, lt
	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
LBB0_9:
	tbnz	x21, #63, LBB0_8
LBB0_10:
	mov	x0, x20
	bl	_i2c_read_nack
	mov	x21, x0
	tbnz	x0, #63, LBB0_8
; %bb.11:
	str	w21, [x19, w23, sxtw #2]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_STATUS_SUCCESS,8,3         ; @I2C_STATUS_SUCCESS
.subsections_via_symbols
