	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function math_random
_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_rand
	movq	%rbx, %rdi
	callq	_lua_gettop
	cmpl	$2, %eax
	je	LBB0_4
## %bb.1:
	cmpl	$1, %eax
	je	LBB0_6
## %bb.2:
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	jmp	LBB0_7
LBB0_4:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_luaL_checkint
	movl	%eax, %r14d
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_luaL_checkint
	xorl	%esi, %esi
	cmpl	%eax, %r14d
	setle	%sil
	leaq	L_.str(%rip), %rcx
	movq	%rbx, %rdi
	movl	$2, %edx
	callq	_luaL_argcheck
	xorl	%edi, %edi
	callq	_floor
	addl	%eax, %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	jmp	LBB0_7
LBB0_6:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_luaL_checkint
	xorl	%esi, %esi
	testl	%eax, %eax
	setg	%sil
	leaq	L_.str(%rip), %rcx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_luaL_argcheck
	xorl	%edi, %edi
	callq	_floor
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %esi
	movq	%rbx, %rdi
LBB0_7:
	callq	_lua_pushnumber
	movl	$1, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_luaL_error                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RAND_MAX,4,2                   ## @RAND_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"interval is empty"

L_.str.1:                               ## @.str.1
	.asciz	"wrong number of arguments"

	.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	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
	bl	_rand
	mov	x0, x19
	bl	_lua_gettop
	cmp	w0, #2
	b.eq	LBB0_4
; %bb.1:
	cmp	w0, #1
	b.eq	LBB0_5
; %bb.2:
	cbnz	w0, LBB0_8
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	b	LBB0_7
LBB0_4:
	mov	x0, x19
	mov	w1, #1
	bl	_luaL_checkint
	mov	x20, x0
	mov	x0, x19
	mov	w1, #2
	bl	_luaL_checkint
	cmp	w20, w0
	cset	w1, le
Lloh0:
	adrp	x3, l_.str@PAGE
Lloh1:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #2
	bl	_luaL_argcheck
	mov	w0, #0
	bl	_floor
	add	w1, w0, w20
	b	LBB0_6
LBB0_5:
	mov	x0, x19
	mov	w1, #1
	bl	_luaL_checkint
	cmp	w0, #0
	cset	w1, gt
Lloh2:
	adrp	x3, l_.str@PAGE
Lloh3:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #1
	bl	_luaL_argcheck
	mov	w0, #0
	bl	_floor
	add	w1, w0, #1
LBB0_6:
	mov	x0, x19
LBB0_7:
	bl	_lua_pushnumber
	mov	w0, #1
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_luaL_error
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_RAND_MAX,4,2                   ; @RAND_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"interval is empty"

l_.str.1:                               ; @.str.1
	.asciz	"wrong number of arguments"

	.no_dead_strip	_math_random
.subsections_via_symbols
