	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function halveImage
LCPI0_0:
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_halveImage:                            ## @halveImage
	.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	%esi, -44(%rbp)                 ## 4-byte Spill
                                        ## kill: def $edi killed $edi def $rdi
	cmpl	$2, %edx
	jl	LBB0_21
## %bb.1:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, %esi
	shrl	$31, %esi
	addl	%edx, %esi
	sarl	%esi
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	imull	%edi, %eax
	movslq	%edi, %rsi
	movslq	%eax, %rdx
	leal	(%rdx,%rdi), %eax
	cltq
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	leaq	(,%rax,4), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	leaq	(,%rdx,4), %r13
	leaq	(,%rsi,4), %r14
	leal	-1(%rsi), %eax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	incq	%rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	andq	$-4, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [2,2,2,2]
	movq	%rdi, -120(%rbp)                ## 8-byte Spill
	movq	%rsi, -112(%rbp)                ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r8, %r15
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rcx
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	incl	%eax
	movq	%r15, %r8
	cmpl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	je	LBB0_21
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##       Child Loop BB0_14 Depth 3
                                        ##       Child Loop BB0_17 Depth 3
	cmpl	$2, -44(%rbp)                   ## 4-byte Folded Reload
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	jl	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r9d, %r9d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=2
	movq	%r8, %r15
	movq	%rcx, %r11
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=2
	leaq	(%r11,%rsi,4), %rcx
	incl	%r9d
	movq	%r15, %r8
	cmpl	-52(%rbp), %r9d                 ## 4-byte Folded Reload
	je	LBB0_20
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_14 Depth 3
                                        ##       Child Loop BB0_17 Depth 3
	testl	%edi, %edi
	jle	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=2
	xorl	%ebx, %ebx
	cmpl	$3, -128(%rbp)                  ## 4-byte Folded Reload
	jb	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	addq	%rcx, %rax
	movq	%r8, %rdx
	subq	%rax, %rdx
	cmpq	$16, %rdx
	jb	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%r8, %rdx
	subq	%r13, %rdx
	subq	%rcx, %rdx
	cmpq	$16, %rdx
	jb	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%r8, %rdx
	subq	%r14, %rdx
	subq	%rcx, %rdx
	cmpq	$16, %rdx
	jb	LBB0_8
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%r8, %rax
	subq	%rcx, %rax
	cmpq	$16, %rax
	jb	LBB0_8
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	leaq	(%rcx,%rbx,4), %r11
	leaq	(%r8,%rbx,4), %r15
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_5 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movdqu	(%rcx), %xmm1
	movdqu	(%rcx,%r14), %xmm2
	paddd	%xmm1, %xmm2
	movdqu	(%rcx,%r13), %xmm1
	movdqu	(%rcx,%rax), %xmm3
	paddd	%xmm1, %xmm3
	paddd	%xmm2, %xmm3
	paddd	%xmm0, %xmm3
	movdqa	%xmm3, %xmm1
	psrad	$31, %xmm1
	psrld	$30, %xmm1
	paddd	%xmm3, %xmm1
	psrad	$2, %xmm1
	movdqu	%xmm1, (%r8)
	addq	$16, %r8
	addq	$16, %rcx
	addq	$-4, %rbx
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, %ebx
	cmpq	%rax, -96(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_19
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=2
	movq	%rcx, %r11
	movq	%r8, %r15
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=2
	leaq	(%r11,%rsi,4), %r8
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	leaq	(%r11,%rax,4), %r10
	movq	-104(%rbp), %rax                ## 8-byte Reload
	leaq	(%r11,%rax,4), %rax
	movq	%rdi, %rsi
                                        ## kill: def $esi killed $esi killed $rsi def $rsi
	subl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_5 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	(%r11,%rdi,4), %ecx
	movl	(%rax,%rdi,4), %ebx
	addl	(%r8,%rdi,4), %ecx
	addl	(%r10,%rdi,4), %ecx
	leal	(%rbx,%rcx), %r12d
	addl	$2, %r12d
	addl	%ebx, %ecx
	addl	$5, %ecx
	testl	%r12d, %r12d
	cmovnsl	%r12d, %ecx
	sarl	$2, %ecx
	movl	%ecx, (%r15,%rdi,4)
	incq	%rdi
	addq	$-4, %rdx
	cmpl	%edi, %esi
	jne	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=2
	subq	%rdx, %r11
	subq	%rdx, %r15
	movq	-120(%rbp), %rdi                ## 8-byte Reload
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	jmp	LBB0_19
LBB0_21:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_halveImage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function halveImage
_halveImage:                            ; @halveImage
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	.cfi_offset w19, -8
	.cfi_offset w20, -16
	.cfi_offset w21, -24
	.cfi_offset w22, -32
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w1, #0
	cinc	w9, w1, lt
	cmp	w2, #0
	cinc	w10, w2, lt
	cmp	w2, #2
	b.lt	LBB0_21
; %bb.1:
	mov	w8, #0
	asr	w9, w9, #1
	asr	w10, w10, #1
	mul	w14, w1, w0
	sxtw	x11, w0
	sxtw	x12, w14
	add	w13, w14, w0
	sbfiz	x13, x13, #2, #32
	sbfiz	x14, x14, #2, #32
	sbfiz	x15, x0, #2, #32
	sub	w16, w0, #1
	add	x17, x16, #1
	and	x2, x17, #0x1fffffffc
	movi.4s	v0, #2
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x6, x4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x3, x3, x12, lsl #2
	add	w8, w8, #1
	mov	x4, x6
	cmp	w8, w10
	b.eq	LBB0_21
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;       Child Loop BB0_16 Depth 3
                                        ;       Child Loop BB0_20 Depth 3
	cmp	w1, #2
	b.lt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w5, #0
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=2
	mov	x6, x4
	mov	x7, x3
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	x3, x7, x11, lsl #2
	add	w5, w5, #1
	mov	x4, x6
	cmp	w5, w9
	b.eq	LBB0_3
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_16 Depth 3
                                        ;       Child Loop BB0_20 Depth 3
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	cmp	w16, #3
	b.hs	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=2
	mov	w19, #0
	b	LBB0_18
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=2
	mov	w19, #0
	add	x6, x13, x3
	sub	x6, x4, x6
	cmp	x6, #16
	b.lo	LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=2
	add	x6, x14, x3
	sub	x6, x4, x6
	cmp	x6, #16
	b.lo	LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=2
	add	x6, x15, x3
	sub	x6, x4, x6
	cmp	x6, #16
	b.lo	LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_8 Depth=2
	sub	x6, x4, x3
	cmp	x6, #16
	b.lo	LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_8 Depth=2
	lsl	x6, x2, #2
	add	x7, x3, x6
	add	x6, x4, x6
	mov	x19, x2
LBB0_16:                                ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_8 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	q1, [x3, x15]
	ldr	q2, [x3, x14]
	ldr	q3, [x3, x13]
	ldr	q4, [x3], #16
	add.4s	v1, v4, v1
	add.4s	v1, v1, v2
	add.4s	v1, v1, v3
	add.4s	v1, v1, v0
	cmlt.4s	v2, v1, #0
	usra.4s	v1, v2, #30
	sshr.4s	v1, v1, #2
	str	q1, [x4], #16
	subs	x19, x19, #4
	b.ne	LBB0_16
; %bb.17:                               ;   in Loop: Header=BB0_8 Depth=2
	mov	x19, x2
	cmp	x17, x2
	b.eq	LBB0_7
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_8 Depth=2
	mov	x7, x3
	mov	x6, x4
LBB0_19:                                ;   in Loop: Header=BB0_8 Depth=2
	sub	w3, w0, w19
LBB0_20:                                ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_8 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w4, [x7]
	ldr	w19, [x7, x15]
	ldr	w20, [x7, x14]
	ldr	w21, [x7, x13]
	add	w4, w4, w19
	add	w4, w4, w20
	add	w4, w4, w21
	add	w19, w4, #2
	add	w4, w4, #5
	cmp	w19, #0
	csel	w4, w4, w19, lt
	asr	w4, w4, #2
	str	w4, [x6], #4
	add	x7, x7, #4
	subs	w3, w3, #1
	b.ne	LBB0_20
	b	LBB0_7
LBB0_21:
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_halveImage
.subsections_via_symbols
