	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function libkvazaar_encode
_libkvazaar_encode:                     ## @libkvazaar_encode
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r15
	movq	$0, -96(%rbp)
	movq	$0, -80(%rbp)
	movq	$0, -88(%rbp)
	movl	$0, (%rcx)
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r13
	movq	(%rdx), %r9
	movq	16(%r15), %rax
	movq	(%rax), %rcx
	cmpq	%rcx, %r9
	jne	LBB0_3
## %bb.4:
	movq	8(%r13), %rsi
	movq	8(%rax), %r8
	cmpq	%r8, %rsi
	jne	LBB0_5
## %bb.6:
	movq	(%r12), %rdi
	cmpq	%rdi, 16(%r13)
	jne	LBB0_7
## %bb.8:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rax
	movq	%r9, %rdi
	callq	*24(%rax)
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, %rbx
	movq	(%r13), %r9
	movl	%r9d, -64(%rbp)
	movq	%r9, %rax
	shrq	$63, %rax
	addq	%r9, %rax
	shrq	%rax
	movl	%eax, -60(%rbp)
	movl	%eax, -56(%rbp)
	movl	$0, -52(%rbp)
	movl	8(%rbx), %edi
	movq	32(%r13), %rdx
	movl	28(%r13), %ecx
	movq	8(%r13), %rax
	movq	16(%r13), %r8
	movq	%rax, (%rsp)
	leaq	-64(%rbp), %rsi
                                        ## kill: def $r9d killed $r9d killed $r9
	callq	_av_image_copy
	movl	24(%r13), %eax
	movl	%eax, 4(%rbx)
	jmp	LBB0_11
LBB0_1:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
LBB0_11:
	movq	(%r15), %rax
	movl	8(%r15), %edi
	leaq	-64(%rbp), %rcx
	movq	%rcx, (%rsp)
	xorl	%r13d, %r13d
	leaq	-80(%rbp), %rdx
	leaq	-88(%rbp), %rcx
	leaq	-96(%rbp), %r8
	movq	%rbx, %rsi
	xorl	%r9d, %r9d
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_12
## %bb.14:
	cmpq	$0, -80(%rbp)
	je	LBB0_23
## %bb.15:
	movq	-88(%rbp), %rcx
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%rcx, %rdx
	callq	_ff_alloc_packet2
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_25
## %bb.16:
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	movq	-80(%rbp), %rbx
	testq	%rbx, %rbx
	je	LBB0_19
