	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function decode_JangGu
_decode_JangGu:                         ## @decode_JangGu
	.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	%rdi, %r14
	movq	(%rsi), %r13
	movl	8(%rsi), %r15d
	movq	(%rdi), %rcx
	movq	32(%rdi), %rax
	leaq	(%rcx,%rcx,4), %rcx
	cmpl	$0, (%rax,%rcx,8)
	jne	LBB0_4
## %bb.1:
	movq	$0, 32(%rax,%rcx,8)
	movq	8(%rax,%rcx,8), %rdx
	movq	16(%rax,%rcx,8), %rsi
	movslq	8(%r14), %rdi
	leaq	(%rdi,%rdi,2), %rdi
	addq	%rdi, %rsi
	decq	%rsi
	movq	%rsi, 24(%rax,%rcx,8)
	movq	_FRAME_READY@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_3
## %bb.2:
	leaq	(%rax,%rcx,8), %rax
	addq	$8, %rax
	movq	_FRAME_GRABBING@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
LBB0_3:
	movl	$0, 12(%r14)
LBB0_4:
	testl	%r15d, %r15d
	jle	LBB0_23
## %bb.5:
	movl	12(%r14), %eax
	xorl	%r12d, %r12d
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_9 Depth=1
	movl	$0, 12(%r14)
	incl	40(%r14)
	movq	(%r14), %rax
	movq	32(%r14), %rcx
	leaq	(%rax,%rax,4), %rax
	movl	$0, (%rcx,%rax,8)
	xorl	%eax, %eax
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %r12d
LBB0_7:                                 ##   in Loop: Header=BB0_9 Depth=1
	addl	%ebx, %r12d
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=1
	cmpl	%r12d, %r15d
	jle	LBB0_23
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1024, %ecx                     ## imm = 0x400
	subl	%eax, %ecx
	leal	(%rcx,%r12), %edx
	movl	%r15d, %ebx
	subl	%r12d, %ebx
	cmpl	%r15d, %edx
	cmovlel	%ecx, %ebx
	movslq	%eax, %rdi
	shlq	$2, %rdi
	addq	16(%r14), %rdi
	movslq	%r12d, %rsi
	addq	%r13, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movl	12(%r14), %eax
	addl	%ebx, %eax
	movl	%eax, 12(%r14)
	cmpl	$4, %eax
	jl	LBB0_7
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	16(%r14), %rsi
	movl	12(%rsi), %ecx
	movl	8(%rsi), %edx
	shll	$8, %edx
	leal	(%rdx,%rcx), %r15d
	addl	$47, %r15d
	sarl	$3, %r15d
	andl	$-2, %r15d
	cmpl	$1025, %r15d                    ## imm = 0x401
	jge	LBB0_6
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	testl	%r15d, %r15d
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpl	%r15d, %eax
	jl	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%rsi), %r13d
	addl	%ecx, %edx
	andl	$63, %r13d
	shll	$8, %r13d
	addl	4(%rsi), %r13d
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	%r15d, %ecx
	callq	_decode_JangGu_vlc
	leal	(%r13,%r13,2), %edi
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	(%r14), %r8
	movq	32(%r14), %rcx
	leaq	(%r8,%r8,4), %rsi
	addl	(%rcx,%rsi,8), %edi
	movl	%edi, (%rcx,%rsi,8)
	addl	%r12d, %ebx
	addl	%r15d, %ebx
	subl	12(%r14), %ebx
	movl	$0, 12(%r14)
	movl	8(%r14), %eax
	imull	24(%r14), %eax
	leal	(%rax,%rax,2), %edx
	xorl	%eax, %eax
	movl	%ebx, %r12d
	cmpl	%edx, %edi
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	jl	LBB0_8
	jmp	LBB0_16
LBB0_15:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_7
LBB0_16:
	jne	LBB0_21
## %bb.17:
	movq	8(%rcx,%rsi,8), %rax
	movq	_FRAME_GRABBING@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_19
## %bb.18:
	leaq	(%rcx,%rsi,8), %rax
	addq	$8, %rax
	movq	_FRAME_DONE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, (%rax)
	incl	48(%r14)
	incl	44(%r14)
LBB0_19:
	leaq	1(%r8), %rdx
	movq	_SE401_NUMFRAMES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	decq	%rax
	andq	%rdx, %rax
	leaq	(%rax,%rax,4), %rdx
	movq	8(%rcx,%rdx,8), %rdx
	movq	_FRAME_READY@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_22
## %bb.20:
	movq	%rax, (%r14)
	movq	%rax, %r8
	jmp	LBB0_22
LBB0_21:
	incl	40(%r14)
LBB0_22:
	leaq	(%r8,%r8,4), %rax
	movl	$0, (%rcx,%rax,8)
LBB0_23:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FRAME_READY,8,3                ## @FRAME_READY
	.comm	_FRAME_GRABBING,8,3             ## @FRAME_GRABBING
	.comm	_FRAME_DONE,8,3                 ## @FRAME_DONE
	.comm	_SE401_NUMFRAMES,4,2            ## @SE401_NUMFRAMES
	.no_dead_strip	_decode_JangGu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function decode_JangGu
