	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lm8323_read
_lm8323_read:                           ## @lm8323_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movq	%rdx, %r15
	movq	%rdi, %r12
	movl	%esi, -36(%rbp)
	movq	(%rdi), %rdi
	leaq	-36(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_master_send
	movl	%eax, %ebx
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	movl	(%rax), %eax
	addl	%ebx, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	(%r12), %rdi
	leaq	-36(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_master_send
	movl	%eax, %ebx
LBB0_2:
	xorl	%edi, %edi
	cmpl	$1, %ebx
	setne	%dil
	callq	_unlikely
	movq	(%r12), %rdi
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	-36(%rbp), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_6
LBB0_4:
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_i2c_master_recv
	movl	%eax, %ebx
	xorl	%edi, %edi
	cmpl	%r14d, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	(%r12), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_6:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	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	"sending read cmd 0x%02x failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"wanted %d bytes, got %d\n"

	.no_dead_strip	_lm8323_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lm8323_read
_lm8323_read:                           ; @lm8323_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x20, x0
	str	w1, [sp, #12]
	ldr	x0, [x0]
	add	x1, sp, #12
	mov	w2, #1
	bl	_i2c_master_send
	mov	x22, x0
Lloh0:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w0, w8
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x0, [x20]
	add	x1, sp, #12
	mov	w2, #1
	bl	_i2c_master_send
	mov	x22, x0
LBB0_2:
	cmp	w22, #1
	cset	w0, ne
	bl	_unlikely
	mov	x8, x0
	ldr	x0, [x20]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w2, [sp, #12]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	w21, #0
	b	LBB0_6
LBB0_4:
	mov	x1, x21
	mov	x2, x19
	bl	_i2c_master_recv
	mov	x21, x0
	cmp	w0, w19
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_6
; %bb.5:
	ldr	x0, [x20]
	str	x21, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_dev_err
LBB0_6:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sending read cmd 0x%02x failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"wanted %d bytes, got %d\n"

	.no_dead_strip	_lm8323_read
.subsections_via_symbols
