	.file	"extr_hapdec.c_hap_decode.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Invalid section type in 2 textures mode %#04x.\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"Insufficient data\n"
	.text
	.p2align 4
	.type	hap_decode, @function
hap_decode:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xor	ebp, ebp
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	r14, QWORD PTR 24[rdi]
	mov	esi, DWORD PTR 4[rcx]
	mov	QWORD PTR 16[rsp], rdx
	mov	edx, DWORD PTR [rcx]
	mov	QWORD PTR 24[rsp], rcx
	lea	r12, 40[r14]
	mov	rdi, r12
	mov	rbx, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rbx
	xor	ebx, ebx
	mov	DWORD PTR 52[rsp], 0
	call	bytestream2_init@PLT
	mov	eax, DWORD PTR [r14]
	cmp	DWORD PTR 4[r14], 2
	mov	DWORD PTR 48[rsp], eax
	je	.L25
.L2:
	xor	edx, edx
	lea	rsi, 40[rsp]
	mov	rdi, r15
	mov	QWORD PTR 40[rsp], r13
	call	ff_thread_get_buffer@PLT
	test	eax, eax
	js	.L1
	lea	rax, 32[r14]
	xor	ebx, ebx
	mov	QWORD PTR 8[rsp], rax
	mov	eax, DWORD PTR 4[r14]
	test	eax, eax
	jg	.L5
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L28:
	mov	r8d, DWORD PTR 28[r14]
	mov	rdx, QWORD PTR 40[rsp]
	xor	ecx, ecx
	mov	rdi, r15
	mov	esi, DWORD PTR decompress_texture_thread[rip]
	call	[QWORD PTR 8[r15]]
.L14:
	add	rbx, 1
	cmp	DWORD PTR 4[r14], ebx
	jle	.L15
.L5:
	mov	edx, DWORD PTR SEEK_SET[rip]
	mov	rdi, r12
	mov	esi, ebp
	call	bytestream2_seek@PLT
	mov	rdi, r15
	call	hap_parse_frame_header@PLT
	test	eax, eax
	js	.L1
	mov	rax, QWORD PTR 48[r14]
	lea	ebp, 4[rbp+rax]
	mov	rax, QWORD PTR 16[r15]
	cmp	QWORD PTR [rax], 0
	jne	.L26
	mov	rdi, r14
	call	hap_can_use_tex_in_place@PLT
	test	rax, rax
	je	.L7
.L30:
	mov	eax, DWORD PTR 40[r14]
	mov	rdi, r12
	mov	DWORD PTR 36[r14], eax
	call	bytestream2_get_bytes_left@PLT
	mov	rdi, QWORD PTR 48[r14]
	mov	esi, eax
	call	FFMIN@PLT
	mov	esi, eax
.L8:
	mov	eax, DWORD PTR [r15]
	cdq
	idiv	DWORD PTR TEXTURE_BLOCK_W[rip]
	mov	ecx, eax
	mov	eax, DWORD PTR 4[r15]
	cdq
	idiv	DWORD PTR TEXTURE_BLOCK_H[rip]
	imul	eax, ecx
	imul	eax, DWORD PTR 48[rsp+rbx*4]
	cmp	eax, esi
	jg	.L27
	test	rbx, rbx
	je	.L28
	mov	QWORD PTR 40[rsp], r13
	mov	r8d, DWORD PTR 28[r14]
	xor	ecx, ecx
	mov	rdx, r13
	mov	esi, DWORD PTR decompress_texture2_thread[rip]
	mov	rdi, r15
	call	[QWORD PTR 8[r15]]
	jmp	.L14
