// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/processtab/tabparser.c
// Function: parseAttribute
ASTAttribute *
parseAttribute(FILE *in)
    {    
    ASTAttribute *a = newASTAttribute();
    char aNameBuffer[AST_ATTRIBUTE_NAME_LENGTH_MAX];
    int index = 0;
    char ch;
//    printf("[parseAttribute]\n");
    
    /* attribute names must be valid C identifiers */
    
    /* first character must be alpha or _ */
    ch = fgetc(in);
    if (!isalpha(ch) && ch != '_')
        {
        Fatal("unexpected character '%c' reading attribute name; expected alpha or '_' character\n", ch);
        return 0;
        }
    aNameBuffer[index++] = ch;
    
    /* remaining characters must be alpha, numeric, or _ */
    while ((ch = fgetc(in)) && (isalnum(ch) || ch == '_'))
        {
            if (index == AST_ATTRIBUTE_NAME_LENGTH_MAX - 1)
                {
                Fatal("attribute name cannot be longer than %i characters\n", AST_ATTRIBUTE_NAME_LENGTH_MAX - 1);
                return 0;
                }

            aNameBuffer[index++] = ch;
//printf("[parseAttribute] added consumed character to name buffer: '%c'\n", ch);
        }
//printf("[parseAttribute] consumed character '%c'\n", ch);
    
    if (ch == EOF)
        {
        Fatal("unexpected EOF reading attribute name\n");
        return 0;
        }
    if (isspace(ch)) skipWhiteSpace(in);
    
    if (ch != ':')
        {
        Fatal("unexpected character '%c' reading attribute name; expected alphanumeric or '_' character, or ':'\n", ch);
        return 0;
        }
        
    aNameBuffer[index] = '\0';
    a->name = trimWhiteSpace(aNameBuffer);
    
    if (strlen(a->name) == 0)
        {
            Fatal("attribute name must be at least one character long\n");
            return 0;
        }
        
    a->value = parseJSON(in);
    
    if (a->value == 0) return 0;
    
//printf("[parseAttribute] value: '%s'\n", a->value);
    
    a->index = nextAttributeIndex++;
    return a;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %r14
movl $0x18, %edi
callq 0x5257
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r14, %rdi
callq 0x10e0
movl %eax, %r12d
callq 0x11d0
movq %rax, %r15
movl %r12d, %eax
shll $0x18, %eax
cmpl $0x5f000000, %eax       # imm = 0x5F000000
je 0x335d
movq (%r15), %rax
movsbq %r12b, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
jne 0x335d
movsbl %r12b, %esi
leaq 0x3ad1(%rip), %rdi      # 0x6e27
xorl %ebx, %ebx
jmp 0x3447
movb %r12b, (%rsp)
movq %r14, %rdi
callq 0x10e0
movl %eax, %r13d
movl $0x1, %r12d
shll $0x18, %r13d
je 0x33bb
cmpl $0x5f000000, %r13d      # imm = 0x5F000000
je 0x339a
movl %r13d, %ebp
sarl $0x18, %ebp
movq (%r15), %rcx
movslq %ebp, %rdx
movzwl (%rcx,%rdx,2), %ecx
andl $0x8, %ecx
je 0x3427
cmpq $0xff, %r12
je 0x3439
movb %al, (%rsp,%r12)
incq %r12
movq %r14, %rdi
callq 0x10e0
movl %eax, %r13d
jmp 0x3372
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%r15), %rax
movslq %ebp, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x33d5
movq %r14, %rdi
callq 0x3479
cmpl $0x3a000000, %r13d      # imm = 0x3A000000
jne 0x341a
movl %r12d, %eax
movb $0x0, (%rsp,%rax)
movq %rsp, %rdi
callq 0x34b8
movq %rax, (%rbx)
cmpb $0x0, (%rax)
je 0x3463
movq %r14, %rdi
callq 0x35af
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x3475
movl 0x6d74(%rip), %eax      # 0xa180
leal 0x1(%rax), %ecx
movl %ecx, 0x6d6b(%rip)      # 0xa180
movl %eax, 0x10(%rbx)
jmp 0x344e
leaq 0x3ab4(%rip), %rdi      # 0x6ed5
xorl %ebx, %ebx
movl %ebp, %esi
jmp 0x3447
cmpl $0xff000000, %r13d      # imm = 0xFF000000
jne 0x33c0
leaq 0x3a77(%rip), %rdi      # 0x6eae
jmp 0x346a
leaq 0x3a3a(%rip), %rdi      # 0x6e7a
xorl %ebx, %ebx
movl $0xff, %esi
xorl %eax, %eax
callq 0x5138
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3acd(%rip), %rdi      # 0x6f37
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x5138
jmp 0x344e
xorl %ebx, %ebx
jmp 0x344e