	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function red_drops
_red_drops:                             ## @red_drops
	.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, %r12
	movq	32(%rdi), %r13
	movq	_DN_QSIZE_BYTES@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	xorl	%ecx, %ecx
	testl	%eax, 52(%r13)
	movl	%esi, %r14d
	sete	%cl
	movq	16(%rdi,%rcx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_SCALE
	subl	(%r12), %eax
	movl	80(%r13), %esi
	movl	%eax, %edi
	callq	_SCALE_MUL
	addl	(%r12), %eax
LBB0_6:
	movl	%eax, (%r12)
LBB0_7:
	movslq	%eax, %rcx
	movq	16(%r13), %rdx
	cmpq	%rcx, %rdx
	jle	LBB0_9
## %bb.8:
	movl	$-1, 8(%r12)
	xorl	%ebx, %ebx
	jmp	LBB0_24
LBB0_9:
	cmpq	%rcx, 24(%r13)
	jle	LBB0_10
## %bb.14:
	xorl	%r15d, %r15d
	cmpq	%rcx, %rdx
	jge	LBB0_18
## %bb.15:
	movq	_DN_IS_ECN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	$1, %ebx
	testl	%ecx, 52(%r13)
	jne	LBB0_24
## %bb.16:
	movl	56(%r13), %edi
	movl	%eax, %esi
	callq	_SCALE_MUL
	movq	%rax, %r15
	leaq	40(%r13), %rax
	jmp	LBB0_17
LBB0_2:
	cmpl	$0, (%r12)
	je	LBB0_3
## %bb.4:
	movq	_dn_cfg@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	subl	4(%r12), %edi
	movl	72(%r13), %esi
	callq	_div64
	movq	%rax, %rcx
	xorl	%eax, %eax
	cmpq	%rcx, (%r13)
	jbe	LBB0_6
## %bb.5:
	movl	(%r12), %edi
	movq	8(%r13), %rax
	movl	(%rax,%rcx,4), %esi
	callq	_SCALE_MUL
	jmp	LBB0_6
LBB0_10:
	movl	52(%r13), %ecx
	movq	_DN_IS_ECN@GOTPCREL(%rip), %rdx
	movl	$1, %ebx
	testl	%ecx, (%rdx)
	jne	LBB0_24
## %bb.11:
	movq	_DN_IS_GENTLE_RED@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_13
## %bb.12:
	movl	64(%r13), %edi
	movl	%eax, %esi
	callq	_SCALE_MUL
	movq	%rax, %r15
	leaq	32(%r13), %rax
LBB0_17:
	subl	(%rax), %r15d
	movq	_DN_QSIZE_BYTES@GOTPCREL(%rip), %rbx
LBB0_18:
	movl	(%rbx), %eax
	testl	%eax, 52(%r13)
	je	LBB0_20
## %bb.19:
	imull	%r14d, %r15d
	movl	48(%r13), %esi
	movl	%r15d, %edi
	callq	_div64
	movq	%rax, %r15
LBB0_20:
	movl	8(%r12), %edi
	incl	%edi
	movl	%edi, 8(%r12)
	jne	LBB0_22
## %bb.21:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_random
	movzwl	%ax, %eax
	movl	%eax, 12(%r12)
	jmp	LBB0_24
LBB0_3:
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_22:
	callq	_SCALE
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_SCALE_MUL
	movslq	12(%r12), %rcx
	xorl	%ebx, %ebx
	cmpq	%rcx, %rax
	jbe	LBB0_24
## %bb.23:
	movl	$0, 8(%r12)
	xorl	%eax, %eax
	callq	_random
	movzwl	%ax, %eax
	movl	%eax, 12(%r12)
	movl	$1, %ebx
	jmp	LBB0_24
LBB0_13:
	movl	$-1, 8(%r12)
LBB0_24:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DN_QSIZE_BYTES,4,2             ## @DN_QSIZE_BYTES
	.comm	_dn_cfg,4,2                     ## @dn_cfg
	.comm	_DN_IS_ECN,4,2                  ## @DN_IS_ECN
	.comm	_DN_IS_GENTLE_RED,4,2           ## @DN_IS_GENTLE_RED
	.no_dead_strip	_red_drops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function red_drops
_red_drops:                             ; @red_drops
	.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	x20, x1
	mov	x19, x0
	ldr	x22, [x0, #32]
	ldr	w8, [x22, #52]
Lloh0:
	adrp	x23, _DN_QSIZE_BYTES@GOTPAGE
Lloh1:
	ldr	x23, [x23, _DN_QSIZE_BYTES@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	mov	w8, #16
	mov	w9, #24
	csel	x8, x9, x8, eq
	ldr	x0, [x0, x8]
	cbz	x0, LBB0_9
; %bb.1:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_SCALE
	ldr	w8, [x19]
	sub	w0, w0, w8
	ldr	w1, [x22, #80]
	bl	_SCALE_MUL
	ldr	w8, [x19]
	add	w0, w8, w0
LBB0_2:
	str	w0, [x19]
LBB0_3:
	sxtw	x1, w0
	ldr	x8, [x22, #16]
	cmp	x8, x1
	b.le	LBB0_5
; %bb.4:
	mov	w0, #0
	mov	w8, #-1
	str	w8, [x19, #8]
	b	LBB0_28
LBB0_5:
	ldr	x9, [x22, #24]
	cmp	x9, x1
	b.le	LBB0_12
; %bb.6:
	cmp	x8, x1
	b.ge	LBB0_17
; %bb.7:
	ldr	w8, [x22, #52]
Lloh2:
	adrp	x9, _DN_IS_ECN@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DN_IS_ECN@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_27
; %bb.8:
	ldr	w0, [x22, #56]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_SCALE_MUL
	add	x8, x22, #40
	b	LBB0_15
LBB0_9:
	ldr	w8, [x19]
	cbz	w8, LBB0_16
; %bb.10:
Lloh5:
	adrp	x8, _dn_cfg@GOTPAGE
Lloh6:
	ldr	x8, [x8, _dn_cfg@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	sub	w0, w8, w9
	ldr	w1, [x22, #72]
	bl	_div64
	ldr	x8, [x22]
	cmp	x8, x0
	b.ls	LBB0_22
; %bb.11:
	ldr	w8, [x19]
	ldr	x9, [x22, #8]
	ldr	w1, [x9, x0, lsl #2]
	mov	x0, x8
	bl	_SCALE_MUL
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
	b	LBB0_2
LBB0_12:
	ldr	w8, [x22, #52]
Lloh8:
	adrp	x9, _DN_IS_ECN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _DN_IS_ECN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_27
; %bb.13:
Lloh11:
	adrp	x9, _DN_IS_GENTLE_RED@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DN_IS_GENTLE_RED@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_26
; %bb.14:
	ldr	w0, [x22, #64]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_SCALE_MUL
	add	x8, x22, #32
LBB0_15:
	ldr	w8, [x8]
	sub	w21, w0, w8
	b	LBB0_18
LBB0_16:
	mov	w0, #0
	b	LBB0_3
LBB0_17:
	mov	w21, #0
LBB0_18:
	ldr	w8, [x22, #52]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.19:
	mul	w0, w21, w20
	ldr	w1, [x22, #48]
	bl	_div64
	mov	x21, x0
LBB0_20:
	ldr	w8, [x19, #8]
	adds	w0, w8, #1
	str	w0, [x19, #8]
	b.lo	LBB0_23
; %bb.21:
	bl	_random
	mov	x8, x0
	mov	w0, #0
	and	w8, w8, #0xffff
	str	w8, [x19, #12]
	b	LBB0_28
LBB0_22:
	mov	w0, #0
	b	LBB0_2
LBB0_23:
	bl	_SCALE
	mov	x1, x0
	mov	x0, x21
	bl	_SCALE_MUL
	ldrsw	x8, [x19, #12]
	cmp	x0, x8
	b.ls	LBB0_25
; %bb.24:
	str	wzr, [x19, #8]
	bl	_random
	and	w8, w0, #0xffff
	str	w8, [x19, #12]
	b	LBB0_27
LBB0_25:
	mov	w0, #0
	b	LBB0_28
LBB0_26:
	mov	w8, #-1
	str	w8, [x19, #8]
LBB0_27:
	mov	w0, #1
LBB0_28:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DN_QSIZE_BYTES,4,2             ; @DN_QSIZE_BYTES
	.comm	_dn_cfg,4,2                     ; @dn_cfg
	.comm	_DN_IS_ECN,4,2                  ; @DN_IS_ECN
	.comm	_DN_IS_GENTLE_RED,4,2           ; @DN_IS_GENTLE_RED
	.no_dead_strip	_red_drops
.subsections_via_symbols
