	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kr_rand                        ## -- Begin function kr_rand
	.p2align	4, 0x90
_kr_rand:                               ## @kr_rand
	.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, %r14
	movl	(%rdi), %eax
	movq	_KR_NN@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	cmpl	%esi, %eax
	jl	LBB0_10
## %bb.1:
	leal	1(%rsi), %ecx
	cmpl	%ecx, %eax
	jne	LBB0_3
## %bb.2:
	movl	$5489, %edi                     ## imm = 0x1571
	movq	%r14, %rsi
	callq	_kr_srand0
	movl	(%r15), %esi
LBB0_3:
	movq	_KR_MM@GOTPCREL(%rip), %r10
	movl	(%r10), %ecx
	xorl	%edi, %edi
	cmpl	%ecx, %esi
	jle	LBB0_6
## %bb.4:
	movq	8(%r14), %r12
	movl	(%r12), %eax
	xorl	%edi, %edi
	movq	_KR_UM@GOTPCREL(%rip), %r8
	movq	_KR_LM@GOTPCREL(%rip), %r9
	leaq	_kr_rand.mag01(%rip), %r11
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	andl	(%r8), %eax
	movl	4(%r12,%rdi,4), %ebx
	movl	(%r9), %esi
	andl	%ebx, %esi
	orl	%eax, %esi
	addl	%edi, %ecx
	movslq	%ecx, %rax
	movl	%esi, %ecx
	sarl	%ecx
	andl	$1, %esi
	movl	(%r11,%rsi,4), %esi
	xorl	(%r12,%rax,4), %esi
	xorl	%ecx, %esi
	movl	%esi, (%r12,%rdi,4)
	incq	%rdi
	movl	(%r15), %esi
	movl	(%r10), %ecx
	movl	%esi, %eax
	subl	%ecx, %eax
	movslq	%eax, %rdx
	movl	%ebx, %eax
	cmpq	%rdx, %rdi
	jl	LBB0_5
LBB0_6:
	leal	-1(%rsi), %edx
	movq	8(%r14), %r12
	cmpl	%edx, %edi
	jge	LBB0_9
## %bb.7:
	movl	%edi, %ebx
	movl	(%r12,%rbx,4), %eax
	movq	_KR_UM@GOTPCREL(%rip), %r8
	movq	_KR_LM@GOTPCREL(%rip), %r9
	leaq	_kr_rand.mag01(%rip), %r11
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	subl	%esi, %ecx
	andl	(%r8), %eax
	movl	4(%r12,%rbx,4), %r13d
	movl	(%r9), %edx
	andl	%r13d, %edx
	orl	%eax, %edx
	addl	%ebx, %ecx
	movslq	%ecx, %rax
	movl	%edx, %ecx
	sarl	%ecx
	xorl	(%r12,%rax,4), %ecx
	andl	$1, %edx
	xorl	(%r11,%rdx,4), %ecx
	movl	%ecx, (%r12,%rbx,4)
	leaq	1(%rbx), %rdi
	movl	(%r15), %esi
	leal	-1(%rsi), %edx
	movl	(%r10), %ecx
	movl	%r13d, %eax
	movq	%rdi, %rbx
	cmpl	%edi, %edx
	jg	LBB0_8
LBB0_9:
	movslq	%edx, %rax
	movq	_KR_UM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	(%r12,%rax,4), %edx
	movq	_KR_LM@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	(%r12), %esi
	orl	%edx, %esi
	movslq	%ecx, %rcx
	movl	%esi, %edx
	sarl	%edx
	xorl	-4(%r12,%rcx,4), %edx
	andl	$1, %esi
	leaq	_kr_rand.mag01(%rip), %rcx
	xorl	(%rcx,%rsi,4), %edx
	movl	%edx, (%r12,%rax,4)
	xorl	%eax, %eax
