	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_svc_run                        ## -- Begin function svc_run
	.p2align	4, 0x90
_svc_run:                               ## @svc_run
	.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, %r13
	movq	_curproc@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_curthread@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movq	(%r13), %rcx
	leaq	L_.str(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	movq	_SVCPOOL_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r13)
	movq	%rbx, 32(%r13)
	movq	_SVC_MAXGROUPS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	12(%r13), %eax
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	sarl	%edi
	movq	_mp_ncpus@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_min
	cltq
	imulq	$715827883, %rax, %rsi          ## imm = 0x2AAAAAAB
	movq	%rsi, %rax
	shrq	$63, %rax
	shrq	$32, %rsi
	addl	%eax, %esi
	movl	%ebx, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_min
	movl	$1, %edi
	movl	%eax, %esi
	callq	_max
	movq	%rax, %rcx
	movl	%ecx, 8(%r13)
	testl	%ecx, %ecx
	jle	LBB0_1
## %bb.2:
	movl	$24, %ebx
	xorl	%r15d, %r15d
	movq	_time_uptime@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %r14
	movl	16(%r13), %eax
	cltd
	idivl	%ecx
	movl	$1, %edi
	movl	%eax, %esi
	callq	_max
	movl	%eax, -24(%r14,%rbx)
	movl	12(%r13), %eax
	cltd
	idivl	8(%r13)
	movl	$1, %edi
	movl	%eax, %esi
	callq	_max
	movq	%rax, (%r14,%rbx)
	movl	(%r12), %eax
	movl	%eax, -4(%r14,%rbx)
	incq	%r15
	movslq	8(%r13), %rcx
	addq	$32, %rbx
	cmpq	%rcx, %r15
	jl	LBB0_3
## %bb.4:
	movq	24(%r13), %r12
	incq	8(%r12)
	testl	%ecx, %ecx
	jle	LBB0_11
## %bb.5:
	xorl	%r15d, %r15d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%r15
	movslq	%ecx, %rax
	movq	24(%r13), %r12
	cmpq	%rax, %r15
	jge	LBB0_11
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	%r15, %rax
	shlq	$5, %rax
	xorl	%ebx, %ebx
	testq	%r15, %r15
	sete	%bl
	cmpl	%ebx, (%r12,%rax)
	jle	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	addq	%rax, %r12
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, %rdi
	callq	_svc_new_thread
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	8(%r13), %ecx
	jmp	LBB0_10
LBB0_1:
	movq	24(%r13), %r12
	incq	8(%r12)
LBB0_11:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_svc_run_internal
	cmpl	$0, 8(%r13)
	jle	LBB0_17
## %bb.12:
	xorl	%ecx, %ecx
	leaq	L_.str.1(%rip), %r15
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%r12, %rdi
	callq	_mtx_unlock
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movslq	8(%r13), %rax
	cmpq	%rax, %rcx
	jge	LBB0_17
LBB0_13:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	movq	24(%r13), %rbx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, %r13
	shlq	$5, %r13
	leaq	(%rbx,%r13), %r12
	addq	$16, %r12
	movq	%r12, %rdi
	callq	_mtx_lock
	cmpq	$0, 8(%rbx,%r13)
	jle	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	leaq	(%rbx,%r13), %r14
	addq	%r13, %rbx
	addq	$8, %rbx
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_13 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	callq	_msleep
	cmpq	$0, (%rbx)
	jg	LBB0_15
	jmp	LBB0_16
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_curproc,8,3                    ## @curproc
	.comm	_curthread,8,3                  ## @curthread
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: master"

	.comm	_SVCPOOL_ACTIVE,4,2             ## @SVCPOOL_ACTIVE
	.comm	_SVC_MAXGROUPS,4,2              ## @SVC_MAXGROUPS
	.comm	_mp_ncpus,4,2                   ## @mp_ncpus
	.comm	_time_uptime,4,2                ## @time_uptime
	.comm	_TRUE,4,2                       ## @TRUE
L_.str.1:                               ## @.str.1
	.asciz	"svcexit"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_svc_run                        ; -- Begin function svc_run
	.p2align	2
_svc_run:                               ; @svc_run
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x8, _curproc@GOTPAGE
Lloh1:
	ldr	x8, [x8, _curproc@GOTPAGEOFF]
Lloh2:
	ldr	x20, [x8]
Lloh3:
	adrp	x8, _curthread@GOTPAGE
