	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function main
LCPI0_0:
	.quad	0xbf847ae147ae147b              ## double -0.01
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_main
	.p2align	4, 0x90
_main:                                  ## @main
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_error_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_glfwSetErrorCallback
	xorl	%eax, %eax
	callq	_glfwInit
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdx
	movl	$640, %edi                      ## imm = 0x280
	movl	$480, %esi                      ## imm = 0x1E0
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_glfwCreateWindow
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	xorl	%eax, %eax
	callq	_glfwTerminate
LBB0_3:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exit
LBB0_4:
	movq	%rax, %r14
	movq	_key_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_glfwSetKeyCallback
	movq	_framebuffer_size_callback@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_glfwSetFramebufferSizeCallback
	movq	_mouse_button_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_glfwSetMouseButtonCallback
	movq	_cursor_position_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_glfwSetCursorPosCallback
	movq	_scroll_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_glfwSetScrollCallback
	movq	%r14, %rdi
	callq	_glfwMakeContextCurrent
	movq	_glfwGetProcAddress@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gladLoadGL
	movl	$1, %edi
	callq	_glfwSwapInterval
	leaq	-40(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	callq	_glfwGetFramebufferSize
	movl	-40(%rbp), %esi
	movl	-36(%rbp), %edx
	movq	%r14, %rdi
	callq	_framebuffer_size_callback
	xorl	%eax, %eax
	callq	_init_opengl
	xorl	%eax, %eax
	callq	_init_vertices
	xorl	%eax, %eax
	callq	_init_grid
	xorl	%eax, %eax
	callq	_adjust_grid
	xorl	%eax, %eax
	callq	_glfwGetTime
	movsd	%xmm0, -32(%rbp)                ## 8-byte Spill
	movq	%r14, %rdi
	callq	_glfwWindowShouldClose
	testl	%eax, %eax
	jne	LBB0_10
## %bb.5:
	movsd	-32(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	addsd	LCPI0_0(%rip), %xmm0
	movsd	%xmm0, -32(%rbp)                ## 8-byte Spill
	movq	_MAX_DELTA_T@GOTPCREL(%rip), %r15
	movq	_dt@GOTPCREL(%rip), %rbx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	xorl	%eax, %eax
	callq	_adjust_grid
	movq	%r14, %rdi
	callq	_draw_scene
	xorl	%eax, %eax
	callq	_glfwPollEvents
	movq	%r14, %rdi
	callq	_glfwWindowShouldClose
	movsd	-48(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	movsd	%xmm0, -32(%rbp)                ## 8-byte Spill
	testl	%eax, %eax
	jne	LBB0_10
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	xorl	%eax, %eax
	callq	_glfwGetTime
	movsd	%xmm0, -48(%rbp)                ## 8-byte Spill
	movapd	%xmm0, %xmm1
	subsd	-32(%rbp), %xmm1                ## 8-byte Folded Reload
	xorpd	%xmm0, %xmm0
	ucomisd	%xmm0, %xmm1
	jbe	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movsd	(%r15), %xmm0                   ## xmm0 = mem[0],zero
	minsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbx)
	subsd	%xmm0, %xmm1
	movsd	%xmm1, -32(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	callq	_calc_grid
	xorpd	%xmm0, %xmm0
	movsd	-32(%rbp), %xmm1                ## 8-byte Reload
                                        ## xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	ja	LBB0_7
	jmp	LBB0_9
LBB0_10:
	xorl	%eax, %eax
	callq	_glfwTerminate
	movq	_EXIT_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_error_callback,4,2             ## @error_callback
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wave Simulation"

	.comm	_key_callback,4,2               ## @key_callback
	.comm	_mouse_button_callback,4,2      ## @mouse_button_callback
	.comm	_cursor_position_callback,4,2   ## @cursor_position_callback
	.comm	_scroll_callback,4,2            ## @scroll_callback
	.comm	_glfwGetProcAddress,4,2         ## @glfwGetProcAddress
	.comm	_MAX_DELTA_T,8,3                ## @MAX_DELTA_T
	.comm	_dt,8,3                         ## @dt
	.comm	_EXIT_SUCCESS,4,2               ## @EXIT_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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 b8, -56
	.cfi_offset b9, -64
Lloh0:
	adrp	x8, _error_callback@GOTPAGE
Lloh1:
	ldr	x8, [x8, _error_callback@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_glfwSetErrorCallback
	bl	_glfwInit
	cbz	w0, LBB0_3
; %bb.1:
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #640
	mov	w1, #480
	mov	x3, #0
	mov	x4, #0
	bl	_glfwCreateWindow
	cbnz	x0, LBB0_4
; %bb.2:
	bl	_glfwTerminate
LBB0_3:
Lloh5:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_exit
LBB0_4:
	mov	x19, x0
Lloh8:
	adrp	x8, _key_callback@GOTPAGE
Lloh9:
	ldr	x8, [x8, _key_callback@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_glfwSetKeyCallback
Lloh11:
	adrp	x1, _framebuffer_size_callback@GOTPAGE
Lloh12:
	ldr	x1, [x1, _framebuffer_size_callback@GOTPAGEOFF]
	mov	x0, x19
	bl	_glfwSetFramebufferSizeCallback
Lloh13:
	adrp	x8, _mouse_button_callback@GOTPAGE
Lloh14:
	ldr	x8, [x8, _mouse_button_callback@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_glfwSetMouseButtonCallback
Lloh16:
	adrp	x8, _cursor_position_callback@GOTPAGE
Lloh17:
	ldr	x8, [x8, _cursor_position_callback@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_glfwSetCursorPosCallback
Lloh19:
	adrp	x8, _scroll_callback@GOTPAGE
Lloh20:
	ldr	x8, [x8, _scroll_callback@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_glfwSetScrollCallback
	mov	x0, x19
	bl	_glfwMakeContextCurrent
Lloh22:
	adrp	x8, _glfwGetProcAddress@GOTPAGE
Lloh23:
	ldr	x8, [x8, _glfwGetProcAddress@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	bl	_gladLoadGL
	mov	w0, #1
	bl	_glfwSwapInterval
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x19
	bl	_glfwGetFramebufferSize
	ldp	w2, w1, [sp, #8]
	mov	x0, x19
	bl	_framebuffer_size_callback
	bl	_init_opengl
	bl	_init_vertices
	bl	_init_grid
	bl	_adjust_grid
	bl	_glfwGetTime
	fmov	d8, d0
	mov	x0, x19
	bl	_glfwWindowShouldClose
	cbnz	w0, LBB0_9
; %bb.5:
	mov	x8, #5243
	movk	x8, #18350, lsl #16
	movk	x8, #31457, lsl #32
	movk	x8, #49028, lsl #48
	fmov	d0, x8
	fadd	d9, d8, d0
Lloh25:
	adrp	x20, _MAX_DELTA_T@GOTPAGE
Lloh26:
	ldr	x20, [x20, _MAX_DELTA_T@GOTPAGEOFF]
Lloh27:
	adrp	x21, _dt@GOTPAGE
Lloh28:
	ldr	x21, [x21, _dt@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	bl	_adjust_grid
	mov	x0, x19
	bl	_draw_scene
	bl	_glfwPollEvents
	mov	x0, x19
	bl	_glfwWindowShouldClose
	fmov	d9, d8
	cbnz	w0, LBB0_9
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	bl	_glfwGetTime
	fmov	d8, d0
	fsub	d9, d0, d9
	fcmp	d9, #0.0
	b.le	LBB0_6
LBB0_8:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	d0, [x20]
	fcmp	d9, d0
	fcsel	d0, d0, d9, gt
	str	d0, [x21]
	fsub	d9, d9, d0
	bl	_calc_grid
	fcmp	d9, #0.0
	b.gt	LBB0_8
	b	LBB0_6
LBB0_9:
	bl	_glfwTerminate
Lloh29:
	adrp	x8, _EXIT_SUCCESS@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EXIT_SUCCESS@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_error_callback,4,2             ; @error_callback
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wave Simulation"

	.comm	_key_callback,4,2               ; @key_callback
	.comm	_mouse_button_callback,4,2      ; @mouse_button_callback
	.comm	_cursor_position_callback,4,2   ; @cursor_position_callback
	.comm	_scroll_callback,4,2            ; @scroll_callback
	.comm	_glfwGetProcAddress,4,2         ; @glfwGetProcAddress
	.comm	_MAX_DELTA_T,8,3                ; @MAX_DELTA_T
	.comm	_dt,8,3                         ; @dt
	.comm	_EXIT_SUCCESS,4,2               ; @EXIT_SUCCESS
.subsections_via_symbols
