	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function query_frame
_query_frame:                           ## @query_frame
	.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, %r13
	movq	%rdi, %r14
	movq	16(%rsi), %r12
	leaq	8(%rdi), %rbx
	movl	8(%rdi), %edi
	callq	_clear_unused_frames
	movq	%rbx, %rdi
	callq	_get_free_frame
	testq	%rax, %rax
	je	LBB0_13
## %bb.1:
	movq	%rax, %r15
	movl	4(%r14), %edi
	callq	_IS_SYSTEM_MEMORY
	testl	%eax, %eax
	je	LBB0_6
## %bb.2:
	movl	4(%r13), %edi
	movl	$128, %esi
	callq	_FFALIGN
	movl	%eax, %ebx
	movl	(%r13), %edi
	movl	$64, %esi
	callq	_FFALIGN
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_ff_get_video_buffer
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_13
## %bb.3:
	movl	4(%r13), %ecx
	movl	%ecx, 4(%rax)
	movl	(%r13), %ecx
	movl	%ecx, (%rax)
	movq	%r15, %rbx
	addq	$8, %rbx
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_map_frame_to_surface
	testl	%eax, %eax
	jns	LBB0_9
	jmp	LBB0_13
LBB0_6:
	xorl	%eax, %eax
	callq	_av_frame_alloc
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_13
## %bb.7:
	movl	8(%r13), %edi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_av_hwframe_get_buffer
	testl	%eax, %eax
	js	LBB0_12
## %bb.8:
	movq	16(%r15), %rax
	movq	8(%rax), %rax
	movq	24(%rax), %rbx
LBB0_9:
	movq	%rbx, (%r15)
	movl	(%r14), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_14
LBB0_12:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
LBB0_13:
	xorl	%r15d, %r15d
LBB0_14:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't allocate a surface.\n"

	.no_dead_strip	_query_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function query_frame
_query_frame:                           ; @query_frame
	.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	x21, x1
	mov	x20, x0
	ldr	x22, [x1, #16]
	mov	x19, x0
	ldr	w0, [x19, #8]!
	bl	_clear_unused_frames
	mov	x0, x19
	bl	_get_free_frame
	mov	x19, x0
	cbz	x0, LBB0_10
; %bb.1:
	ldr	w0, [x20, #4]
	bl	_IS_SYSTEM_MEMORY
	cbz	w0, LBB0_4
; %bb.2:
	ldr	w0, [x21, #4]
	mov	w1, #128
	bl	_FFALIGN
	mov	x22, x0
	ldr	w0, [x21]
	mov	w1, #64
	bl	_FFALIGN
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_ff_get_video_buffer
	str	x0, [x19, #16]
	cbz	x0, LBB0_9
; %bb.3:
	ldr	d0, [x21]
	str	d0, [x0]
	add	x21, x19, #8
	mov	x1, x21
	bl	_map_frame_to_surface
	tbz	w0, #31, LBB0_7
	b	LBB0_9
LBB0_4:
	bl	_av_frame_alloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_9
; %bb.5:
	mov	x1, x0
	ldr	w0, [x21, #8]
	mov	w2, #0
	bl	_av_hwframe_get_buffer
	tbnz	w0, #31, LBB0_8
; %bb.6:
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #8]
	ldr	x21, [x8, #24]
LBB0_7:
	str	x21, [x19]
	ldr	w8, [x20]
	str	w8, [x21]
	b	LBB0_10
LBB0_8:
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	bl	_av_log
LBB0_9:
	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
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't allocate a surface.\n"

	.no_dead_strip	_query_frame
.subsections_via_symbols
