// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x10(%rbp)
callq 0x32c0
movq %rax, -0x18(%rbp)
movl $0x0, -0x124(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10c0
movb %al, -0x125(%rbp)
callq 0x1190
movq (%rax), %rax
movsbl -0x125(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x3b4f
movsbl -0x125(%rbp), %eax
cmpl $0x5f, %eax
je 0x3b4f
movsbl -0x125(%rbp), %esi
leaq 0x430d(%rip), %rdi      # 0x7e48
movb $0x0, %al
callq 0x63e0
movq $0x0, -0x8(%rbp)
jmp 0x3d46
movb -0x125(%rbp), %cl
movl -0x124(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x124(%rbp)
cltq
movb %cl, -0x120(%rbp,%rax)
movq -0x10(%rbp), %rdi
callq 0x10c0
movb %al, -0x125(%rbp)
movsbl %al, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x126(%rbp)
je 0x3bd3
callq 0x1190
movq (%rax), %rax
movsbl -0x125(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x8, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x127(%rbp)
jne 0x3bc7
movsbl -0x125(%rbp), %eax
cmpl $0x5f, %eax
sete %al
movb %al, -0x127(%rbp)
movb -0x127(%rbp), %al
movb %al, -0x126(%rbp)
movb -0x126(%rbp), %al
testb $0x1, %al
jne 0x3bdf
jmp 0x3c30
cmpl $0xff, -0x124(%rbp)
jne 0x3c0b
leaq 0x42a9(%rip), %rdi      # 0x7e9b
movl $0xff, %esi
movb $0x0, %al
callq 0x63e0
movq $0x0, -0x8(%rbp)
jmp 0x3d46
movb -0x125(%rbp), %cl
movl -0x124(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x124(%rbp)
cltq
movb %cl, -0x120(%rbp,%rax)
jmp 0x3b6f
movsbl -0x125(%rbp), %eax
cmpl $-0x1, %eax
jne 0x3c57
leaq 0x428c(%rip), %rdi      # 0x7ecf
movb $0x0, %al
callq 0x63e0
movq $0x0, -0x8(%rbp)
jmp 0x3d46
callq 0x1190
movq (%rax), %rax
movsbl -0x125(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x3c80
movq -0x10(%rbp), %rdi
callq 0x3d60
movsbl -0x125(%rbp), %eax
cmpl $0x3a, %eax
je 0x3cae
movsbl -0x125(%rbp), %esi
leaq 0x425c(%rip), %rdi      # 0x7ef6
movb $0x0, %al
callq 0x63e0
movq $0x0, -0x8(%rbp)
jmp 0x3d46
movslq -0x124(%rbp), %rax
movb $0x0, -0x120(%rbp,%rax)
leaq -0x120(%rbp), %rdi
callq 0x3dd0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x1060
cmpq $0x0, %rax
jne 0x3cfd
leaq 0x426c(%rip), %rdi      # 0x7f58
movb $0x0, %al
callq 0x63e0
movq $0x0, -0x8(%rbp)
jmp 0x3d46
movq -0x10(%rbp), %rdi
callq 0x3fa0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x3d26
movq $0x0, -0x8(%rbp)
jmp 0x3d46
movl 0x7434(%rip), %ecx      # 0xb160
movl %ecx, %eax
addl $0x1, %eax
movl %eax, 0x7429(%rip)      # 0xb160
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw %cs:(%rax,%rax)