// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/lib/rra.c
// Function: readRRAHeader
void
readRRAHeader(FILE *in,RRA *w,void (*handler)(RRA *,char *,void *))
    {
    int ch;
    char *attribute,*value;

    if (handler == 0) handler = pushPair;

    attribute = readAttribute(in);

    if (attribute == 0)
        Fatal("not an RRA file: first attribute should be RRAUDIO\n");

    /* check if raw data file -- if so, just return */
    if (isdigit(*attribute))
        {
        ungetc(*attribute,in);
        return;
        }

    if (strcmp(attribute,"RRAUDIO") != 0)
        Fatal("not an RRA file: first attribute is %s (should be RRAUDIO)\n",
            attribute);

    attribute = readAttribute(in);
    while (attribute != 0)
        {
        skipWhiteSpace(in,0,discardComment);

        ch = fgetc(in);
        if (ch == EOF)
            Fatal("premature end of file\n");
        else if (ch != ':')
            Fatal("line %d, expected a colon after attribute %s\n",
                LineNumber,attribute);

        value = readValue(in);

        if (strcmp(attribute,"samples") == 0)
            {
            w->samples = atoi(value);
            if (w->samples < 0)
                Fatal("attribute samples must have a non-zero value\n");
            }
        else if (strcmp(attribute,"skip") == 0)
            {
            w->skip = atoi(value);
            if (w->skip < 0)
                Fatal("attribute skip must have a non-zero value\n");
            }
        else if (strcmp(attribute,"sampleRate") == 0)
            {
            w->sampleRate = atoi(value);
            if (w->sampleRate < 1)
                Fatal("attribute sampleRate must have a non-zero value\n");
            }
        else if (strcmp(attribute,"bitsPerSample") == 0)
            {
            w->bitsPerSample = atoi(value);
            if (w->bitsPerSample < 1)
                Fatal("attribute bitsPerSample must have a non-zero value\n");
            }
        else if (strcmp(attribute,"channels") == 0)
            {
            w->channels = atoi(value);
            if (w->channels < 1)
                Fatal("attribute channels must have a non-zero value\n");
            }
        else
            handler(w,attribute,value);

        attribute = readAttribute(in);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rsi, %r15
movq %rdi, %rbx
testq %rdx, %rdx
leaq -0x2fa(%rip), %rax      # 0x18a8
cmovneq %rdx, %rax
movq %rax, (%rsp)
callq 0x1eb5
movq %rax, %r14
testq %rax, %rax
jne 0x1bc5
leaq 0x1616(%rip), %rdi      # 0x31d4
xorl %eax, %eax
callq 0x1490
callq 0x1240
movq (%rax), %rax
movsbq (%r14), %rdi
testb $0x8, 0x1(%rax,%rdi,2)
jne 0x1e8a
leaq 0x1625(%rip), %rsi      # 0x3208
movq %r14, %rdi
callq 0x1120
testl %eax, %eax
je 0x1c00
leaq 0x161a(%rip), %rdi      # 0x3210
movq %r14, %rsi
xorl %eax, %eax
callq 0x1490
movq %rbx, %rdi
callq 0x1eb5
movq %rax, %rbp
leaq 0x398(%rip), %r12       # 0x1faa
movq %r15, 0x8(%rsp)
testq %rbp, %rbp
je 0x1ea3
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x1f35
movq %rbx, %rdi
callq 0x10e0
cmpl $0x3a, %eax
je 0x1c66
cmpl $-0x1, %eax
jne 0x1c4f
leaq 0x1606(%rip), %rdi      # 0x324c
xorl %eax, %eax
callq 0x1490
jmp 0x1c66
movl 0x44f3(%rip), %esi      # 0x6148
leaq 0x1607(%rip), %rdi      # 0x3263
movq %rbp, %rdx
xorl %eax, %eax
callq 0x1490
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x1f35
movq %rbx, %rdi
callq 0x10e0
cmpl $0x22, %eax
jne 0x1d07
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x10e0
movl %eax, %r14d
leal -0x1(%r14), %eax
cmpl $-0x3, %eax
ja 0x1d37
movl %r14d, %eax
xorl $0x22, %eax
orl %r12d, %eax
je 0x1d65
movl %r14d, %eax
xorl $0x5c, %eax
xorl %r13d, %r13d
orl %eax, %r12d
sete %r12b
cmpl $0xa, %r14d
jne 0x1ccd
incl 0x447b(%rip)            # 0x6148
cmpq $0xfff, %r15            # imm = 0xFFF
jne 0x1cf7
movb $0x0, 0x100f(%rsp)
movl 0x4464(%rip), %esi      # 0x6148
leaq 0x1821(%rip), %rdi      # 0x350c
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x1490
movb %r12b, %r13b
movb %r14b, 0x10(%rsp,%r15)
incq %r15
movl %r13d, %r12d
jmp 0x1c8a
movq %rbx, %rdi
movl %eax, %esi
callq 0x2d55
movq %rax, %r14
cmpb $0x25, (%rax)
jne 0x1d89
cmpb $0x25, 0x1(%r14)
jne 0x1d89
cmpb $0x0, 0x2(%r14)
jne 0x1d89
leaq 0x17b8(%rip), %rdi      # 0x34e6
xorl %eax, %eax
callq 0x1490
jmp 0x1d89
movl %r15d, %eax
xorl %ecx, %ecx
movb %cl, 0x10(%rsp,%rax)
movb %cl, 0x100f(%rsp)
movl 0x43fb(%rip), %esi      # 0x6148
leaq 0x17d6(%rip), %rdi      # 0x352a
leaq 0x10(%rsp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x1490
jmp 0x1d72
movl %r15d, %eax
movb $0x0, 0x10(%rsp,%rax)
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x1628
movq %rax, %r14
movq 0x8(%rsp), %r15
leaq 0x221(%rip), %r12       # 0x1faa
movq %rbp, %rdi
leaq 0x14fe(%rip), %rsi      # 0x3291
callq 0x1120
testl %eax, %eax
je 0x1df9
movq %rbp, %rdi
leaq 0x1521(%rip), %rsi      # 0x32c7
callq 0x1120
testl %eax, %eax
je 0x1e12
movq %rbp, %rdi
leaq 0x153e(%rip), %rsi      # 0x32f7
callq 0x1120
testl %eax, %eax
je 0x1e2b
movq %rbp, %rdi
leaq 0x1567(%rip), %rsi      # 0x3333
callq 0x1120
testl %eax, %eax
je 0x1e44
movq %rbp, %rdi
leaq 0x1596(%rip), %rsi      # 0x3375
callq 0x1120
testl %eax, %eax
je 0x1e5d
movq %r15, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq *(%rsp)
jmp 0x1e7a
movq %r14, %rdi
callq 0x11f0
movl %eax, 0xc(%r15)
testl %eax, %eax
jns 0x1e7a
leaq 0x1489(%rip), %rdi      # 0x3299
jmp 0x1e73
movq %r14, %rdi
callq 0x11f0
movl %eax, 0x10(%r15)
testl %eax, %eax
jns 0x1e7a
leaq 0x14a3(%rip), %rdi      # 0x32cc
jmp 0x1e73
movq %r14, %rdi
callq 0x11f0
movl %eax, 0x4(%r15)
testl %eax, %eax
jg 0x1e7a
leaq 0x14c0(%rip), %rdi      # 0x3302
jmp 0x1e73
movq %r14, %rdi
callq 0x11f0
movl %eax, 0x8(%r15)
testl %eax, %eax
jg 0x1e7a
leaq 0x14e6(%rip), %rdi      # 0x3341
jmp 0x1e73
movq %r14, %rdi
callq 0x11f0
movl %eax, (%r15)
testl %eax, %eax
jg 0x1e7a
leaq 0x150b(%rip), %rdi      # 0x337e
xorl %eax, %eax
callq 0x1490
movq %rbx, %rdi
callq 0x1eb5
movq %rax, %rbp
jmp 0x1c17
movq %rbx, %rsi
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1190
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq