	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flac_finish_header
_flac_finish_header:                    ## @flac_finish_header
	.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	%rdi, %r12
	movl	(%rdi), %eax
	testl	%eax, %eax
	movl	$8192, %edi                     ## imm = 0x2000
	cmovnsl	%eax, %edi
	movl	$24, %esi
	callq	_av_clip_uintp2
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmpl	$0, 4(%r12)
	jle	LBB0_6
## %bb.1:
	xorl	%ebx, %ebx
	movq	_AV_EF_EXPLODE@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movslq	4(%r12), %rax
	cmpq	%rax, %rbx
	jge	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax), %r13
	testq	%r13, %r13
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_flac_write_picture
	movl	%eax, %r15d
	movq	%r13, %rdi
	callq	_av_packet_unref
	testl	%r15d, %r15d
	jns	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r14), %eax
	testl	%eax, 8(%r12)
	je	LBB0_5
	jmp	LBB0_9
LBB0_6:
	movl	16(%r12), %edi
	leaq	20(%r12), %rsi
	xorl	%edx, %edx
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	sete	%dl
	movq	_AVFMT_FLAG_BITEXACT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	12(%r12), %ecx
	callq	_flac_write_block_comment
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:
	testl	%ebx, %ebx
	je	LBB0_9
## %bb.8:
	movl	16(%r12), %edi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_flac_write_block_padding
	xorl	%r15d, %r15d
LBB0_9:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_EF_EXPLODE,4,2              ## @AV_EF_EXPLODE
	.comm	_AVFMT_FLAG_BITEXACT,4,2        ## @AVFMT_FLAG_BITEXACT
	.no_dead_strip	_flac_finish_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flac_finish_header
_flac_finish_header:                    ; @flac_finish_header
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	w8, [x0]
	mov	w9, #8192
	cmp	w8, #0
	csel	w0, w9, w8, lt
	mov	w1, #24
	bl	_av_clip_uintp2
	mov	x20, x0
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x23, #0
Lloh0:
	adrp	x24, _AV_EF_EXPLODE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _AV_EF_EXPLODE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x19, #4]
	cmp	x23, x8
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x23, lsl #3]
	ldr	x22, [x8]
	cbz	x22, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_flac_write_picture
	mov	x21, x0
	mov	x0, x22
	bl	_av_packet_unref
	tbz	w21, #31, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19, #8]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_2
	b	LBB0_8
LBB0_6:
	add	x1, x19, #20
	cmp	w20, #0
	cset	w2, eq
	ldp	w8, w0, [x19, #12]
Lloh2:
	adrp	x9, _AVFMT_FLAG_BITEXACT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AVFMT_FLAG_BITEXACT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	and	w3, w9, w8
	bl	_flac_write_block_comment
	mov	x21, x0
	cmp	w0, #0
	ccmp	w20, #0, #4, eq
	b.eq	LBB0_8
; %bb.7:
	ldr	w0, [x19, #16]
	mov	x1, x20
	mov	w2, #1
	bl	_flac_write_block_padding
	mov	w21, #0
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_EF_EXPLODE,4,2              ; @AV_EF_EXPLODE
	.comm	_AVFMT_FLAG_BITEXACT,4,2        ; @AVFMT_FLAG_BITEXACT
	.no_dead_strip	_flac_finish_header
.subsections_via_symbols
