	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function x1r5g5b5_to_dxtn
_x1r5g5b5_to_dxtn:                      ## @x1r5g5b5_to_dxtn
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r15d
	movl	%r8d, %ebx
	movl	%ecx, %r12d
	movl	%edx, %ecx
	movq	%rsi, %r14
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rdi
	movl	%r8d, %esi
	movl	%r9d, %edx
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movl	%r12d, %r8d
	callq	_TRACE
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	imull	%r15d, %ebx
	shll	$2, %ebx
	movl	%eax, %edi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_HeapAlloc
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_12
## %bb.1:
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	testl	%r15d, %r15d
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	je	LBB0_10
## %bb.2:
	movq	24(%rbp), %r8
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	xorl	%r10d, %r10d
	leaq	_x1r5g5b5_to_dxtn.convert_5to8(%rip), %rdi
	xorl	%r11d, %r11d
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r13
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	addl	%esi, %r11d
	addl	-56(%rbp), %r10d                ## 4-byte Folded Reload
	cmpq	-88(%rbp), %r13                 ## 8-byte Folded Reload
	je	LBB0_10
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	testl	%esi, %esi
	je	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r11d, %ecx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rsi
	movl	%r10d, %ecx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rcx
	xorl	%r14d, %r14d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=2
	movl	%r9d, %eax
	andl	$31, %eax
	movzbl	(%rax,%rdi), %eax
	shll	$16, %eax
	movl	%r9d, %edx
	shrl	$5, %edx
	andl	$31, %edx
	movzbl	(%rdx,%rdi), %edx
	shll	$8, %edx
	orl	%eax, %edx
	shrl	$10, %r9d
	andl	$31, %r9d
	movzbl	(%r9,%rdi), %ebx
	orl	%edx, %ebx
	orl	$-16777216, %ebx                ## imm = 0xFF000000
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=2
	movl	%ebx, (%rsi,%r14,4)
	incq	%r14
	cmpq	%r14, %r15
	je	LBB0_9
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rcx,%r14,4), %r9d
	testq	%r8, %r8
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movswl	%r9w, %ebx
	andl	$-16777216, %ebx                ## imm = 0xFF000000
	movl	%r9d, %r12d
	andl	$31, %r12d
	movzbl	(%r12,%rdi), %eax
	shll	$16, %eax
	orl	%ebx, %eax
	movl	%r9d, %ebx
	shrl	$5, %ebx
	andl	$31, %ebx
	movzbl	(%rbx,%rdi), %edx
	shll	$8, %edx
	orl	%eax, %edx
	shrl	$10, %r9d
	andl	$31, %r9d
	movzbl	(%r9,%rdi), %ebx
	orl	%edx, %ebx
	jmp	LBB0_8
LBB0_10:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rsp)
	movl	$4, %edi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rcx
	movl	16(%rbp), %r8d
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	callq	_ptx_compress_dxtn
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_HeapFree
	movq	_TRUE@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_12:
	leaq	L_.str.1(%rip), %rdi
	callq	_ERR
	movq	_FALSE@GOTPCREL(%rip), %rax
LBB0_11:
	movq	(%rax), %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @x1r5g5b5_to_dxtn.convert_5to8
_x1r5g5b5_to_dxtn.convert_5to8:
	.ascii	"\000\b\020\031!)1:BJRZcks{\204\214\224\234\245\255\265\275\305\316\326\336\346\357\367\377"

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Converting %ux%u pixels, pitches %u %u.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate memory for conversion\n"

	.comm	_FALSE,8,3                      ## @FALSE
	.comm	_TRUE,8,3                       ## @TRUE
	.no_dead_strip	_x1r5g5b5_to_dxtn
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function x1r5g5b5_to_dxtn
_x1r5g5b5_to_dxtn:                      ; @x1r5g5b5_to_dxtn
	.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	x24, x7
	mov	x19, x6
	mov	x21, x5
	mov	x23, x4
	mov	x20, x3
	mov	x25, x2
	mov	x22, x1
	mov	x26, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x4
	mov	x2, x5
	mov	x3, x25
	mov	x4, x20
	bl	_TRACE
	bl	_GetProcessHeap
	mul	w8, w23, w21
	lsl	w2, w8, #2
	mov	w1, #0
	bl	_HeapAlloc
	cbz	x0, LBB0_11
; %bb.1:
	mov	x27, x0
	cbz	w21, LBB0_10
; %bb.2:
	mov	w8, #0
	mov	w9, #0
	mov	x10, #0
	mov	w11, w21
	mov	w12, w23
Lloh2:
	adrp	x13, _x1r5g5b5_to_dxtn.convert_5to8@PAGE
Lloh3:
	add	x13, x13, _x1r5g5b5_to_dxtn.convert_5to8@PAGEOFF
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x10, x10, #1
	add	w9, w9, w23
	add	w8, w8, w25
	cmp	x10, x11
	b.eq	LBB0_10
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	cbz	w23, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x14, x27, w9, uxtw #2
	mov	x15, x12
	add	x16, x26, w8, uxtw #2
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=2
	mov	x1, x17
	and	x17, x17, #0x1f
	ldrb	w17, [x13, x17]
	ubfx	x0, x0, #5, #5
	ldrb	w0, [x13, x0]
	lsl	w0, w0, #8
	ubfx	x1, x1, #10, #5
	ldrb	w1, [x13, x1]
	bfi	w0, w17, #16, #16
	orr	w17, w0, w1
	orr	w17, w17, #0xff000000
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	str	w17, [x14], #4
	add	x16, x16, #4
	subs	x15, x15, #1
	b.eq	LBB0_3
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w17, [x16]
	mov	x0, x17
	cbz	x24, LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	sbfx	w1, w17, #15, #1
	and	w1, w1, #0xff000000
	and	x2, x17, #0x1f
	ldrb	w2, [x13, x2]
	ubfx	x17, x17, #5, #5
	ldrb	w17, [x13, x17]
	bfi	w1, w2, #16, #8
	bfi	w1, w17, #8, #8
	ubfx	x17, x0, #10, #5
	ldrb	w17, [x13, x17]
	orr	w17, w1, w17
	b	LBB0_7
LBB0_10:
	mov	w0, #4
	mov	x1, x23
	mov	x2, x21
	mov	x3, x27
	mov	x4, x19
	mov	x5, x22
	mov	x6, x20
	bl	_ptx_compress_dxtn
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x27
	bl	_HeapFree
Lloh4:
	adrp	x8, _TRUE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERR
Lloh8:
	adrp	x8, _FALSE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_12:
	ldr	x0, [x8]
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_x1r5g5b5_to_dxtn.convert_5to8:         ; @x1r5g5b5_to_dxtn.convert_5to8
	.ascii	"\000\b\020\031!)1:BJRZcks{\204\214\224\234\245\255\265\275\305\316\326\336\346\357\367\377"

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Converting %ux%u pixels, pitches %u %u.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate memory for conversion\n"

	.comm	_FALSE,8,3                      ; @FALSE
	.comm	_TRUE,8,3                       ; @TRUE
	.no_dead_strip	_x1r5g5b5_to_dxtn
.subsections_via_symbols
