	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function libdav1d_picture_allocator
_libdav1d_picture_allocator:            ## @libdav1d_picture_allocator
	.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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_pix_fmt@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	24(%rdi), %rcx
	movq	48(%rdi), %rdx
	movq	(%rax,%rcx,8), %rax
	movq	(%rdx), %rcx
	movl	(%rax,%rcx,4), %r14d
	movq	32(%rdi), %rdi
	movl	$128, %esi
	callq	_FFALIGN
	movl	%eax, %r15d
	movq	40(%r13), %rdi
	movl	$128, %esi
	callq	_FFALIGN
	movq	_DAV1D_PICTURE_ALIGNMENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rsp)
	leaq	-96(%rbp), %rdi
	leaq	-64(%rbp), %rsi
	xorl	%edx, %edx
	movl	%r14d, %ecx
	movl	%eax, %r8d
	movl	%r15d, %r9d
	callq	_av_image_fill_arrays
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_11
## %bb.1:
	movl	%r14d, -100(%rbp)               ## 4-byte Spill
	leaq	4(%r12), %r14
	cmpl	(%r12), %ebx
	jne	LBB0_3
## %bb.2:
	movl	(%r14), %edi
	jmp	LBB0_6
LBB0_3:
	movq	%r14, %rdi
	callq	_av_buffer_pool_uninit
	movq	_DAV1D_PICTURE_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rbx,%rax,2), %edi
	xorl	%esi, %esi
	callq	_av_buffer_pool_init
	movl	%eax, (%r14)
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movl	%eax, %edi
	movl	%ebx, (%r12)
LBB0_6:
	callq	_av_buffer_pool_get
	movq	%rax, -112(%rbp)
	testq	%rax, %rax
	movl	-100(%rbp), %ebx                ## 4-byte Reload
	je	LBB0_7
## %bb.8:
	movq	(%rax), %rdi
	movq	_DAV1D_PICTURE_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_FFALIGN
	movslq	%eax, %rcx
	leaq	-96(%rbp), %rdi
	leaq	-64(%rbp), %r8
	movl	%ebx, %esi
	movl	%r15d, %edx
	callq	_av_image_fill_pointers
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movq	-96(%rbp), %rax
	movq	16(%r13), %rcx
	movq	%rax, (%rcx)
	movq	-88(%rbp), %rax
	movq	16(%r13), %rcx
	movq	%rax, 8(%rcx)
	movq	-80(%rbp), %rax
	movq	16(%r13), %rcx
	movq	%rax, 16(%rcx)
	movl	-64(%rbp), %eax
	movq	(%r13), %rcx
	movl	%eax, (%rcx)
	movl	-60(%rbp), %eax
	movl	%eax, 4(%rcx)
	movq	-112(%rbp), %rax
	movq	%rax, 8(%r13)
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_9:
	movl	%eax, %ebx
	leaq	-112(%rbp), %rdi
	callq	_av_buffer_unref
	jmp	LBB0_11
LBB0_4:
	movl	$0, (%r12)
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_pix_fmt,8,3                    ## @pix_fmt
	.comm	_DAV1D_PICTURE_ALIGNMENT,4,2    ## @DAV1D_PICTURE_ALIGNMENT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_libdav1d_picture_allocator
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function libdav1d_picture_allocator
_libdav1d_picture_allocator:            ; @libdav1d_picture_allocator
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
Lloh3:
	adrp	x8, _pix_fmt@GOTPAGE
Lloh4:
	ldr	x8, [x8, _pix_fmt@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldp	x9, x0, [x0, #24]
	ldr	x8, [x8, x9, lsl #3]
	ldr	x9, [x19, #48]
	ldr	x9, [x9]
	ldr	w20, [x8, x9, lsl #2]
	mov	w1, #128
	bl	_FFALIGN
	mov	x21, x0
	ldr	x0, [x19, #40]
	mov	w1, #128
	bl	_FFALIGN
	mov	x4, x0
Lloh6:
	adrp	x25, _DAV1D_PICTURE_ALIGNMENT@GOTPAGE
Lloh7:
	ldr	x25, [x25, _DAV1D_PICTURE_ALIGNMENT@GOTPAGEOFF]
	ldr	w6, [x25]
	add	x0, sp, #8
	add	x1, sp, #40
	mov	x2, #0
	mov	x3, x20
	mov	x5, x21
	bl	_av_image_fill_arrays
	mov	x22, x0
	tbnz	w0, #31, LBB0_11
; %bb.1:
	mov	x24, x23
	ldr	w8, [x24], #4
	cmp	w22, w8
	b.ne	LBB0_3
; %bb.2:
	ldr	w0, [x24]
	b	LBB0_5
LBB0_3:
	mov	x0, x24
	bl	_av_buffer_pool_uninit
	ldr	w8, [x25]
	add	w0, w22, w8, lsl #1
	mov	x1, #0
	bl	_av_buffer_pool_init
	str	w0, [x24]
	cbz	w0, LBB0_9
; %bb.4:
	str	w22, [x23]
LBB0_5:
	bl	_av_buffer_pool_get
	str	x0, [sp]
	cbz	x0, LBB0_10
; %bb.6:
	ldr	x0, [x0]
	ldr	w1, [x25]
	bl	_FFALIGN
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x3, w0
	add	x0, sp, #8
	add	x4, sp, #40
	mov	x1, x20
	mov	x2, x21
	bl	_av_image_fill_pointers
	tbnz	w0, #31, LBB0_8
; %bb.7:
	mov	w22, #0
	ldr	x8, [sp, #8]
	ldr	x9, [x19, #16]
	str	x8, [x9]
	ldr	x8, [sp, #16]
	ldr	x9, [x19, #16]
	str	x8, [x9, #8]
	ldr	x8, [sp, #24]
	ldr	x9, [x19, #16]
	str	x8, [x9, #16]
	ldr	w8, [sp, #40]
	ldr	x9, [x19]
	str	w8, [x9]
	ldr	w8, [sp, #44]
	str	w8, [x9, #4]
	ldr	x8, [sp]
	str	x8, [x19, #8]
	b	LBB0_11
LBB0_8:
	mov	x22, x0
	mov	x0, sp
	bl	_av_buffer_unref
	b	LBB0_11
LBB0_9:
	str	wzr, [x23]
LBB0_10:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x22, x0
LBB0_11:
	ldr	x8, [sp, #56]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x22
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_pix_fmt,8,3                    ; @pix_fmt
	.comm	_DAV1D_PICTURE_ALIGNMENT,4,2    ; @DAV1D_PICTURE_ALIGNMENT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_libdav1d_picture_allocator
.subsections_via_symbols
