	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ffmpeg_init_video
_ffmpeg_init_video:                     ## @ffmpeg_init_video
	.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	128(%rdi), %rdi
	cmpb	$0, (%rdi)
	jne	LBB0_2
## %bb.1:
	leaq	160(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	leaq	L_.str.1(%rip), %rdx
	xorl	%ecx, %ecx
	callq	_av_dict_set
	leaq	L_.str.2(%rip), %rdi
LBB0_2:
	callq	_avcodec_find_encoder_by_name
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%r14, 120(%rbx)
	movq	136(%rbx), %rax
	movq	_PIX_FMT_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.10:
	movq	$129, 40(%rbx)
	jmp	LBB0_11
LBB0_3:
	movq	128(%rbx), %rax
	cmpb	$0, (%rax)
	leaq	L_.str.2(%rip), %rsi
	cmovneq	%rax, %rsi
	leaq	L_.str.3(%rip), %rdi
	callq	_RARCH_ERR
	xorl	%r15d, %r15d
	jmp	LBB0_27
LBB0_5:
	movq	%rax, 40(%rbx)
	movq	%rax, %rcx
	andq	$-2, %rcx
	cmpq	$128, %rcx
	je	LBB0_7
## %bb.6:
	movl	$1, 48(%rbx)
LBB0_7:
	cmpq	$129, %rax
	je	LBB0_11
## %bb.8:
	cmpq	$128, %rax
	jne	LBB0_13
## %bb.9:
	movq	_SCALER_FMT_ARGB8888@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movq	_SCALER_FMT_BGR24@GOTPCREL(%rip), %rax
LBB0_12:
	movq	(%rax), %rax
	movq	%rax, 112(%rbx)
LBB0_13:
	movl	8(%rbx), %eax
	xorl	%r15d, %r15d
	cmpl	$132, %eax
	je	LBB0_18
## %bb.14:
	cmpl	$131, %eax
	je	LBB0_17
## %bb.15:
	cmpl	$130, %eax
	jne	LBB0_27
## %bb.16:
	movq	_SCALER_FMT_RGB565@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 104(%rbx)
	movq	_PIX_FMT_RGB565@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$2, %eax
	jmp	LBB0_19
LBB0_18:
	movq	_SCALER_FMT_ARGB8888@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 104(%rbx)
	movl	$4, %eax
	movl	$128, %ecx
	jmp	LBB0_19
LBB0_17:
	movq	_SCALER_FMT_BGR24@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 104(%rbx)
	movl	$3, %eax
	movl	$129, %ecx
LBB0_19:
	movl	%ecx, 52(%rbx)
	movl	%eax, 56(%rbx)
	movq	%r14, %rdi
	callq	_avcodec_alloc_context3
	movq	%rax, 96(%rbx)
	movss	144(%rbx), %xmm0                ## xmm0 = mem[0],zero,zero,zero
	movss	12(%rbx), %xmm1                 ## xmm1 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm1
	movss	%xmm1, 12(%rbx)
	mulss	16(%rbx), %xmm0
	movss	%xmm0, 16(%rbx)
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 48(%rax)
	movss	%xmm1, (%rax)
	movss	%xmm0, 4(%rax)
	xorps	%xmm0, %xmm0
	cvtsi2sdq	152(%rbx), %xmm0
	divsd	24(%rbx), %xmm0
	movl	$1000000, %edi                  ## imm = 0xF4240
	callq	_av_d2q
	movq	96(%rbx), %rcx
	movq	%rax, 40(%rcx)
	movss	12(%rbx), %xmm1                 ## xmm1 = mem[0],zero,zero,zero
	movss	16(%rbx), %xmm0                 ## xmm0 = mem[0],zero,zero,zero
	cvtss2sd	%xmm0, %xmm0
	mulsd	32(%rbx), %xmm0
	cvtss2sd	%xmm1, %xmm1
	divsd	%xmm1, %xmm0
	movl	$255, %edi
	callq	_av_d2q
	movq	96(%rbx), %rdi
	movq	%rax, 32(%rdi)
	movl	40(%rbx), %eax
	movl	%eax, 8(%rdi)
	movl	192(%rbx), %eax
	movl	%eax, 28(%rdi)
	cmpq	$0, 184(%rbx)
	je	LBB0_21
## %bb.20:
	movq	_AV_CODEC_FLAG_QSCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%rdi)
	movl	176(%rbx), %eax
	movl	%eax, 24(%rdi)
	jmp	LBB0_23
