	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pwc_frame_complete
_pwc_frame_complete:                    ## @pwc_frame_complete
	.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	%rdi, %rbx
	movq	40(%rdi), %r14
	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	16(%r14), %r15
	cmpb	$1, 1(%r15)
	jne	LBB0_6
## %bb.4:
	testb	$16, (%r15)
	je	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rdi
	callq	_PWC_TRACE
	addq	$2, 8(%rbx)
LBB0_6:
	movb	(%r15), %al
	movb	16(%rbx), %cl
	xorb	%al, %cl
	testb	$1, %cl
	je	LBB0_8
## %bb.7:
	andb	$1, %al
	movzbl	%al, %esi
	movq	%rbx, %rdi
	callq	_pwc_snapshot_button
	movb	(%r15), %al
	movb	16(%rbx), %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	(%r15), %al
	andb	$3, %al
	movb	%al, 16(%rbx)
	cmpl	$4, (%r14)
	jne	LBB0_15
## %bb.11:
	incq	8(%rbx)
	jmp	LBB0_15
LBB0_12:
	movq	16(%r14), %r15
	movb	(%r15), %al
	movb	16(%rbx), %cl
	xorb	%al, %cl
	testb	$1, %cl
	je	LBB0_14
## %bb.13:
	andb	$1, %al
	movzbl	%al, %esi
	movq	%rbx, %rdi
	callq	_pwc_snapshot_button
	movb	(%r15), %al
LBB0_14:
	andb	$3, %al
	movb	%al, 16(%rbx)
LBB0_15:
	movq	8(%rbx), %rax
	testq	%rax, %rax
	jle	LBB0_17
## %bb.16:
	decq	%rax
	movq	%rax, 8(%rbx)
	jmp	LBB0_20
LBB0_17:
	movl	(%r14), %esi
	cmpl	20(%rbx), %esi
	jge	LBB0_19
## %bb.18:
	leaq	L_.str.3(%rip), %rdi
	callq	_PWC_DEBUG_FLOW
	jmp	LBB0_20
LBB0_19:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	4(%r14), %rdi
	movl	%eax, 12(%r14)
	movl	24(%rbx), %eax
	movl	%eax, 8(%r14)
	movq	_VB2_BUF_STATE_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_vb2_buffer_done
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rbx)
LBB0_20:
	incl	24(%rbx)
	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"

	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.comm	_VB2_BUF_STATE_DONE,4,2         ## @VB2_BUF_STATE_DONE
	.no_dead_strip	_pwc_frame_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pwc_frame_complete
_pwc_frame_complete:                    ; @pwc_frame_complete
	.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	x19, x0
	ldr	x20, [x0, #40]
	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, #16]
	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]
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, #16]
	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:
	str	x8, [x19, #8]
	b	LBB0_20
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
	b	LBB0_20
LBB0_19:
Lloh8:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	add	x0, x20, #4
	ldr	w9, [x19, #24]
	stp	w9, w8, [x20, #8]
Lloh11:
	adrp	x8, _VB2_BUF_STATE_DONE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VB2_BUF_STATE_DONE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_vb2_buffer_done
	stp	xzr, xzr, [x19, #32]
LBB0_20:
	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
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.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"

	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.comm	_VB2_BUF_STATE_DONE,4,2         ; @VB2_BUF_STATE_DONE
	.no_dead_strip	_pwc_frame_complete
.subsections_via_symbols
