	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function physics_thread_main
_physics_thread_main:                   ## @physics_thread_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_thread_sync@GOTPCREL(%rip), %r13
	leaq	20(%r13), %rbx
	leaq	-48(%rbp), %r15
	leaq	32(%r13), %r12
	leaq	16(%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movq	%rbx, %rdi
	callq	_mtx_lock
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	callq	_glfwWindowShouldClose
	testq	%rax, %rax
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	8(%r13), %rax
	cmpq	%rax, (%r13)
	jle	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	_CLOCK_REALTIME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_clock_gettime
	movl	-48(%rbp), %eax
	leal	100000000(%rax), %ecx
	movslq	%ecx, %rcx
	imulq	$1152921505, %rcx, %rcx         ## imm = 0x44B82FA1
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$60, %rcx
	addl	%edx, %ecx
	addl	%ecx, -44(%rbp)
	imull	$1000000000, %ecx, %ecx         ## imm = 0x3B9ACA00
	negl	%ecx
	addl	%ecx, %eax
	addl	$100000000, %eax                ## imm = 0x5F5E100
	movl	%eax, -48(%rbp)
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_cnd_timedwait
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_glfwWindowShouldClose
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	24(%r13), %esi
	movl	28(%r13), %edi
	callq	_particle_engine
	incq	(%r13)
	movq	%rbx, %rdi
	callq	_mtx_unlock
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_cnd_signal
	jmp	LBB0_1
LBB0_7:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_thread_sync,40,3               ## @thread_sync
	.comm	_CLOCK_REALTIME,4,2             ## @CLOCK_REALTIME
	.no_dead_strip	_physics_thread_main
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function physics_thread_main
_physics_thread_main:                   ; @physics_thread_main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [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 w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	mov	w20, #51712
	movk	w20, #15258, lsl #16
Lloh0:
	adrp	x21, _thread_sync@GOTPAGE
Lloh1:
	ldr	x21, [x21, _thread_sync@GOTPAGEOFF]
Lloh2:
	adrp	x22, _CLOCK_REALTIME@GOTPAGE
Lloh3:
	ldr	x22, [x22, _CLOCK_REALTIME@GOTPAGEOFF]
	mov	w23, #57600
	movk	w23, #1525, lsl #16
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
	add	x0, x21, #20
	bl	_mtx_lock
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	bl	_glfwWindowShouldClose
	cbnz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=2
	ldp	x8, x9, [x21]
	cmp	x8, x9
	b.le	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=2
	ldr	w0, [x22]
	add	x1, sp, #8
	bl	_clock_gettime
	ldp	w8, w9, [sp, #8]
	add	w8, w8, w23
	sdiv	w10, w8, w20
	add	w9, w9, w10
	msub	w8, w10, w20, w8
	stp	w8, w9, [sp, #8]
	add	x0, x21, #32
	add	x1, x21, #20
	add	x2, sp, #8
	bl	_cnd_timedwait
	b	LBB0_2
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	bl	_glfwWindowShouldClose
	cbnz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	ldp	w1, w0, [x21, #24]
	bl	_particle_engine
	ldr	x8, [x21]
	add	x8, x8, #1
	str	x8, [x21]
	add	x0, x21, #20
	bl	_mtx_unlock
	add	x0, x21, #16
	bl	_cnd_signal
	b	LBB0_1
LBB0_7:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_thread_sync,40,3               ; @thread_sync
	.comm	_CLOCK_REALTIME,4,2             ; @CLOCK_REALTIME
	.no_dead_strip	_physics_thread_main
.subsections_via_symbols
