	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function halveImage_ushort
_halveImage_ushort:                     ## @halveImage_ushort
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r15d
	movq	%r8, %r12
	movq	%rcx, %rbx
	movl	%edx, %r13d
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	cmpl	$1, %esi
	je	LBB0_21
## %bb.1:
	cmpl	$1, %r13d
	je	LBB0_21
## %bb.2:
	movl	24(%rbp), %eax
	movl	16(%rbp), %ecx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, %edx
	shrl	$31, %edx
	addl	%esi, %edx
	sarl	%edx
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movl	%r13d, %edx
	shrl	$31, %edx
	addl	%r13d, %edx
	sarl	%edx
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movl	%eax, %edx
	imull	%esi, %edx
	movl	%ecx, %esi
	subl	%edx, %esi
	cmpl	$0, 32(%rbp)
	je	LBB0_11
## %bb.3:
	cmpl	$2, %r13d
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	jl	LBB0_20
## %bb.4:
	movl	%r15d, %edx
	movslq	%eax, %r15
	movslq	%ecx, %r13
	movslq	%edx, %rax
	movslq	%esi, %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	leaq	(%r15,%r13), %rcx
	movl	$0, -56(%rbp)                   ## 4-byte Folded Spill
	movq	%r15, -112(%rbp)                ## 8-byte Spill
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	addq	-80(%rbp), %rbx                 ## 8-byte Folded Reload
	addq	%r13, %rbx
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	incl	%edx
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	cmpl	-52(%rbp), %edx                 ## 4-byte Folded Reload
	je	LBB0_20
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##       Child Loop BB0_8 Depth 3
	cmpl	$2, -44(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%edx, %edx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=2
	addq	%r15, %rbx
	movl	-64(%rbp), %edx                 ## 4-byte Reload
	incl	%edx
	cmpl	-60(%rbp), %edx                 ## 4-byte Folded Reload
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	je	LBB0_10
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_8 Depth 3
	testl	%r14d, %r14d
	movl	%edx, -64(%rbp)                 ## 4-byte Spill
	jle	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_7 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%rbx, %rdi
	callq	___GLU_SWAP_2_BYTES
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	leaq	(%rbx,%r15), %rdi
	callq	___GLU_SWAP_2_BYTES
	movl	%eax, %r15d
	leaq	(%rbx,%r13), %rdi
	callq	___GLU_SWAP_2_BYTES
	movq	%r12, %r13
	movl	%eax, %r12d
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rbx,%rax), %rdi
	callq	___GLU_SWAP_2_BYTES
                                        ## kill: def $eax killed $eax def $rax
	addl	-68(%rbp), %r15d                ## 4-byte Folded Reload
	addl	%r12d, %r15d
	movq	%r13, %r12
	movq	-104(%rbp), %r13                ## 8-byte Reload
	leal	(%rax,%r15), %ecx
	addl	$2, %ecx
	addl	%r15d, %eax
	addl	$5, %eax
	movq	-112(%rbp), %r15                ## 8-byte Reload
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$2, %eax
	movl	%eax, (%r12)
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	addq	$4, %r12
	addq	%rax, %rbx
	decl	%r14d
	jne	LBB0_8
	jmp	LBB0_9
LBB0_21:
	movl	%r13d, %eax
	xorl	$1, %eax
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %ecx
	xorl	$1, %ecx
	xorl	%edi, %edi
	orl	%eax, %ecx
	setne	%dil
	callq	_assert
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movl	%r14d, %esi
	movl	%r13d, %edx
	movq	%rbx, %rcx
	movq	%r12, %r8
	movl	%r15d, %r9d
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_halve1Dimage_ushort            ## TAILCALL
LBB0_11:
	cmpl	$2, %r13d
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	jl	LBB0_20
## %bb.12:
	cltq
	movslq	%ecx, %r11
	movslq	%r15d, %r14
	movslq	%esi, %r8
	leaq	(%rax,%r11), %r15
	xorl	%r9d, %r9d
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_13 Depth=1
	addq	%r8, %rbx
	addq	%r11, %rbx
	incl	%r9d
	cmpl	-52(%rbp), %r9d                 ## 4-byte Folded Reload
	je	LBB0_20
