	.file	"extr_libzvbi-teletextdec.c_gen_sub_text.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"UTF-8"
.LC1:
	.string	"vbi_print error\n"
.LC2:
	.string	" \n"
.LC3:
	.string	"%s\n"
.LC4:
	.string	"subtext:%s:txetbus\n"
.LC5:
	.string	"\n"
	.text
	.p2align 4
	.type	gen_sub_text, @function
gen_sub_text:
.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
	mov	r14d, ecx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rdi, QWORD PTR TEXT_MAXSZ[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	av_malloc@PLT
	test	rax, rax
	je	.L23
	mov	rbp, rax
	mov	rcx, QWORD PTR [r12]
	mov	rax, QWORD PTR TEXT_MAXSZ[rip]
	mov	rdi, r12
	mov	r9d, DWORD PTR FALSE[rip]
	mov	r8d, DWORD PTR TRUE[rip]
	mov	rsi, rbp
	lea	rdx, -1[rax]
	movsx	rax, r14d
	sub	rcx, rax
	mov	eax, DWORD PTR 8[r12]
	push	rcx
	.cfi_def_cfa_offset 104
	lea	rcx, .LC0[rip]
	push	rax
	.cfi_def_cfa_offset 112
	push	r14
	.cfi_def_cfa_offset 120
	push	0
	.cfi_def_cfa_offset 128
	call	vbi_print_page_region@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 96
	test	eax, eax
	jle	.L26
	cdqe
	mov	r14, rsp
	xor	esi, esi
	mov	BYTE PTR 0[rbp+rax], 0
	mov	rdx, QWORD PTR TEXT_MAXSZ[rip]
	mov	rdi, r14
	call	av_bprint_init@PLT
	cmp	QWORD PTR 0[r13], 0
	jne	.L27
	mov	rdx, rbp
	lea	rsi, .LC3[rip]
	mov	rdi, r14
	xor	eax, eax
	call	av_bprintf@PLT
.L6:
	mov	rdi, rbp
	call	av_free@PLT
	mov	rdi, r14
	call	av_bprint_is_complete@PLT
	test	eax, eax
	je	.L22
	cmp	QWORD PTR 8[rsp], 0
	jne	.L28
	mov	eax, DWORD PTR SUBTITLE_NONE[rip]
	mov	DWORD PTR [rbx], eax
.L13:
	xor	esi, esi
	mov	rdi, r14
	call	av_bprint_finalize@PLT
	xor	eax, eax
.L1:
	mov	rbx, QWORD PTR 24[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L29
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L22:
	.cfi_restore_state
	xor	esi, esi
	mov	rdi, r14
	call	av_bprint_finalize@PLT
.L23:
	mov	edi, DWORD PTR ENOMEM[rip]
	call	AVERROR@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L26:
	mov	esi, DWORD PTR AV_LOG_ERROR[rip]
	lea	rdx, .LC1[rip]
	mov	rdi, r13
	xor	eax, eax
	call	av_log@PLT
	mov	rdi, rbp
	call	av_free@PLT
	mov	eax, DWORD PTR AVERROR_EXTERNAL[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L27:
	mov	r15, rbp
.L14:
	lea	rsi, .LC2[rip]
	mov	rdi, r15
	call	strspn@PLT
	movsx	r12, eax
	add	r12, r15
	movzx	edx, BYTE PTR [r12]
	test	dl, dl
	je	.L6
	xor	eax, eax
	lea	r15, [r12+rax]
	mov	esi, eax
	cmp	dl, 10
	je	.L30
.L7:
	add	rax, 1
	movzx	edx, BYTE PTR [r12+rax]
	test	dl, dl
	je	.L6
	lea	r15, [r12+rax]
	mov	esi, eax
	cmp	dl, 10
	jne	.L7
.L30:
	test	rax, rax
	jne	.L31
	xor	esi, esi
.L8:
	mov	rdi, r12
	call	chop_spaces_utf8@PLT
	mov	rsi, r12
	mov	rdi, r14
	mov	edx, eax
	call	av_bprint_append_data@PLT
	lea	rsi, .LC5[rip]
	mov	rdi, r14
	xor	eax, eax
	call	av_bprintf@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L28:
	mov	eax, DWORD PTR SUBTITLE_ASS[rip]
	mov	esi, DWORD PTR [rsp]
	mov	rdi, r13
	mov	DWORD PTR [rbx], eax
	call	create_ass_text@PLT
	mov	DWORD PTR 4[rbx], eax
	mov	ecx, eax
	test	eax, eax
	je	.L22
	mov	esi, DWORD PTR AV_LOG_DEBUG[rip]
	lea	rdx, .LC4[rip]
	mov	rdi, r13
	xor	eax, eax
	call	av_log@PLT
	jmp	.L13
.L29:
	call	__stack_chk_fail@PLT
.L31:
	cmp	BYTE PTR -1[r12+rax], 0
	js	.L7
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	gen_sub_text, .-gen_sub_text
	.comm	TRUE,4,4
	.comm	TEXT_MAXSZ,8,8
	.comm	SUBTITLE_NONE,4,4
	.comm	SUBTITLE_ASS,4,4
	.comm	FALSE,4,4
	.comm	ENOMEM,4,4
	.comm	AV_LOG_ERROR,4,4
	.comm	AV_LOG_DEBUG,4,4
	.comm	AVERROR_EXTERNAL,4,4
	.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_libzvbi-teletextdec.c_gen_sub_text.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"UTF-8\000"
	.align	2
.LC1:
	.ascii	"vbi_print error\012\000"
	.align	2
.LC2:
	.ascii	" \012\000"
	.align	2
.LC3:
	.ascii	"%s\012\000"
	.align	2
.LC4:
	.ascii	"subtext:%s:txetbus\012\000"
	.align	2
.LC5:
	.ascii	"\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	gen_sub_text, %function
gen_sub_text:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r9, .L35
	mov	r6, r3
	ldr	r3, .L35+4
	sub	sp, sp, #40
	mov	r7, r0
	ldr	r0, [r9]
	mov	r8, r1
	mov	r5, r2
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	bl	av_malloc
	subs	r4, r0, #0
	beq	.L25
	mov	r10, #0
	ldr	r1, .L35+8
	ldr	r2, .L35+12
	ldr	r1, [r1]
	ldr	r0, [r2]
	ldr	r3, [r5]
	str	r6, [sp, #12]
	ldr	r2, [r9]
	str	r1, [sp, #4]
	ldr	r1, [r5, #4]
	sub	r3, r3, r6
	str	r0, [sp]
	str	r3, [sp, #20]
	str	r1, [sp, #16]
	mov	r0, r5
	mov	r1, r4
	ldr	r3, .L35+16
	str	r10, [sp, #8]
	sub	r2, r2, #1
	bl	vbi_print_page_region
	cmp	r0, #0
	ble	.L28
	strb	r10, [r4, r0]
	mov	r1, r10
	ldr	r2, [r9]
	add	r0, sp, #28
	bl	av_bprint_init
	ldr	r3, [r7]
	cmp	r3, #0
	bne	.L29
	mov	r2, r4
	ldr	r1, .L35+20
	add	r0, sp, #28
	bl	av_bprintf
.L6:
	mov	r0, r4
	bl	av_free
	add	r0, sp, #28
	bl	av_bprint_is_complete
	subs	r1, r0, #0
	beq	.L24
	ldr	r3, [sp, #32]
	cmp	r3, #0
	bne	.L30
	ldr	r3, .L35+24
	ldr	r3, [r3]
	str	r3, [r8]
.L13:
	mov	r1, #0
	add	r0, sp, #28
	bl	av_bprint_finalize
	mov	r0, #0
.L1:
	ldr	r3, .L35+4
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L31
	add	sp, sp, #40
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L34:
	mov	r1, r0
.L24:
	add	r0, sp, #28
	bl	av_bprint_finalize
.L25:
	ldr	r3, .L35+28
	ldr	r0, [r3]
	bl	AVERROR
	b	.L1
.L28:
	ldr	r3, .L35+32
	ldr	r2, .L35+36
	ldr	r1, [r3]
	mov	r0, r7
	bl	av_log
	mov	r0, r4
	bl	av_free
	ldr	r3, .L35+40
	ldr	r0, [r3]
	b	.L1
.L29:
	mov	r5, r4
	ldr	r6, .L35+44
	ldr	r9, .L35+48
.L14:
	mov	r1, r6
	mov	r0, r5
	bl	strspn
	ldrb	r3, [r5, r0]	@ zero_extendqisi2
	add	r10, r5, r0
	cmp	r3, #0
	beq	.L6
	cmp	r3, #10
	mov	r5, r10
	mov	r1, #0
	beq	.L32
.L7:
	ldrb	r3, [r5, #1]!	@ zero_extendqisi2
	add	r1, r1, #1
	cmp	r3, #0
	beq	.L6
	cmp	r3, #10
	bne	.L7
.L32:
	cmp	r1, #0
	bne	.L33
.L8:
	mov	r0, r10
	bl	chop_spaces_utf8
	mov	r1, r10
	mov	r2, r0
	add	r0, sp, #28
	bl	av_bprint_append_data
	mov	r1, r9
	add	r0, sp, #28
	bl	av_bprintf
	b	.L14
.L30:
	ldr	r3, .L35+52
	mov	r0, r7
	ldr	r3, [r3]
	ldr	r1, [sp, #28]
	str	r3, [r8]
	bl	create_ass_text
	cmp	r0, #0
	mov	r3, r0
	str	r0, [r8, #4]
	beq	.L34
	ldr	r2, .L35+56
	mov	r0, r7
	ldr	r1, [r2]
	ldr	r2, .L35+60
	bl	av_log
	b	.L13
.L31:
	bl	__stack_chk_fail
.L33:
	ldrsb	r3, [r5, #-1]
	cmp	r3, #0
	blt	.L7
	b	.L8
.L36:
	.align	2
.L35:
	.word	TEXT_MAXSZ
	.word	.LC6
	.word	FALSE
	.word	TRUE
	.word	.LC0
	.word	.LC3
	.word	SUBTITLE_NONE
	.word	ENOMEM
	.word	AV_LOG_ERROR
	.word	.LC1
	.word	AVERROR_EXTERNAL
	.word	.LC2
	.word	.LC5
	.word	SUBTITLE_ASS
	.word	AV_LOG_DEBUG
	.word	.LC4
	.size	gen_sub_text, .-gen_sub_text
	.comm	TRUE,4,4
	.comm	TEXT_MAXSZ,4,4
	.comm	SUBTITLE_NONE,4,4
	.comm	SUBTITLE_ASS,4,4
	.comm	FALSE,4,4
	.comm	ENOMEM,4,4
	.comm	AV_LOG_ERROR,4,4
	.comm	AV_LOG_DEBUG,4,4
	.comm	AVERROR_EXTERNAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
