	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zoran_g_fmt_vid_out
_zoran_g_fmt_vid_out:                   ## @zoran_g_fmt_vid_out
	.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	%rdx, %r15
	movq	%rsi, %rbx
	movq	32(%rsi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%rbx), %eax
	cltd
	idivl	4(%rbx)
	movl	%eax, (%r15)
	movl	8(%rbx), %eax
	movl	16(%rbx), %ecx
	imull	12(%rbx), %ecx
	addl	%eax, %eax
	cltd
	idivl	%ecx
	movl	%eax, 4(%r15)
	movq	%rbx, %rdi
	callq	_zoran_v4l2_calc_bufsize
	movl	%eax, 32(%r15)
	movq	_V4L2_PIX_FMT_MJPEG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r15)
	cmpl	$1, 16(%rbx)
	movq	_V4L2_FIELD_TOP@GOTPCREL(%rip), %rax
	cmoveq	_V4L2_FIELD_SEQ_TB@GOTPCREL(%rip), %rax
	movq	_V4L2_FIELD_BOTTOM@GOTPCREL(%rip), %rcx
	cmoveq	_V4L2_FIELD_SEQ_BT@GOTPCREL(%rip), %rcx
	cmpq	$0, 24(%rbx)
	cmovneq	%rax, %rcx
	movl	(%rcx), %eax
	movl	%eax, 24(%r15)
	movq	$0, 16(%r15)
	movq	_V4L2_COLORSPACE_SMPTE170M@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_PIX_FMT_MJPEG,4,2         ## @V4L2_PIX_FMT_MJPEG
	.comm	_V4L2_FIELD_SEQ_TB,4,2          ## @V4L2_FIELD_SEQ_TB
	.comm	_V4L2_FIELD_SEQ_BT,4,2          ## @V4L2_FIELD_SEQ_BT
	.comm	_V4L2_FIELD_TOP,4,2             ## @V4L2_FIELD_TOP
	.comm	_V4L2_FIELD_BOTTOM,4,2          ## @V4L2_FIELD_BOTTOM
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ## @V4L2_COLORSPACE_SMPTE170M
	.no_dead_strip	_zoran_g_fmt_vid_out
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zoran_g_fmt_vid_out
_zoran_g_fmt_vid_out:                   ; @zoran_g_fmt_vid_out
	.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, x2
	mov	x20, x1
	ldr	x21, [x1, #32]
	mov	x0, x21
	bl	_mutex_lock
	ldp	w8, w9, [x20]
	sdiv	w8, w8, w9
	ldp	w9, w10, [x20, #8]
	lsl	w9, w9, #1
	ldr	w11, [x20, #16]
	mul	w10, w11, w10
	sdiv	w9, w9, w10
	stp	w8, w9, [x19]
	mov	x0, x20
	bl	_zoran_v4l2_calc_bufsize
Lloh0:
	adrp	x8, _V4L2_PIX_FMT_MJPEG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_PIX_FMT_MJPEG@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	stp	w8, w0, [x19, #28]
	ldr	w8, [x20, #16]
	ldr	x9, [x20, #24]
Lloh3:
	adrp	x10, _V4L2_FIELD_SEQ_TB@GOTPAGE
Lloh4:
	ldr	x10, [x10, _V4L2_FIELD_SEQ_TB@GOTPAGEOFF]
Lloh5:
	adrp	x11, _V4L2_FIELD_TOP@GOTPAGE
Lloh6:
	ldr	x11, [x11, _V4L2_FIELD_TOP@GOTPAGEOFF]
	cmp	w8, #1
	csel	x8, x10, x11, eq
Lloh7:
	adrp	x10, _V4L2_FIELD_SEQ_BT@GOTPAGE
Lloh8:
	ldr	x10, [x10, _V4L2_FIELD_SEQ_BT@GOTPAGEOFF]
Lloh9:
	adrp	x11, _V4L2_FIELD_BOTTOM@GOTPAGE
Lloh10:
	ldr	x11, [x11, _V4L2_FIELD_BOTTOM@GOTPAGEOFF]
	csel	x10, x10, x11, eq
	cmp	x9, #0
	csel	x8, x10, x8, eq
	ldr	w8, [x8]
	str	w8, [x19, #24]
	str	xzr, [x19, #16]
Lloh11:
	adrp	x8, _V4L2_COLORSPACE_SMPTE170M@GOTPAGE
Lloh12:
	ldr	x8, [x8, _V4L2_COLORSPACE_SMPTE170M@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	mov	x0, x21
	bl	_mutex_unlock
	mov	w0, #0
	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	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_PIX_FMT_MJPEG,4,2         ; @V4L2_PIX_FMT_MJPEG
	.comm	_V4L2_FIELD_SEQ_TB,4,2          ; @V4L2_FIELD_SEQ_TB
	.comm	_V4L2_FIELD_SEQ_BT,4,2          ; @V4L2_FIELD_SEQ_BT
	.comm	_V4L2_FIELD_TOP,4,2             ; @V4L2_FIELD_TOP
	.comm	_V4L2_FIELD_BOTTOM,4,2          ; @V4L2_FIELD_BOTTOM
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ; @V4L2_COLORSPACE_SMPTE170M
	.no_dead_strip	_zoran_g_fmt_vid_out
.subsections_via_symbols