LBB0_10:
	incl	%eax
	movl	%eax, (%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	2                               ## @kr_rand.mag01
_kr_rand.mag01:
	.long	0                               ## 0x0
	.long	2842040809                      ## 0xa96619e9

	.comm	_KR_NN,4,2                      ## @KR_NN
	.comm	_KR_MM,4,2                      ## @KR_MM
	.comm	_KR_UM,4,2                      ## @KR_UM
	.comm	_KR_LM,4,2                      ## @KR_LM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kr_rand                        ; -- Begin function kr_rand
	.p2align	2
_kr_rand:                               ; @kr_rand
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w12, [x0]
Lloh0:
	adrp	x20, _KR_NN@GOTPAGE
Lloh1:
	ldr	x20, [x20, _KR_NN@GOTPAGEOFF]
	ldr	w13, [x20]
	cmp	w12, w13
	b.lt	LBB0_11
; %bb.1:
	add	w8, w13, #1
	cmp	w12, w8
	b.ne	LBB0_3
; %bb.2:
	mov	w0, #5489
	mov	x1, x19
	bl	_kr_srand0
	ldr	w13, [x20]
LBB0_3:
Lloh2:
	adrp	x12, _KR_MM@GOTPAGE
Lloh3:
	ldr	x12, [x12, _KR_MM@GOTPAGEOFF]
Lloh4:
	adrp	x10, _KR_UM@GOTPAGE
Lloh5:
	ldr	x10, [x10, _KR_UM@GOTPAGEOFF]
	ldr	w11, [x12]
Lloh6:
	adrp	x9, _KR_LM@GOTPAGE
Lloh7:
	ldr	x9, [x9, _KR_LM@GOTPAGEOFF]
Lloh8:
	adrp	x8, _kr_rand.mag01@PAGE
Lloh9:
	add	x8, x8, _kr_rand.mag01@PAGEOFF
	cmp	w13, w11
	b.le	LBB0_6
; %bb.4:
	mov	x15, #0
	ldr	x14, [x19, #8]
	ldr	w16, [x14]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x13, x14, x15, lsl #2
	ldr	w17, [x10]
	mov	w16, w16
	and	x17, x17, x16
	add	w11, w15, w11
	add	x15, x15, #1
	ldr	w16, [x13, #4]
	ldr	w0, [x9]
	and	x0, x0, x16
	orr	x17, x0, x17
	ldr	w11, [x14, w11, sxtw #2]
	and	x0, x17, #0x1
	ldr	w0, [x8, x0, lsl #2]
	eor	w11, w0, w11
	eor	w11, w11, w17, asr #1
	str	w11, [x13]
	ldr	w13, [x20]
	ldr	w11, [x12]
	sub	w17, w13, w11
	cmp	x15, w17, sxtw
	b.lt	LBB0_5
	b	LBB0_7
LBB0_6:
	mov	w15, #0
LBB0_7:
	sub	w17, w13, #1
	ldr	x14, [x19, #8]
	cmp	w15, w17
	b.ge	LBB0_10
; %bb.8:
	ldr	w16, [x14, w15, uxtw #2]
	mov	w15, w15
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	x17, x14, x15, lsl #2
	ldr	w0, [x10]
	mov	w16, w16
	and	x0, x0, x16
	sub	w11, w11, w13
	add	w11, w15, w11
	add	x1, x15, #1
	ldr	w16, [x17, #4]
	ldr	w13, [x9]
	and	x13, x13, x16
	ldr	w11, [x14, w11, sxtw #2]
	orr	x13, x13, x0
	eor	w11, w11, w13, asr #1
	and	x13, x13, #0x1
	ldr	w13, [x8, x13, lsl #2]
	eor	w11, w11, w13
	str	w11, [x17]
	ldr	w13, [x20]
	sub	w17, w13, #1
	ldr	w11, [x12]
	mov	x15, x1
	cmp	w17, w1
	b.gt	LBB0_9
LBB0_10:
	mov	w12, #0
	sbfiz	x13, x17, #2, #32
	ldr	w15, [x14, x13]
	ldr	w10, [x10]
	and	x10, x10, x15
	ldr	w15, [x14]
	ldr	w9, [x9]
	and	x9, x9, x15
	orr	x9, x9, x10
	sub	w10, w11, #1
	ldr	w10, [x14, w10, sxtw #2]
	eor	w10, w10, w9, asr #1
	and	x9, x9, #0x1
	ldr	w8, [x8, x9, lsl #2]
	eor	w8, w10, w8
	str	w8, [x14, x13]
LBB0_11:
	add	w8, w12, #1
	str	w8, [x19]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @kr_rand.mag01
_kr_rand.mag01:
	.long	0                               ; 0x0
	.long	2842040809                      ; 0xa96619e9

	.comm	_KR_NN,4,2                      ; @KR_NN
	.comm	_KR_MM,4,2                      ; @KR_MM
	.comm	_KR_UM,4,2                      ; @KR_UM
	.comm	_KR_LM,4,2                      ; @KR_LM
.subsections_via_symbols