Lloh4:
	ldr	x8, [x8, _curthread@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w0, [x8]
	ldr	x3, [x19]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #4
	bl	_snprintf
Lloh8:
	adrp	x8, _SVCPOOL_ACTIVE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SVCPOOL_ACTIVE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x19, #40]
	str	x20, [x19, #32]
Lloh11:
	adrp	x8, _SVC_MAXGROUPS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SVC_MAXGROUPS@GOTPAGEOFF]
Lloh13:
	ldr	w20, [x8]
	ldr	w8, [x19, #12]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w0, w8, #1
Lloh14:
	adrp	x8, _mp_ncpus@GOTPAGE
Lloh15:
	ldr	x8, [x8, _mp_ncpus@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_min
	mov	w8, #43691
	movk	w8, #10922, lsl #16
	smull	x8, w0, w8
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	add	w1, w8, w9
	mov	x0, x20
	bl	_min
	mov	x1, x0
	mov	w0, #1
	bl	_max
	str	w0, [x19, #8]
	cmp	w0, #0
	b.le	LBB0_9
; %bb.1:
	mov	x8, x0
	mov	x20, #0
	mov	x21, #0
Lloh17:
	adrp	x22, _time_uptime@GOTPAGE
Lloh18:
	ldr	x22, [x22, _time_uptime@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x23, [x19, #24]
	ldr	w9, [x19, #16]
	sdiv	w1, w9, w8
	mov	w0, #1
	bl	_max
	add	x23, x23, x20
	str	w0, [x23]
	ldp	w9, w8, [x19, #8]
	sdiv	w1, w8, w9
	mov	w0, #1
	bl	_max
	str	x0, [x23, #24]
	ldr	w8, [x22]
	str	w8, [x23, #20]
	add	x21, x21, #1
	ldrsw	x8, [x19, #8]
	add	x20, x20, #32
	cmp	x21, x8
	b.lt	LBB0_2
; %bb.3:
	ldr	x0, [x19, #24]
	ldr	x9, [x0, #8]
	add	x9, x9, #1
	str	x9, [x0, #8]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.4:
	mov	x21, #0
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x21, x21, #1
	ldr	x0, [x19, #24]
	cmp	x21, w8, sxtw
	b.ge	LBB0_10
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	add	x20, x0, x21, lsl #5
	cmp	x21, #0
	cset	w22, eq
	ldr	w9, [x20]
	cmp	w9, w22
	b.le	LBB0_5
LBB0_7:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	bl	_svc_new_thread
	add	w22, w22, #1
	ldr	w8, [x20]
	cmp	w22, w8
	b.lt	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x19, #8]
	b	LBB0_5
LBB0_9:
	ldr	x0, [x19, #24]
	ldr	x8, [x0, #8]
	add	x8, x8, #1
	str	x8, [x0, #8]
LBB0_10:
Lloh19:
	adrp	x8, _TRUE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	bl	_svc_run_internal
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.11:
	mov	x23, #0
Lloh22:
	adrp	x20, l_.str.1@PAGE
Lloh23:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x21
	bl	_mtx_unlock
	add	x23, x23, #1
	ldrsw	x8, [x19, #8]
	cmp	x23, x8
	b.ge	LBB0_15
LBB0_13:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_14 Depth 2
	ldr	x8, [x19, #24]
	add	x22, x8, x23, lsl #5
	add	x21, x22, #16
	mov	x0, x21
	bl	_mtx_lock
	mov	x24, x22
	ldr	x8, [x24, #8]!
	cmp	x8, #1
	b.lt	LBB0_12
LBB0_14:                                ;   Parent Loop BB0_13 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	mov	x1, x21
	mov	w2, #0
	mov	x3, x20
	mov	w4, #0
	bl	_msleep
	ldr	x8, [x24]
	cmp	x8, #0
	b.gt	LBB0_14
	b	LBB0_12
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_curproc,8,3                    ; @curproc
	.comm	_curthread,8,3                  ; @curthread
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: master"

	.comm	_SVCPOOL_ACTIVE,4,2             ; @SVCPOOL_ACTIVE
	.comm	_SVC_MAXGROUPS,4,2              ; @SVC_MAXGROUPS
	.comm	_mp_ncpus,4,2                   ; @mp_ncpus
	.comm	_time_uptime,4,2                ; @time_uptime
	.comm	_TRUE,4,2                       ; @TRUE
l_.str.1:                               ; @.str.1
	.asciz	"svcexit"

.subsections_via_symbols
