	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qtrle_decode_2n4bpp
_qtrle_decode_2n4bpp:                   ## @qtrle_decode_2n4bpp
	.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	$168, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -120(%rbp)                ## 4-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorl	%eax, %eax
	movl	%ecx, -116(%rbp)                ## 4-byte Spill
	cmpl	$4, %ecx
	setne	%cl
	movl	%edx, -124(%rbp)                ## 4-byte Spill
	testl	%edx, %edx
	je	LBB0_19
## %bb.1:
	movq	%rdi, %rbx
	movq	16(%rdi), %rdx
	movq	(%rdx), %rsi
	movl	(%rsi), %esi
	movl	%esi, -156(%rbp)                ## 4-byte Spill
	movq	8(%rdx), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, -144(%rbp)                ## 8-byte Spill
	movb	%cl, %al
	leal	8(,%rax,8), %eax
	movl	%eax, %edx
	shrl	$2, %edx
	leal	-1(%rax), %esi
	movl	$-1, %edi
	movl	-116(%rbp), %r8d                ## 4-byte Reload
	movl	%r8d, %ecx
	shll	%cl, %edi
	notl	%edi
	movl	%edi, -168(%rbp)                ## 4-byte Spill
	movq	%rdx, -200(%rbp)                ## 8-byte Spill
	leal	-1(%rdx), %ecx
	movl	%ecx, -164(%rbp)                ## 4-byte Spill
	movl	%eax, %ecx
	imull	%r8d, %esi
	movl	%esi, -160(%rbp)                ## 4-byte Spill
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	addl	$-8, %eax
	subq	%rcx, %rax
	leaq	-80(,%rax,4), %rax
	addq	%rbp, %rax
	movq	%rax, -184(%rbp)                ## 8-byte Spill
	movq	%rcx, -192(%rbp)                ## 8-byte Spill
	leaq	(,%rcx,4), %rax
	movq	%rax, -208(%rbp)                ## 8-byte Spill
	movq	%rbx, -152(%rbp)                ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-124(%rbp), %eax                ## 4-byte Reload
	decl	%eax
	movl	-156(%rbp), %ecx                ## 4-byte Reload
	addl	%ecx, -120(%rbp)                ## 4-byte Folded Spill
	movl	%eax, -124(%rbp)                ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_19
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
                                        ##       Child Loop BB0_13 Depth 3
                                        ##       Child Loop BB0_9 Depth 3
                                        ##       Child Loop BB0_11 Depth 3
	movq	%rbx, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %r14d
	xorl	%edi, %edi
	callq	_CHECK_PIXEL_PTR
	movq	%rbx, %rdi
	callq	_bytestream2_get_byte
	cmpl	$-1, %eax
	je	LBB0_18
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %r15d
	decl	%r14d
	imull	-136(%rbp), %r14d               ## 4-byte Folded Reload
	addl	-120(%rbp), %r14d               ## 4-byte Folded Reload
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	%rbx, %rdi
	callq	_bytestream2_get_byte
	decl	%eax
	imull	-136(%rbp), %eax                ## 4-byte Folded Reload
	addl	%eax, %r14d
	xorl	%edi, %edi
	callq	_CHECK_PIXEL_PTR
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	%rbx, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %r15d
	cmpl	$-1, %eax
	je	LBB0_18
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_13 Depth 3
                                        ##       Child Loop BB0_9 Depth 3
                                        ##       Child Loop BB0_11 Depth 3
	movq	%rbx, %rdi
	callq	_bytestream2_get_bytes_left
	testl	%eax, %eax
	jle	LBB0_19
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	js	LBB0_8
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	%r15d, %edi
	imull	-200(%rbp), %edi                ## 4-byte Folded Reload
	shll	$2, %edi
	callq	_CHECK_PIXEL_PTR
	shll	$2, %r15d
	negl	%r15d
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=3
	movl	%eax, %ecx
	shrl	$6, %ecx
	andl	$3, %ecx
	movslq	%r14d, %rdx
	movq	-144(%rbp), %rbx                ## 8-byte Reload
	movl	%ecx, (%rbx,%rdx,4)
	movl	%eax, %ecx
	shrl	$4, %ecx
	andl	$3, %ecx
	leal	2(%rdx), %r9d
	movl	%ecx, 4(%rbx,%rdx,4)
	movl	$4, %r8d
	movl	$3, %esi
	movl	$2, %ecx
	movl	$3, %edi
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=3
	movl	%eax, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %edx
	andl	%esi, %edx
	addl	%r14d, %edi
	movslq	%r9d, %rcx
	movl	%edx, (%rbx,%rcx,4)
	andl	%esi, %eax
	addl	%r8d, %r14d
	movslq	%edi, %rcx
	movl	%eax, (%rbx,%rcx,4)
	incl	%r15d
	movq	%r13, %rbx
	je	LBB0_17