LBB0_21:
	movq	168(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_23
## %bb.22:
	movq	%rax, 16(%rdi)
LBB0_23:
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	_AVFMT_GLOBALHEADER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_25
## %bb.24:
	movq	_AV_CODEC_FLAG_GLOBAL_HEADER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%rdi)
LBB0_25:
	leaq	160(%rbx), %rdx
	movq	160(%rbx), %rax
	testq	%rax, %rax
	cmoveq	%rax, %rdx
	movq	%r14, %rsi
	callq	_avcodec_open2
	testq	%rax, %rax
	jne	LBB0_27
## %bb.26:
	movl	$8388608, 60(%rbx)              ## imm = 0x800000
	movl	$8388608, %edi                  ## imm = 0x800000
	callq	_av_malloc
	movq	%rax, 88(%rbx)
	movq	152(%rbx), %rax
	movq	%rax, 80(%rbx)
	movl	40(%rbx), %edi
	movss	12(%rbx), %xmm0                 ## xmm0 = mem[0],zero,zero,zero
	movss	16(%rbx), %xmm1                 ## xmm1 = mem[0],zero,zero,zero
	cvtss2sd	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm1
	callq	_avpicture_get_size
	movq	%rax, %rdi
	callq	_av_malloc
	movq	%rax, 72(%rbx)
	xorl	%eax, %eax
	callq	_av_frame_alloc
	movq	%rax, 64(%rbx)
	movq	72(%rbx), %rsi
	movl	40(%rbx), %edx
	movss	12(%rbx), %xmm0                 ## xmm0 = mem[0],zero,zero,zero
	movss	16(%rbx), %xmm1                 ## xmm1 = mem[0],zero,zero,zero
	cvtss2sd	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm1
	movq	%rax, %rdi
	callq	_avpicture_fill
	movq	64(%rbx), %rax
	cvtps2pd	12(%rbx), %xmm0
	movupd	%xmm0, (%rax)
	movl	40(%rbx), %ecx
	movl	%ecx, 16(%rax)
	movl	$1, %r15d
LBB0_27:
	movl	%r15d, %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	"qp"

L_.str.1:                               ## @.str.1
	.asciz	"0"

L_.str.2:                               ## @.str.2
	.asciz	"libx264rgb"

L_.str.3:                               ## @.str.3
	.asciz	"[FFmpeg]: Cannot find vcodec %s.\n"

	.comm	_PIX_FMT_NONE,8,3               ## @PIX_FMT_NONE
	.comm	_SCALER_FMT_BGR24,8,3           ## @SCALER_FMT_BGR24
	.comm	_SCALER_FMT_ARGB8888,8,3        ## @SCALER_FMT_ARGB8888
	.comm	_SCALER_FMT_RGB565,8,3          ## @SCALER_FMT_RGB565
	.comm	_PIX_FMT_RGB565,4,2             ## @PIX_FMT_RGB565
	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ## @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_FLAG_QSCALE,4,2       ## @AV_CODEC_FLAG_QSCALE
	.comm	_AVFMT_GLOBALHEADER,4,2         ## @AVFMT_GLOBALHEADER
	.comm	_AV_CODEC_FLAG_GLOBAL_HEADER,4,2 ## @AV_CODEC_FLAG_GLOBAL_HEADER
	.no_dead_strip	_ffmpeg_init_video
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function ffmpeg_init_video
lCPI0_0:
	.long	128                             ; 0x80
	.long	4                               ; 0x4
