	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function serve_sched
_serve_sched:                           ## @serve_sched
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	32(%rsi), %rbx
	testq	%rdi, %rdi
	jne	LBB0_2
## %bb.1:
	movq	$0, -96(%rbp)
	leaq	-96(%rbp), %rdi
LBB0_2:
	movq	16(%r13), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	16(%r13), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movslq	(%rbx), %r14
	movq	_DN_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 24(%r13)
	testq	%r14, %r14
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	jle	LBB0_3
## %bb.8:
	movl	%edx, %eax
	subl	8(%r13), %eax
	imull	%r14d, %eax
	cltq
	addq	%rax, (%r13)
	movl	%edx, 8(%r13)
	jns	LBB0_4
## %bb.9:
	xorl	%r12d, %r12d
	jmp	LBB0_13
LBB0_3:
	movq	$0, (%r13)
	movl	%edx, 8(%r13)
LBB0_4:
	xorl	%r12d, %r12d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %r14
	movq	_hz@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	(%r15), %ebx
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_extra_bits
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rbx,8), %eax
	imull	%r13d, %eax
	movq	%r14, %r13
	movq	-88(%rbp), %r14                 ## 8-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	cltq
	subq	%rax, (%r13)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %ebx
	movq	_dn_cfg@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_dn_tag_get
	movl	%ebx, (%rax)
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_mq_append
	incl	%r12d
	cmpq	$0, (%r13)
	js	LBB0_14
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rax
	movq	%r13, %rdi
	callq	*(%rax)
	testq	%rax, %rax
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rax, %r15
	testl	%r14d, %r14d
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_12:
	cmpq	$0, (%r13)
	js	LBB0_13
## %bb.21:
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, 12(%r13)
	jmp	LBB0_17
LBB0_13:
	xorl	%r15d, %r15d
LBB0_14:
	xorl	%edi, %edi
	testl	%r14d, %r14d
	setg	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	(%r13), %rdi
	notq	%rdi
	addq	%r14, %rdi
	movl	%r14d, %esi
	callq	_div64
	movl	%eax, %r14d
	testq	%r15, %r15
	je	LBB0_16
## %bb.15:
	movq	%r15, %rdi
	callq	_dn_tag_get
	addl	%r14d, (%rax)
LBB0_16:
	movq	_DN_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%r13)
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	addl	%r15d, %r14d
	movq	_dn_cfg@GOTPCREL(%rip), %rdi
	addq	$4, %rdi
	movl	%r14d, %esi
	movq	%r13, %rdx
	callq	_heap_insert
LBB0_17:
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_20
## %bb.18:
	testl	%r12d, %r12d
	je	LBB0_20
## %bb.19:
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_transmit_event
LBB0_20:
	movq	(%rbx), %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DN_ACTIVE,4,2                  ## @DN_ACTIVE
	.comm	_hz,4,2                         ## @hz
	.comm	_dn_cfg,8,2                     ## @dn_cfg
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bw=0 and credit<0 ?"

	.no_dead_strip	_serve_sched
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function serve_sched
_serve_sched:                           ; @serve_sched
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x22, x1
	mov	x21, x1
	ldr	x8, [x21, #16]!
	str	x8, [sp]                        ; 8-byte Folded Spill
	ldr	x24, [x21, #16]
	cbnz	x0, LBB0_2
; %bb.1:
	str	xzr, [sp, #24]
	add	x0, sp, #24
LBB0_2:
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	ldrsw	x23, [x24]
Lloh0:
	adrp	x8, _DN_ACTIVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DN_ACTIVE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x22, #24]
	bic	w8, w9, w8
	str	w8, [x22, #24]
Lloh3:
	adrp	x28, _dn_cfg@GOTPAGE
Lloh4:
	ldr	x28, [x28, _dn_cfg@GOTPAGEOFF]
	cmp	w23, #0
	str	w2, [sp, #20]                   ; 4-byte Folded Spill
	b.le	LBB0_5
; %bb.3:
	ldr	w8, [x22, #8]
	sub	w8, w2, w8
	mul	w8, w8, w23
	ldr	x9, [x22]
	adds	x8, x9, w8, sxtw
	str	x8, [x22]
	str	w2, [x22, #8]
	b.pl	LBB0_6
; %bb.4:
	mov	w27, #0
	b	LBB0_14
LBB0_5:
	str	xzr, [x22]
	str	w2, [x22, #8]
LBB0_6:
	mov	w27, #0
Lloh5:
	adrp	x26, _hz@GOTPAGE
Lloh6:
	ldr	x26, [x26, _hz@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w20, [x26]
	ldr	w19, [x25]
	mov	x0, x25
	mov	x1, x24
	bl	_extra_bits
	add	w8, w0, w19, lsl #3
	mul	w8, w8, w20
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x9, [x22]
	sub	x8, x9, w8, sxtw
	str	x8, [x22]
	ldr	w8, [x28]
	ldr	w9, [x24, #4]
	add	w19, w9, w8
	mov	x0, x25
	bl	_dn_tag_get
	str	w19, [x0]
	mov	x0, x21
	mov	x1, x25
	bl	_mq_append
	ldr	x8, [x22]
	add	w27, w27, #1
	tbnz	x8, #63, LBB0_15
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24, #8]
	ldr	x8, [x8]
	mov	x0, x22
	blr	x8
	cbz	x0, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x25, x0
	cbnz	w23, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w8, #0
	b	LBB0_8
LBB0_12:
	ldr	x8, [x22]
	tbnz	x8, #63, LBB0_14
; %bb.13:
	ldr	w19, [sp, #20]                  ; 4-byte Folded Reload
	str	w19, [x22, #12]
	ldp	x8, x20, [sp]                   ; 16-byte Folded Reload
	cbz	x8, LBB0_18
	b	LBB0_20
LBB0_14:
	mov	x25, #0
LBB0_15:
	cmp	w23, #0
	cset	w0, gt
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	x8, [x22]
	mvn	x8, x8
	add	x0, x8, x23
	mov	x1, x23
	bl	_div64
	mov	x23, x0
	cbz	x25, LBB0_17
; %bb.16:
	mov	x0, x25
	bl	_dn_tag_get
	ldr	w8, [x0]
	add	w8, w8, w23
	str	w8, [x0]
LBB0_17:
Lloh9:
	adrp	x8, _DN_ACTIVE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DN_ACTIVE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x22, #24]
	orr	w8, w9, w8
	str	w8, [x22, #24]
	ldr	w19, [sp, #20]                  ; 4-byte Folded Reload
	add	w1, w23, w19
	add	x0, x28, #4
	mov	x2, x22
	bl	_heap_insert
	ldp	x8, x20, [sp]                   ; 16-byte Folded Reload
	cbnz	x8, LBB0_20
LBB0_18:
	cbz	w27, LBB0_20
; %bb.19:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_transmit_event
LBB0_20:
	ldr	x0, [x20]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_DN_ACTIVE,4,2                  ; @DN_ACTIVE
	.comm	_hz,4,2                         ; @hz
	.comm	_dn_cfg,8,2                     ; @dn_cfg
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bw=0 and credit<0 ?"

	.no_dead_strip	_serve_sched
.subsections_via_symbols
