	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v4l2_fwht_encode               ## -- Begin function v4l2_fwht_encode
	.p2align	4, 0x90
_v4l2_fwht_encode:                      ## @v4l2_fwht_encode
	.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	56(%rdi), %r15
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movq	%rsi, %rdx
	movq	%rdi, %r13
	movl	(%rdi), %ebx
	movl	4(%rdi), %ecx
	imull	%ebx, %ecx
	leaq	-48(%rbp), %rdi
	movq	%r15, %rsi
	callq	_prepare_raw_frame
	testq	%rax, %rax
	je	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_21
LBB0_3:
	cmpl	$3, (%r15)
	sete	%cl
	shrl	%cl, %ebx
	movq	8(%r15), %rax
	movq	_V4L2_PIX_FMT_NV24@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%dl
	movq	_V4L2_PIX_FMT_NV42@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%cl
	orb	%dl, %cl
	shll	%cl, %ebx
	movl	48(%r13), %eax
	movl	%eax, -52(%rbp)
	movl	44(%r13), %eax
	movl	%eax, -56(%rbp)
	leaq	320(%r14), %rax
	movq	%rax, -64(%rbp)
	leaq	40(%r13), %rsi
	movl	(%r13), %r10d
	movl	8(%r13), %edx
	xorl	%ecx, %ecx
	testl	%edx, %edx
	sete	%cl
	movl	12(%r13), %edi
	decl	%edi
	xorl	%r8d, %r8d
	cmpl	%edi, %edx
	sete	%r8b
	movl	16(%r13), %r9d
	movl	20(%r13), %eax
	subq	$8, %rsp
	leaq	-48(%rbp), %rdi
	leaq	-72(%rbp), %rdx
	pushq	%rbx
	pushq	%r10
	pushq	%rax
	callq	_fwht_encode_frame
	addq	$32, %rsp
	movl	%eax, %r12d
	movq	_FWHT_FRAME_PCODED@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_4
## %bb.5:
	movl	8(%r13), %eax
	incl	%eax
	jmp	LBB0_6
LBB0_4:
	movl	$1, %eax
LBB0_6:
	xorl	%ebx, %ebx
	cmpl	12(%r13), %eax
	cmovgel	%ebx, %eax
	movl	%eax, 8(%r13)
	movq	_FWHT_MAGIC1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 76(%r14)
	movq	_FWHT_MAGIC2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 72(%r14)
	movq	_FWHT_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htonl
	movq	%rax, 64(%r14)
	movl	16(%r13), %edi
	callq	_htonl
	movq	%rax, 56(%r14)
	movl	20(%r13), %edi
	callq	_htonl
	movq	%rax, 48(%r14)
	movl	16(%r15), %edi
	decl	%edi
	movq	_FWHT_FL_COMPONENTS_NUM_OFFSET@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edi
	movq	_FWHT_LUMA_UNENCODED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	%r12d, %ecx
	je	LBB0_8
## %bb.7:
	movq	_FWHT_FL_LUMA_IS_UNCOMPRESSED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_8:
	movq	_FWHT_CB_UNENCODED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r12d, %eax
	je	LBB0_10
## %bb.9:
	movq	_FWHT_FL_CB_IS_UNCOMPRESSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	movq	_FWHT_CR_UNENCODED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	andl	%r12d, %esi
	je	LBB0_12
## %bb.11:
	movq	_FWHT_FL_CR_IS_UNCOMPRESSED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
LBB0_12:
	orl	20(%r15), %edi
	movq	_FWHT_ALPHA_UNENCODED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	%r12d, %edx
	je	LBB0_14
## %bb.13:
	movq	_FWHT_FL_ALPHA_IS_UNCOMPRESSED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_14:
	orl	%ecx, %edi
	orl	%esi, %eax
	movq	_FWHT_FRAME_PCODED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	$0, %ecx
	andl	%r12d, %esi
	jne	LBB0_16
## %bb.15:
	movq	_FWHT_FL_I_FRAME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_16:
	orl	%ecx, %edx
	orl	%eax, %edi
	movl	-44(%rbp), %eax
	cmpl	$1, -48(%rbp)
	movl	$0, %ecx
	jne	LBB0_18
## %bb.17:
	movq	_FWHT_FL_CHROMA_FULL_HEIGHT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_18:
	orl	%ecx, %edx
	orl	%edx, %edi
	cmpl	$1, %eax
	jne	LBB0_20
