	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mrb_ary_sample
_mrb_ary_sample:                        ## @mrb_ary_sample
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	$0, -44(%rbp)
	movq	$0, -56(%rbp)
	leaq	L_.str(%rip), %rsi
	movq	_mt_state_type@GOTPCREL(%rip), %r9
	leaq	-44(%rbp), %rdx
	leaq	-68(%rbp), %rcx
	leaq	-56(%rbp), %r8
	callq	_mrb_get_args
	movq	-56(%rbp), %rsi
	testq	%rsi, %rsi
	jne	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_get_random_state
	movq	%rax, %rsi
	movq	%rax, -56(%rbp)
LBB0_2:
	movq	%r15, %rdi
	callq	_mrb_random_rand_seed
	movq	-56(%rbp), %rdi
	callq	_mt_rand
	movl	%r14d, %edi
	callq	_RARRAY_LEN
	movl	%eax, %r12d
	cmpl	$0, -68(%rbp)
	je	LBB0_3
## %bb.9:
	movl	-44(%rbp), %esi
	testl	%esi, %esi
	js	LBB0_10
## %bb.11:
	cmpl	%r12d, %esi
	jle	LBB0_13
LBB0_12:
	movl	%r12d, -44(%rbp)
	movl	%r12d, %esi
LBB0_13:
	movq	%r15, %rdi
	callq	_mrb_ary_new_capa
	movl	%eax, %ebx
	cmpl	$0, -44(%rbp)
	jle	LBB0_7
## %bb.14:
	movl	%r14d, -64(%rbp)                ## 4-byte Spill
	xorl	%r14d, %r14d
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_15 Depth=1
	movl	%r13d, %edi
	callq	_mrb_fixnum_value
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_mrb_ary_push
	incq	%r14
	movslq	-44(%rbp), %rax
	cmpq	%rax, %r14
	jge	LBB0_16
LBB0_15:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_20 Depth 2
                                        ##       Child Loop BB0_21 Depth 3
	movq	-56(%rbp), %rdi
	callq	_mt_rand
	cltd
	idivl	%r12d
	movl	%edx, %r13d
	testq	%r14, %r14
	jne	LBB0_20
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_20 Depth=2
	movq	-56(%rbp), %rdi
	callq	_mt_rand
	cltd
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	idivl	%r12d
	movl	%edx, %r13d
LBB0_20:                                ##   Parent Loop BB0_15 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_21 Depth 3
	movslq	%r13d, %r15
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_21:                                ##   Parent Loop BB0_15 Depth=1
                                        ##     Parent Loop BB0_20 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	%ebx, %edi
	callq	_RARRAY_PTR
	movl	(%rax,%r12,4), %edi
	callq	_mrb_fixnum
	cmpq	%r15, %rax
	je	LBB0_19
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=3
	incq	%r12
	cmpq	%r12, %r14
	jne	LBB0_21
## %bb.23:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_24
LBB0_16:
	testl	%eax, %eax
	jle	LBB0_7
## %bb.17:
	xorl	%r12d, %r12d
	movl	-64(%rbp), %r14d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	callq	_RARRAY_PTR
	movq	%rax, %r13
	movl	%ebx, %edi
	callq	_RARRAY_PTR
	movl	(%rax,%r12,4), %edi
	callq	_mrb_fixnum
	movl	(%r13,%rax,4), %ecx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_mrb_ary_set
	incq	%r12
	movslq	-44(%rbp), %rax
	cmpq	%rax, %r12
	jl	LBB0_18
	jmp	LBB0_7
LBB0_3:
	cmpl	$1, %r12d
	je	LBB0_6
## %bb.4:
	testl	%r12d, %r12d
	jne	LBB0_8
## %bb.5:
	xorl	%eax, %eax
	callq	_mrb_nil_value
	movl	%eax, %ebx
	jmp	LBB0_7
LBB0_10:
	movq	_E_ARGUMENT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	callq	_mrb_raise
	movl	-44(%rbp), %esi
	cmpl	%r12d, %esi
	jg	LBB0_12
	jmp	LBB0_13
LBB0_6:
	movl	%r14d, %edi
	callq	_RARRAY_PTR
	movl	(%rax), %ebx
	jmp	LBB0_7
