	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pms7003_receive_buf
_pms7003_receive_buf:                   ## @pms7003_receive_buf
	.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	%rdx, %r13
	movq	%rsi, %r15
	callq	_serdev_device_get_drvdata
	movq	%rax, %rdi
	callq	_iio_priv
	movq	%rax, %r12
	movslq	8(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.5:
	movq	%rax, %rbx
	movslq	12(%r12), %rax
	subq	%rax, %rsi
	movq	%r13, %rdi
	callq	_min
	movl	%eax, %r14d
	movslq	12(%r12), %rdi
	addq	16(%r12), %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_memcpy
	movl	%r14d, %eax
	addl	12(%r12), %eax
	movl	%eax, 12(%r12)
	cmpl	8(%r12), %eax
	jne	LBB0_9
## %bb.6:
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_pms7003_frame_is_okay
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%r12, %rdi
	callq	_complete
LBB0_8:
	movl	$0, (%rbx)
	jmp	LBB0_9
LBB0_1:
	xorl	%r14d, %r14d
	cmpq	$4, %r13
	jb	LBB0_9
## %bb.2:
	movq	%r15, %rdi
	callq	_get_unaligned_be16
	movq	_PMS7003_MAGIC@GOTPCREL(%rip), %rcx
	movl	$2, %r14d
	cmpq	%rax, (%rcx)
	jne	LBB0_9
## %bb.3:
	addq	$2, %r15
	movq	%r15, %rdi
	callq	_get_unaligned_be16
	movq	_PMS7003_MAX_DATA_LENGTH@GOTPCREL(%rip), %rcx
	movl	$4, %r14d
	cmpl	%eax, (%rcx)
	jl	LBB0_9
## %bb.4:
	movl	%eax, 8(%r12)
	movl	$0, 12(%r12)
LBB0_9:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PMS7003_MAGIC,8,3              ## @PMS7003_MAGIC
	.comm	_PMS7003_MAX_DATA_LENGTH,4,2    ## @PMS7003_MAX_DATA_LENGTH
	.no_dead_strip	_pms7003_receive_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pms7003_receive_buf
_pms7003_receive_buf:                   ; @pms7003_receive_buf
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x2
	mov	x21, x1
	bl	_serdev_device_get_drvdata
	bl	_iio_priv
	mov	x19, x0
	mov	x22, x0
	ldrsw	x8, [x22, #8]!
	cbz	w8, LBB0_5
; %bb.1:
	ldrsw	x9, [x19, #12]
	sub	x1, x8, x9
	mov	x0, x20
	bl	_min
	mov	x20, x0
	ldr	x8, [x19, #16]
	ldrsw	x9, [x19, #12]
	add	x0, x8, x9
	mov	x1, x21
	mov	x2, x20
	bl	_memcpy
	ldp	w9, w8, [x19, #8]
	add	w8, w8, w20
	cmp	w8, w9
	str	w8, [x19, #12]
	b.ne	LBB0_12
; %bb.2:
	mov	x0, x22
	bl	_pms7003_frame_is_okay
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_complete
LBB0_4:
	str	wzr, [x22]
	b	LBB0_12
LBB0_5:
	cmp	x20, #4
	b.hs	LBB0_7
; %bb.6:
	mov	w20, #0
	b	LBB0_12
LBB0_7:
	mov	x0, x21
	bl	_get_unaligned_be16
Lloh0:
	adrp	x8, _PMS7003_MAGIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PMS7003_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x0
	b.ne	LBB0_11
; %bb.8:
	add	x0, x21, #2
	bl	_get_unaligned_be16
Lloh3:
	adrp	x8, _PMS7003_MAX_DATA_LENGTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PMS7003_MAX_DATA_LENGTH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w0
	b.lt	LBB0_10
; %bb.9:
	stp	w0, wzr, [x19, #8]
LBB0_10:
	mov	w20, #4
	b	LBB0_12
LBB0_11:
	mov	w20, #2
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PMS7003_MAGIC,8,3              ; @PMS7003_MAGIC
	.comm	_PMS7003_MAX_DATA_LENGTH,4,2    ; @PMS7003_MAX_DATA_LENGTH
	.no_dead_strip	_pms7003_receive_buf
.subsections_via_symbols
