	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function init_grid
LCPI0_0:
	.quad	0x3fb999999999999a              ## double 0.10000000000000001
LCPI0_1:
	.quad	0x4024000000000000              ## double 10
LCPI0_2:
	.quad	0xc059000000000000              ## double -100
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_init_grid
	.p2align	4, 0x90
_init_grid:                             ## @init_grid
	.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
	movq	_GRIDH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testl	%eax, %eax
	jle	LBB0_8
## %bb.1:
	movq	_GRIDW@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %r12d
	shrl	$31, %r12d
	addl	%ebx, %r12d
	sarl	%r12d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
                                        ## kill: def $eax killed $eax killed $rax
	cvtsi2sd	%r12d, %xmm2
	shrl	%eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	negl	%r12d
	mulsd	LCPI0_0(%rip), %xmm2
	leal	(,%rbx,4), %eax
	cvtsi2sd	%eax, %xmm0
	movsd	%xmm0, -80(%rbp)                ## 8-byte Spill
	movq	_vx@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_vy@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	xorl	%r14d, %r14d
	movsd	%xmm2, -88(%rbp)                ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	cmpq	-56(%rbp), %r14                 ## 8-byte Folded Reload
	je	LBB0_8
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r14d, %eax
	subl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	xorps	%xmm3, %xmm3
	cvtsi2sd	%eax, %xmm3
	mulsd	%xmm3, %xmm3
	movq	_p@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	xorl	%r13d, %r13d
	movsd	%xmm3, -96(%rbp)                ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	(%rdx,%r13,8), %rax
	movsd	%xmm0, (%rax,%r14,8)
	movq	(%r15,%r13,8), %rax
	movq	$0, (%rax,%r14,8)
	movq	(%rdi,%r13,8), %rax
	movq	$0, (%rax,%r14,8)
	incq	%r13
	cmpq	%r13, %rbx
	je	LBB0_7
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	(%r12,%r13), %eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	mulsd	%xmm0, %xmm0
	addsd	%xmm3, %xmm0
	xorps	%xmm1, %xmm1
	sqrtsd	%xmm0, %xmm1
	xorpd	%xmm0, %xmm0
	ucomisd	%xmm1, %xmm2
	jbe	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	mulsd	LCPI0_1(%rip), %xmm1
	movq	_M_PI@GOTPCREL(%rip), %rax
	movsd	(%rax), %xmm0                   ## xmm0 = mem[0],zero
	divsd	-80(%rbp), %xmm0                ## 8-byte Folded Reload
	mulsd	%xmm1, %xmm0
	movq	%rdx, %rbx
	callq	_cos
	movq	%rbx, %rdx
	movsd	-96(%rbp), %xmm3                ## 8-byte Reload
                                        ## xmm3 = mem[0],zero
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movsd	-88(%rbp), %xmm2                ## 8-byte Reload
                                        ## xmm2 = mem[0],zero
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	mulsd	LCPI0_2(%rip), %xmm0
	jmp	LBB0_6
LBB0_8:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GRIDH,4,2                      ## @GRIDH
	.comm	_GRIDW,4,2                      ## @GRIDW
	.comm	_M_PI,8,3                       ## @M_PI
	.comm	_p,8,3                          ## @p
	.comm	_vx,8,3                         ## @vx
	.comm	_vy,8,3                         ## @vy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_grid                      ; -- Begin function init_grid
	.p2align	2
_init_grid:                             ; @init_grid
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	d11, d10, [sp, #32]             ; 16-byte Folded Spill
	stp	d9, d8, [sp, #48]               ; 16-byte Folded Spill
	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
	add	x29, sp, #144
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	.cfi_offset b10, -120
	.cfi_offset b11, -128
Lloh0:
	adrp	x8, _GRIDH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GRIDH@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	cmp	w19, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x20, #0
Lloh3:
	adrp	x8, _GRIDW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GRIDW@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	cmp	w22, #0
	cinc	w8, w22, lt
	asr	w8, w8, #1
	ubfx	x9, x19, #1, #31
	str	x9, [sp, #24]                   ; 8-byte Folded Spill
	scvtf	d0, w8
	mov	x9, #-7378697629483820647
	movk	x9, #39322
	movk	x9, #16313, lsl #48
	fmov	d1, x9
	lsl	w9, w22, #2
	scvtf	d8, w9
Lloh6:
	adrp	x9, _vx@GOTPAGE
Lloh7:
	ldr	x9, [x9, _vx@GOTPAGEOFF]
	fmul	d9, d0, d1
Lloh8:
	ldr	x9, [x9]
	str	x9, [sp, #16]                   ; 8-byte Folded Spill
Lloh9:
	adrp	x9, _vy@GOTPAGE
Lloh10:
	ldr	x9, [x9, _vy@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	neg	w8, w8
	str	w8, [sp, #4]                    ; 4-byte Folded Spill
	fmov	d10, #10.00000000
Lloh12:
	adrp	x27, _M_PI@GOTPAGE
Lloh13:
	ldr	x27, [x27, _M_PI@GOTPAGEOFF]
	mov	x28, #-4586634745500139520
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x20, x20, #1
	cmp	x20, x19
	b.eq	LBB0_8
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	cmp	w22, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldp	x24, x8, [sp, #16]              ; 16-byte Folded Reload
	sub	w8, w20, w8
	scvtf	d0, w8
	fmul	d11, d0, d0
Lloh14:
	adrp	x8, _p@GOTPAGE
Lloh15:
	ldr	x8, [x8, _p@GOTPAGEOFF]
Lloh16:
	ldr	x26, [x8]
	mov	x21, x22
	ldr	w25, [sp, #4]                   ; 4-byte Folded Reload
	ldr	x23, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	ldr	x8, [x26], #8
	lsl	x9, x20, #3
	str	d0, [x8, x9]
	ldr	x8, [x24], #8
	str	xzr, [x8, x9]
	ldr	x8, [x23], #8
	str	xzr, [x8, x9]
	add	w25, w25, #1
	subs	x21, x21, #1
	b.eq	LBB0_2
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	scvtf	d0, w25
	fmadd	d0, d0, d0, d11
	fsqrt	d1, d0
	movi	d0, #0000000000000000
	fcmp	d1, d9
	b.pl	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	fmul	d0, d1, d10
	ldr	d1, [x27]
	fdiv	d1, d1, d8
	fmul	d0, d0, d1
	bl	_cos
	fmov	d1, x28
	fmul	d0, d0, d1
	b	LBB0_5
LBB0_8:
	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
	ldp	d9, d8, [sp, #48]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_GRIDH,4,2                      ; @GRIDH
	.comm	_GRIDW,4,2                      ; @GRIDW
	.comm	_M_PI,8,3                       ; @M_PI
	.comm	_p,8,3                          ; @p
	.comm	_vx,8,3                         ; @vx
	.comm	_vy,8,3                         ; @vy
.subsections_via_symbols
