	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hap_encode
_hap_encode:                            ## @hap_encode
	.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	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_hap_header_length
	movl	%eax, %r12d
	movl	(%rbx), %edi
	movl	8(%rbx), %esi
	imull	4(%rbx), %esi
	callq	_FFMAX
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r12), %edx
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%r12d, %ecx
	callq	_ff_alloc_packet2
	testl	%eax, %eax
	js	LBB0_9
## %bb.1:
	movq	16(%rbx), %rax
	movq	_HAP_COMP_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.2:
	movl	8(%r15), %esi
	addl	%r12d, %esi
	movl	(%r15), %edx
	subl	%r12d, %edx
	movq	%r13, %rdi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_compress_texture
	testl	%eax, %eax
	js	LBB0_9
## %bb.3:
	movq	_HAP_COMP_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	32(%rbx), %rcx
	movq	%rax, (%rcx)
	movl	(%rbx), %r14d
	jmp	LBB0_7
LBB0_5:
	movl	(%rbx), %edx
	movl	24(%rbx), %esi
	movq	%r13, %rdi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_compress_texture
	testl	%eax, %eax
	js	LBB0_9
## %bb.6:
	movl	8(%r15), %esi
	addl	%r12d, %esi
	movq	%r13, %rdi
	callq	_hap_compress_frame
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_10
LBB0_7:
	movl	8(%r15), %esi
	addl	%r12d, %r14d
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_hap_write_frame_header
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_av_shrink_packet
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r15)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	xorl	%r14d, %r14d
	jmp	LBB0_10
LBB0_9:
	movl	%eax, %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HAP_COMP_NONE,8,3              ## @HAP_COMP_NONE
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_hap_encode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hap_encode
_hap_encode:                            ; @hap_encode
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x3
	mov	x24, x2
	mov	x20, x1
	mov	x23, x0
	ldr	x21, [x0]
	mov	x0, x21
	bl	_hap_header_length
	mov	x22, x0
	ldp	w0, w8, [x21]
	ldr	w9, [x21, #8]
	mul	w1, w9, w8
	bl	_FFMAX
	add	w2, w0, w22
	mov	x0, x23
	mov	x1, x20
	mov	x3, x22
	bl	_ff_alloc_packet2
	tbnz	w0, #31, LBB0_7
; %bb.1:
	ldr	x8, [x21, #16]
Lloh0:
	adrp	x25, _HAP_COMP_NONE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _HAP_COMP_NONE@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	ldr	w8, [x20, #8]
	add	w1, w8, w22
	ldr	w8, [x20]
	sub	w2, w8, w22
	mov	x0, x23
	mov	x3, x24
	bl	_compress_texture
	tbnz	w0, #31, LBB0_7
; %bb.3:
	ldr	x8, [x25]
	ldr	x9, [x21, #32]
	str	x8, [x9]
	ldr	w0, [x21]
	b	LBB0_6
LBB0_4:
	ldr	w1, [x21, #24]
	ldr	w2, [x21]
	mov	x0, x23
	mov	x3, x24
	bl	_compress_texture
	tbnz	w0, #31, LBB0_7
; %bb.5:
	ldr	w8, [x20, #8]
	add	w1, w8, w22
	mov	x0, x23
	bl	_hap_compress_frame
	tbnz	w0, #31, LBB0_7
LBB0_6:
	ldr	w1, [x20, #8]
	add	w22, w0, w22
	mov	x0, x21
	mov	x2, x22
	bl	_hap_write_frame_header
	mov	x0, x20
	mov	x1, x22
	bl	_av_shrink_packet
	mov	w0, #0
Lloh2:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x20, #4]
	orr	w8, w9, w8
	str	w8, [x20, #4]
	mov	w8, #1
	str	w8, [x19]
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_HAP_COMP_NONE,8,3              ; @HAP_COMP_NONE
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_hap_encode
.subsections_via_symbols