.L15:
	mov	rax, QWORD PTR 40[rsp]
	mov	edx, DWORD PTR AV_PICTURE_TYPE_I[rip]
	mov	DWORD PTR [rax], 1
	mov	DWORD PTR 4[rax], edx
	mov	rax, QWORD PTR 16[rsp]
	mov	DWORD PTR [rax], 1
	mov	rax, QWORD PTR 24[rsp]
	mov	eax, DWORD PTR [rax]
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rbx, QWORD PTR 56[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L29
	add	rsp, 72
	.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
.L26:
	.cfi_restore_state
	mov	rdi, r15
	call	ff_thread_finish_setup@PLT
	mov	rdi, r14
	call	hap_can_use_tex_in_place@PLT
	test	rax, rax
	jne	.L30
.L7:
	mov	esi, DWORD PTR 8[r14]
	mov	rdi, QWORD PTR 8[rsp]
	call	av_reallocp@PLT
	test	eax, eax
	js	.L1
	mov	rcx, QWORD PTR 16[r14]
	mov	r8d, DWORD PTR 24[r14]
	xor	edx, edx
	mov	rdi, r15
	mov	esi, DWORD PTR decompress_chunks_thread[rip]
	call	[QWORD PTR 8[r15]]
	mov	eax, DWORD PTR 24[r14]
	test	eax, eax
	jle	.L9
	mov	rdx, QWORD PTR 16[r14]
	sub	eax, 1
	lea	rcx, 8[rdx+rax*8]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L31:
	add	rdx, 8
	cmp	rcx, rdx
	je	.L9
.L11:
	mov	rax, QWORD PTR [rdx]
	test	rax, rax
	jns	.L31
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	mov	eax, DWORD PTR 32[r14]
	mov	esi, DWORD PTR 8[r14]
	mov	DWORD PTR 36[r14], eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L25:
	lea	rdx, 36[rsp]
	lea	rsi, 32[rsp]
	mov	rdi, r12
	call	ff_hap_parse_section_header@PLT
	test	eax, eax
	jne	.L1
	mov	ecx, DWORD PTR 36[rsp]
	mov	eax, ecx
	and	eax, 15
	cmp	eax, 13
	jne	.L32
	mov	eax, DWORD PTR 56[r14]
	mov	ebp, 4
	mov	DWORD PTR 52[rsp], eax
	jmp	.L2
.L32:
	mov	esi, DWORD PTR AV_LOG_ERROR[rip]
	lea	rdx, .LC0[rip]
	mov	rdi, r15
	xor	eax, eax
	call	av_log@PLT
	mov	eax, DWORD PTR AVERROR_INVALIDDATA[rip]
	jmp	.L1
.L27:
	mov	esi, DWORD PTR AV_LOG_ERROR[rip]
	lea	rdx, .LC1[rip]
	mov	rdi, r15
	xor	eax, eax
	call	av_log@PLT
	mov	eax, DWORD PTR AVERROR_INVALIDDATA[rip]
	jmp	.L1
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	hap_decode, .-hap_decode
	.comm	decompress_texture_thread,4,4
	.comm	decompress_texture2_thread,4,4
	.comm	decompress_chunks_thread,4,4
	.comm	TEXTURE_BLOCK_W,4,4
	.comm	TEXTURE_BLOCK_H,4,4
	.comm	SEEK_SET,4,4
	.comm	AV_PICTURE_TYPE_I,4,4
	.comm	AV_LOG_ERROR,4,4
	.comm	AVERROR_INVALIDDATA,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_hapdec.c_hap_decode.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Invalid section type in 2 textures mode %#04x.\012\000"
	.global	__aeabi_idiv
	.align	2
.LC1:
	.ascii	"Insufficient data\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	hap_decode, %function
hap_decode:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	mov	r0, r3
	sub	sp, sp, #52
	str	r3, [sp, #20]
	mov	r3, r2
	mov	r9, r1
	mov	r1, r0
	mov	r6, #0
	ldr	r4, [r5, #16]
	str	r3, [sp, #16]
	add	r8, r4, #32
	ldr	r3, .L36
	ldr	r2, [r0]
	ldr	r1, [r1, #4]
	mov	r0, r8
	ldr	r3, [r3]
	str	r3, [sp, #44]
	mov	r3,#0
	str	r6, [sp, #40]
	bl	bytestream2_init
	ldr	r2, [r4, #4]
	ldr	r3, [r4]
	cmp	r2, #2
	str	r3, [sp, #36]
	beq	.L28
.L2:
	mov	r2, #0
	mov	r0, r5
	add	r1, sp, #24
	str	r9, [sp, #24]
	bl	ff_thread_get_buffer
	cmp	r0, #0
	blt	.L1
	ldr	r3, [r4, #4]
	cmp	r3, #0
	ble	.L15
	add	r3, r4, #24
	mov	r7, #0
	add	r10, sp, #36
	str	r3, [sp, #12]
	str	r9, [sp, #8]
	b	.L14
.L31:
	ldr	r1, .L36+4
	ldr	fp, [r5, #8]
	str	r3, [sp]
	mov	r0, r5
	mov	r3, r7
	ldr	r2, [sp, #24]
	ldr	r1, [r1]
	blx	fp
.L13:
	ldr	r3, [r4, #4]
	add	r7, r7, #1
	cmp	r3, r7
	ble	.L15
.L14:
	ldr	r3, .L36+8
	mov	r1, r6
	ldr	r2, [r3]
	mov	r0, r8
	bl	bytestream2_seek
	mov	r0, r5
	bl	hap_parse_frame_header
	cmp	r0, #0
	blt	.L1
	ldr	r2, [r5, #12]
	ldr	r3, [r4, #36]
	ldr	r2, [r2]
	add	r3, r3, #4
	cmp	r2, #0
	add	r6, r6, r3
	bne	.L29
	mov	r0, r4
	bl	hap_can_use_tex_in_place
	subs	r9, r0, #0
	beq	.L7
.L33:
	ldr	r3, [r4, #32]
	mov	r0, r8
	str	r3, [r4, #28]
	ldr	fp, [r4, #36]
	bl	bytestream2_get_bytes_left
	mov	r1, r0
	mov	r0, fp
	bl	FFMIN
	mov	r9, r0
.L8:
	ldr	r3, .L36+12
	ldr	r0, [r5]
	ldr	r1, [r3]
	bl	__aeabi_idiv
	ldr	r3, .L36+16
	mov	fp, r0
	ldr	r1, [r3]
	ldr	r0, [r5, #4]
	bl	__aeabi_idiv
	mul	fp, r0, fp
	ldr	r0, [r10], #4
	mul	fp, r0, fp
	cmp	fp, r9
	bgt	.L30
	cmp	r7, #0
	ldr	r3, [r4, #20]
	beq	.L31
	ldr	r2, [sp, #8]
	ldr	r1, .L36+20
	str	r3, [sp]
	mov	r0, r5
	mov	r3, #0
	ldr	fp, [r5, #8]
	ldr	r1, [r1]
	str	r2, [sp, #24]
	blx	fp
	b	.L13
.L15:
	mov	r3, #1
	ldr	r1, .L36+24
	ldr	r2, [sp, #24]
	ldr	r1, [r1]
	str	r3, [r2]
	str	r1, [r2, #4]
	ldr	r2, [sp, #16]
	str	r3, [r2]
	ldr	r3, [sp, #20]
	ldr	r0, [r3]
.L1:
	ldr	r3, .L36
	ldr	r2, [r3]
	ldr	r3, [sp, #44]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L32
	add	sp, sp, #52
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L29:
	mov	r0, r5
	bl	ff_thread_finish_setup
	mov	r0, r4
	bl	hap_can_use_tex_in_place
	subs	r9, r0, #0
	bne	.L33
.L7:
	ldr	r1, [r4, #8]
	ldr	r0, [sp, #12]
	bl	av_reallocp
	cmp	r0, #0
	blt	.L1
	ldr	r1, [r4, #16]
	ldr	r3, [r4, #12]
	str	r1, [sp]
	ldr	r1, .L36+28
	mov	r2, r9
	ldr	r1, [r1]
	mov	r0, r5
	ldr	fp, [r5, #8]
	blx	fp
	ldr	r1, [r4, #16]
	cmp	r1, #0
	ble	.L9
	ldr	r3, [r4, #12]
	sub	r3, r3, #4
	b	.L10
.L34:
	add	r9, r9, #1
	cmp	r1, r9
	beq	.L9
.L10:
	ldr	r0, [r3, #4]!
	cmp	r0, #0
	bge	.L34
	b	.L1
.L9:
	ldr	r2, [r4, #24]
	ldr	r9, [r4, #8]
	str	r2, [r4, #28]
	b	.L8
.L28:
	mov	r0, r8
	add	r2, sp, #32
	add	r1, sp, #28
	bl	ff_hap_parse_section_header
	cmp	r0, #0
	bne	.L1
	ldr	r3, [sp, #32]
	and	r2, r3, #15
	cmp	r2, #13
	ldreq	r3, [r4, #40]
	moveq	r6, #4
	streq	r3, [sp, #40]
	beq	.L2
.L35:
	ldr	r2, .L36+32
	mov	r0, r5
	ldr	r1, [r2]
	ldr	r2, .L36+36
	bl	av_log
	ldr	r3, .L36+40
	ldr	r0, [r3]
	b	.L1
.L30:
	ldr	r3, .L36+32
	mov	r0, r5
	ldr	r1, [r3]
	ldr	r2, .L36+44
	bl	av_log
	ldr	r3, .L36+40
	ldr	r0, [r3]
	b	.L1
.L32:
	bl	__stack_chk_fail
.L37:
	.align	2
.L36:
	.word	.LC2
	.word	decompress_texture_thread
	.word	SEEK_SET
	.word	TEXTURE_BLOCK_W
	.word	TEXTURE_BLOCK_H
	.word	decompress_texture2_thread
	.word	AV_PICTURE_TYPE_I
	.word	decompress_chunks_thread
	.word	AV_LOG_ERROR
	.word	.LC0
	.word	AVERROR_INVALIDDATA
	.word	.LC1
	.size	hap_decode, .-hap_decode
	.comm	decompress_texture_thread,4,4
	.comm	decompress_texture2_thread,4,4
	.comm	decompress_chunks_thread,4,4
	.comm	TEXTURE_BLOCK_W,4,4
	.comm	TEXTURE_BLOCK_H,4,4
	.comm	SEEK_SET,4,4
	.comm	AV_PICTURE_TYPE_I,4,4
	.comm	AV_LOG_ERROR,4,4
	.comm	AVERROR_INVALIDDATA,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
