	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hap_decode
_hap_decode:                            ## @hap_decode
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, -112(%rbp)                ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	24(%rdi), %rbx
	movq	$0, -72(%rbp)
	leaq	40(%rbx), %r12
	movl	(%rcx), %edx
	movl	4(%rcx), %esi
	movq	%r12, %rdi
	callq	_bytestream2_init
	movl	(%rbx), %eax
	movl	%eax, -72(%rbp)
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpl	$2, 4(%rbx)
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_4
## %bb.1:
	leaq	-116(%rbp), %rsi
	leaq	-76(%rbp), %rdx
	movq	%r12, %rdi
	callq	_ff_hap_parse_section_header
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	jne	LBB0_28
## %bb.2:
	movl	-76(%rbp), %ecx
	movl	%ecx, %eax
	andl	$15, %eax
	cmpl	$13, %eax
	jne	LBB0_24
## %bb.3:
	movl	56(%rbx), %eax
	movl	%eax, -68(%rbp)
	movl	$4, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r15                 ## 8-byte Reload
LBB0_4:
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)
	leaq	-56(%rbp), %rsi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_ff_thread_get_buffer
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	js	LBB0_28
## %bb.5:
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	cmpl	$0, 4(%rbx)
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jle	LBB0_23
## %bb.6:
	leaq	32(%rbx), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	xorl	%r15d, %r15d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_9 Depth=1
	movq	%r14, -56(%rbp)
	movq	_decompress_texture2_thread@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	28(%rbx), %r8d
	movq	%r13, %rdi
	movq	%r14, %rdx
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=1
	xorl	%ecx, %ecx
	callq	*8(%r13)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addl	%eax, %r12d
	addl	$4, %r12d
	incq	%r15
	movslq	4(%rbx), %rax
	cmpq	%rax, %r15
	jge	LBB0_23
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_17 Depth 2
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	callq	_bytestream2_seek
	movq	%r13, %rdi
	callq	_hap_parse_frame_header
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	js	LBB0_28
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	48(%rbx), %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	16(%r13), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rdi
	callq	_ff_thread_finish_setup
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	callq	_hap_can_use_tex_in_place
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	40(%rbx), %eax
	movl	%eax, 36(%rbx)
	movq	48(%rbx), %r14
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_bytestream2_get_bytes_left
	movq	%r14, %rdi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_FFMIN
	movl	%eax, %ecx
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	8(%rbx), %esi
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	callq	_av_reallocp
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	js	LBB0_28
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_decompress_chunks_thread@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	16(%rbx), %rcx
	movl	24(%rbx), %r8d
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	*8(%r13)
	movl	24(%rbx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	16(%rbx), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rdx,%rsi,8), %rax
	testq	%rax, %rax
	js	LBB0_28
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=2
	incq	%rsi
	cmpq	%rsi, %rcx
	jne	LBB0_17
LBB0_19:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	8(%rbx), %ecx
	movl	32(%rbx), %eax
	movl	%eax, 36(%rbx)
LBB0_20:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r13), %eax
	movl	4(%r13), %esi
	cltd
	movq	_TEXTURE_BLOCK_W@GOTPCREL(%rip), %rdi
	idivl	(%rdi)
	movl	%eax, %edi
	movl	%esi, %eax
	cltd
	movq	_TEXTURE_BLOCK_H@GOTPCREL(%rip), %rsi
	idivl	(%rsi)
	imull	%edi, %eax
	imull	-72(%rbp,%r15,4), %eax
	cmpl	%eax, %ecx
	jl	LBB0_25
## %bb.21:                              ##   in Loop: Header=BB0_9 Depth=1
	testq	%r15, %r15
	jne	LBB0_7
## %bb.22:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_decompress_texture_thread@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rdx
	movl	28(%rbx), %r8d
	movq	%r13, %rdi
	jmp	LBB0_8
LBB0_23:
	movq	_AV_PICTURE_TYPE_I@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx
	movl	%eax, 4(%rcx)
	movl	$1, (%rcx)
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movl	$1, (%rax)
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_27
LBB0_24:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_26
LBB0_25:
	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
LBB0_26:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
LBB0_27:
	movl	(%rax), %eax
LBB0_28:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.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 in 2 textures mode %#04x.\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_decompress_chunks_thread,4,2   ## @decompress_chunks_thread
	.comm	_TEXTURE_BLOCK_W,4,2            ## @TEXTURE_BLOCK_W
	.comm	_TEXTURE_BLOCK_H,4,2            ## @TEXTURE_BLOCK_H
L_.str.1:                               ## @.str.1
	.asciz	"Insufficient data\n"

	.comm	_decompress_texture_thread,4,2  ## @decompress_texture_thread
	.comm	_decompress_texture2_thread,4,2 ## @decompress_texture2_thread
	.comm	_AV_PICTURE_TYPE_I,4,2          ## @AV_PICTURE_TYPE_I
	.no_dead_strip	_hap_decode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hap_decode
