	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tinythread
_tinythread:                            ## @tinythread
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	$1000, %r12d                    ## imm = 0x3E8
	movq	_mymtx@GOTPCREL(%rip), %r14
	leaq	_tinythread(%rip), %r15
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	decl	%r12d
	je	LBB0_10
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_mutex_enter
	movq	%r15, %rdi
	callq	_wakeup
	movq	_NTHREADS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	cmpl	%eax, _tinythread.wakeups(%rip)
	jge	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%esi, %esi
	testb	$1, %bl
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_PNORELOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	leaq	L_.str(%rip), %rdx
	xorl	%ecx, %ecx
	movq	%r14, %r8
	callq	_mtsleep
	movl	%eax, %r13d
	testb	$1, %bl
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_mutex_exit
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	testl	%r13d, %r13d
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_panic
	jmp	LBB0_9
LBB0_2:
	movq	_mymtx@GOTPCREL(%rip), %rdi
	callq	_mutex_exit
LBB0_10:
	movq	_mymtx@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_mutex_enter
	incl	_tinythread.wakeups(%rip)
	leaq	_tinythread(%rip), %rdi
	callq	_wakeup
	movq	_PNORELOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_rumptest_tsleep@GOTPCREL(%rip), %rdi
	leaq	L_.str.2(%rip), %rdx
	movl	$1, %ecx
	movq	%rbx, %r8
	callq	_mtsleep
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_panic
LBB0_12:
	xorl	%edi, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kthread_exit                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_tinythread.wakeups,4,2 ## @tinythread.wakeups
	.comm	_mymtx,4,2                      ## @mymtx
	.comm	_NTHREADS,4,2                   ## @NTHREADS
	.comm	_PNORELOCK,4,2                  ## @PNORELOCK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"haa"

L_.str.1:                               ## @.str.1
	.asciz	"mtsleep failed"

L_.str.2:                               ## @.str.2
	.asciz	"kepuli"

	.comm	_EWOULDBLOCK,4,2                ## @EWOULDBLOCK
L_.str.3:                               ## @.str.3
	.asciz	"mtsleep unexpected return value %d"

	.no_dead_strip	_tinythread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tinythread
_tinythread:                            ; @tinythread
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _mymtx@GOTPAGE
Lloh1:
	ldr	x20, [x20, _mymtx@GOTPAGEOFF]
	mov	w27, #1000
Lloh2:
	adrp	x21, _tinythread@PAGE
Lloh3:
	add	x21, x21, _tinythread@PAGEOFF
	adrp	x26, _tinythread.wakeups@PAGE
Lloh4:
	adrp	x28, _NTHREADS@GOTPAGE
Lloh5:
	ldr	x28, [x28, _NTHREADS@GOTPAGEOFF]
Lloh6:
	adrp	x25, _PNORELOCK@GOTPAGE
Lloh7:
	ldr	x25, [x25, _PNORELOCK@GOTPAGEOFF]
Lloh8:
	adrp	x22, l_.str@PAGE
Lloh9:
	add	x22, x22, l_.str@PAGEOFF
Lloh10:
	adrp	x23, l_.str.1@PAGE
Lloh11:
	add	x23, x23, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	subs	w27, w27, #1
	b.eq	LBB0_8
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_mutex_enter
	mov	x0, x21
	bl	_wakeup
	ldr	w8, [x26, _tinythread.wakeups@PAGEOFF]
	ldr	w9, [x28]
	sub	w9, w9, #1
	cmp	w8, w9
	b.ge	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x25]
	tst	x19, #0x1
	csel	w1, wzr, w8, eq
	mov	x0, x21
	mov	x2, x22
	mov	w3, #0
	mov	x4, x20
	bl	_mtsleep
	mov	x24, x0
	tbnz	w19, #0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	bl	_mutex_exit
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	cbz	w24, LBB0_1
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x23
	bl	_panic
	b	LBB0_1
LBB0_7:
Lloh12:
	adrp	x0, _mymtx@GOTPAGE
Lloh13:
	ldr	x0, [x0, _mymtx@GOTPAGEOFF]
	bl	_mutex_exit
LBB0_8:
Lloh14:
	adrp	x19, _mymtx@GOTPAGE
Lloh15:
	ldr	x19, [x19, _mymtx@GOTPAGEOFF]
	mov	x0, x19
	bl	_mutex_enter
	ldr	w8, [x26, _tinythread.wakeups@PAGEOFF]
	add	w8, w8, #1
	str	w8, [x26, _tinythread.wakeups@PAGEOFF]
Lloh16:
	adrp	x0, _tinythread@PAGE
Lloh17:
	add	x0, x0, _tinythread@PAGEOFF
	bl	_wakeup
	ldr	w1, [x25]
Lloh18:
	adrp	x0, _rumptest_tsleep@GOTPAGE
Lloh19:
	ldr	x0, [x0, _rumptest_tsleep@GOTPAGEOFF]
Lloh20:
	adrp	x2, l_.str.2@PAGE
Lloh21:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w3, #1
	mov	x4, x19
	bl	_mtsleep
                                        ; kill: def $w0 killed $w0 def $x0
Lloh22:
	adrp	x8, _EWOULDBLOCK@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EWOULDBLOCK@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	cmp	w0, w8
	b.eq	LBB0_10
; %bb.9:
	str	x0, [sp]
Lloh25:
	adrp	x0, l_.str.3@PAGE
Lloh26:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_panic
LBB0_10:
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_kthread_exit
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_tinythread.wakeups,4,2 ; @tinythread.wakeups
	.comm	_mymtx,4,2                      ; @mymtx
	.comm	_NTHREADS,4,2                   ; @NTHREADS
	.comm	_PNORELOCK,4,2                  ; @PNORELOCK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"haa"

l_.str.1:                               ; @.str.1
	.asciz	"mtsleep failed"

l_.str.2:                               ; @.str.2
	.asciz	"kepuli"

	.comm	_EWOULDBLOCK,4,2                ; @EWOULDBLOCK
l_.str.3:                               ; @.str.3
	.asciz	"mtsleep unexpected return value %d"

	.no_dead_strip	_tinythread
.subsections_via_symbols
