	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function math_random
LCPI0_0:
	.quad	0x3ff0000000000000              ## double 1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_math_random:                           ## @math_random
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	xorl	%eax, %eax
	callq	_l_rand
	cvtsi2sd	%rax, %xmm0
	movq	_L_RANDMAX@GOTPCREL(%rip), %rax
	cvtsi2sdq	(%rax), %xmm1
	movsd	LCPI0_0(%rip), %xmm2            ## xmm2 = mem[0],zero
	addsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm2
	mulsd	%xmm0, %xmm2
	movsd	%xmm2, -40(%rbp)                ## 8-byte Spill
	movq	%r15, %rdi
	callq	_lua_gettop
	movl	%eax, %ebx
	cmpl	$2, %eax
	je	LBB0_6
## %bb.1:
	cmpl	$1, %ebx
	je	LBB0_2
## %bb.3:
	testl	%ebx, %ebx
	jne	LBB0_5
## %bb.4:
	cvttsd2si	-40(%rbp), %esi         ## 8-byte Folded Reload
	movq	%r15, %rdi
	callq	_lua_pushnumber
	jmp	LBB0_8
LBB0_6:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_luaL_checkinteger
	movq	%rax, %r14
	jmp	LBB0_7
LBB0_2:
	movl	$1, %r14d
LBB0_7:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_luaL_checkinteger
	movq	%rax, %r12
	xorl	%esi, %esi
	movq	%rax, %rbx
	subq	%r14, %rbx
	setge	%sil
	leaq	L_.str.1(%rip), %rcx
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_luaL_argcheck
	testq	%r14, %r14
	setns	%al
	movq	_LUA_MAXINTEGER@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	%r14, %rcx
	cmpq	%rcx, %r12
	setle	%cl
	orb	%al, %cl
	movzbl	%cl, %esi
	leaq	L_.str.2(%rip), %rcx
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_luaL_argcheck
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rbx, %xmm0
	addsd	LCPI0_0(%rip), %xmm0
	movsd	-40(%rbp), %xmm1                ## 8-byte Reload
                                        ## xmm1 = mem[0],zero
	mulsd	%xmm0, %xmm1
	cvttsd2si	%xmm1, %rsi
	addq	%r14, %rsi
	movq	%r15, %rdi
	callq	_lua_pushinteger
LBB0_8:
	movl	$1, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_luaL_error                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_L_RANDMAX,8,3                  ## @L_RANDMAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wrong number of arguments"

L_.str.1:                               ## @.str.1
	.asciz	"interval is empty"

	.comm	_LUA_MAXINTEGER,8,3             ## @LUA_MAXINTEGER
L_.str.2:                               ## @.str.2
	.asciz	"interval too large"

	.no_dead_strip	_math_random
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function math_random
_math_random:                           ; @math_random
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [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 b8, -56
	.cfi_offset b9, -64
	mov	x19, x0
	bl	_l_rand
	scvtf	d0, x0
Lloh0:
	adrp	x8, _L_RANDMAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _L_RANDMAX@GOTPAGEOFF]
Lloh2:
	ldr	d1, [x8]
	scvtf	d1, d1
	fmov	d2, #1.00000000
	fadd	d1, d1, d2
	fdiv	d1, d2, d1
	fmul	d8, d1, d0
	mov	x0, x19
	bl	_lua_gettop
	mov	x21, x0
	cmp	w0, #2
	b.eq	LBB0_4
; %bb.1:
	cmp	w21, #1
	b.eq	LBB0_5
; %bb.2:
	cbnz	w21, LBB0_8
; %bb.3:
	fcvtzs	w1, d8
	mov	x0, x19
	bl	_lua_pushnumber
	b	LBB0_7
LBB0_4:
	mov	x0, x19
	mov	w1, #1
	bl	_luaL_checkinteger
	mov	x20, x0
	b	LBB0_6
LBB0_5:
	mov	w20, #1
LBB0_6:
	mov	x0, x19
	mov	x1, x21
	bl	_luaL_checkinteger
	mov	x21, x0
	subs	x22, x0, x20
	cset	w1, ge
Lloh3:
	adrp	x3, l_.str.1@PAGE
Lloh4:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w2, #1
	bl	_luaL_argcheck
	cmp	x20, #0
Lloh5:
	adrp	x8, _LUA_MAXINTEGER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LUA_MAXINTEGER@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	add	x8, x8, x20
	ccmp	x21, x8, #4, lt
	cset	w1, le
Lloh8:
	adrp	x3, l_.str.2@PAGE
Lloh9:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	w2, #1
	bl	_luaL_argcheck
	scvtf	d0, x22
	fmov	d1, #1.00000000
	fadd	d0, d0, d1
	fmul	d0, d8, d0
	fcvtzs	x8, d0
	add	x1, x20, x8
	mov	x0, x19
	bl	_lua_pushinteger
LBB0_7:
	mov	w0, #1
	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	d9, d8, [sp], #64               ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	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	d9, d8, [sp], #64               ; 16-byte Folded Reload
	b	_luaL_error
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_L_RANDMAX,8,3                  ; @L_RANDMAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wrong number of arguments"

l_.str.1:                               ; @.str.1
	.asciz	"interval is empty"

	.comm	_LUA_MAXINTEGER,8,3             ; @LUA_MAXINTEGER
l_.str.2:                               ; @.str.2
	.asciz	"interval too large"

	.no_dead_strip	_math_random
.subsections_via_symbols