## %bb.19:
	movq	_FWHT_FL_CHROMA_FULL_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_20:
	orl	%ebx, %edi
	callq	_htonl
	movq	%rax, 40(%r14)
	movl	24(%r13), %edi
	callq	_htonl
	movq	%rax, 32(%r14)
	movl	28(%r13), %edi
	callq	_htonl
	movq	%rax, 24(%r14)
	movl	32(%r13), %edi
	callq	_htonl
	movq	%rax, 16(%r14)
	movl	36(%r13), %edi
	callq	_htonl
	movq	%rax, 8(%r14)
	movl	-72(%rbp), %edi
	callq	_htonl
	movq	%rax, (%r14)
	movl	-72(%rbp), %eax
	addl	$80, %eax
LBB0_21:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_PIX_FMT_NV24,8,3          ## @V4L2_PIX_FMT_NV24
	.comm	_V4L2_PIX_FMT_NV42,8,3          ## @V4L2_PIX_FMT_NV42
	.comm	_FWHT_FRAME_PCODED,4,2          ## @FWHT_FRAME_PCODED
	.comm	_FWHT_MAGIC1,4,2                ## @FWHT_MAGIC1
	.comm	_FWHT_MAGIC2,4,2                ## @FWHT_MAGIC2
	.comm	_FWHT_VERSION,4,2               ## @FWHT_VERSION
	.comm	_FWHT_FL_COMPONENTS_NUM_OFFSET,4,2 ## @FWHT_FL_COMPONENTS_NUM_OFFSET
	.comm	_FWHT_LUMA_UNENCODED,4,2        ## @FWHT_LUMA_UNENCODED
	.comm	_FWHT_FL_LUMA_IS_UNCOMPRESSED,4,2 ## @FWHT_FL_LUMA_IS_UNCOMPRESSED
	.comm	_FWHT_CB_UNENCODED,4,2          ## @FWHT_CB_UNENCODED
	.comm	_FWHT_FL_CB_IS_UNCOMPRESSED,4,2 ## @FWHT_FL_CB_IS_UNCOMPRESSED
	.comm	_FWHT_CR_UNENCODED,4,2          ## @FWHT_CR_UNENCODED
	.comm	_FWHT_FL_CR_IS_UNCOMPRESSED,4,2 ## @FWHT_FL_CR_IS_UNCOMPRESSED
	.comm	_FWHT_ALPHA_UNENCODED,4,2       ## @FWHT_ALPHA_UNENCODED
	.comm	_FWHT_FL_ALPHA_IS_UNCOMPRESSED,4,2 ## @FWHT_FL_ALPHA_IS_UNCOMPRESSED
	.comm	_FWHT_FL_I_FRAME,4,2            ## @FWHT_FL_I_FRAME
	.comm	_FWHT_FL_CHROMA_FULL_HEIGHT,4,2 ## @FWHT_FL_CHROMA_FULL_HEIGHT
	.comm	_FWHT_FL_CHROMA_FULL_WIDTH,4,2  ## @FWHT_FL_CHROMA_FULL_WIDTH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v4l2_fwht_encode               ; -- Begin function v4l2_fwht_encode
	.p2align	2