LBB0_13:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
                                        ##       Child Loop BB0_17 Depth 3
	cmpl	$2, -44(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	xorl	%r10d, %r10d
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_15 Depth=2
	addq	%rax, %rbx
	incl	%r10d
	cmpl	-60(%rbp), %r10d                ## 4-byte Folded Reload
	je	LBB0_19
LBB0_15:                                ##   Parent Loop BB0_13 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_17 Depth 3
	testl	%r13d, %r13d
	jle	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=2
	movl	%r13d, %esi
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_13 Depth=1
                                        ##     Parent Loop BB0_15 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	(%rbx), %ecx
	movl	(%rbx,%r15), %edx
	addl	(%rbx,%rax), %ecx
	addl	(%rbx,%r11), %ecx
	leal	(%rdx,%rcx), %edi
	addl	$2, %edi
	addl	%edx, %ecx
	addl	$5, %ecx
	testl	%edi, %edi
	cmovnsl	%edi, %ecx
	sarl	$2, %ecx
	movl	%ecx, (%r12)
	addq	$4, %r12
	addq	%r14, %rbx
	decl	%esi
	jne	LBB0_17
	jmp	LBB0_18
LBB0_20:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_halveImage_ushort
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function halveImage_ushort
_halveImage_ushort:                     ; @halveImage_ushort
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x25, x6
	mov	x23, x5
	mov	x19, x4
	mov	x20, x3
	mov	x26, x2
	mov	x22, x0
	ldr	w21, [x29, #16]
	str	w1, [sp, #12]                   ; 4-byte Folded Spill
	cmp	w1, #1
	b.eq	LBB0_11
; %bb.1:
	cmp	w26, #1
	b.eq	LBB0_11
; %bb.2:
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w9, #0
	cinc	w8, w9, lt
	asr	w8, w8, #1
	str	w8, [sp, #24]                   ; 4-byte Folded Spill
	cmp	w26, #0
	cinc	w8, w26, lt
	asr	w8, w8, #1
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	mul	w8, w24, w9
	sxtw	x28, w25
	sub	x8, x28, w8, sxtw
	str	x8, [sp]                        ; 8-byte Folded Spill
	cmp	w26, #2
	cbz	w21, LBB0_12
; %bb.3:
	b.lt	LBB0_21
; %bb.4:
	stp	wzr, w22, [sp, #16]             ; 8-byte Folded Spill
	sxtw	x21, w24
	sxtw	x26, w23
	add	x27, x21, x28
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	add	x8, x20, x8
	add	x20, x8, x28
	ldr	w9, [sp, #16]                   ; 4-byte Folded Reload
	add	w9, w9, #1
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	str	w9, [sp, #16]                   ; 4-byte Folded Spill
	cmp	w9, w8
	b.eq	LBB0_21
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
                                        ;       Child Loop BB0_10 Depth 3
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w8, #2
	b.lt	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w9, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	add	x20, x20, x21
	ldp	w8, w9, [sp, #24]               ; 8-byte Folded Reload
	add	w9, w9, #1
	cmp	w9, w8
	ldr	w22, [sp, #20]                  ; 4-byte Folded Reload
	b.eq	LBB0_5
LBB0_9:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_10 Depth 3
	cmp	w22, #1
	str	w9, [sp, #28]                   ; 4-byte Folded Spill
	b.lt	LBB0_8
LBB0_10:                                ;   Parent Loop BB0_6 Depth=1
                                        ;     Parent Loop BB0_9 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x20
	bl	___GLU_SWAP_2_BYTES
	mov	x23, x0
	add	x0, x20, x21
	bl	___GLU_SWAP_2_BYTES
	mov	x24, x0
	add	x0, x20, x28
	bl	___GLU_SWAP_2_BYTES
	mov	x25, x0
	add	x0, x20, x27
	bl	___GLU_SWAP_2_BYTES
	add	w8, w23, w24
	add	w8, w8, w25
	add	w8, w8, w0
	add	w9, w8, #2
	add	w8, w8, #5
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w8, w8, #2
	str	w8, [x19], #4
	add	x20, x20, x26
	subs	w22, w22, #1
	b.ne	LBB0_10
	b	LBB0_8
LBB0_11:
	mov	x27, x22
	ldr	w22, [sp, #12]                  ; 4-byte Folded Reload
	cmp	w22, #1
	ccmp	w26, #1, #0, eq
	cset	w0, ne
	bl	_assert
	str	w21, [x29, #16]
	mov	x0, x27
	mov	x1, x22
	mov	x2, x26
	mov	x3, x20
	mov	x4, x19
	mov	x5, x23
	mov	x6, x25
	mov	x7, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_halve1Dimage_ushort
LBB0_12:
	b.lt	LBB0_21
; %bb.13:
	mov	w8, #0
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	sxtw	x9, w24
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	sxtw	x10, w23
	ldr	x11, [sp]                       ; 8-byte Folded Reload
                                        ; kill: def $w11 killed $w11 killed $x11 def $x11
	sxtw	x11, w11
	add	x12, x9, x28
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x13, x20, x11
	add	x20, x13, x28
	add	w8, w8, #1
	ldr	w13, [sp, #8]                   ; 4-byte Folded Reload
	cmp	w8, w13
	b.eq	LBB0_21
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
                                        ;       Child Loop BB0_20 Depth 3
	ldr	w13, [sp, #12]                  ; 4-byte Folded Reload
	cmp	w13, #2
	b.lt	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	w13, #0
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=2
	add	x20, x20, x9
	add	w13, w13, #1
	ldr	w14, [sp, #24]                  ; 4-byte Folded Reload
	cmp	w13, w14
	b.eq	LBB0_14
LBB0_18:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_20 Depth 3
	cmp	w22, #1
	b.lt	LBB0_17
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=2
	mov	x14, x22
LBB0_20:                                ;   Parent Loop BB0_15 Depth=1
                                        ;     Parent Loop BB0_18 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w15, [x20]
	ldr	w16, [x20, x9]
	ldr	w17, [x20, x28]
	ldr	w1, [x20, x12]
	add	w15, w15, w16
	add	w15, w15, w17
	add	w15, w15, w1
	add	w16, w15, #2
	add	w15, w15, #5
	cmp	w16, #0
	csel	w15, w15, w16, lt
	asr	w15, w15, #2
	str	w15, [x19], #4
	add	x20, x20, x10
	subs	w14, w14, #1
	b.ne	LBB0_20
	b	LBB0_17
LBB0_21:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_halveImage_ushort
.subsections_via_symbols
