	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hapqa_extract
_hapqa_extract:                         ## @hapqa_extract
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	(%rdi), %r15
	callq	_ff_bsf_get_packet_ref
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	(%r14), %esi
	movl	4(%r14), %edx
	leaq	-52(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_bytestream2_init
	leaq	-48(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ff_hap_parse_section_header
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movl	-44(%rbp), %ecx
	andl	$15, %ecx
	cmpl	$13, %ecx
	jne	LBB0_4
## %bb.8:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-52(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$4, %esi
	callq	_bytestream2_seek
	leaq	-48(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ff_hap_parse_section_header
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.9:
	movl	$4, %r12d
	movl	-48(%rbp), %ebx
	movl	-44(%rbp), %esi
	movq	%r15, %rdi
	callq	_check_texture
	testq	%rax, %rax
	je	LBB0_10
LBB0_13:
	addl	%r12d, (%r14)
	addl	$4, %ebx
	movl	%ebx, 4(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_1:
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_4:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_av_log
LBB0_5:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_6:
	testl	%ebx, %ebx
	jns	LBB0_14
## %bb.7:
	movq	%r14, %rdi
	callq	_av_packet_unref
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	-48(%rbp), %r12d
	addl	$8, %r12d
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-52(%rbp), %rbx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_bytestream2_seek
	leaq	-48(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ff_hap_parse_section_header
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.11:
	movl	-48(%rbp), %ebx
	movl	-44(%rbp), %esi
	movq	%r15, %rdi
	callq	_check_texture
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid section type for HAPQA %#04x.\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.1:                               ## @.str.1
	.asciz	"No valid texture found.\n"

	.no_dead_strip	_hapqa_extract
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hapqa_extract
_hapqa_extract:                         ; @hapqa_extract
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x20, x0
	ldr	x21, [x0]
	bl	_ff_bsf_get_packet_ref
	tbnz	w0, #31, LBB0_7
; %bb.1:
	ldp	w1, w2, [x19]
	add	x0, sp, #28
	bl	_bytestream2_init
	add	x0, sp, #28
	add	x1, sp, #24
	add	x2, sp, #20
	bl	_ff_hap_parse_section_header
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.2:
	ldr	w8, [sp, #20]
	and	w8, w8, #0xf
	cmp	w8, #13
	b.ne	LBB0_8
; %bb.3:
Lloh0:
	adrp	x24, _SEEK_SET@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x24]
	add	x0, sp, #28
	mov	w1, #4
	bl	_bytestream2_seek
	add	x0, sp, #28
	add	x1, sp, #24
	add	x2, sp, #20
	bl	_ff_hap_parse_section_header
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.4:
	ldp	w1, w25, [sp, #20]
	mov	x0, x21
	bl	_check_texture
	cbz	x0, LBB0_13
; %bb.5:
	mov	w23, #4
LBB0_6:
	mov	w22, #0
	add	w8, w25, #4
	ldr	w9, [x19]
	add	w9, w9, w23
	stp	w9, w8, [x19]
	b	LBB0_12
LBB0_7:
	mov	x22, x0
	b	LBB0_12
LBB0_8:
Lloh2:
	adrp	x9, _AV_LOG_ERROR@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x9]
	str	x8, [sp]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
LBB0_9:
	mov	x0, x20
	bl	_av_log
Lloh7:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh9:
	ldr	w22, [x8]
LBB0_10:
	tbz	w22, #31, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_av_packet_unref
LBB0_12:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_13:
	ldr	w8, [sp, #24]
	add	w23, w8, #8
	ldr	w2, [x24]
	add	x0, sp, #28
	mov	x1, x23
	bl	_bytestream2_seek
	add	x0, sp, #28
	add	x1, sp, #24
	add	x2, sp, #20
	bl	_ff_hap_parse_section_header
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.14:
	ldp	w1, w25, [sp, #20]
	mov	x0, x21
	bl	_check_texture
	cbnz	x0, LBB0_6
; %bb.15:
Lloh10:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x2, l_.str.1@PAGE
Lloh14:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid section type for HAPQA %#04x.\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.1:                               ; @.str.1
	.asciz	"No valid texture found.\n"

	.no_dead_strip	_hapqa_extract
.subsections_via_symbols
