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

	n = 1;
	for (s = s0; *s;) {
		s += chartorune(&rune, s);
		full = toupperrune_full(rune);
		if (full) {
			while (*full) {
				n += runelen(*full);
				++full;
			}
		} else {
			rune = toupperrune(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 = toupperrune_full(rune);
		if (full) {
			while (*full) {
				d += runetochar(d, full);
				++full;
			}
		} else {
			rune = toupperrune(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 0x1958c
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 $0x66, %esi
movl 0x8(%rsp), %edi
leaq 0x16c4e(%rip), %rcx     # 0x30140
movl %esi, %edx
movq %rcx, %rax
movl %esi, %ecx
shrl %ecx
movl %ecx, %esi
leal (%rsi,%rsi,4), %esi
cmpl %edi, (%rax,%rsi,4)
jg 0x1950d
leaq (%rax,%rsi,4), %rax
subl %ecx, %edx
jmp 0x1950f
movl %ecx, %edx
movq %rax, %rcx
movl %edx, %esi
cmpl $0x1, %edx
jg 0x194f2
testl %edx, %edx
je 0x1955b
cmpl %edi, (%rax)
jne 0x1955b
movl 0x4(%rax), %ecx
testl %ecx, %ecx
je 0x19579
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 0x19532
jmp 0x19579
callq 0x1c418
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 0x194d1
jmp 0x19591
movl $0x1, %ebp
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x13b6c
movq %rax, %rdi
callq 0x3100
testl %eax, %eax
jne 0x196c7
movq %rbx, %rdi
movl %ebp, %esi
callq 0xde05
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %r15
cmpb $0x0, (%r15)
je 0x19684
leaq 0x8(%rsp), %r14
leaq 0x16b68(%rip), %rbp     # 0x30140
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x18239
movl %eax, %eax
movl %eax, %ebx
movl $0x66, %esi
movl 0x8(%rsp), %edi
movq %rbp, %rcx
movl %esi, %edx
movq %rcx, %rax
movl %esi, %ecx
shrl %ecx
movl %ecx, %esi
leal (%rsi,%rsi,4), %esi
cmpl %edi, (%rax,%rsi,4)
jg 0x19611
leaq (%rax,%rsi,4), %rax
subl %ecx, %edx
jmp 0x19613
movl %ecx, %edx
movq %rax, %rcx
movl %edx, %esi
cmpl $0x1, %edx
jg 0x195f6
testl %edx, %edx
je 0x19658
cmpl %edi, (%rax)
jne 0x19658
cmpl $0x0, 0x4(%rax)
je 0x19674
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 0x19635
jmp 0x19674
callq 0x1c418
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 0x195db
movb $0x0, (%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x13215
movl 0x8198(%rbx), %eax
testl %eax, %eax
je 0x196dc
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 0x1a156(%rip), %rsi     # 0x33839
xorl %eax, %eax
movq %rbx, %rdi
callq 0xc666