	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function downscale
_downscale:                             ## @downscale
	.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, %r14
	xorl	%eax, %eax
	callq	_av_frame_alloc
	movq	%rax, -32(%rbp)
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %r15
	movl	24(%r14), %eax
	movl	%eax, 24(%r15)
	movl	(%r14), %eax
	movl	%eax, %ecx
	incl	%ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	incl	%eax
	sarl	%eax
	movl	%eax, (%r15)
	movl	4(%r14), %eax
	movl	%eax, %ecx
	incl	%ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	incl	%eax
	sarl	%eax
	movl	%eax, 4(%r15)
	movq	%r15, %rdi
	movl	$32, %esi
	callq	_av_frame_get_buffer
	testq	%rax, %rax
	js	LBB0_10
## %bb.2:
	movl	4(%r15), %r9d
	testl	%r9d, %r9d
	jle	LBB0_12
## %bb.3:
	movq	8(%r15), %rax
	movq	(%rax), %rax
	movq	8(%r14), %rcx
	movq	16(%r14), %rdx
	movq	(%rcx), %rcx
	movq	(%rdx), %r10
	movq	16(%r15), %rdx
	movq	(%rdx), %r8
	movl	(%r15), %edx
	leaq	(%rcx,%r10,4), %rdi
	addq	$4, %rdi
	shlq	$3, %r10
	shlq	$2, %r8
	xorl	%r11d, %r11d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	incl	%r11d
	addq	%r10, %rdi
	addq	%r10, %rcx
	addq	%r8, %rax
	cmpl	%r9d, %r11d
	jge	LBB0_12
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	testl	%edx, %edx
	jle	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rcx,%rsi,8), %edx
	movl	(%rdi,%rsi,8), %ebx
	addl	4(%rcx,%rsi,8), %edx
	addl	-4(%rdi,%rsi,8), %edx
	addl	%ebx, %edx
	addl	$2, %edx
	sarl	$2, %edx
	movl	%edx, (%rax,%rsi,4)
	incq	%rsi
	movslq	(%r15), %rdx
	cmpq	%rdx, %rsi
	jl	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%r15), %r9d
	jmp	LBB0_4
LBB0_10:
	leaq	-32(%rbp), %rdi
	callq	_av_frame_free
LBB0_11:
	xorl	%r15d, %r15d
LBB0_12:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_downscale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function downscale
_downscale:                             ; @downscale
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x0
	bl	_av_frame_alloc
	mov	x19, x0
	str	x0, [sp, #8]
	cbz	x0, LBB0_10
; %bb.1:
	ldr	w8, [x20, #24]
	str	w8, [x19, #24]
	ldp	w8, w9, [x20]
	add	w10, w8, #1
	cmp	w10, #0
	add	w10, w8, #2
	csinc	w8, w10, w8, lt
	asr	w8, w8, #1
	add	w10, w9, #1
	cmp	w10, #0
	add	w10, w9, #2
	csinc	w9, w10, w9, lt
	asr	w9, w9, #1
	stp	w8, w9, [x19]
	mov	x0, x19
	mov	w1, #32
	bl	_av_frame_get_buffer
	tbnz	x0, #63, LBB0_9
; %bb.2:
	ldr	w15, [x19, #4]
	cmp	w15, #1
	b.lt	LBB0_10
; %bb.3:
	mov	w8, #0
	ldp	x9, x12, [x19, #8]
	ldr	x9, [x9]
	ldp	x10, x11, [x20, #8]
	ldr	x10, [x10]
	ldr	x11, [x11]
	ldr	x12, [x12]
	lsl	x12, x12, #2
	ldr	w16, [x19]
	lsl	x13, x11, #2
	lsl	x14, x11, #3
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w8, w8, #1
	add	x9, x9, x12
	add	x10, x10, x14
	cmp	w8, w15
	b.ge	LBB0_10
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	cmp	w16, #1
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x15, #0
	mov	x17, x10
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	w16, w0, [x17]
	add	x1, x17, x13
	ldr	w2, [x17, x11, lsl #2]
	ldr	w1, [x1, #4]
	add	w16, w16, w0
	add	w16, w16, w2
	add	w16, w16, w1
	add	w16, w16, #2
	asr	w16, w16, #2
	str	w16, [x9, x15, lsl #2]
	add	x15, x15, #1
	ldrsw	x16, [x19]
	add	x17, x17, #8
	cmp	x15, x16
	b.lt	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w15, [x19, #4]
	b	LBB0_4
LBB0_9:
	add	x0, sp, #8
	bl	_av_frame_free
	mov	x19, #0
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_downscale
.subsections_via_symbols
