	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stop_timer_thread
_stop_timer_thread:                     ## @stop_timer_thread
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_timer_event@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_SetEvent
LBB0_2:
	movq	_timer_thread@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.3:
	movl	$10000, %esi                    ## imm = 0x2710
	callq	_WaitForSingleObject
	movq	_WAIT_TIMEOUT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
	jmp	LBB0_7
LBB0_5:
	movq	_WAIT_OBJECT_0@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_error
LBB0_7:
	movq	(%rbx), %rdi
	callq	_CloseHandle
LBB0_8:
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:
	callq	_CloseHandle
LBB0_10:
	movq	$0, (%r14)
	movq	$0, (%rbx)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_timer_event,8,3                ## @timer_event
	.comm	_timer_thread,8,3               ## @timer_thread
	.comm	_WAIT_TIMEOUT,4,2               ## @WAIT_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timer thread did not terminate timely"

	.comm	_WAIT_OBJECT_0,4,2              ## @WAIT_OBJECT_0
L_.str.1:                               ## @.str.1
	.asciz	"waiting for timer thread failed: %lu"

	.no_dead_strip	_stop_timer_thread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stop_timer_thread
_stop_timer_thread:                     ; @stop_timer_thread
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x19, _timer_event@GOTPAGE
Lloh1:
	ldr	x19, [x19, _timer_event@GOTPAGEOFF]
	ldr	x0, [x19]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_SetEvent
LBB0_2:
Lloh2:
	adrp	x20, _timer_thread@GOTPAGE
Lloh3:
	ldr	x20, [x20, _timer_thread@GOTPAGEOFF]
	ldr	x0, [x20]
	cbz	x0, LBB0_9
; %bb.3:
	mov	w1, #10000
	bl	_WaitForSingleObject
Lloh4:
	adrp	x8, _WAIT_TIMEOUT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _WAIT_TIMEOUT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.4:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_5:
Lloh9:
	adrp	x8, _WAIT_OBJECT_0@GOTPAGE
Lloh10:
	ldr	x8, [x8, _WAIT_OBJECT_0@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w0, w8
	b.eq	LBB0_8
; %bb.6:
	bl	_GetLastError
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_7:
	bl	_error
LBB0_8:
	ldr	x0, [x20]
	bl	_CloseHandle
LBB0_9:
	ldr	x0, [x19]
	cbz	x0, LBB0_11
; %bb.10:
	bl	_CloseHandle
LBB0_11:
	str	xzr, [x19]
	str	xzr, [x20]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_timer_event,8,3                ; @timer_event
	.comm	_timer_thread,8,3               ; @timer_thread
	.comm	_WAIT_TIMEOUT,4,2               ; @WAIT_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timer thread did not terminate timely"

	.comm	_WAIT_OBJECT_0,4,2              ; @WAIT_OBJECT_0
l_.str.1:                               ; @.str.1
	.asciz	"waiting for timer thread failed: %lu"

	.no_dead_strip	_stop_timer_thread
.subsections_via_symbols
