	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function convert_r16g16
_convert_r16g16:                        ## @convert_r16g16
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	32(%rbp), %eax
	testl	%eax, %eax
	je	LBB0_13
## %bb.1:
	movl	16(%rbp), %r12d
	movl	%eax, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	24(%rbp), %r13d
	leal	-1(%r12), %r14d
	movl	%r12d, %eax
	andl	$-4, %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%r12d, %eax
	andl	$3, %eax
	xorl	%ecx, %ecx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	incq	%rsi
	movq	%rsi, %rcx
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	cmpq	-88(%rbp), %rsi                 ## 8-byte Folded Reload
	je	LBB0_13
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
                                        ##       Child Loop BB0_7 Depth 3
                                        ##       Child Loop BB0_10 Depth 3
	cmpl	$0, 24(%rbp)
	je	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%edi, %ecx
	imull	-52(%rbp), %ecx                 ## 4-byte Folded Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	leaq	(%rsi,%rcx,4), %r10
	movl	%edi, %ecx
	imull	-56(%rbp), %ecx                 ## 4-byte Folded Reload
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	leaq	(%rsi,%rcx,4), %r11
	xorl	%r9d, %r9d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=2
	incq	%r9
	cmpq	%r13, %r9
	je	LBB0_12
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_7 Depth 3
                                        ##       Child Loop BB0_10 Depth 3
	testl	%r12d, %r12d
	je	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%r9d, %ecx
	imull	%r8d, %ecx
	movl	%r9d, %esi
	imull	%edx, %esi
	leaq	(%r11,%rcx,4), %rcx
	leaq	(%r10,%rsi,4), %rsi
	cmpl	$3, %r14d
	jb	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	-60(%rbp), %r15d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	(%rsi), %rdi
	movq	%rdi, (%rcx)
	movl	$65535, 8(%rcx)                 ## imm = 0xFFFF
	movq	8(%rsi), %rdi
	movq	%rdi, 12(%rcx)
	movl	$65535, 20(%rcx)                ## imm = 0xFFFF
	movq	16(%rsi), %rdi
	movq	%rdi, 24(%rcx)
	movl	$65535, 32(%rcx)                ## imm = 0xFFFF
	movq	24(%rsi), %rdi
	addq	$32, %rsi
	movq	%rdi, 36(%rcx)
	movl	$65535, 44(%rcx)                ## imm = 0xFFFF
	addq	$48, %rcx
	addl	$-4, %r15d
	jne	LBB0_7
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=2
	testb	$3, %r12b
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=2
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	(%rsi,%rdi,8), %rbx
	movq	%rbx, (%rcx)
	movl	$65535, 8(%rcx)                 ## imm = 0xFFFF
	incq	%rdi
	addq	$12, %rcx
	cmpl	%edi, %eax
	jne	LBB0_10
	jmp	LBB0_11
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_convert_r16g16
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function convert_r16g16
_convert_r16g16:                        ; @convert_r16g16
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	.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
	stp	w7, w5, [sp, #56]               ; 8-byte Folded Spill
	stp	x0, x1, [sp, #32]               ; 16-byte Folded Spill
	ldr	w8, [sp, #160]
	str	x8, [sp, #48]                   ; 8-byte Folded Spill
	cbz	w8, LBB0_16
; %bb.1:
	mov	w8, #0
	mov	w12, #0
	mov	x9, #0
	ldr	w10, [sp, #56]                  ; 4-byte Folded Reload
	mov	w10, w10
	sub	w11, w6, #1
	mov	w13, #12
	ldp	x15, x14, [sp, #32]             ; 16-byte Folded Reload
	umaddl	x13, w11, w13, x14
	add	x14, x13, #12
	add	x13, x15, w11, uxtw #3
	add	x13, x13, #8
	stp	x13, x14, [sp, #16]             ; 16-byte Folded Spill
	add	x14, x11, #1
	and	x21, x14, #0x1fffffff8
	lsl	x16, x21, #1
	add	x17, x16, x21
	add	x13, x15, #32
	str	x13, [sp, #8]                   ; 8-byte Folded Spill
	mov	w20, #65535
	movi.2d	v2, #0x00ffff0000ffff
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x9, #1
	add	w12, w5, w3
	ldr	w8, [sp, #60]                   ; 4-byte Folded Reload
	add	w8, w22, w8
	ldr	x13, [sp, #48]                  ; 8-byte Folded Reload
	cmp	x9, x13
	b.eq	LBB0_16
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;       Child Loop BB0_14 Depth 3
                                        ;       Child Loop BB0_12 Depth 3
	mov	w5, w12
	mov	w22, w8
	ldr	w8, [sp, #56]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #0
	mov	w24, #0
	mov	x25, #0
	mul	w8, w9, w3
	lsl	x8, x8, #2
	ldr	w12, [sp, #60]                  ; 4-byte Folded Reload
	mul	w12, w9, w12
	lsl	x12, x12, #2
	ldp	x15, x13, [sp, #24]             ; 16-byte Folded Reload
	add	x26, x13, x8
	ldr	x13, [sp, #40]                  ; 8-byte Folded Reload
	add	x27, x13, x12
	add	x28, x15, x12
	ldr	x12, [sp, #16]                  ; 8-byte Folded Reload
	add	x30, x12, x8
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	add	x12, x8, x5, lsl #2
	add	x13, x13, x22, lsl #2
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	add	x25, x25, #1
	add	w24, w24, w2
	add	w23, w23, w4
	cmp	x25, x10
	b.eq	LBB0_2
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_14 Depth 3
                                        ;       Child Loop BB0_12 Depth 3
	cbz	w6, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	mul	w8, w25, w4
	add	x19, x27, w8, uxtw #2
	mul	w8, w25, w2
	add	x8, x26, w8, uxtw #2
	cmp	w11, #7
	b.lo	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=2
	mul	w15, w25, w4
	lsl	x15, x15, #2
	add	x7, x27, x15
	mul	w0, w25, w2
	lsl	x0, x0, #2
	add	x1, x30, x0
	cmp	x7, x1
	b.hs	LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=2
	add	x15, x28, x15
	add	x0, x26, x0
	cmp	x0, x15
	b.hs	LBB0_13
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	w15, #0
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=2
	sub	w15, w6, w15
LBB0_12:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_6 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	d3, [x8], #8
	str	d3, [x19]
	str	w20, [x19, #8]
	add	x19, x19, #12
	subs	w15, w15, #1
	b.ne	LBB0_12
	b	LBB0_5
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=2
	add	x0, x12, w24, uxtw #2
	add	x7, x13, w23, uxtw #2
	add	x19, x19, x17, lsl #2
	mov	x15, x21
	add	x8, x8, x16, lsl #2
LBB0_14:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_6 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	sub	x1, x0, #32
	ld2.4s	{ v0, v1 }, [x1]
	ld2.4s	{ v3, v4 }, [x0]
	mov.16b	v5, v2
	add	x1, x7, #96
	st3.4s	{ v0, v1, v2 }, [x7], #48
	st3.4s	{ v3, v4, v5 }, [x7]
	add	x0, x0, #64
	mov	x7, x1
	subs	x15, x15, #8
	b.ne	LBB0_14
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=2
	mov	x15, x21
	cmp	x14, x21
	b.eq	LBB0_5
	b	LBB0_11
LBB0_16:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_convert_r16g16
.subsections_via_symbols
