// File: /workspace/github_c_makefile_star2_O3/ArtifexSoftware[P]mujs/./jsstring.c
// Function: Sp_toLowerCase
static void Sp_toLowerCase(js_State *J)
{
	const char *s, *s0 = checkstring(J, 0);
	char * volatile dst = NULL;
	char *d;
	Rune rune;
	const Rune *full;
	int n;

	n = 1;
	for (s = s0; *s;) {
		s += chartorune(&rune, s);
		full = tolowerrune_full(rune);
		if (full) {
			while (*full) {
				n += runelen(*full);
				++full;
			}
		} else {
			rune = tolowerrune(rune);
			n += runelen(rune);
		}
	}

	if (js_try(J)) {
		js_free(J, dst);
		js_throw(J);
	}

	d = dst = js_malloc(J, n);
	for (s = s0; *s;) {
		s += chartorune(&rune, s);
		full = tolowerrune_full(rune);
		if (full) {
			while (*full) {
				d += runetochar(d, full);
				++full;
			}
		} else {
			rune = tolowerrune(rune);
			d += runetochar(d, &rune);
		}
	}
	*d = 0;

	js_pushstring(J, dst);
	js_endtry(J);
	js_free(J, dst);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x18(%rsp)
callq 0x28e6e
movq $0x0, 0x10(%rsp)
cmpb $0x0, (%rax)
movq %rax, 0x20(%rsp)
je 0x1932a
movl $0x1, %r14d
leaq 0x2e(%rsp), %r15
leaq 0xc(%rsp), %r12
movq %rax, %r13
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x18239
movl %eax, %eax
movl %eax, %ebx
movl $0x1c, %esi
movl 0x8(%rsp), %edi
leaq 0x16cf4(%rip), %rcx     # 0x2ff80
movl %esi, %edx
movq %rcx, %rax
movl %esi, %ecx
shrl %ecx
movl %ecx, %esi
leal (,%rsi,4), %esi
cmpl %edi, (%rax,%rsi,4)
jg 0x192ab
leaq (%rax,%rsi,4), %rax
subl %ecx, %edx
jmp 0x192ad
movl %ecx, %edx
movq %rax, %rcx
movl %edx, %esi
cmpl $0x1, %edx
jg 0x1928c
testl %edx, %edx
je 0x192f9
cmpl %edi, (%rax)
jne 0x192f9
movl 0x4(%rax), %ecx
testl %ecx, %ecx
je 0x19317
movq %rax, %rbp
addq $0x8, %rbp
movl %r14d, %edx
movl %edx, %r14d
movl %ecx, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1c2e2
movl %r14d, %edx
addl %eax, %edx
movl (%rbp), %esi
addq $0x4, %rbp
movl %esi, %ecx
movl %edx, %r14d
testl %esi, %esi
jne 0x192d0
jmp 0x19317
callq 0x1c3a1
movl %eax, 0x8(%rsp)
movl %eax, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1c2e2
addl %r14d, %eax
movl %eax, %r14d
addq %rbx, %r13
cmpb $0x0, (%r13)
movl %r14d, %ebp
jne 0x1926b
jmp 0x1932f
movl $0x1, %ebp
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x13b6c
movq %rax, %rdi
callq 0x3100
testl %eax, %eax
jne 0x19469
movq %rbx, %rdi
movl %ebp, %esi
callq 0xde05
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %r15
cmpb $0x0, (%r15)
je 0x19426
leaq 0x8(%rsp), %r14
leaq 0x16c0a(%rip), %rbp     # 0x2ff80
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x18239
movl %eax, %eax
movl %eax, %ebx
movl $0x1c, %esi
movl 0x8(%rsp), %edi
movq %rbp, %rcx
movl %esi, %edx
movq %rcx, %rax
movl %esi, %ecx
shrl %ecx
movl %ecx, %esi
leal (,%rsi,4), %esi
cmpl %edi, (%rax,%rsi,4)
jg 0x193b3
leaq (%rax,%rsi,4), %rax
subl %ecx, %edx
jmp 0x193b5
movl %ecx, %edx
movq %rax, %rcx
movl %edx, %esi
cmpl $0x1, %edx
jg 0x19394
testl %edx, %edx
je 0x193fa
cmpl %edi, (%rax)
jne 0x193fa
cmpl $0x0, 0x4(%rax)
je 0x19416
movq %rax, %r13
addq $0x4, %r13
movq %r12, %rax
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0x1c2e2
movl %eax, %eax
addq %r12, %rax
cmpl $0x0, 0x4(%r13)
leaq 0x4(%r13), %r13
movq %rax, %r12
jne 0x193d7
jmp 0x19416
callq 0x1c3a1
movl %eax, 0x8(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x1c2e2
movl %eax, %eax
addq %r12, %rax
movq %rax, %r12
addq %rbx, %r15
cmpb $0x0, (%r15)
movq %r12, %rax
jne 0x19379
movb $0x0, (%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x13215
movl 0x8198(%rbx), %eax
testl %eax, %eax
je 0x1947e
decl %eax
movl %eax, 0x8198(%rbx)
movq 0x10(%rsp), %rsi
movq (%rbx), %rdi
xorl %edx, %edx
callq *0x10(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rsi
movq (%rbx), %rdi
xorl %edx, %edx
callq *0x10(%rbx)
movq %rbx, %rdi
callq 0x8e1b
leaq 0x1a3b4(%rip), %rsi     # 0x33839
xorl %eax, %eax
movq %rbx, %rdi
callq 0xc666