## %bb.17:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rax
	addq	%r12, %rax
	xorl	%edi, %edi
	cmpq	-88(%rbp), %rax
	setle	%dil
	callq	_av_assert0
	movq	(%r14), %rdi
	addq	%r12, %rdi
	movl	8(%rbx), %esi
	movq	(%rbx), %rdx
	callq	_memcpy
	addq	(%rbx), %r12
	movq	16(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_18
LBB0_19:
	movq	-96(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%ecx, 16(%r14)
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	movl	$0, 8(%r14)
	movq	-64(%rbp), %rax
	movq	_KVZ_NAL_BLA_W_LP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	jl	LBB0_22
## %bb.20:
	movq	_KVZ_NAL_RSV_IRAP_VCL23@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_22
## %bb.21:
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
LBB0_22:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	jmp	LBB0_23
LBB0_3:
	movq	8(%rax), %r8
	movq	8(%r13), %rsi
LBB0_5:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rsi, (%rsp)
	leaq	L_.str(%rip), %rdx
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_13
LBB0_12:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_13
LBB0_7:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	callq	_av_get_pix_fmt_name
	movl	%eax, %r14d
	movq	16(%r13), %rdi
	callq	_av_get_pix_fmt_name
	leaq	L_.str.1(%rip), %rdx
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movl	-72(%rbp), %esi                 ## 4-byte Reload
	movl	%r14d, %ecx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_av_log
LBB0_13:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_23:
	movq	(%r15), %rax
	movq	%rbx, %rdi
	callq	*16(%rax)
	movq	(%r15), %rax
	movq	-96(%rbp), %rdi
	callq	*16(%rax)
	movq	(%r15), %rax
	movq	-80(%rbp), %rdi
	callq	*8(%rax)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_26
## %bb.24:
	movl	%r13d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_23
LBB0_9:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r13d
	jmp	LBB0_23
LBB0_26:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Changing video dimensions during encoding is not supported. (changed from %dx%d to %dx%d)\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
L_.str.1:                               ## @.str.1
	.asciz	"Changing pixel format during encoding is not supported. (changed from %s to %s)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to allocate picture.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"Failed to encode frame.\n"

L_.str.4:                               ## @.str.4
	.asciz	"Failed to allocate output packet.\n"

	.comm	_KVZ_NAL_BLA_W_LP,8,3           ## @KVZ_NAL_BLA_W_LP
	.comm	_KVZ_NAL_RSV_IRAP_VCL23,8,3     ## @KVZ_NAL_RSV_IRAP_VCL23
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_libkvazaar_encode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function libkvazaar_encode
_libkvazaar_encode:                     ; @libkvazaar_encode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x20, x3
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #72]
	ldr	x24, [x0, #8]
	stp	xzr, xzr, [sp, #40]
	str	xzr, [sp, #32]
	str	wzr, [x3]
	cbz	x2, LBB0_6
; %bb.1:
	mov	x23, x2
	ldr	x0, [x2]
	ldr	x8, [x24, #16]
	ldr	x9, [x8]
	cmp	x0, x9
	b.ne	LBB0_16
; %bb.2:
	ldr	x1, [x23, #8]
	ldr	x10, [x8, #8]
	cmp	x1, x10
	b.ne	LBB0_17
; %bb.3:
	ldr	x9, [x23, #16]
	ldr	x8, [x21]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.4:
	ldr	x8, [x24]
	ldr	x8, [x8, #24]
	blr	x8
	mov	x19, x0
	cbz	x0, LBB0_26
; %bb.5:
	ldp	x5, x6, [x23]
	cmp	x5, #0
	cinc	x8, x5, lt
	lsr	x8, x8, #1
	stp	w5, w8, [sp, #56]
	stp	w8, wzr, [sp, #64]
	ldr	w0, [x19, #8]
	ldr	x2, [x23, #32]
	ldr	w3, [x23, #28]
	ldr	x4, [x23, #16]
	add	x1, sp, #56
                                        ; kill: def $w5 killed $w5 killed $x5
	bl	_av_image_copy
	ldr	w8, [x23, #24]
	str	w8, [x19, #4]
	b	LBB0_7
LBB0_6:
	mov	x19, #0
LBB0_7:
	ldr	x8, [x24]
	ldr	x8, [x8]
	ldr	w0, [x24, #8]
	add	x2, sp, #40
	add	x3, sp, #32
	add	x4, sp, #48
	add	x6, sp, #56
	mov	x1, x19
	mov	x5, #0
	blr	x8
	cbz	w0, LBB0_19
; %bb.8:
	ldr	x8, [sp, #40]
	cbz	x8, LBB0_23
; %bb.9:
	ldr	x2, [sp, #32]
	mov	x0, x21
	mov	x1, x22
	mov	x3, x2
	bl	_ff_alloc_packet2
	mov	x23, x0
	tbnz	w0, #31, LBB0_25
; %bb.10:
	ldr	x21, [sp, #40]
	cbz	x21, LBB0_13
; %bb.11:
	mov	x25, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	x9, [sp, #32]
	add	x8, x8, x25
	cmp	x8, x9
	cset	w0, le
	bl	_av_assert0
	ldr	x8, [x22]
	add	x0, x8, x25
	ldr	w1, [x21, #8]
	ldr	x2, [x21]
	bl	_memcpy
	ldr	x8, [x21]
	add	x25, x8, x25
	ldr	x21, [x21, #16]
	cbnz	x21, LBB0_12
LBB0_13:
	ldr	x8, [sp, #48]
	ldr	d0, [x8]
	stur	d0, [x22, #12]
	str	wzr, [x22, #8]
	ldr	x8, [sp, #56]
Lloh3:
	adrp	x9, _KVZ_NAL_BLA_W_LP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _KVZ_NAL_BLA_W_LP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _KVZ_NAL_RSV_IRAP_VCL23@GOTPAGE
Lloh7:
	ldr	x10, [x10, _KVZ_NAL_RSV_IRAP_VCL23@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #0, ge
	b.gt	LBB0_15
; %bb.14:
Lloh9:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x22, #8]
LBB0_15:
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_21
LBB0_16:
	ldr	x10, [x8, #8]
	ldr	x1, [x23, #8]
LBB0_17:
Lloh12:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	stp	x0, x1, [sp, #16]
	stp	x9, x10, [sp]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	mov	x1, x8
LBB0_18:
	bl	_av_log
	mov	x19, #0
	b	LBB0_20
LBB0_19:
Lloh17:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x2, l_.str.3@PAGE
Lloh21:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_av_log
LBB0_20:
Lloh22:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh24:
	ldr	w23, [x8]
LBB0_21:
	ldr	x8, [x24]
	ldr	x8, [x8, #16]
	mov	x0, x19
	blr	x8
	ldr	x8, [x24]
	ldr	x8, [x8, #16]
	ldr	x0, [sp, #48]
	blr	x8
	ldr	x8, [x24]
	ldr	x8, [x8, #8]
	ldr	x0, [sp, #40]
	blr	x8
	ldr	x8, [sp, #72]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.22:
	mov	x0, x23
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_23:
	mov	w23, #0
	b	LBB0_21
LBB0_24:
Lloh28:
	adrp	x9, _AV_LOG_ERROR@GOTPAGE
Lloh29:
	ldr	x9, [x9, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh30:
	ldr	w19, [x9]
	mov	x0, x8
	bl	_av_get_pix_fmt_name
	mov	x20, x0
	ldr	x0, [x23, #16]
	bl	_av_get_pix_fmt_name
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x20, x0, [sp]
Lloh31:
	adrp	x2, l_.str.1@PAGE
Lloh32:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x1, x19
	b	LBB0_18
LBB0_25:
Lloh33:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh34:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
Lloh36:
	adrp	x2, l_.str.4@PAGE
Lloh37:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_av_log
	b	LBB0_21
LBB0_26:
Lloh38:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh39:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
Lloh41:
	adrp	x2, l_.str.2@PAGE
Lloh42:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_av_log
Lloh43:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh44:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh45:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x23, x0
	b	LBB0_21
LBB0_27:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Changing video dimensions during encoding is not supported. (changed from %dx%d to %dx%d)\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
l_.str.1:                               ; @.str.1
	.asciz	"Changing pixel format during encoding is not supported. (changed from %s to %s)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to allocate picture.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"Failed to encode frame.\n"

l_.str.4:                               ; @.str.4
	.asciz	"Failed to allocate output packet.\n"

	.comm	_KVZ_NAL_BLA_W_LP,8,3           ; @KVZ_NAL_BLA_W_LP
	.comm	_KVZ_NAL_RSV_IRAP_VCL23,8,3     ; @KVZ_NAL_RSV_IRAP_VCL23
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_libkvazaar_encode
.subsections_via_symbols
