	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function str_new
_str_new:                               ## @str_new
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r12
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_mrb_ro_data_p
	testq	%rax, %rax
	je	LBB0_2
## %bb.10:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_str_new_static                 ## TAILCALL
LBB0_2:
	movq	%r12, %rdi
	callq	_mrb_obj_alloc_string
	movq	%rax, %r15
	movq	_RSTRING_EMBED_LEN_MAX@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jae	LBB0_3
## %bb.5:
	movq	_MRB_INT_MAX@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	ja	LBB0_7
## %bb.6:
	movq	_E_ARGUMENT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_mrb_raise
LBB0_7:
	leaq	1(%r14), %rsi
	movq	%r12, %rdi
	callq	_mrb_malloc
	movq	%rax, %rdi
	movq	%rax, 8(%r15)
	movq	%r14, 24(%r15)
	movq	%r14, 16(%r15)
	testq	%rbx, %rbx
	jne	LBB0_8
	jmp	LBB0_9
LBB0_3:
	movq	%r15, %rdi
	callq	_RSTR_SET_EMBED_FLAG
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_RSTR_SET_EMBED_LEN
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.4:
	movq	(%r15), %rdi
LBB0_8:
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_memcpy
LBB0_9:
	movq	%r15, %rdi
	callq	_RSTR_PTR
	movb	$0, (%rax,%r14)
	movq	%r15, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RSTRING_EMBED_LEN_MAX,8,3      ## @RSTRING_EMBED_LEN_MAX
	.comm	_MRB_INT_MAX,8,3                ## @MRB_INT_MAX
	.comm	_E_ARGUMENT_ERROR,4,2           ## @E_ARGUMENT_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"string size too big"

	.no_dead_strip	_str_new
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function str_new
_str_new:                               ; @str_new
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
	cbz	x1, LBB0_3
; %bb.1:
	mov	x0, x20
	bl	_mrb_ro_data_p
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_str_new_static
LBB0_3:
	mov	x0, x22
	bl	_mrb_obj_alloc_string
	mov	x21, x0
Lloh0:
	adrp	x8, _RSTRING_EMBED_LEN_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RSTRING_EMBED_LEN_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x19
	b.hs	LBB0_7
; %bb.4:
Lloh3:
	adrp	x8, _MRB_INT_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MRB_INT_MAX@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x19
	b.hi	LBB0_6
; %bb.5:
Lloh6:
	adrp	x8, _E_ARGUMENT_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _E_ARGUMENT_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	bl	_mrb_raise
LBB0_6:
	add	x1, x19, #1
	mov	x0, x22
	bl	_mrb_malloc
	stp	x19, x19, [x21, #16]
	str	x0, [x21, #8]
	cbnz	x20, LBB0_9
	b	LBB0_10
LBB0_7:
	mov	x0, x21
	bl	_RSTR_SET_EMBED_FLAG
	mov	x0, x21
	mov	x1, x19
	bl	_RSTR_SET_EMBED_LEN
	cbz	x20, LBB0_10
; %bb.8:
	ldr	x0, [x21]
LBB0_9:
	mov	x1, x20
	mov	x2, x19
	bl	_memcpy
LBB0_10:
	mov	x0, x21
	bl	_RSTR_PTR
	strb	wzr, [x0, x19]
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_RSTRING_EMBED_LEN_MAX,8,3      ; @RSTRING_EMBED_LEN_MAX
	.comm	_MRB_INT_MAX,8,3                ; @MRB_INT_MAX
	.comm	_E_ARGUMENT_ERROR,4,2           ; @E_ARGUMENT_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"string size too big"

	.no_dead_strip	_str_new
.subsections_via_symbols