_hap_decode:                            ; @hap_decode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x23, [x0, #24]
	str	xzr, [sp, #24]
	add	x24, x23, #40
	ldp	w2, w1, [x3]
	mov	x0, x24
	bl	_bytestream2_init
	ldp	w8, w9, [x23]
	str	w8, [sp, #24]
	cmp	w9, #2
	b.ne	LBB0_4
; %bb.1:
	add	x1, sp, #36
	add	x2, sp, #32
	mov	x0, x24
	bl	_ff_hap_parse_section_header
                                        ; kill: def $w0 killed $w0 def $x0
	cbnz	w0, LBB0_28
; %bb.2:
	ldr	w8, [sp, #32]
	and	w9, w8, #0xf
	cmp	w9, #13
	b.ne	LBB0_25
; %bb.3:
	ldr	w8, [x23, #56]
	str	w8, [sp, #28]
	mov	w25, #4
	b	LBB0_5
LBB0_4:
	mov	w25, #0
LBB0_5:
	str	x22, [sp, #40]
	add	x1, sp, #40
	mov	x0, x19
	mov	w2, #0
	bl	_ff_thread_get_buffer
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_28
; %bb.6:
	ldr	w8, [x23, #4]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.7:
	mov	x28, #0
	add	x8, x23, #32
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	str	x22, [sp, #40]
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _decompress_texture2_thread@GOTPAGE
Lloh1:
	ldr	x9, [x9, _decompress_texture2_thread@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	ldr	w4, [x23, #28]
	mov	x0, x19
	mov	x2, x22
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	mov	x3, #0
	blr	x8
	add	w8, w25, w26
	add	w25, w8, #4
	add	x28, x28, #1
	ldrsw	x8, [x23, #4]
	cmp	x28, x8
	b.ge	LBB0_24
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
Lloh3:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x24
	mov	x1, x25
	bl	_bytestream2_seek
	mov	x0, x19
	bl	_hap_parse_frame_header
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_28
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w26, [x23, #48]
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x19
	bl	_ff_thread_finish_setup
LBB0_13:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x23
	bl	_hap_can_use_tex_in_place
	cbz	x0, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x23, #40]
	str	w8, [x23, #36]
	ldr	x27, [x23, #48]
	mov	x0, x24
	bl	_bytestream2_get_bytes_left
	mov	x1, x0
	mov	x0, x27
	bl	_FFMIN
	b	LBB0_21
LBB0_15:                                ;   in Loop: Header=BB0_10 Depth=1
	ldr	w1, [x23, #8]
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_av_reallocp
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_28
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x9, _decompress_chunks_thread@GOTPAGE
Lloh7:
	ldr	x9, [x9, _decompress_chunks_thread@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x9]
	ldr	x3, [x23, #16]
	ldr	w4, [x23, #24]
	mov	x0, x19
	mov	x2, #0
	blr	x8
	ldr	w8, [x23, #24]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x9, [x23, #16]
LBB0_18:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x9]
	tbnz	x0, #63, LBB0_28
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=2
	add	x9, x9, #8
	subs	x8, x8, #1
	b.ne	LBB0_18
LBB0_20:                                ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x23, #32]
	str	w8, [x23, #36]
	ldr	w0, [x23, #8]
LBB0_21:                                ;   in Loop: Header=BB0_10 Depth=1
Lloh9:
	adrp	x8, _TEXTURE_BLOCK_W@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TEXTURE_BLOCK_W@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldp	w9, w10, [x19]
	sdiv	w8, w9, w8
Lloh12:
	adrp	x9, _TEXTURE_BLOCK_H@GOTPAGE
Lloh13:
	ldr	x9, [x9, _TEXTURE_BLOCK_H@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	sdiv	w9, w10, w9
	mul	w8, w9, w8
	add	x9, sp, #24
	ldr	w9, [x9, x28, lsl #2]
	mul	w8, w8, w9
	cmp	w0, w8
	b.lt	LBB0_26
; %bb.22:                               ;   in Loop: Header=BB0_10 Depth=1
	cbnz	x28, LBB0_8
; %bb.23:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x19, #8]
Lloh15:
	adrp	x9, _decompress_texture_thread@GOTPAGE
Lloh16:
	ldr	x9, [x9, _decompress_texture_thread@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x9]
	ldr	x2, [sp, #40]
	ldr	w4, [x23, #28]
	mov	x0, x19
	b	LBB0_9
LBB0_24:
Lloh18:
	adrp	x8, _AV_PICTURE_TYPE_I@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AV_PICTURE_TYPE_I@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	x9, [sp, #40]
	mov	w10, #1
	stp	w10, w8, [x9]
	str	w10, [x21]
	ldr	w0, [x20]
	b	LBB0_28
LBB0_25:
Lloh21:
	adrp	x9, _AV_LOG_ERROR@GOTPAGE
Lloh22:
	ldr	x9, [x9, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x9]
	str	x8, [sp]
Lloh24:
	adrp	x2, l_.str@PAGE
Lloh25:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_27
LBB0_26:
Lloh26:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x2, l_.str.1@PAGE
Lloh30:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_27:
	mov	x0, x19
	bl	_av_log
Lloh31:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
LBB0_28:
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.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 in 2 textures mode %#04x.\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_decompress_chunks_thread,4,2   ; @decompress_chunks_thread
	.comm	_TEXTURE_BLOCK_W,4,2            ; @TEXTURE_BLOCK_W
	.comm	_TEXTURE_BLOCK_H,4,2            ; @TEXTURE_BLOCK_H
l_.str.1:                               ; @.str.1
	.asciz	"Insufficient data\n"

	.comm	_decompress_texture_thread,4,2  ; @decompress_texture_thread
	.comm	_decompress_texture2_thread,4,2 ; @decompress_texture2_thread
	.comm	_AV_PICTURE_TYPE_I,4,2          ; @AV_PICTURE_TYPE_I
	.no_dead_strip	_hap_decode
.subsections_via_symbols
