	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function String_substring
_String_substring:                      ## @String_substring
	.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
	movq	%r9, %r12
	movq	%r8, %r14
	movl	%ecx, %r13d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	leaq	-64(%rbp), %rdx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_get_string_val
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_20
## %bb.1:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rdi
	callq	_jsstr_length
	movq	%rax, %r14
	testl	%r13d, %r13d
	je	LBB0_2
## %bb.3:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_to_integer
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_19
## %bb.4:
	movsd	-48(%rbp), %xmm0                ## xmm0 = mem[0],zero
	xorpd	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jae	LBB0_6
## %bb.5:
	xorl	%ecx, %ecx
	jmp	LBB0_8
LBB0_2:
	xorl	%ecx, %ecx
	jmp	LBB0_15
LBB0_6:
	callq	_is_int32
	movq	%r14, %rcx
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movsd	-48(%rbp), %xmm0                ## xmm0 = mem[0],zero
	movq	%r14, %rdi
	callq	_min
	movq	%rax, %rcx
LBB0_8:
	cmpl	$2, %r13d
	jb	LBB0_15
## %bb.9:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_to_integer
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_19
## %bb.10:
	movsd	-48(%rbp), %xmm0                ## xmm0 = mem[0],zero
	xorpd	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jae	LBB0_12
## %bb.11:
	xorl	%r14d, %r14d
	jmp	LBB0_14
LBB0_12:
	callq	_is_int32
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movsd	-48(%rbp), %xmm0                ## xmm0 = mem[0],zero
	movq	%r14, %rdi
	callq	_min
	movq	%rax, %r14
LBB0_14:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
LBB0_15:
	testq	%r12, %r12
	je	LBB0_19
## %bb.16:
	cmpq	%r14, %rcx
	movq	%r14, %rsi
	cmovlq	%rcx, %rsi
	cmovgq	%rcx, %r14
	movq	-64(%rbp), %rdi
	subq	%rsi, %r14
	movq	%r14, %rdx
	callq	_jsstr_substr
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movq	%rax, %rdi
	callq	_jsval_string
	movl	%eax, (%r12)
	jmp	LBB0_19
LBB0_18:
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_19:
	movq	-64(%rbp), %rdi
	callq	_jsstr_release
LBB0_20:
	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	"\n"

	.comm	_E_OUTOFMEMORY,4,2              ## @E_OUTOFMEMORY
	.no_dead_strip	_String_substring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function String_substring
_String_substring:                      ; @String_substring
	.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, x5
	mov	x23, x4
	mov	x25, x3
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	add	x2, sp, #8
	mov	x0, x22
	mov	x1, x20
	bl	_get_string_val
	mov	x20, x0
	bl	_FAILED
	cbnz	x0, LBB0_19
; %bb.1:
	ldr	x0, [sp, #8]
	bl	_jsstr_length
	mov	x21, x0
	cbz	w25, LBB0_5
; %bb.2:
	ldr	w1, [x23]
	mov	x2, sp
	mov	x0, x22
	bl	_to_integer
	mov	x20, x0
	bl	_FAILED
	cbnz	x0, LBB0_18
; %bb.3:
	ldr	d0, [sp]
	fcmp	d0, #0.0
	b.ge	LBB0_6
; %bb.4:
	mov	x24, #0
	b	LBB0_8
LBB0_5:
	mov	x24, #0
	b	LBB0_14
LBB0_6:
	bl	_is_int32
	mov	x24, x21
	cbz	x0, LBB0_8
; %bb.7:
	ldr	d0, [sp]
	mov	x0, x21
	bl	_min
	mov	x24, x0
LBB0_8:
	cmp	w25, #2
	b.lo	LBB0_14
; %bb.9:
	ldr	w1, [x23, #4]
	mov	x2, sp
	mov	x0, x22
	bl	_to_integer
	mov	x20, x0
	bl	_FAILED
	cbnz	x0, LBB0_18
; %bb.10:
	ldr	d0, [sp]
	fcmp	d0, #0.0
	b.ge	LBB0_12
; %bb.11:
	mov	x21, #0
	b	LBB0_14
LBB0_12:
	bl	_is_int32
	cbz	x0, LBB0_14
; %bb.13:
	ldr	d0, [sp]
	mov	x0, x21
	bl	_min
	mov	x21, x0
LBB0_14:
	cbz	x19, LBB0_18
; %bb.15:
	cmp	x24, x21
	csel	x1, x24, x21, lt
	csel	x8, x24, x21, gt
	ldr	x0, [sp, #8]
	sub	x2, x8, x1
	bl	_jsstr_substr
	cbz	x0, LBB0_17
; %bb.16:
	bl	_jsval_string
	str	w0, [x19]
	b	LBB0_18
LBB0_17:
Lloh2:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
Lloh4:
	ldr	w20, [x8]
LBB0_18:
	ldr	x0, [sp, #8]
	bl	_jsstr_release
LBB0_19:
	mov	x0, x20
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_E_OUTOFMEMORY,4,2              ; @E_OUTOFMEMORY
	.no_dead_strip	_String_substring
.subsections_via_symbols
