// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/htmshell.c
// Function: htmlSpecifierToEncoding
char htmlSpecifierToEncoding(char *format, int *pI, boolean noAbort)
/* translate specifier to encoding type */
{
int i = *pI + 1;
int cnt =  0;
char enc;
char spec[7+1];  // only check for 7 characters after |spec| starts.
spec[0] = 0;
if (format[i] == '|')
    {
    ++i;
    while (TRUE)
	{
	char c = format[i++];
	if ((c == 0) || (cnt >= 7)) // end of format string
	    {
	    i = *pI + 1;
	    spec[0] = 0;
	    break;
	    }
	if (c == '|')
	    {
	    spec[cnt] = 0; // terminate spec
	    if (cnt == 0) // double || escapes itself
		i--;      // retain the last | char
	    break;
	    }
	else
	    {
	    spec[cnt++] = c;
	    }
	}
    }
if (sameString(spec,"js"))
    enc  = (enum htmlSafefEncoding) js;
else if (sameString(spec,"css"))
    enc = (enum htmlSafefEncoding) css;
else if (sameString(spec,"attr"))
    enc = (enum htmlSafefEncoding) attr;
else if (sameString(spec,"url"))
    enc = (enum htmlSafefEncoding) url;
else if (sameString(spec,""))
    enc = (enum htmlSafefEncoding) html;
else if (sameString(spec,"none"))
    enc = (enum htmlSafefEncoding) none;
else
    {
    htmlSafefAbort(noAbort, -2, "Unknown spec [%s] in format string [%s].", spec, format);
    return 0;
    }

*pI = i - 1;
return enc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movb $0x0, -0x2d(%rbp)
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x7c, %eax
jne 0x6ab28
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x2e(%rbp)
movsbl -0x2e(%rbp), %eax
cmpl $0x0, %eax
je 0x6aadb
cmpl $0x7, -0x24(%rbp)
jl 0x6aaed
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movb $0x0, -0x2d(%rbp)
jmp 0x6ab26
movsbl -0x2e(%rbp), %eax
cmpl $0x7c, %eax
jne 0x6ab10
movslq -0x24(%rbp), %rax
movb $0x0, -0x2d(%rbp,%rax)
cmpl $0x0, -0x24(%rbp)
jne 0x6ab0e
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x6ab26
movb -0x2e(%rbp), %cl
movl -0x24(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
cltq
movb %cl, -0x2d(%rbp,%rax)
jmp 0x6aab4
jmp 0x6ab28
leaq -0x2d(%rbp), %rdi
leaq 0x764d0(%rip), %rsi     # 0xe1003
callq 0x6a40
cmpl $0x0, %eax
jne 0x6ab46
movb $0x3, -0x25(%rbp)
jmp 0x6abfe
leaq -0x2d(%rbp), %rdi
leaq 0x76b2d(%rip), %rsi     # 0xe167e
callq 0x6a40
cmpl $0x0, %eax
jne 0x6ab64
movb $0x4, -0x25(%rbp)
jmp 0x6abfc
leaq -0x2d(%rbp), %rdi
leaq 0x72877(%rip), %rsi     # 0xdd3e6
callq 0x6a40
cmpl $0x0, %eax
jne 0x6ab7f
movb $0x5, -0x25(%rbp)
jmp 0x6abfa
leaq -0x2d(%rbp), %rdi
leaq 0x76af8(%rip), %rsi     # 0xe1682
callq 0x6a40
cmpl $0x0, %eax
jne 0x6ab9a
movb $0x6, -0x25(%rbp)
jmp 0x6abf8
leaq -0x2d(%rbp), %rdi
leaq 0x7a861(%rip), %rsi     # 0xe5406
callq 0x6a40
cmpl $0x0, %eax
jne 0x6abb5
movb $0x2, -0x25(%rbp)
jmp 0x6abf6
leaq -0x2d(%rbp), %rdi
leaq 0x76ac6(%rip), %rsi     # 0xe1686
callq 0x6a40
cmpl $0x0, %eax
jne 0x6abd0
movb $0x1, -0x25(%rbp)
jmp 0x6abf4
movl -0x1c(%rbp), %edi
leaq -0x2d(%rbp), %rcx
movq -0x10(%rbp), %r8
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x76aa4(%rip), %rdx     # 0xe168b
movb $0x0, %al
callq 0x6a680
movb $0x0, -0x1(%rbp)
jmp 0x6ac10
jmp 0x6abf6
jmp 0x6abf8
jmp 0x6abfa
jmp 0x6abfc
jmp 0x6abfe
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movb -0x25(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)