LBB0_13:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%rbx, %r13
	movq	%rbx, %rdi
	callq	_bytestream2_get_byte
	cmpl	$4, -116(%rbp)                  ## 4-byte Folded Reload
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=3
	movl	$2, %r8d
	movl	$1, %edi
	movl	$15, %esi
	movl	$4, %ecx
	movl	%r14d, %r9d
	movq	-144(%rbp), %rbx                ## 8-byte Reload
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	-184(%rbp), %r13                ## 8-byte Reload
	movl	-160(%rbp), %ebx                ## 4-byte Reload
	movq	-192(%rbp), %r12                ## 8-byte Reload
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	leaq	-1(%r12), %rax
	movq	%rax, -176(%rbp)                ## 8-byte Spill
	movq	-152(%rbp), %rdi                ## 8-byte Reload
	callq	_bytestream2_peek_byte
	movl	%ebx, %ecx
	andb	$7, %cl
	sarl	%cl, %eax
	andl	-168(%rbp), %eax                ## 4-byte Folded Reload
	movl	%eax, (%r13)
	xorl	%esi, %esi
	movq	-176(%rbp), %rax                ## 8-byte Reload
	testl	%eax, -164(%rbp)                ## 4-byte Folded Reload
	sete	%sil
	movq	-152(%rbp), %rdi                ## 8-byte Reload
	callq	_bytestream2_skip
	subl	-116(%rbp), %ebx                ## 4-byte Folded Reload
	addq	$4, %r13
	cmpq	$1, %r12
	movq	-176(%rbp), %r12                ## 8-byte Reload
	jg	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	%r15d, %edi
	negl	%edi
	imull	-136(%rbp), %edi                ## 4-byte Folded Reload
	callq	_CHECK_PIXEL_PTR
	movslq	%r14d, %rax
	movq	-144(%rbp), %rcx                ## 8-byte Reload
	leaq	(%rcx,%rax,4), %r13
	movq	-152(%rbp), %rbx                ## 8-byte Reload
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r13, %rdi
	leaq	-112(%rbp), %rsi
	movq	-136(%rbp), %r12                ## 8-byte Reload
	movl	%r12d, %edx
	callq	_memcpy
	addq	-208(%rbp), %r13                ## 8-byte Folded Reload
	addl	%r12d, %r14d
	incl	%r15d
	jne	LBB0_11
	jmp	LBB0_17
LBB0_19:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.20:
	addq	$168, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_qtrle_decode_2n4bpp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qtrle_decode_2n4bpp