_decode_JangGu:                         ; @decode_JangGu
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	ldr	x22, [x1]
	ldr	w23, [x1, #8]
	ldr	x8, [x0, #32]
	ldr	x9, [x0]
	mov	w10, #40
	mul	x10, x9, x10
	ldr	w10, [x8, x10]
	cbnz	w10, LBB0_4
; %bb.1:
	mov	w10, #40
	madd	x8, x9, x10, x8
	ldp	x9, x10, [x8, #8]!
	ldrsw	x11, [x19, #8]
	add	x11, x11, x11, lsl #1
	add	x10, x10, x11
	sub	x10, x10, #1
	stp	x10, xzr, [x8, #16]
Lloh0:
	adrp	x10, _FRAME_READY@GOTPAGE
Lloh1:
	ldr	x10, [x10, _FRAME_READY@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_3
; %bb.2:
Lloh3:
	adrp	x9, _FRAME_GRABBING@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FRAME_GRABBING@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	str	x9, [x8]
LBB0_3:
	str	wzr, [x19, #12]
LBB0_4:
	cmp	w23, #1
	b.lt	LBB0_21
; %bb.5:
	mov	w26, #0
	ldr	w8, [x19, #12]
	mov	w24, #1024
	mov	w25, #40
	b	LBB0_9
LBB0_6:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	w8, #0
	str	wzr, [x19, #12]
	ldr	w9, [x19, #40]
	add	w9, w9, #1
	str	w9, [x19, #40]
	ldr	x9, [x19, #32]
	ldr	x10, [x19]
	mul	x10, x10, x25
	str	wzr, [x9, x10]
	mov	x26, x23
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w26, w26, w20
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	cmp	w23, w26
	b.le	LBB0_21
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	sub	w9, w24, w8
	add	w10, w9, w26
	sub	w11, w23, w26
	cmp	w10, w23
	csel	w20, w11, w9, gt
	ldr	x9, [x19, #16]
	add	x0, x9, w8, sxtw #2
	add	x1, x22, w26, sxtw
	mov	x2, x20
	bl	_memcpy
	ldr	w8, [x19, #12]
	add	w8, w20, w8
	str	w8, [x19, #12]
	cmp	w8, #4
	b.lt	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x1, [x19, #16]
	ldp	w10, w9, [x1, #8]
	add	w2, w9, w10, lsl #8
	add	w9, w2, #47
	asr	w9, w9, #3
	and	w21, w9, #0xfffffffe
	cmp	w21, #1025
	b.ge	LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w21, #0
	ccmp	w8, w21, #8, ne
	b.lt	LBB0_7
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	ldp	w9, w8, [x1]
	ubfiz	w9, w9, #8, #6
	add	w27, w9, w8
	mov	x0, x19
	mov	x3, x21
	bl	_decode_JangGu_vlc
	add	w11, w27, w27, lsl #1
	ldr	x8, [x19, #32]
	ldr	x9, [x19]
	mul	x12, x9, x25
	ldr	w13, [x8, x12]
	ldp	w14, w10, [x19, #8]
	ldr	w15, [x19, #24]
	mul	w14, w14, w15
	add	w14, w14, w14, lsl #1
	add	w11, w13, w11
	cmp	w11, w14
	str	w11, [x8, x12]
	str	wzr, [x19, #12]
	b.ge	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w8, #0
	add	w9, w20, w26
	add	w9, w9, w21
	sub	w26, w9, w10
	b	LBB0_8
LBB0_14:
	b.ne	LBB0_19
; %bb.15:
	mov	w10, #40
	madd	x10, x9, x10, x8
	ldr	x11, [x10, #8]!
Lloh6:
	adrp	x12, _FRAME_GRABBING@GOTPAGE
Lloh7:
	ldr	x12, [x12, _FRAME_GRABBING@GOTPAGEOFF]
Lloh8:
	ldr	x12, [x12]
	cmp	x11, x12
	b.ne	LBB0_17
; %bb.16:
Lloh9:
	adrp	x11, _FRAME_DONE@GOTPAGE
Lloh10:
	ldr	x11, [x11, _FRAME_DONE@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x11]
	str	x11, [x10]
	ldur	d0, [x19, #44]
	movi.2s	v1, #1
	add.2s	v0, v0, v1
	stur	d0, [x19, #44]
LBB0_17:
	add	x10, x9, #1
Lloh12:
	adrp	x11, _SE401_NUMFRAMES@GOTPAGE
Lloh13:
	ldr	x11, [x11, _SE401_NUMFRAMES@GOTPAGEOFF]
Lloh14:
	ldrsw	x11, [x11]
	sub	x11, x11, #1
	and	x10, x10, x11
	mov	w11, #40
	madd	x11, x10, x11, x8
	ldr	x11, [x11, #8]
Lloh15:
	adrp	x12, _FRAME_READY@GOTPAGE
Lloh16:
	ldr	x12, [x12, _FRAME_READY@GOTPAGEOFF]
Lloh17:
	ldr	x12, [x12]
	cmp	x11, x12
	b.ne	LBB0_20
; %bb.18:
	str	x10, [x19]
	mov	x9, x10
	b	LBB0_20
LBB0_19:
	ldr	w10, [x19, #40]
	add	w10, w10, #1
	str	w10, [x19, #40]
LBB0_20:
	mov	w10, #40
	mul	x9, x9, x10
	str	wzr, [x8, x9]
LBB0_21:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_FRAME_READY,8,3                ; @FRAME_READY
	.comm	_FRAME_GRABBING,8,3             ; @FRAME_GRABBING
	.comm	_FRAME_DONE,8,3                 ; @FRAME_DONE
	.comm	_SE401_NUMFRAMES,4,2            ; @SE401_NUMFRAMES
	.no_dead_strip	_decode_JangGu
.subsections_via_symbols