_v4l2_fwht_encode:                      ; @v4l2_fwht_encode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	x21, [x0, #56]
	cbz	x21, LBB0_2
; %bb.1:
	mov	x19, x2
	mov	x2, x1
	mov	x20, x0
	ldp	w22, w8, [x0]
	mul	w3, w8, w22
	add	x0, sp, #16
	mov	x1, x21
	bl	_prepare_raw_frame
	cbz	x0, LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_3:
	ldr	w8, [x21]
	cmp	w8, #3
	cset	w8, eq
	lsr	w8, w22, w8
Lloh3:
	adrp	x9, _V4L2_PIX_FMT_NV24@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_PIX_FMT_NV24@GOTPAGEOFF]
	ldr	x10, [x21, #8]
Lloh5:
	ldr	x9, [x9]
	cmp	x10, x9
Lloh6:
	adrp	x9, _V4L2_PIX_FMT_NV42@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_PIX_FMT_NV42@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ccmp	x10, x9, #4, ne
	cset	w9, eq
	lsl	w8, w8, w9
	ldur	d0, [x20, #44]
	str	d0, [sp, #40]
	add	x9, x19, #320
	str	x9, [sp, #32]
	add	x1, x20, #40
	ldp	w9, w10, [x20, #8]
	cmp	w9, #0
	cset	w3, eq
	sub	w10, w10, #1
	cmp	w9, w10
	cset	w4, eq
	ldp	w5, w6, [x20, #16]
	ldr	w7, [x20]
	str	w8, [sp]
	add	x0, sp, #16
	add	x2, sp, #24
	bl	_fwht_encode_frame
	mov	x22, x0
Lloh9:
	adrp	x23, _FWHT_FRAME_PCODED@GOTPAGE
Lloh10:
	ldr	x23, [x23, _FWHT_FRAME_PCODED@GOTPAGEOFF]
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.4:
	ldr	w8, [x20, #8]
	add	w8, w8, #1
	b	LBB0_6
LBB0_5:
	mov	w8, #1
LBB0_6:
	ldr	w9, [x20, #12]
	cmp	w8, w9
	csel	w8, w8, wzr, lt
	str	w8, [x20, #8]
Lloh11:
	adrp	x8, _FWHT_MAGIC1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _FWHT_MAGIC1@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _FWHT_MAGIC2@GOTPAGE
Lloh15:
	ldr	x9, [x9, _FWHT_MAGIC2@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #72]
Lloh17:
	adrp	x8, _FWHT_VERSION@GOTPAGE
Lloh18:
	ldr	x8, [x8, _FWHT_VERSION@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_htonl
	str	x0, [x19, #64]
	ldr	w0, [x20, #16]
	bl	_htonl
	str	x0, [x19, #56]
	ldr	w0, [x20, #20]
	bl	_htonl
	str	x0, [x19, #48]
	ldp	w8, w9, [x21, #16]
	sub	w8, w8, #1
Lloh20:
	adrp	x10, _FWHT_FL_COMPONENTS_NUM_OFFSET@GOTPAGE
Lloh21:
	ldr	x10, [x10, _FWHT_FL_COMPONENTS_NUM_OFFSET@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	lsl	w8, w8, w10
	orr	w8, w8, w9
Lloh23:
	adrp	x9, _FWHT_LUMA_UNENCODED@GOTPAGE
Lloh24:
	ldr	x9, [x9, _FWHT_LUMA_UNENCODED@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
Lloh26:
	adrp	x10, _FWHT_FL_LUMA_IS_UNCOMPRESSED@GOTPAGE
Lloh27:
	ldr	x10, [x10, _FWHT_FL_LUMA_IS_UNCOMPRESSED@GOTPAGEOFF]
Lloh28:
	ldr	w10, [x10]
	tst	w9, w22
	csel	w9, wzr, w10, eq
	orr	w8, w8, w9
Lloh29:
	adrp	x9, _FWHT_CB_UNENCODED@GOTPAGE
Lloh30:
	ldr	x9, [x9, _FWHT_CB_UNENCODED@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
Lloh32:
	adrp	x10, _FWHT_FL_CB_IS_UNCOMPRESSED@GOTPAGE
Lloh33:
	ldr	x10, [x10, _FWHT_FL_CB_IS_UNCOMPRESSED@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
	tst	w9, w22
	csel	w9, wzr, w10, eq
	orr	w8, w8, w9
Lloh35:
	adrp	x9, _FWHT_CR_UNENCODED@GOTPAGE
Lloh36:
	ldr	x9, [x9, _FWHT_CR_UNENCODED@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
Lloh38:
	adrp	x10, _FWHT_FL_CR_IS_UNCOMPRESSED@GOTPAGE
Lloh39:
	ldr	x10, [x10, _FWHT_FL_CR_IS_UNCOMPRESSED@GOTPAGEOFF]
Lloh40:
	ldr	w10, [x10]
	tst	w9, w22
	csel	w9, wzr, w10, eq
	orr	w8, w8, w9
Lloh41:
	adrp	x9, _FWHT_ALPHA_UNENCODED@GOTPAGE
Lloh42:
	ldr	x9, [x9, _FWHT_ALPHA_UNENCODED@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
Lloh44:
	adrp	x10, _FWHT_FL_ALPHA_IS_UNCOMPRESSED@GOTPAGE
Lloh45:
	ldr	x10, [x10, _FWHT_FL_ALPHA_IS_UNCOMPRESSED@GOTPAGEOFF]
Lloh46:
	ldr	w10, [x10]
	tst	w9, w22
	csel	w9, wzr, w10, eq
	orr	w8, w8, w9
	ldr	w9, [x23]
Lloh47:
	adrp	x10, _FWHT_FL_I_FRAME@GOTPAGE
Lloh48:
	ldr	x10, [x10, _FWHT_FL_I_FRAME@GOTPAGEOFF]
Lloh49:
	ldr	w10, [x10]
	tst	w9, w22
	csel	w9, w10, wzr, eq
	orr	w8, w8, w9
Lloh50:
	adrp	x9, _FWHT_FL_CHROMA_FULL_HEIGHT@GOTPAGE
Lloh51:
	ldr	x9, [x9, _FWHT_FL_CHROMA_FULL_HEIGHT@GOTPAGEOFF]
Lloh52:
	ldr	w9, [x9]
	ldp	w10, w11, [sp, #16]
	cmp	w10, #1
	csel	w9, w9, wzr, eq
	orr	w8, w8, w9
Lloh53:
	adrp	x9, _FWHT_FL_CHROMA_FULL_WIDTH@GOTPAGE
Lloh54:
	ldr	x9, [x9, _FWHT_FL_CHROMA_FULL_WIDTH@GOTPAGEOFF]
Lloh55:
	ldr	w9, [x9]
	cmp	w11, #1
	csel	w9, w9, wzr, eq
	orr	w0, w8, w9
	bl	_htonl
	str	x0, [x19, #40]
	ldr	w0, [x20, #24]
	bl	_htonl
	str	x0, [x19, #32]
	ldr	w0, [x20, #28]
	bl	_htonl
	str	x0, [x19, #24]
	ldr	w0, [x20, #32]
	bl	_htonl
	str	x0, [x19, #16]
	ldr	w0, [x20, #36]
	bl	_htonl
	str	x0, [x19, #8]
	ldr	w0, [sp, #24]
	bl	_htonl
	str	x0, [x19]
	ldr	w8, [sp, #24]
	add	w0, w8, #80
LBB0_7:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_PIX_FMT_NV24,8,3          ; @V4L2_PIX_FMT_NV24
	.comm	_V4L2_PIX_FMT_NV42,8,3          ; @V4L2_PIX_FMT_NV42
	.comm	_FWHT_FRAME_PCODED,4,2          ; @FWHT_FRAME_PCODED
	.comm	_FWHT_MAGIC1,4,2                ; @FWHT_MAGIC1
	.comm	_FWHT_MAGIC2,4,2                ; @FWHT_MAGIC2
	.comm	_FWHT_VERSION,4,2               ; @FWHT_VERSION
	.comm	_FWHT_FL_COMPONENTS_NUM_OFFSET,4,2 ; @FWHT_FL_COMPONENTS_NUM_OFFSET
	.comm	_FWHT_LUMA_UNENCODED,4,2        ; @FWHT_LUMA_UNENCODED
	.comm	_FWHT_FL_LUMA_IS_UNCOMPRESSED,4,2 ; @FWHT_FL_LUMA_IS_UNCOMPRESSED
	.comm	_FWHT_CB_UNENCODED,4,2          ; @FWHT_CB_UNENCODED
	.comm	_FWHT_FL_CB_IS_UNCOMPRESSED,4,2 ; @FWHT_FL_CB_IS_UNCOMPRESSED
	.comm	_FWHT_CR_UNENCODED,4,2          ; @FWHT_CR_UNENCODED
	.comm	_FWHT_FL_CR_IS_UNCOMPRESSED,4,2 ; @FWHT_FL_CR_IS_UNCOMPRESSED
	.comm	_FWHT_ALPHA_UNENCODED,4,2       ; @FWHT_ALPHA_UNENCODED
	.comm	_FWHT_FL_ALPHA_IS_UNCOMPRESSED,4,2 ; @FWHT_FL_ALPHA_IS_UNCOMPRESSED
	.comm	_FWHT_FL_I_FRAME,4,2            ; @FWHT_FL_I_FRAME
	.comm	_FWHT_FL_CHROMA_FULL_HEIGHT,4,2 ; @FWHT_FL_CHROMA_FULL_HEIGHT
	.comm	_FWHT_FL_CHROMA_FULL_WIDTH,4,2  ; @FWHT_FL_CHROMA_FULL_WIDTH
.subsections_via_symbols
