	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _sun4i_csi_try_fmt
__sun4i_csi_try_fmt:                    ## @_sun4i_csi_try_fmt
	.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	%rsi, %r14
	leaq	28(%rsi), %rdi
	xorl	%esi, %esi
	callq	_sun4i_csi_find_format
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_sun4i_csi_formats@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
LBB0_2:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r14)
	movq	_V4L2_COLORSPACE_SRGB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, 36(%r14)
	callq	_V4L2_MAP_XFER_FUNC_DEFAULT
	movl	%eax, 44(%r14)
	movl	36(%r14), %edi
	callq	_V4L2_MAP_YCBCR_ENC_DEFAULT
	movl	%eax, 32(%r14)
	movl	36(%r14), %esi
	movl	$1, %edi
	movl	%eax, %edx
	callq	_V4L2_MAP_QUANTIZATION_DEFAULT
	movl	%eax, 40(%r14)
	movl	(%r13), %eax
	movl	%eax, (%r14)
	movl	24(%r13), %eax
	movl	%eax, 28(%r14)
	movl	24(%r14), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movl	4(%r14), %edi
	movl	4(%r13), %esi
	callq	_ALIGN
	movl	%eax, %r15d
	movl	8(%r14), %edi
	movl	8(%r13), %esi
	callq	_ALIGN
	movl	%eax, %r12d
	movl	4(%r13), %esi
	movq	_CSI_MAX_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	callq	_clamp
	movl	%eax, 4(%r14)
	movl	8(%r13), %esi
	movq	_CSI_MAX_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %edi
	callq	_clamp
	movl	%eax, 8(%r14)
	cmpl	$0, (%r13)
	je	LBB0_6
## %bb.3:
	movq	16(%r13), %rcx
	movl	(%rcx), %ecx
	imull	4(%r14), %ecx
	shrl	$3, %ecx
	movq	16(%r14), %rdx
	movl	%ecx, (%rdx)
	imull	%eax, %ecx
	movl	%ecx, 4(%rdx)
	movl	8(%rdx), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	cmpl	$2, (%r13)
	jb	LBB0_6
## %bb.4:
	movl	$1, %r15d
	movl	$5, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%r13), %ecx
	movl	4(%r14), %eax
	xorl	%edx, %edx
	divl	4(%r13)
	movq	16(%r13), %rdx
	imull	(%rdx,%r15,4), %eax
	shrl	$3, %eax
	movq	16(%r14), %rsi
	movl	%eax, -8(%rsi,%rbx,4)
	imull	8(%r14), %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, -4(%rsi,%rbx,4)
	movl	(%rsi,%rbx,4), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	incq	%r15
	movl	(%r13), %eax
	addq	$3, %rbx
	cmpq	%rax, %r15
	jb	LBB0_5
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sun4i_csi_formats,8,3          ## @sun4i_csi_formats
	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.comm	_V4L2_COLORSPACE_SRGB,4,2       ## @V4L2_COLORSPACE_SRGB
	.comm	_CSI_MAX_WIDTH,4,2              ## @CSI_MAX_WIDTH
	.comm	_CSI_MAX_HEIGHT,4,2             ## @CSI_MAX_HEIGHT
	.no_dead_strip	__sun4i_csi_try_fmt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _sun4i_csi_try_fmt
__sun4i_csi_try_fmt:                    ; @_sun4i_csi_try_fmt
	.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, x1
	add	x0, x1, #28
	mov	x1, #0
	bl	_sun4i_csi_find_format
Lloh0:
	adrp	x8, _sun4i_csi_formats@GOTPAGE
Lloh1:
	ldr	x8, [x8, _sun4i_csi_formats@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, #0
	csel	x22, x8, x0, eq
Lloh3:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #48]
Lloh6:
	adrp	x8, _V4L2_COLORSPACE_SRGB@GOTPAGE
Lloh7:
	ldr	x8, [x8, _V4L2_COLORSPACE_SRGB@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	str	w0, [x19, #36]
	bl	_V4L2_MAP_XFER_FUNC_DEFAULT
	str	w0, [x19, #44]
	ldr	w0, [x19, #36]
	bl	_V4L2_MAP_YCBCR_ENC_DEFAULT
	mov	x2, x0
	str	w0, [x19, #32]
	ldr	w1, [x19, #36]
	mov	w0, #1
	bl	_V4L2_MAP_QUANTIZATION_DEFAULT
	str	w0, [x19, #40]
	ldr	w8, [x22]
	str	w8, [x19]
	ldr	w8, [x22, #24]
	str	w8, [x19, #28]
	ldr	w0, [x19, #24]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w0, [x19, #4]
	ldr	w1, [x22, #4]
	bl	_ALIGN
	mov	x20, x0
	ldr	w0, [x19, #8]
	ldr	w1, [x22, #8]
	bl	_ALIGN
	mov	x21, x0
	ldr	w1, [x22, #4]
Lloh9:
	adrp	x8, _CSI_MAX_WIDTH@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CSI_MAX_WIDTH@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_clamp
	str	w0, [x19, #4]
	ldr	w1, [x22, #8]
Lloh12:
	adrp	x8, _CSI_MAX_HEIGHT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CSI_MAX_HEIGHT@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_clamp
	str	w0, [x19, #8]
	ldr	w8, [x22]
	cbz	w8, LBB0_4
; %bb.1:
	ldr	w8, [x19, #4]
	ldr	x9, [x22, #16]
	ldr	w9, [x9]
	mul	w8, w9, w8
	lsr	w8, w8, #3
	ldr	x9, [x19, #16]
	mul	w10, w8, w0
	stp	w8, w10, [x9]
	ldr	w0, [x9, #8]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w8, [x22]
	cmp	w8, #2
	b.lo	LBB0_4
; %bb.2:
	mov	x20, #0
	mov	w21, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w8, w9, [x22, #4]
	ldp	w10, w11, [x19, #4]
	udiv	w8, w10, w8
	ldr	x10, [x22, #16]
	ldr	w10, [x10, x21, lsl #2]
	mul	w8, w10, w8
	lsr	w8, w8, #3
	ldr	x10, [x19, #16]
	add	x10, x10, x20
	mul	w11, w11, w8
	udiv	w9, w11, w9
	stp	w8, w9, [x10, #12]
	ldr	w0, [x10, #20]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	add	x21, x21, #1
	ldr	w8, [x22]
	add	x20, x20, #12
	cmp	x21, x8
	b.lo	LBB0_3
LBB0_4:
	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	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_sun4i_csi_formats,8,3          ; @sun4i_csi_formats
	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.comm	_V4L2_COLORSPACE_SRGB,4,2       ; @V4L2_COLORSPACE_SRGB
	.comm	_CSI_MAX_WIDTH,4,2              ; @CSI_MAX_WIDTH
	.comm	_CSI_MAX_HEIGHT,4,2             ; @CSI_MAX_HEIGHT
	.no_dead_strip	__sun4i_csi_try_fmt
.subsections_via_symbols