LBB0_8:
	movl	%r14d, %edi
	callq	_RARRAY_PTR
	movq	%rax, %rbx
	movq	-56(%rbp), %rdi
	callq	_mt_rand
	cltd
	idivl	%r12d
	movslq	%edx, %rax
	movl	(%rbx,%rax,4), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"|i?d"

	.comm	_mt_state_type,4,2              ## @mt_state_type
	.comm	_E_ARGUMENT_ERROR,4,2           ## @E_ARGUMENT_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"negative sample number"

	.no_dead_strip	_mrb_ary_sample
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mrb_ary_sample
_mrb_ary_sample:                        ; @mrb_ary_sample
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
	str	wzr, [sp, #12]
	str	xzr, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
Lloh2:
	adrp	x5, _mt_state_type@GOTPAGE
Lloh3:
	ldr	x5, [x5, _mt_state_type@GOTPAGEOFF]
	add	x2, sp, #12
	add	x3, sp, #8
	mov	x4, sp
	bl	_mrb_get_args
	ldr	x1, [sp]
	cbnz	x1, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_get_random_state
	mov	x1, x0
	str	x0, [sp]
LBB0_2:
	mov	x0, x20
	bl	_mrb_random_rand_seed
	ldr	x0, [sp]
	bl	_mt_rand
	mov	x0, x19
	bl	_RARRAY_LEN
	mov	x22, x0
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_17
; %bb.3:
	ldr	w1, [sp, #12]
	tbnz	w1, #31, LBB0_20
; %bb.4:
	cmp	w1, w22
	b.le	LBB0_6
LBB0_5:
	str	w22, [sp, #12]
	mov	x1, x22
LBB0_6:
	mov	x0, x20
	bl	_mrb_ary_new_capa
	mov	x21, x0
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.lt	LBB0_23
; %bb.7:
	mov	x24, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x23
	bl	_mrb_fixnum_value
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_mrb_ary_push
	add	x24, x24, #1
	ldrsw	x8, [sp, #12]
	cmp	x24, x8
	b.ge	LBB0_14
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
                                        ;       Child Loop BB0_12 Depth 3
	ldr	x0, [sp]
	bl	_mt_rand
	sdiv	w8, w0, w22
	msub	w23, w8, w22, w0
	cbnz	x24, LBB0_11
	b	LBB0_8
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=2
	ldr	x0, [sp]
	bl	_mt_rand
	sdiv	w8, w0, w22
	msub	w23, w8, w22, w0
LBB0_11:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_12 Depth 3
	mov	x25, #0
	sxtw	x26, w23
LBB0_12:                                ;   Parent Loop BB0_9 Depth=1
                                        ;     Parent Loop BB0_11 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x21
	bl	_RARRAY_PTR
	ldr	w0, [x0, x25, lsl #2]
	bl	_mrb_fixnum
	cmp	x0, x26
	b.eq	LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=3
	add	x25, x25, #1
	cmp	x24, x25
	b.ne	LBB0_12
	b	LBB0_8
LBB0_14:
	cmp	w8, #1
	b.lt	LBB0_23
; %bb.15:
	mov	x22, #0
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_RARRAY_PTR
	mov	x23, x0
	mov	x0, x21
	bl	_RARRAY_PTR
	ldr	w0, [x0, x22, lsl #2]
	bl	_mrb_fixnum
	ldr	w3, [x23, x0, lsl #2]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_mrb_ary_set
	add	x22, x22, #1
	ldrsw	x8, [sp, #12]
	cmp	x22, x8
	b.lt	LBB0_16
	b	LBB0_23
LBB0_17:
	cmp	w22, #1
	b.eq	LBB0_21
; %bb.18:
	cbnz	w22, LBB0_22
; %bb.19:
	bl	_mrb_nil_value
	mov	x21, x0
	b	LBB0_23
LBB0_20:
Lloh4:
	adrp	x8, _E_ARGUMENT_ERROR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _E_ARGUMENT_ERROR@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x2, l_.str.1@PAGE
Lloh8:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_mrb_raise
	ldr	w1, [sp, #12]
	cmp	w1, w22
	b.gt	LBB0_5
	b	LBB0_6
LBB0_21:
	mov	x0, x19
	bl	_RARRAY_PTR
	ldr	w21, [x0]
	b	LBB0_23
LBB0_22:
	mov	x0, x19
	bl	_RARRAY_PTR
	mov	x19, x0
	ldr	x0, [sp]
	bl	_mt_rand
	sdiv	w8, w0, w22
	msub	w8, w8, w22, w0
	ldr	w21, [x19, w8, sxtw #2]
LBB0_23:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"|i?d"

	.comm	_mt_state_type,4,2              ; @mt_state_type
	.comm	_E_ARGUMENT_ERROR,4,2           ; @E_ARGUMENT_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"negative sample number"

	.no_dead_strip	_mrb_ary_sample
.subsections_via_symbols
