	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function str_rep
_str_rep:                               ## @str_rep
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movl	$1, %ebx
	leaq	-48(%rbp), %rdx
	movl	$1, %esi
	callq	_luaL_checklstring
	movq	%rax, %r14
	movq	%r13, %rdi
	movl	$2, %esi
	callq	_luaL_checkinteger
	movq	%rax, %r15
	leaq	L_.str(%rip), %rdx
	leaq	-56(%rbp), %rcx
	movq	%r13, %rdi
	movl	$3, %esi
	callq	_luaL_optlstring
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	-48(%rbp), %rcx
	movq	-56(%rbp), %rbx
	movq	%rbx, %rsi
	addq	%rcx, %rsi
	jb	LBB0_7
## %bb.3:
	movq	%rax, %r12
	movq	_MAXSIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, %rdx
	orq	%r15, %rdx
	shrq	$32, %rdx
	je	LBB0_4
## %bb.5:
	xorl	%edx, %edx
	divq	%r15
	cmpq	%rax, %rsi
	jbe	LBB0_8
LBB0_7:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_luaL_error
	movl	%eax, %ebx
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_lua_pushliteral
	jmp	LBB0_13
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r15d
                                        ## kill: def $eax killed $eax def $rax
	cmpq	%rax, %rsi
	ja	LBB0_7
LBB0_8:
	imulq	%r15, %rcx
	leaq	-1(%r15), %rax
	imulq	%rax, %rbx
	addq	%rcx, %rbx
	leaq	-60(%rbp), %rsi
	movq	%r13, %rdi
	movq	%rbx, %r13
	movq	%rbx, %rdx
	callq	_luaL_buffinitsize
	movq	%rax, %rbx
	cmpq	$2, %r15
	jae	LBB0_9
LBB0_12:
	movq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_memcpy
	leaq	-60(%rbp), %rdi
	movq	%r13, %rsi
	callq	_luaL_pushresultsize
	movl	$1, %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	cmpq	$1, %r15
	jbe	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	decq	%r15
	movq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_memcpy
	addq	-48(%rbp), %rbx
	movq	-56(%rbp), %rdx
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_memcpy
	addq	-56(%rbp), %rbx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_MAXSIZE,8,3                    ## @MAXSIZE
L_.str.1:                               ## @.str.1
	.asciz	"resulting string too large"

	.no_dead_strip	_str_rep
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function str_rep
_str_rep:                               ; @str_rep
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x23, x0
	add	x2, sp, #24
	mov	w1, #1
	bl	_luaL_checklstring
	mov	x19, x0
	mov	x0, x23
	mov	w1, #2
	bl	_luaL_checkinteger
	mov	x20, x0
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	add	x3, sp, #16
	mov	x0, x23
	mov	w1, #3
	bl	_luaL_optlstring
	cbz	x20, LBB0_4
; %bb.1:
	ldp	x8, x9, [sp, #16]
	adds	x10, x8, x9
	b.hs	LBB0_3
; %bb.2:
Lloh2:
	adrp	x11, _MAXSIZE@GOTPAGE
Lloh3:
	ldr	x11, [x11, _MAXSIZE@GOTPAGEOFF]
Lloh4:
	ldr	x11, [x11]
	udiv	x11, x11, x20
	cmp	x10, x11
	b.ls	LBB0_5
LBB0_3:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_luaL_error
	b	LBB0_8
LBB0_4:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	bl	_lua_pushliteral
	b	LBB0_7
LBB0_5:
	mov	x21, x0
	mul	x9, x9, x20
	sub	x10, x20, #1
	madd	x22, x8, x10, x9
	add	x1, sp, #12
	mov	x0, x23
	mov	x2, x22
	bl	_luaL_buffinitsize
	mov	x23, x0
	cmp	x20, #2
	b.hs	LBB0_10
LBB0_6:
	ldr	x2, [sp, #24]
	mov	x0, x23
	mov	x1, x19
	bl	_memcpy
	add	x0, sp, #12
	mov	x1, x22
	bl	_luaL_pushresultsize
LBB0_7:
	mov	w0, #1
LBB0_8:
	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
	add	sp, sp, #96
	ret
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	cmp	x20, #1
	b.ls	LBB0_6
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	sub	x20, x20, #1
	ldr	x2, [sp, #24]
	mov	x0, x23
	mov	x1, x19
	bl	_memcpy
	ldp	x2, x8, [sp, #16]
	add	x23, x23, x8
	cbz	x2, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x23
	mov	x1, x21
	bl	_memcpy
	ldr	x8, [sp, #16]
	add	x23, x23, x8
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_MAXSIZE,8,3                    ; @MAXSIZE
l_.str.1:                               ; @.str.1
	.asciz	"resulting string too large"

	.no_dead_strip	_str_rep
.subsections_via_symbols
