	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pwc_rcv_short_packet
_pwc_rcv_short_packet:                  ## @pwc_rcv_short_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	(%rdi), %eax
	cmpl	$720, %eax                      ## imm = 0x2D0
	je	LBB0_12
## %bb.1:
	cmpl	$740, %eax                      ## imm = 0x2E4
	je	LBB0_12
## %bb.2:
	cmpl	$730, %eax                      ## imm = 0x2DA
	jne	LBB0_15
## %bb.3:
	movq	8(%r14), %rbx
	cmpb	$1, 1(%rbx)
	jne	LBB0_6
## %bb.4:
	testb	$16, (%rbx)
	je	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rdi
	callq	_PWC_TRACE
	addq	$2, 8(%r15)
	incl	28(%r15)
LBB0_6:
	movb	(%rbx), %al
	movb	16(%r15), %cl
	xorb	%al, %cl
	testb	$1, %cl
	je	LBB0_8
## %bb.7:
	andb	$1, %al
	movzbl	%al, %esi
	movq	%r15, %rdi
	callq	_pwc_snapshot_button
	movb	(%rbx), %al
	movb	16(%r15), %cl
	xorb	%al, %cl
LBB0_8:
	testb	$2, %cl
	je	LBB0_10
## %bb.9:
	testb	$2, %al
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rdi
	cmoveq	%rax, %rdi
	callq	_PWC_TRACE
LBB0_10:
	movb	(%rbx), %al
	andb	$3, %al
	movb	%al, 16(%r15)
	cmpl	$4, (%r14)
	jne	LBB0_15
## %bb.11:
	incq	8(%r15)
	jmp	LBB0_15
LBB0_12:
	movq	8(%r14), %rbx
	movb	(%rbx), %al
	movb	16(%r15), %cl
	xorb	%al, %cl
	testb	$1, %cl
	je	LBB0_14
## %bb.13:
	andb	$1, %al
	movzbl	%al, %esi
	movq	%r15, %rdi
	callq	_pwc_snapshot_button
	movb	(%rbx), %al
LBB0_14:
	andb	$3, %al
	movb	%al, 16(%r15)
LBB0_15:
	movq	8(%r15), %rax
	testq	%rax, %rax
	jle	LBB0_17
## %bb.16:
	decq	%rax
	movq	%rax, 8(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_17:
	movl	(%r14), %esi
	cmpl	20(%r15), %esi
	jge	LBB0_19
## %bb.18:
	leaq	L_.str.3(%rip), %rdi
	callq	_PWC_DEBUG_FLOW
	incl	28(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_19:
	movq	%r15, %rdi
	callq	_pwc_next_fill_frame
	movl	$1, %ebx
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movq	%r15, %rdi
	callq	_pwc_frame_dumped
LBB0_21:
	incl	24(%r15)
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Hyundai CMOS sensor bug. Dropping frame.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Image is mirrored.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Image is normal.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Frame buffer underflow (%d bytes); discarded.\n"

	.no_dead_strip	_pwc_rcv_short_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pwc_rcv_short_packet
_pwc_rcv_short_packet:                  ; @pwc_rcv_short_packet
	.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, x1
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #720
	b.eq	LBB0_12
; %bb.1:
	cmp	w8, #740
	b.eq	LBB0_12
; %bb.2:
	cmp	w8, #730
	b.ne	LBB0_15
; %bb.3:
	ldr	x21, [x20, #8]
	ldrb	w8, [x21, #1]
	cmp	w8, #1
	b.ne	LBB0_6
; %bb.4:
	ldrb	w8, [x21]
	tbz	w8, #4, LBB0_6
; %bb.5:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_PWC_TRACE
	ldr	x8, [x19, #8]
	add	x8, x8, #2
	str	x8, [x19, #8]
	ldr	w8, [x19, #28]
	add	w8, w8, #1
	str	w8, [x19, #28]
LBB0_6:
	ldrb	w8, [x21]
	ldrb	w9, [x19, #16]
	eor	w9, w9, w8
	tbz	w9, #0, LBB0_8
; %bb.7:
	and	w1, w8, #0x1
	mov	x0, x19
	bl	_pwc_snapshot_button
	ldrb	w8, [x21]
	ldrb	w9, [x19, #16]
	eor	w9, w9, w8
LBB0_8:
	tbz	w9, #1, LBB0_10
; %bb.9:
Lloh2:
	adrp	x9, l_.str.1@PAGE
Lloh3:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh4:
	adrp	x10, l_.str.2@PAGE
Lloh5:
	add	x10, x10, l_.str.2@PAGEOFF
	tst	w8, #0x2
	csel	x0, x10, x9, eq
	bl	_PWC_TRACE
LBB0_10:
	ldrb	w8, [x21]
	and	w8, w8, #0x3
	strb	w8, [x19, #16]
	ldr	w8, [x20]
	cmp	w8, #4
	b.ne	LBB0_15
; %bb.11:
	ldr	x8, [x19, #8]
	add	x8, x8, #1
	str	x8, [x19, #8]
	b	LBB0_15
LBB0_12:
	ldr	x21, [x20, #8]
	ldrb	w8, [x21]
	ldrb	w9, [x19, #16]
	eor	w9, w9, w8
	tbz	w9, #0, LBB0_14
; %bb.13:
	and	w1, w8, #0x1
	mov	x0, x19
	bl	_pwc_snapshot_button
	ldrb	w8, [x21]
LBB0_14:
	and	w8, w8, #0x3
	strb	w8, [x19, #16]
LBB0_15:
	ldr	x8, [x19, #8]
	subs	x8, x8, #1
	b.lt	LBB0_17
; %bb.16:
	mov	w0, #0
	str	x8, [x19, #8]
	b	LBB0_22
LBB0_17:
	ldr	w1, [x20]
	ldr	w8, [x19, #20]
	cmp	w1, w8
	b.ge	LBB0_19
; %bb.18:
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_PWC_DEBUG_FLOW
	mov	w0, #0
	ldr	w8, [x19, #28]
	add	w8, w8, #1
	str	w8, [x19, #28]
	b	LBB0_22
LBB0_19:
	mov	x0, x19
	bl	_pwc_next_fill_frame
	cbz	x0, LBB0_21
; %bb.20:
	mov	x0, x19
	bl	_pwc_frame_dumped
LBB0_21:
	mov	w0, #1
LBB0_22:
	ldr	w8, [x19, #24]
	add	w8, w8, #1
	str	w8, [x19, #24]
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Hyundai CMOS sensor bug. Dropping frame.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Image is mirrored.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Image is normal.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Frame buffer underflow (%d bytes); discarded.\n"

	.no_dead_strip	_pwc_rcv_short_packet
.subsections_via_symbols