_qtrle_decode_2n4bpp:                   ; @qtrle_decode_2n4bpp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #224
	.cfi_def_cfa_offset 224
	stp	x28, x27, [sp, #128]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #144]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #160]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #176]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #192]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #208]            ; 16-byte Folded Spill
	add	x29, sp, #208
	.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
	str	w1, [sp, #12]                   ; 4-byte Folded Spill
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	mov	w8, #16
	mov	w9, #8
	cmp	w3, #4
	csel	w26, w9, w8, eq
	str	w2, [sp, #8]                    ; 4-byte Folded Spill
	cbz	w2, LBB0_19
; %bb.1:
	mov	x19, x3
	mov	x22, x0
	ldr	x8, [x0, #16]
	ldp	x9, x8, [x8]
	ldr	w9, [x9]
	str	w9, [sp, #4]                    ; 4-byte Folded Spill
	ldr	x27, [x8]
	lsr	w10, w26, #2
	sub	w8, w26, #1
	mov	w9, #-1
	lsl	w9, w9, w3
	mvn	w23, w9
	stp	w10, w3, [sp, #48]              ; 8-byte Folded Spill
	sub	w28, w10, #1
	mul	w8, w3, w8
	str	w8, [sp, #36]                   ; 4-byte Folded Spill
	sub	w8, w26, #8
	sub	x8, x8, x26
	add	x9, sp, #56
	add	x8, x9, x8, lsl #2
	add	x8, x8, #32
	lsl	x21, x26, #2
	str	x26, [sp, #40]                  ; 8-byte Folded Spill
	stp	x21, x8, [sp, #16]              ; 16-byte Folded Spill
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	ldr	w9, [sp, #4]                    ; 4-byte Folded Reload
	add	w8, w8, w9
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	sub	w8, w8, #1
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	cbz	w8, LBB0_19
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;       Child Loop BB0_13 Depth 3
                                        ;       Child Loop BB0_16 Depth 3
                                        ;       Child Loop BB0_18 Depth 3
	mov	x0, x22
	bl	_bytestream2_get_byte
	mov	x25, x0
	mov	w0, #0
	bl	_CHECK_PIXEL_PTR
	mov	x0, x22
	bl	_bytestream2_get_byte
	cmn	w0, #1
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x24, x0
	sub	w8, w25, #1
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	madd	w20, w8, w26, w9
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x22
	bl	_bytestream2_get_byte
	sub	w8, w0, #1
	madd	w20, w8, w26, w20
	mov	w0, #0
	bl	_CHECK_PIXEL_PTR
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x22
	bl	_bytestream2_get_byte
	mov	x24, x0
	cmn	w0, #1
	b.eq	LBB0_2
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_13 Depth 3
                                        ;       Child Loop BB0_16 Depth 3
                                        ;       Child Loop BB0_18 Depth 3
	mov	x0, x22
	bl	_bytestream2_get_bytes_left
	cmp	w0, #1
	b.lt	LBB0_19
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	cbz	w24, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	tbnz	w24, #31, LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=2
	lsl	w21, w24, #2
	ldr	w8, [sp, #48]                   ; 4-byte Folded Reload
	mul	w0, w21, w8
	bl	_CHECK_PIXEL_PTR
	neg	w24, w21
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=3
	ubfx	w8, w0, #6, #2
	add	x9, x27, w20, sxtw #2
	ubfx	w11, w0, #4, #2
	add	w10, w20, #2
	stp	w8, w11, [x9]
	mov	w8, #4
	mov	w9, #3
	mov	w12, #2
	mov	w11, #3
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=3
	lsr	w12, w0, w12
	and	w12, w12, w9
	str	w12, [x27, w10, sxtw #2]
	add	w10, w20, w11
	and	w9, w0, w9
	add	w20, w20, w8
	str	w9, [x27, w10, sxtw #2]
	adds	w24, w24, #1
	b.hs	LBB0_6
LBB0_13:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x22
	bl	_bytestream2_get_byte
	cmp	w19, #4
	b.ne	LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=3
	mov	w8, #2
	mov	w11, #1
	mov	w9, #15
	mov	w12, #4
	mov	x10, x20
	b	LBB0_12
LBB0_15:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x25, [sp, #24]                  ; 8-byte Folded Reload
	mov	x8, x26
	ldr	w26, [sp, #36]                  ; 4-byte Folded Reload
	mov	x19, x28
	mov	x28, x23
	mov	x23, x8
LBB0_16:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	subs	x21, x23, #1
	mov	x0, x22
	bl	_bytestream2_peek_byte
	and	w8, w26, #0x7
	asr	w8, w0, w8
	and	w8, w8, w28
	str	w8, [x25], #4
	tst	w19, w21
	cset	w1, eq
	mov	x0, x22
	bl	_bytestream2_skip
	ldr	w8, [sp, #52]                   ; 4-byte Folded Reload
	sub	w26, w26, w8
	subs	x23, x23, #1
	b.gt	LBB0_16
; %bb.17:                               ;   in Loop: Header=BB0_7 Depth=2
	ldr	x26, [sp, #40]                  ; 8-byte Folded Reload
	mneg	w0, w24, w26
	bl	_CHECK_PIXEL_PTR
	add	x25, x27, w20, sxtw #2
	mov	x23, x28
	mov	x28, x19
	ldr	w19, [sp, #52]                  ; 4-byte Folded Reload
	ldr	x21, [sp, #16]                  ; 8-byte Folded Reload
LBB0_18:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	add	x1, sp, #56
	mov	x0, x25
	mov	x2, x26
	bl	_memcpy
	add	x25, x25, x21
	add	w20, w20, w26
	adds	w24, w24, #1
	b.lo	LBB0_18
	b	LBB0_6
LBB0_19:
	ldur	x8, [x29, #-88]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.20:
	ldp	x29, x30, [sp, #208]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #192]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #176]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #160]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #144]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #128]            ; 16-byte Folded Reload
	add	sp, sp, #224
	ret
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_qtrle_decode_2n4bpp
.subsections_via_symbols
