// File: /workspace/github_c_makefile_star2_O1/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 0x4c71
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 0x3316
movq (%r15), %rax
movsbq %r12b, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
jne 0x3316
movsbl %r12b, %esi
leaq 0x2b18(%rip), %rdi      # 0x5e27
xorl %ebx, %ebx
jmp 0x3400
movb %r12b, (%rsp)
movq %r14, %rdi
callq 0x10e0
movl %eax, %r13d
shll $0x18, %r13d
movsbl %al, %ebp
movl $0x1, %r12d
je 0x338b
cmpl $0x5f000000, %r13d      # imm = 0x5F000000
je 0x334c
movq (%r15), %rcx
movslq %ebp, %rdx
movzwl (%rcx,%rdx,2), %ecx
andl $0x8, %ecx
je 0x3376
cmpq $0xff, %r12
je 0x33f2
movb %al, (%rsp,%r12)
incq %r12
movq %r14, %rdi
callq 0x10e0
movl %eax, %r13d
shll $0x18, %r13d
movsbl %al, %ebp
jne 0x3334
jmp 0x338b
cmpl $0xff000000, %r13d      # imm = 0xFF000000
jne 0x338b
leaq 0x2b28(%rip), %rdi      # 0x5eae
jmp 0x3423
movq (%r15), %rax
movslq %ebp, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x33a0
movq %r14, %rdi
callq 0x3432
cmpl $0x3a000000, %r13d      # imm = 0x3A000000
jne 0x33e5
movl %r12d, %eax
movb $0x0, (%rsp,%rax)
movq %rsp, %rdi
callq 0x3471
movq %rax, (%rbx)
cmpb $0x0, (%rax)
je 0x341c
movq %r14, %rdi
callq 0x3568
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x342e
movl 0x5da9(%rip), %eax      # 0x9180
leal 0x1(%rax), %ecx
movl %ecx, 0x5da0(%rip)      # 0x9180
movl %eax, 0x10(%rbx)
jmp 0x3407
leaq 0x2ae9(%rip), %rdi      # 0x5ed5
xorl %ebx, %ebx
movl %ebp, %esi
jmp 0x3400
leaq 0x2a81(%rip), %rdi      # 0x5e7a
xorl %ebx, %ebx
movl $0xff, %esi
xorl %eax, %eax
callq 0x4b44
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2b14(%rip), %rdi      # 0x5f37
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4b44
jmp 0x3407
xorl %ebx, %ebx
jmp 0x3407