	.file	"extr_hapdec.c_hap_parse_frame_header.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"snappy"
.LC1:
	.string	"complex"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"Invalid texture format %#04x.\n"
	.section	.rodata.str1.1
.LC3:
	.string	"%s compressor\n"
	.text
	.p2align 4
	.type	hap_parse_frame_header, @function
hap_parse_frame_header:
.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
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	r15, QWORD PTR 8[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	lea	rdx, 44[rsp]
	lea	r13, 32[r15]
	mov	rsi, r15
	mov	rdi, r13
	call	ff_hap_parse_section_header@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L27
.L1:
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L28
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L27:
	.cfi_restore_state
	mov	rbx, QWORD PTR 0[rbp]
	mov	ecx, 49
	mov	edx, 112
	mov	esi, 97
	mov	edi, 72
	call	MKTAG@PLT
	cmp	rbx, rax
	jne	.L3
	mov	ecx, DWORD PTR 44[rsp]
	and	ecx, 15
	cmp	ecx, DWORD PTR HAP_FMT_RGBDXT1[rip]
	je	.L3
.L4:
	mov	esi, DWORD PTR AV_LOG_ERROR[rip]
	lea	rdx, .LC2[rip]
	mov	rdi, rbp
	xor	eax, eax
	call	av_log@PLT
	mov	r12d, DWORD PTR AVERROR_INVALIDDATA[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rbx, QWORD PTR 0[rbp]
	mov	ecx, 53
	mov	edx, 112
	mov	esi, 97
	mov	edi, 72
	call	MKTAG@PLT
	cmp	rbx, rax
	jne	.L5
	mov	ecx, DWORD PTR 44[rsp]
	and	ecx, 15
	cmp	ecx, DWORD PTR HAP_FMT_RGBADXT5[rip]
	jne	.L4
.L5:
	mov	rbx, QWORD PTR 0[rbp]
	mov	ecx, 89
	mov	edx, 112
	mov	esi, 97
	mov	edi, 72
	call	MKTAG@PLT
	cmp	rbx, rax
	jne	.L6
	mov	ecx, DWORD PTR 44[rsp]
	and	ecx, 15
	cmp	ecx, DWORD PTR HAP_FMT_YCOCGDXT5[rip]
	jne	.L4
.L6:
	mov	rbx, QWORD PTR 0[rbp]
	mov	ecx, 65
	mov	edx, 112
	mov	esi, 97
	mov	edi, 72
	call	MKTAG@PLT
	cmp	rbx, rax
	jne	.L7
	mov	ecx, DWORD PTR 44[rsp]
	and	ecx, 15
	cmp	ecx, DWORD PTR HAP_FMT_RGTC1[rip]
	jne	.L4
.L7:
	mov	ecx, 77
	mov	edx, 112
	mov	esi, 97
	mov	edi, 72
	mov	rbx, QWORD PTR 0[rbp]
	call	MKTAG@PLT
	mov	r9, rax
	mov	eax, DWORD PTR 44[rsp]
	cmp	rbx, r9
	je	.L29
.L9:
	and	eax, 240
	add	eax, -128
	cmp	eax, 1
	jbe	.L30
	mov	eax, DWORD PTR AVERROR_INVALIDDATA[rip]
	test	eax, eax
	jne	.L21
	lea	rax, .LC1[rip]
	mov	QWORD PTR 24[rsp], rax
.L11:
	lea	rax, 48[rsp]
	mov	QWORD PTR 8[r15], 0
	xor	r14d, r14d
	mov	QWORD PTR 16[rsp], rax
	mov	eax, DWORD PTR 16[r15]
	test	eax, eax
	jg	.L12
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L14:
	cmp	eax, 129
	jne	.L17
	movsx	rax, DWORD PTR 16[rcx]
	mov	QWORD PTR 32[rcx], rax
.L16:
	add	rax, rdx
	add	r14, 1
	mov	QWORD PTR 8[r15], rax
	cmp	DWORD PTR 16[r15], r14d
	jle	.L18
.L12:
	mov	rdx, QWORD PTR 24[r15]
	lea	rax, [r14+r14*4]
	mov	rdi, r13
	lea	rcx, [rdx+rax*8]
	movsx	rbx, DWORD PTR 16[rcx]
	add	rbx, QWORD PTR 8[rcx]
	mov	QWORD PTR 8[rsp], rcx
	call	bytestream2_get_bytes_left@PLT
	mov	rcx, QWORD PTR 8[rsp]
	cmp	rbx, rax
	jg	.L17
	mov	rdx, QWORD PTR 8[r15]
	mov	eax, DWORD PTR [rcx]
	mov	QWORD PTR 24[rcx], rdx
	cmp	eax, 128
	jne	.L14
	mov	rbx, QWORD PTR 16[rsp]
	movsx	rdx, DWORD PTR 16[rcx]
	mov	QWORD PTR 8[rsp], rcx
	mov	rsi, QWORD PTR 8[rcx]
	add	rsi, QWORD PTR 32[r15]
	mov	rdi, rbx
	call	bytestream2_init@PLT
	mov	rdi, rbx
	call	ff_snappy_peek_uncompressed_length@PLT
	mov	rcx, QWORD PTR 8[rsp]
	test	rax, rax
	js	.L21
	mov	QWORD PTR 32[rcx], rax
	mov	rdx, QWORD PTR 8[r15]
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	mov	r12d, DWORD PTR AVERROR_INVALIDDATA[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L29:
	mov	ecx, eax
	and	ecx, 15
	cmp	ecx, DWORD PTR HAP_FMT_RGTC1[rip]
	je	.L9
	cmp	ecx, DWORD PTR HAP_FMT_YCOCGDXT5[rip]
	je	.L9
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L30:
	mov	edx, 1
	mov	esi, 1
	mov	rdi, r15
	call	ff_hap_set_chunk_count@PLT
	test	eax, eax
	jne	.L21
	mov	edx, DWORD PTR 44[rsp]
	mov	rax, QWORD PTR 24[r15]
	and	edx, 240
	mov	QWORD PTR 8[rax], 0
	mov	DWORD PTR [rax], edx
	mov	edx, DWORD PTR [r15]
	mov	DWORD PTR 16[rax], edx
	lea	rax, .LC0[rip]
	mov	QWORD PTR 24[rsp], rax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rcx, QWORD PTR 24[rsp]
	mov	esi, DWORD PTR AV_LOG_DEBUG[rip]
	mov	rdi, rbp
	xor	eax, eax
	lea	rdx, .LC3[rip]
	call	av_log@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	r12d, eax
	jmp	.L1
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	hap_parse_frame_header, .-hap_parse_frame_header
	.comm	HAP_ST_DECODE_INSTRUCTIONS,4,4
	.comm	HAP_FMT_YCOCGDXT5,4,4
	.comm	HAP_FMT_RGTC1,4,4
	.comm	HAP_FMT_RGBDXT1,4,4
	.comm	HAP_FMT_RGBADXT5,4,4
	.comm	AV_LOG_ERROR,4,4
	.comm	AV_LOG_DEBUG,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_parse_frame_header.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"snappy\000"
	.align	2
.LC1:
	.ascii	"complex\000"
	.align	2
.LC2:
	.ascii	"Invalid texture format %#04x.\012\000"
	.align	2
.LC3:
	.ascii	"%s compressor\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	hap_parse_frame_header, %function
hap_parse_frame_header:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r4, [r0, #4]
	sub	sp, sp, #28
	ldr	r3, .L30
	add	r9, r4, #16
	mov	r6, r0
	mov	r1, r4
	mov	r0, r9
	add	r2, sp, #12
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	bl	ff_hap_parse_section_header
	subs	r7, r0, #0
	beq	.L26
.L1:
	ldr	r3, .L30
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L27
	mov	r0, r7
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L26:
	mov	r3, #49
	mov	r2, #112
	mov	r1, #97
	mov	r0, #72
	ldr	r5, [r6]
	bl	MKTAG
	cmp	r5, r0
	bne	.L3
	ldr	r2, .L30+4
	ldr	r3, [sp, #12]
	ldr	r2, [r2]
	and	r3, r3, #15
	cmp	r3, r2
	beq	.L3
.L4:
	ldr	r2, .L30+8
	mov	r0, r6
	ldr	r1, [r2]
	ldr	r2, .L30+12
	bl	av_log
	ldr	r3, .L30+16
	ldr	r7, [r3]
	b	.L1
.L3:
	mov	r3, #53
	mov	r2, #112
	mov	r1, #97
	mov	r0, #72
	ldr	r5, [r6]
	bl	MKTAG
	cmp	r5, r0
	bne	.L5
	ldr	r2, .L30+20
	ldr	r3, [sp, #12]
	ldr	r2, [r2]
	and	r3, r3, #15
	cmp	r3, r2
	bne	.L4
.L5:
	mov	r3, #89
	mov	r2, #112
	mov	r1, #97
	mov	r0, #72
	ldr	r5, [r6]
	bl	MKTAG
	cmp	r5, r0
	bne	.L6
	ldr	r2, .L30+24
	ldr	r3, [sp, #12]
	ldr	r2, [r2]
	and	r3, r3, #15
	cmp	r3, r2
	bne	.L4
.L6:
	mov	r3, #65
	mov	r2, #112
	mov	r1, #97
	mov	r0, #72
	ldr	r5, [r6]
	bl	MKTAG
	cmp	r5, r0
	bne	.L7
	ldr	r2, .L30+28
	ldr	r3, [sp, #12]
	ldr	r2, [r2]
	and	r3, r3, #15
	cmp	r3, r2
	bne	.L4
.L7:
	mov	r2, #112
	mov	r3, #77
	mov	r1, #97
	mov	r0, #72
	ldr	r5, [r6]
	bl	MKTAG
	cmp	r5, r0
	ldrne	r2, [sp, #12]
	beq	.L28
.L9:
	and	r2, r2, #240
	sub	r2, r2, #128
	cmp	r2, #1
	bls	.L29
	ldr	r3, .L30+16
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L21
	ldr	r3, .L30+32
	str	r3, [sp, #4]
.L11:
	mov	fp, #0
	ldr	r3, [r4, #8]
	str	fp, [r4, #4]
	cmp	r3, fp
	movgt	r8, fp
	bgt	.L12
	b	.L18
.L14:
	cmp	r3, #129
	bne	.L17
	ldr	r3, [r5, #8]
	str	r3, [r5, #16]
.L16:
	ldr	r2, [r4, #8]
	add	fp, fp, #1
	add	r3, r3, r0
	cmp	r2, fp
	str	r3, [r4, #4]
	add	r8, r8, #20
	ble	.L18
.L12:
	ldr	r10, [r4, #12]
	mov	r0, r9
	add	r5, r10, r8
	ldmib	r5, {r1, r3}
	add	r3, r3, r1
	str	r3, [sp]
	bl	bytestream2_get_bytes_left
	ldr	r3, [sp]
	cmp	r3, r0
	bgt	.L17
	ldr	r3, [r10, r8]
	ldr	r0, [r4, #4]
	cmp	r3, #128
	str	r0, [r5, #12]
	bne	.L14
	ldr	r3, [r5, #4]
	ldr	r1, [r4, #16]
	ldr	r2, [r5, #8]
	add	r1, r1, r3
	add	r0, sp, #16
	bl	bytestream2_init
	add	r0, sp, #16
	bl	ff_snappy_peek_uncompressed_length
	subs	r3, r0, #0
	blt	.L21
	ldr	r0, [r4, #4]
	str	r3, [r5, #16]
	b	.L16
.L17:
	ldr	r3, .L30+16
	ldr	r7, [r3]
	b	.L1
.L28:
	ldr	r3, .L30+28
	ldr	r2, [sp, #12]
	ldr	r1, [r3]
	and	r3, r2, #15
	cmp	r3, r1
	beq	.L9
	ldr	r1, .L30+24
	ldr	r1, [r1]
	cmp	r3, r1
	beq	.L9
	b	.L4
.L29:
	mov	r2, #1
	mov	r0, r4
	mov	r1, r2
	bl	ff_hap_set_chunk_count
	cmp	r0, #0
	movne	r7, r0
	bne	.L1
	ldr	r2, [sp, #12]
	ldr	r3, [r4, #12]
	ldr	r1, [r4]
	and	r2, r2, #240
	stmib	r3, {r0, r1}
	str	r2, [r3]
	ldr	r3, .L30+36
	str	r3, [sp, #4]
	b	.L11
.L18:
	ldr	r2, .L30+40
	mov	r0, r6
	ldr	r1, [r2]
	ldr	r3, [sp, #4]
	ldr	r2, .L30+44
	bl	av_log
	b	.L1
.L21:
	mov	r7, r3
	b	.L1
.L27:
	bl	__stack_chk_fail
.L31:
	.align	2
.L30:
	.word	.LC4
	.word	HAP_FMT_RGBDXT1
	.word	AV_LOG_ERROR
	.word	.LC2
	.word	AVERROR_INVALIDDATA
	.word	HAP_FMT_RGBADXT5
	.word	HAP_FMT_YCOCGDXT5
	.word	HAP_FMT_RGTC1
	.word	.LC1
	.word	.LC0
	.word	AV_LOG_DEBUG
	.word	.LC3
	.size	hap_parse_frame_header, .-hap_parse_frame_header
	.comm	HAP_ST_DECODE_INSTRUCTIONS,4,4
	.comm	HAP_FMT_YCOCGDXT5,4,4
	.comm	HAP_FMT_RGTC1,4,4
	.comm	HAP_FMT_RGBDXT1,4,4
	.comm	HAP_FMT_RGBADXT5,4,4
	.comm	AV_LOG_ERROR,4,4
	.comm	AV_LOG_DEBUG,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
