	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sgp_read_cmd
_sgp_read_cmd:                          ## @sgp_read_cmd
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movl	%esi, -44(%rbp)
	movq	(%rdi), %r13
	movq	_SGP_WORD_LEN@GOTPCREL(%rip), %rax
	movq	_SGP_CRC8_LEN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	addq	(%rax), %rbx
	movq	_SGP_CMD_LEN@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	leaq	-44(%rbp), %rsi
	movq	%r13, %rdi
	callq	_i2c_master_send
	cmpl	(%r15), %eax
	jne	LBB0_1
## %bb.2:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	leaq	1000(%r14), %rsi
	movq	%r14, %rdi
	callq	_usleep_range
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	testq	%r12, %r12
	je	LBB0_3
## %bb.4:
	imulq	%r12, %rbx
	movq	%r13, %rdi
	movq	%r15, %r14
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_i2c_master_recv
	testl	%eax, %eax
	js	LBB0_7
## %bb.5:
	movl	%eax, %eax
	cmpq	%rax, %rbx
	jne	LBB0_1
## %bb.6:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_sgp_verify_buffer
	jmp	LBB0_7
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_3:
	xorl	%eax, %eax
LBB0_7:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SGP_WORD_LEN,8,3               ## @SGP_WORD_LEN
	.comm	_SGP_CRC8_LEN,8,3               ## @SGP_CRC8_LEN
	.comm	_SGP_CMD_LEN,4,2                ## @SGP_CMD_LEN
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_sgp_read_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sgp_read_cmd
_sgp_read_cmd:                          ; @sgp_read_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x23, x4
	mov	x19, x3
	mov	x20, x2
	mov	x21, x0
	str	w1, [sp, #12]
	ldr	x22, [x0]
Lloh0:
	adrp	x8, _SGP_WORD_LEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SGP_WORD_LEN@GOTPAGEOFF]
Lloh2:
	ldr	x24, [x8]
Lloh3:
	adrp	x8, _SGP_CRC8_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SGP_CRC8_LEN@GOTPAGEOFF]
Lloh5:
	ldr	x25, [x8]
Lloh6:
	adrp	x26, _SGP_CMD_LEN@GOTPAGE
Lloh7:
	ldr	x26, [x26, _SGP_CMD_LEN@GOTPAGEOFF]
	ldr	w2, [x26]
	add	x1, sp, #12
	mov	x0, x22
	bl	_i2c_master_send
	ldr	w8, [x26]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.1:
	add	x1, x23, #1000
	mov	x0, x23
	bl	_usleep_range
	cbz	x19, LBB0_6
; %bb.2:
	add	x8, x25, x24
	mul	x23, x8, x19
	mov	x0, x22
	mov	x1, x20
	mov	x2, x23
	bl	_i2c_master_recv
	tbnz	w0, #31, LBB0_7
; %bb.3:
	cmp	x23, w0, uxtw
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_sgp_verify_buffer
	b	LBB0_7
LBB0_5:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_SGP_WORD_LEN,8,3               ; @SGP_WORD_LEN
	.comm	_SGP_CRC8_LEN,8,3               ; @SGP_CRC8_LEN
	.comm	_SGP_CMD_LEN,4,2                ; @SGP_CMD_LEN
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_sgp_read_cmd
.subsections_via_symbols