lCPI0_1:
	.long	129                             ; 0x81
	.long	3                               ; 0x3
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_ffmpeg_init_video:                     ; @ffmpeg_init_video
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x0, [x0, #128]
	ldrb	w8, [x0]
	cbnz	w8, LBB0_2
; %bb.1:
	add	x0, x19, #160
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
Lloh2:
	adrp	x2, l_.str.1@PAGE
Lloh3:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w3, #0
	bl	_av_dict_set
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_2:
	bl	_avcodec_find_encoder_by_name
	mov	x20, x0
	cbz	x0, LBB0_5
; %bb.3:
	str	x20, [x19, #120]
	ldr	x8, [x19, #136]
Lloh6:
	adrp	x9, _PIX_FMT_NONE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PIX_FMT_NONE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	mov	w8, #129
	str	x8, [x19, #40]
	b	LBB0_11
LBB0_5:
	ldr	x8, [x19, #128]
	ldrb	w9, [x8]
Lloh9:
	adrp	x10, l_.str.2@PAGE
Lloh10:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	w9, #0
	csel	x1, x10, x8, eq
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_RARCH_ERR
	b	LBB0_26
LBB0_6:
	str	x8, [x19, #40]
	and	x9, x8, #0xfffffffffffffffe
	cmp	x9, #128
	b.eq	LBB0_8
; %bb.7:
	mov	w9, #1
	str	w9, [x19, #48]
LBB0_8:
	cmp	x8, #129
	b.eq	LBB0_11
; %bb.9:
	cmp	x8, #128
	b.ne	LBB0_13
; %bb.10:
Lloh13:
	adrp	x8, _SCALER_FMT_ARGB8888@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SCALER_FMT_ARGB8888@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh15:
	adrp	x8, _SCALER_FMT_BGR24@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SCALER_FMT_BGR24@GOTPAGEOFF]
LBB0_12:
	ldr	x8, [x8]
	str	x8, [x19, #112]
LBB0_13:
	ldr	w8, [x19, #8]
	cmp	w8, #132
	b.eq	LBB0_17
; %bb.14:
	cmp	w8, #131
	b.eq	LBB0_18
; %bb.15:
	cmp	w8, #130
	b.ne	LBB0_26
; %bb.16:
Lloh17:
	adrp	x8, _SCALER_FMT_RGB565@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SCALER_FMT_RGB565@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	str	x8, [x19, #104]
Lloh20:
	adrp	x8, _PIX_FMT_RGB565@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PIX_FMT_RGB565@GOTPAGEOFF]
	movi.2s	v0, #2
	ld1.s	{ v0 }[0], [x8]
	b	LBB0_19
LBB0_17:
Lloh22:
	adrp	x8, _SCALER_FMT_ARGB8888@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SCALER_FMT_ARGB8888@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	str	x8, [x19, #104]
Lloh25:
	adrp	x8, lCPI0_0@PAGE
Lloh26:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	b	LBB0_19
LBB0_18:
Lloh27:
	adrp	x8, _SCALER_FMT_BGR24@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SCALER_FMT_BGR24@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	str	x8, [x19, #104]
Lloh30:
	adrp	x8, lCPI0_1@PAGE
Lloh31:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
LBB0_19:
	stur	d0, [x19, #52]
	mov	x0, x20
	bl	_avcodec_alloc_context3
	str	x0, [x19, #96]
	ldr	s0, [x19, #144]
	ldp	s1, s2, [x19, #12]
	fmul	s1, s1, s0
	str	s1, [x19, #12]
	fmul	s0, s0, s2
	str	s0, [x19, #16]
Lloh32:
	adrp	x8, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	str	w8, [x0, #48]
	str	s1, [x0]
	str	s0, [x0, #4]
	ldr	d0, [x19, #152]
	scvtf	d0, d0
	ldr	d1, [x19, #24]
	fdiv	d0, d0, d1
	mov	w0, #16960
	movk	w0, #15, lsl #16
	bl	_av_d2q
	ldr	x8, [x19, #96]
	str	x0, [x8, #40]
	ldr	d0, [x19, #32]
	ldp	s2, s1, [x19, #12]
	fcvt	d1, s1
	fmul	d0, d0, d1
	fcvt	d1, s2
	fdiv	d0, d0, d1
	mov	w0, #255
	bl	_av_d2q
	mov	x8, x0
	ldr	x0, [x19, #96]
	str	x8, [x0, #32]
	ldr	x8, [x19, #40]
	str	w8, [x0, #8]
	ldr	w8, [x19, #192]
	str	w8, [x0, #28]
	ldr	x8, [x19, #184]
	cbz	x8, LBB0_21
; %bb.20:
Lloh35:
	adrp	x8, _AV_CODEC_FLAG_QSCALE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AV_CODEC_FLAG_QSCALE@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	ldr	w9, [x0, #12]
	orr	w8, w9, w8
	str	w8, [x0, #12]
	ldr	w8, [x19, #176]
	str	w8, [x0, #24]
	b	LBB0_23
LBB0_21:
	ldr	x8, [x19, #168]
	cbz	x8, LBB0_23
; %bb.22:
	str	x8, [x0, #16]
LBB0_23:
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	w8, [x8]
Lloh38:
	adrp	x9, _AVFMT_GLOBALHEADER@GOTPAGE
Lloh39:
	ldr	x9, [x9, _AVFMT_GLOBALHEADER@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_25
; %bb.24:
Lloh41:
	adrp	x8, _AV_CODEC_FLAG_GLOBAL_HEADER@GOTPAGE
Lloh42:
	ldr	x8, [x8, _AV_CODEC_FLAG_GLOBAL_HEADER@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	ldr	w9, [x0, #12]
	orr	w8, w9, w8
	str	w8, [x0, #12]
LBB0_25:
	mov	x8, x19
	ldr	x9, [x8, #160]!
	cmp	x9, #0
	csel	x2, xzr, x8, eq
	mov	x1, x20
	bl	_avcodec_open2
	cbz	x0, LBB0_28
LBB0_26:
	mov	w0, #0
LBB0_27:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_28:
	mov	w8, #8388608
	str	w8, [x19, #60]
	mov	w0, #8388608
	bl	_av_malloc
	ldr	x8, [x19, #152]
	stp	x8, x0, [x19, #80]
	ldr	w0, [x19, #40]
	ldp	s0, s1, [x19, #12]
	fcvt	d0, s0
	fcvt	d1, s1
	bl	_avpicture_get_size
	bl	_av_malloc
	str	x0, [x19, #72]
	bl	_av_frame_alloc
	str	x0, [x19, #64]
	ldr	x1, [x19, #72]
	ldr	w2, [x19, #40]
	ldp	s0, s1, [x19, #12]
	fcvt	d0, s0
	fcvt	d1, s1
	bl	_avpicture_fill
	ldr	x8, [x19, #64]
	ldur	d0, [x19, #12]
	fcvtl	v0.2d, v0.2s
	str	q0, [x8]
	ldr	x9, [x19, #40]
	str	w9, [x8, #16]
	mov	w0, #1
	b	LBB0_27
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdr	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdr	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"qp"

l_.str.1:                               ; @.str.1
	.asciz	"0"

l_.str.2:                               ; @.str.2
	.asciz	"libx264rgb"

l_.str.3:                               ; @.str.3
	.asciz	"[FFmpeg]: Cannot find vcodec %s.\n"

	.comm	_PIX_FMT_NONE,8,3               ; @PIX_FMT_NONE
	.comm	_SCALER_FMT_BGR24,8,3           ; @SCALER_FMT_BGR24
	.comm	_SCALER_FMT_ARGB8888,8,3        ; @SCALER_FMT_ARGB8888
	.comm	_SCALER_FMT_RGB565,8,3          ; @SCALER_FMT_RGB565
	.comm	_PIX_FMT_RGB565,4,2             ; @PIX_FMT_RGB565
	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ; @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_FLAG_QSCALE,4,2       ; @AV_CODEC_FLAG_QSCALE
	.comm	_AVFMT_GLOBALHEADER,4,2         ; @AVFMT_GLOBALHEADER
	.comm	_AV_CODEC_FLAG_GLOBAL_HEADER,4,2 ; @AV_CODEC_FLAG_GLOBAL_HEADER
	.no_dead_strip	_ffmpeg_init_video
.subsections_via_symbols
