	.file	"extr_id3v2enc.c_write_ctoc.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"toc"
.LC1:
	.string	"ch%d"
	.text
	.p2align 4
	.type	write_ctoc, @function
write_ctoc:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 168
	.cfi_def_cfa_offset 224
	mov	r13d, DWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 152[rsp], rax
	xor	eax, eax
	mov	QWORD PTR [rsp], 0
	mov	QWORD PTR 8[rsp], 0
	test	r13d, r13d
	jne	.L18
.L1:
	mov	rax, QWORD PTR 152[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L19
	add	rsp, 168
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	r12, rdi
	lea	rdi, 8[rsp]
	mov	rbp, rsi
	mov	r14, rsp
	call	avio_open_dyn_buf@PLT
	mov	r13d, eax
	test	eax, eax
	js	.L3
	mov	rdi, QWORD PTR 8[rsp]
	lea	rsi, .LC0[rip]
	call	avio_put_str@PLT
	add	DWORD PTR 0[rbp], eax
	mov	rdi, QWORD PTR 8[rsp]
	mov	esi, 3
	call	avio_w8@PLT
	mov	esi, DWORD PTR [r12]
	mov	rdi, QWORD PTR 8[rsp]
	call	avio_w8@PLT
	mov	eax, DWORD PTR [r12]
	test	eax, eax
	jle	.L4
	xor	ebx, ebx
	lea	r14, 16[rsp]
	lea	r15, .LC1[rip]
	.p2align 4,,10
	.p2align 3
.L5:
	mov	ecx, ebx
	mov	rdx, r15
	mov	esi, 122
	mov	rdi, r14
	call	snprintf@PLT
	mov	rdi, QWORD PTR 8[rsp]
	mov	rsi, r14
	add	ebx, 1
	call	avio_put_str@PLT
	add	DWORD PTR 0[rbp], eax
	cmp	DWORD PTR [r12], ebx
	jg	.L5
.L4:
	mov	rdi, QWORD PTR 8[rsp]
	mov	r14, rsp
	mov	rsi, r14
	call	avio_close_dyn_buf@PLT
	mov	edx, 79
	mov	ecx, 67
	mov	esi, 84
	mov	r15d, eax
	mov	eax, DWORD PTR ID3v2_HEADER_SIZE[rip]
	mov	edi, 67
	add	eax, 16
	add	DWORD PTR 0[rbp], eax
	call	MKBETAG@PLT
	mov	edi, DWORD PTR 4[r12]
	mov	esi, eax
	call	avio_wb32@PLT
	mov	edi, DWORD PTR 4[r12]
	mov	esi, r15d
	call	avio_wb32@PLT
	mov	edi, DWORD PTR 4[r12]
	xor	esi, esi
	call	avio_wb16@PLT
	mov	edi, DWORD PTR 4[r12]
	mov	rsi, QWORD PTR [rsp]
	mov	edx, r15d
	call	avio_write@PLT
.L3:
	mov	rdi, QWORD PTR 8[rsp]
	test	rdi, rdi
	je	.L6
	cmp	QWORD PTR [rsp], 0
	je	.L20
.L6:
	mov	rdi, r14
	call	av_freep@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rsi, r14
	call	avio_close_dyn_buf@PLT
	jmp	.L6
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	write_ctoc, .-write_ctoc
	.comm	ID3v2_HEADER_SIZE,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_id3v2enc.c_write_ctoc.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"toc\000"
	.align	2
.LC1:
	.ascii	"ch%d\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_ctoc, %function
write_ctoc:
	@ args = 0, pretend = 0, frame = 136
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, #0
	ldr	r7, [r0]
	ldr	r3, .L22
	sub	sp, sp, #136
	cmp	r7, r4
	ldr	r3, [r3]
	str	r3, [sp, #132]
	mov	r3,#0
	str	r4, [sp]
	str	r4, [sp, #4]
	bne	.L19
.L1:
	ldr	r3, .L22
	ldr	r2, [r3]
	ldr	r3, [sp, #132]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L20
	mov	r0, r7
	add	sp, sp, #136
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L19:
	mov	r6, r0
	add	r0, sp, #4
	mov	r5, r1
	bl	avio_open_dyn_buf
	subs	r7, r0, #0
	movlt	r8, sp
	blt	.L3
	ldr	r1, .L22+4
	ldr	r0, [sp, #4]
	bl	avio_put_str
	ldr	r3, [r5]
	mov	r1, #3
	add	r3, r3, r0
	str	r3, [r5]
	ldr	r0, [sp, #4]
	bl	avio_w8
	ldr	r1, [r6]
	ldr	r0, [sp, #4]
	bl	avio_w8
	ldr	r3, [r6]
	cmp	r3, #0
	ble	.L4
	ldr	r8, .L22+8
.L5:
	mov	r3, r4
	mov	r2, r8
	mov	r1, #122
	add	r0, sp, #8
	bl	snprintf
	add	r1, sp, #8
	ldr	r0, [sp, #4]
	bl	avio_put_str
	ldr	r1, [r6]
	ldr	r3, [r5]
	add	r4, r4, #1
	add	r3, r3, r0
	cmp	r1, r4
	str	r3, [r5]
	bgt	.L5
.L4:
	mov	r8, sp
	ldr	r0, [sp, #4]
	mov	r1, r8
	bl	avio_close_dyn_buf
	mov	r3, #67
	ldr	r1, .L22+12
	ldr	r2, [r5]
	ldr	r1, [r1]
	mov	r4, r0
	add	r1, r1, #16
	add	r2, r2, r1
	mov	r0, r3
	str	r2, [r5]
	mov	r1, #84
	mov	r2, #79
	ldr	r5, [r6, #4]
	bl	MKBETAG
	mov	r1, r0
	mov	r0, r5
	bl	avio_wb32
	mov	r1, r4
	ldr	r0, [r6, #4]
	bl	avio_wb32
	mov	r1, #0
	ldr	r0, [r6, #4]
	bl	avio_wb16
	mov	r2, r4
	ldr	r0, [r6, #4]
	ldr	r1, [sp]
	bl	avio_write
.L3:
	ldr	r0, [sp, #4]
	cmp	r0, #0
	beq	.L6
	ldr	r3, [sp]
	cmp	r3, #0
	beq	.L21
.L6:
	mov	r0, r8
	bl	av_freep
	b	.L1
.L21:
	mov	r1, r8
	bl	avio_close_dyn_buf
	b	.L6
.L20:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.word	ID3v2_HEADER_SIZE
	.size	write_ctoc, .-write_ctoc
	.comm	ID3v2_HEADER_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
