// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/processtab/tabparser.c
// Function: trimWhiteSpace
static char *
trimWhiteSpace(char *str)
    {
    int frontIndex = 0;
    int backIndex = 0;
    char ch;
    char *newString;
    int i;
    
    if (str == 0) return 0;
    
    while ((ch = str[backIndex]) && ch != '\0' && isspace(ch))
        {
        frontIndex++;
        backIndex++;
        }
        
    if (ch == '\0') return "";
        
    backIndex++;
        
    while ((ch = str[backIndex]) && ch != '\0')
        {
        backIndex++;
        }

    while ((ch = str[backIndex-1]) && isspace(ch) && backIndex > frontIndex)
        {
        backIndex--;
        }
    newString  = (char *)New(sizeof(char) * (backIndex-frontIndex));
    
    for (i = 0; i < backIndex - frontIndex; i++)
        {
        newString[i] = str[frontIndex + i];
        }
    
    newString[backIndex - frontIndex] = '\0';
    return newString;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3dfe
movq $0x0, -0x8(%rbp)
jmp 0x3f94
jmp 0x3e00
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x19(%rbp)
movsbl %al, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x2d(%rbp)
je 0x3e4a
movsbl -0x19(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x2d(%rbp)
je 0x3e4a
callq 0x1190
movq (%rax), %rax
movsbl -0x19(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x2d(%rbp)
movb -0x2d(%rbp), %al
testb $0x1, %al
jne 0x3e53
jmp 0x3e67
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x3e00
movsbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jne 0x3e80
leaq 0x3378(%rip), %rax      # 0x71ef
movq %rax, -0x8(%rbp)
jmp 0x3f94
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x19(%rbp)
movsbl %al, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x2e(%rbp)
je 0x3eb1
movsbl -0x19(%rbp), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x2e(%rbp)
movb -0x2e(%rbp), %al
testb $0x1, %al
jne 0x3eba
jmp 0x3ec5
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x3e89
jmp 0x3ec7
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x19(%rbp)
movsbl %al, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x2f(%rbp)
je 0x3f16
callq 0x1190
movq (%rax), %rax
movsbl -0x19(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x2f(%rbp)
je 0x3f16
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
setg %al
movb %al, -0x2f(%rbp)
movb -0x2f(%rbp), %al
testb $0x1, %al
jne 0x3f1f
jmp 0x3f2a
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x3ec7
movl -0x18(%rbp), %eax
subl -0x14(%rbp), %eax
cltq
shlq $0x0, %rax
movl %eax, %edi
callq 0x6630
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl -0x18(%rbp), %ecx
subl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jge 0x3f7b
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3f48
movq -0x28(%rbp), %rax
movl -0x18(%rbp), %ecx
subl -0x14(%rbp), %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop