	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qtrle_decode_16bpp
_qtrle_decode_16bpp:                    ## @qtrle_decode_16bpp
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	testl	%edx, %edx
	je	LBB0_19
## %bb.1:
	movq	%rdi, %r13
	movq	16(%rdi), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rax
	movl	(%rcx), %ecx
	movl	%ecx, -68(%rbp)                 ## 4-byte Spill
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	decl	%eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	addl	-68(%rbp), %ecx                 ## 4-byte Folded Reload
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, -44(%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_16 Depth 3
                                        ##       Child Loop BB0_11 Depth 3
                                        ##       Child Loop BB0_14 Depth 3
	movq	%r13, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %r14d
	xorl	%edi, %edi
	callq	_CHECK_PIXEL_PTR
	movq	%r13, %rdi
	callq	_bytestream2_get_byte
	cmpl	$-1, %eax
	je	LBB0_18
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%r14,2), %r15d
	addl	$-2, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	%r13, %rdi
	callq	_bytestream2_get_byte
                                        ## kill: def $eax killed $eax def $rax
	leal	(%r15,%rax,2), %r15d
	addl	$-2, %r15d
	xorl	%edi, %edi
	callq	_CHECK_PIXEL_PTR
	movq	%r13, %r14
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	%r14, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %ebx
	cmpl	$-1, %eax
	movq	%r14, %r13
	je	LBB0_18
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_16 Depth 3
                                        ##       Child Loop BB0_11 Depth 3
                                        ##       Child Loop BB0_14 Depth 3
	movq	%r13, %rdi
	callq	_bytestream2_get_bytes_left
	testl	%eax, %eax
	jle	LBB0_19
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	js	LBB0_8
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=2
	leal	(%rbx,%rbx), %edi
	callq	_CHECK_PIXEL_PTR
	movslq	%r15d, %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %r12
	movl	%ebx, %ebx
	movq	%r13, %r14
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r14, %rdi
	callq	_bytestream2_get_be16
	movl	%eax, (%r12,%r13,8)
	incq	%r13
	addl	$2, %r15d
	cmpl	%r13d, %ebx
	jne	LBB0_16
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	%rbx, %r14
	movl	%r14d, %r12d
	negl	%r12d
	movq	%r13, %rdi
	callq	_bytestream2_get_be16
	movl	%eax, %ebx
	leal	(%r12,%r12), %edi
	callq	_CHECK_PIXEL_PTR
	movslq	%r15d, %rax
	testb	$3, %r12b
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	%r14, %rdi
	movl	%r14d, %ecx
	negb	%cl
	movzbl	%cl, %ecx
	andl	$3, %ecx
	xorl	%edx, %edx
	movq	-64(%rbp), %rsi                 ## 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
	movl	%ebx, (%rsi,%rax,4)
	addq	$2, %rax
	incq	%rdx
	cmpl	%edx, %ecx
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=2
	subl	%edx, %r12d
	jmp	LBB0_13
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	%r14, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	%r13, %r14
	movq	%rax, %r15
	cmpl	$-4, %edi
	ja	LBB0_17
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	%ebx, (%rsi,%rax,4)
	movl	%ebx, 8(%rsi,%rax,4)
	movl	%ebx, 16(%rsi,%rax,4)
	leaq	8(%rax), %r15
	movl	%ebx, 24(%rsi,%rax,4)
	movq	%r15, %rax
	addl	$-4, %r12d
	jne	LBB0_14
	jmp	LBB0_17
LBB0_19:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_qtrle_decode_16bpp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qtrle_decode_16bpp
_qtrle_decode_16bpp:                    ; @qtrle_decode_16bpp
	.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
	cbz	w2, LBB0_19
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x0, #16]
	ldp	x9, x8, [x8]
	ldr	w24, [x9]
	ldr	x25, [x8]
	add	x26, x25, #16
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w20, w20, w24
	sub	w19, w19, #1
	cbz	w19, LBB0_19
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;       Child Loop BB0_11 Depth 3
                                        ;       Child Loop BB0_15 Depth 3
                                        ;       Child Loop BB0_17 Depth 3
	mov	x0, x21
	bl	_bytestream2_get_byte
	mov	x23, x0
	mov	w0, #0
	bl	_CHECK_PIXEL_PTR
	mov	x0, x21
	bl	_bytestream2_get_byte
	cmn	w0, #1
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, x0
	add	w8, w20, w23, lsl #1
	sub	w27, w8, #2
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x21
	bl	_bytestream2_get_byte
	add	w8, w27, w0, lsl #1
	sub	w27, w8, #2
	mov	w0, #0
	bl	_CHECK_PIXEL_PTR
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x21
	bl	_bytestream2_get_byte
	mov	x22, x0
	cmn	w0, #1
	b.eq	LBB0_2
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_11 Depth 3
                                        ;       Child Loop BB0_15 Depth 3
                                        ;       Child Loop BB0_17 Depth 3
	mov	x0, x21
	bl	_bytestream2_get_bytes_left
	cmp	w0, #1
	b.lt	LBB0_19
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	cbz	w22, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	tbnz	w22, #31, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=2
	lsl	w0, w22, #1
	bl	_CHECK_PIXEL_PTR
	add	x23, x25, w27, sxtw #2
LBB0_11:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	sub	w22, w22, #1
	mov	x0, x21
	bl	_bytestream2_get_be16
	str	w0, [x23], #8
	add	w27, w27, #2
	cbnz	w22, LBB0_11
	b	LBB0_6
LBB0_12:                                ;   in Loop: Header=BB0_7 Depth=2
	neg	w28, w22
	mov	x0, x21
	bl	_bytestream2_get_be16
	mov	x23, x0
	lsl	w0, w28, #1
	bl	_CHECK_PIXEL_PTR
	sxtw	x10, w27
	cmn	w22, #4
	b.ls	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=2
	mov	x27, x10
	b	LBB0_17
LBB0_14:                                ;   in Loop: Header=BB0_7 Depth=2
	mvn	w8, w22
	add	x8, x8, #1
	and	x9, x8, #0x1fffffffc
	add	x27, x10, x9, lsl #1
	sub	w28, w28, w9
	add	x10, x26, x10, lsl #2
	mov	x11, x9
LBB0_15:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	stur	w23, [x10, #-16]
	stur	w23, [x10, #-8]
	str	w23, [x10]
	str	w23, [x10, #8]
	add	x10, x10, #32
	subs	x11, x11, #4
	b.ne	LBB0_15
; %bb.16:                               ;   in Loop: Header=BB0_7 Depth=2
	cmp	x8, x9
	b.eq	LBB0_18
LBB0_17:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	str	w23, [x25, x27, lsl #2]
	add	x27, x27, #2
	subs	w28, w28, #1
	b.ne	LBB0_17
LBB0_18:                                ;   in Loop: Header=BB0_7 Depth=2
                                        ; kill: def $w27 killed $w27 killed $x27 def $x27
	b	LBB0_6
LBB0_19:
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_qtrle_decode_16bpp
.subsections_via_symbols
