	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zforce_read_packet
_zforce_read_packet:                    ## @zforce_read_packet
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	callq	_mutex_lock
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$2, %edx
	callq	_i2c_master_recv
	testl	%eax, %eax
	js	LBB0_5
## %bb.1:
	movq	_PAYLOAD_HEADER@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r12,%rax,4), %eax
	movq	_FRAME_START@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
## %bb.2:
	movq	_PAYLOAD_LENGTH@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movl	(%r12,%rax,4), %edx
	testl	%edx, %edx
	je	LBB0_8
## %bb.3:
	movq	_PAYLOAD_BODY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%r12,%rax,4), %rsi
	movq	%r15, %rdi
	callq	_i2c_master_recv
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_11
## %bb.4:
	movq	(%r13), %rax
	movl	(%r12,%rax,4), %edx
	movq	_PAYLOAD_BODY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r12,%rax,4), %ecx
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	jmp	LBB0_10
LBB0_5:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
LBB0_6:
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_dev_err
	jmp	LBB0_10
LBB0_7:
	movl	(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_9:
	subl	(%rax), %ebx
LBB0_10:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error reading header: %d\n"

	.comm	_PAYLOAD_HEADER,8,3             ## @PAYLOAD_HEADER
	.comm	_FRAME_START,4,2                ## @FRAME_START
L_.str.1:                               ## @.str.1
	.asciz	"invalid frame start: %d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_PAYLOAD_LENGTH,8,3             ## @PAYLOAD_LENGTH
L_.str.2:                               ## @.str.2
	.asciz	"invalid payload length: %d\n"

	.comm	_PAYLOAD_BODY,8,3               ## @PAYLOAD_BODY
L_.str.3:                               ## @.str.3
	.asciz	"error reading payload: %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"read %d bytes for response command 0x%x\n"

	.no_dead_strip	_zforce_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zforce_read_packet
_zforce_read_packet:                    ; @zforce_read_packet
	.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	x22, x1
	mov	x19, x0
	ldr	x20, [x0, #8]
	bl	_mutex_lock
	mov	x0, x20
	mov	x1, x22
	mov	w2, #2
	bl	_i2c_master_recv
	tbnz	w0, #31, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _PAYLOAD_HEADER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAYLOAD_HEADER@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w8, [x22, x8, lsl #2]
Lloh3:
	adrp	x9, _FRAME_START@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FRAME_START@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.2:
Lloh6:
	adrp	x23, _PAYLOAD_LENGTH@GOTPAGE
Lloh7:
	ldr	x23, [x23, _PAYLOAD_LENGTH@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	w2, [x22, x8, lsl #2]
	cbz	w2, LBB0_8
; %bb.3:
Lloh8:
	adrp	x24, _PAYLOAD_BODY@GOTPAGE
Lloh9:
	ldr	x24, [x24, _PAYLOAD_BODY@GOTPAGEOFF]
	ldr	x8, [x24]
	add	x1, x22, x8, lsl #2
	mov	x0, x20
	bl	_i2c_master_recv
	mov	x21, x0
	tbnz	w0, #31, LBB0_11
; %bb.4:
	ldr	x8, [x23]
	ldr	w2, [x22, x8, lsl #2]
	ldr	x8, [x24]
	ldr	w3, [x22, x8, lsl #2]
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	b	LBB0_10
LBB0_5:
	mov	x21, x0
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
LBB0_6:
	mov	x0, x20
	mov	x2, x21
	bl	_dev_err
	b	LBB0_10
LBB0_7:
	ldr	w2, [x22]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	mov	x0, x20
	bl	_dev_err
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error reading header: %d\n"

	.comm	_PAYLOAD_HEADER,8,3             ; @PAYLOAD_HEADER
	.comm	_FRAME_START,4,2                ; @FRAME_START
l_.str.1:                               ; @.str.1
	.asciz	"invalid frame start: %d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_PAYLOAD_LENGTH,8,3             ; @PAYLOAD_LENGTH
l_.str.2:                               ; @.str.2
	.asciz	"invalid payload length: %d\n"

	.comm	_PAYLOAD_BODY,8,3               ; @PAYLOAD_BODY
l_.str.3:                               ; @.str.3
	.asciz	"error reading payload: %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"read %d bytes for response command 0x%x\n"

	.no_dead_strip	_zforce_read_packet
.subsections_via_symbols
