// File: /workspace/github_c_makefile_star2_O2/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
callq 0x2af2
movq %rax, %rbx
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 0x2fac
movq (%r15), %rax
movsbq %r12b, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
jne 0x2fac
movsbl %r12b, %esi
leaq 0x2e82(%rip), %rdi      # 0x5e27
xorl %ebx, %ebx
jmp 0x307d
movb %r12b, (%rsp)
pushq $0x1
popq %r12
movq %r14, %rdi
callq 0x10e0
movl %eax, %r13d
shll $0x18, %r13d
movsbl %al, %ebp
movq (%r15), %rcx
je 0x2ff4
cmpl $0x5f000000, %r13d      # imm = 0x5F000000
je 0x2fe2
movslq %ebp, %rdx
movzwl (%rcx,%rdx,2), %ecx
movl %ecx, %edx
andl $0x8, %edx
je 0x2ffc
cmpq $0xff, %r12
je 0x3062
movb %al, (%rsp,%r12)
incq %r12
jmp 0x2fb4
movl %ebp, %eax
movzwl (%rcx,%rax,2), %ecx
jmp 0x3011
cmpl $0xff000000, %r13d      # imm = 0xFF000000
jne 0x3011
leaq 0x2ea2(%rip), %rdi      # 0x5eae
jmp 0x30a0
btl $0xd, %ecx
jae 0x301f
movq %r14, %rdi
callq 0x30af
cmpl $0x3a000000, %r13d      # imm = 0x3A000000
jne 0x3072
movb $0x0, (%rsp,%r12)
movq %rsp, %rdi
callq 0x30ee
movq %rax, (%rbx)
cmpb $0x0, (%rax)
je 0x3099
movq %r14, %rdi
callq 0x31c8
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x30ab
movl 0x612c(%rip), %eax      # 0x9180
leal 0x1(%rax), %ecx
movl %ecx, 0x6123(%rip)      # 0x9180
movl %eax, 0x10(%rbx)
jmp 0x3084
leaq 0x2e11(%rip), %rdi      # 0x5e7a
xorl %ebx, %ebx
movl $0xff, %esi
jmp 0x307d
leaq 0x2e5c(%rip), %rdi      # 0x5ed5
xorl %ebx, %ebx
movl %ebp, %esi
xorl %eax, %eax
callq 0x4610
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2e97(%rip), %rdi      # 0x5f37
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4610
jmp 0x3084
xorl %ebx, %ebx
jmp 0x3084