	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tabledist
_tabledist:                             ## @tabledist
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	testl	%esi, %esi
	je	LBB0_4
## %bb.1:
	movq	%rcx, %rbx
	movl	%esi, %r15d
	movq	%rdx, %rdi
	callq	_get_crandom
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.3:
	movq	(%rbx), %rcx
	cltd
	idivl	8(%rbx)
	movslq	%edx, %rax
	movl	(%rcx,%rax,8), %r8d
	movq	_NETEM_DIST_SCALE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	movl	%eax, %esi
	movl	%edx, %edi
	imull	%r8d, %edi
	movl	%edi, %eax
	notl	%eax
	shrl	$31, %eax
	leal	-2(,%rax,4), %ebx
	movl	%ecx, %eax
	cltd
	idivl	%ebx
	addl	%edi, %eax
	cltd
	idivl	%ecx
	imull	%r8d, %esi
	addl	%r14d, %eax
	addl	%esi, %eax
	movl	%eax, %r14d
	jmp	LBB0_4
LBB0_2:
	leal	(%r15,%r15), %ecx
	cltd
	idivl	%ecx
	subl	%r15d, %r14d
	addl	%edx, %r14d
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NETEM_DIST_SCALE,4,2           ## @NETEM_DIST_SCALE
	.no_dead_strip	_tabledist
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tabledist
_tabledist:                             ; @tabledist
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	cbz	w1, LBB0_4
; %bb.1:
	mov	x21, x3
	mov	x20, x1
	mov	x0, x2
	bl	_get_crandom
	cbz	x21, LBB0_3
; %bb.2:
	ldr	x8, [x21]
	ldr	w9, [x21, #8]
	sdiv	w10, w0, w9
	msub	w9, w10, w9, w0
	ldr	x8, [x8, w9, sxtw #3]
Lloh0:
	adrp	x9, _NETEM_DIST_SCALE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NETEM_DIST_SCALE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sdiv	w10, w20, w9
	msub	w11, w10, w9, w20
	mul	w11, w11, w8
	cmp	w11, #0
	mov	w12, #2
	cneg	w12, w12, lt
	sdiv	w12, w9, w12
	add	w11, w11, w12
	sdiv	w9, w11, w9
	add	w9, w9, w19
	madd	w19, w10, w8, w9
	b	LBB0_4
LBB0_3:
	lsl	w8, w20, #1
	sdiv	w9, w0, w8
	msub	w8, w9, w8, w0
	sub	w9, w19, w20
	add	w19, w9, w8
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NETEM_DIST_SCALE,4,2           ; @NETEM_DIST_SCALE
	.no_dead_strip	_tabledist
.subsections_via_symbols
