	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_trailer
_write_trailer:                         ## @write_trailer
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r12
	movq	8(%rdi), %r15
	movq	$0, -48(%rbp)
	movq	$0, -56(%rbp)
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r14d
	movl	8(%r15), %edi
	callq	_chromaprint_finish
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movl	8(%r15), %edi
	leaq	-48(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	callq	_chromaprint_get_raw_fingerprint
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movl	(%r15), %eax
	leal	-129(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_6
## %bb.8:
	movq	-48(%rbp), %rdi
	movl	-36(%rbp), %esi
	movl	4(%r15), %edx
	xorl	%r9d, %r9d
	cmpl	$130, %eax
	sete	%r9b
	leaq	-56(%rbp), %rcx
	leaq	-60(%rbp), %r8
	callq	_chromaprint_encode_fingerprint
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movq	-56(%rbp), %rsi
	movl	-60(%rbp), %edx
	jmp	LBB0_11
LBB0_1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_2
LBB0_4:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_2
LBB0_6:
	cmpl	$128, %eax
	jne	LBB0_12
## %bb.7:
	movq	-48(%rbp), %rsi
	movl	-36(%rbp), %edx
	shll	$2, %edx
LBB0_11:
	movq	%r12, %rdi
	callq	_avio_write
LBB0_12:
	xorl	%r14d, %r14d
	jmp	LBB0_13
LBB0_9:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
LBB0_2:
	movq	%rbx, %rdi
	callq	_av_log
LBB0_13:
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:
	callq	_chromaprint_dealloc
LBB0_15:
	movq	-56(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:
	callq	_chromaprint_dealloc
LBB0_17:
	movq	%r15, %rdi
	callq	_cleanup
	movl	%r14d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to generate fingerprint\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to retrieve fingerprint\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to encode fingerprint\n"

	.no_dead_strip	_write_trailer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_trailer
_write_trailer:                         ; @write_trailer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x0
	ldp	x22, x19, [x0]
	stp	xzr, xzr, [sp, #16]
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x20, x0
	ldr	w0, [x19, #8]
	bl	_chromaprint_finish
	cbz	w0, LBB0_5
; %bb.1:
	ldr	w0, [x19, #8]
	add	x1, sp, #24
	add	x2, sp, #12
	bl	_chromaprint_get_raw_fingerprint
	cbz	w0, LBB0_6
; %bb.2:
	ldr	w8, [x19]
	sub	w9, w8, #129
	cmp	w9, #2
	b.hs	LBB0_7
; %bb.3:
	ldr	x0, [sp, #24]
	ldr	w1, [sp, #12]
	ldr	w2, [x19, #4]
	cmp	w8, #130
	cset	w5, eq
	add	x3, sp, #16
	add	x4, sp, #8
	bl	_chromaprint_encode_fingerprint
	cbz	w0, LBB0_11
; %bb.4:
	ldr	x1, [sp, #16]
	ldr	w2, [sp, #8]
	b	LBB0_9
LBB0_5:
Lloh3:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_12
LBB0_6:
Lloh8:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str.1@PAGE
Lloh12:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_7:
	cmp	w8, #128
	b.ne	LBB0_10
; %bb.8:
	ldr	x1, [sp, #24]
	ldr	w8, [sp, #12]
	lsl	w2, w8, #2
LBB0_9:
	mov	x0, x22
	bl	_avio_write
LBB0_10:
	mov	w20, #0
	ldr	x0, [sp, #24]
	cbnz	x0, LBB0_13
	b	LBB0_14
LBB0_11:
Lloh13:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x2, l_.str.2@PAGE
Lloh17:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_12:
	mov	x0, x21
	bl	_av_log
	ldr	x0, [sp, #24]
	cbz	x0, LBB0_14
LBB0_13:
	bl	_chromaprint_dealloc
LBB0_14:
	ldr	x0, [sp, #16]
	cbz	x0, LBB0_16
; %bb.15:
	bl	_chromaprint_dealloc
LBB0_16:
	mov	x0, x19
	bl	_cleanup
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to generate fingerprint\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to retrieve fingerprint\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to encode fingerprint\n"

	.no_dead_strip	_write_trailer
.subsections_via_symbols
