// File: /workspace/github_c_makefile_star2_O3/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 -0x3ab(%rip), %rax      # 0x1ab3
cmovneq %rdx, %rax
movq %rax, 0x8(%rsp)
callq 0x2190
movq %rax, %r14
testq %rax, %rax
jne 0x1e82
leaq 0x2359(%rip), %rdi      # 0x41d4
xorl %eax, %eax
callq 0x170c
callq 0x1240
movq (%rax), %rax
movsbq (%r14), %rdi
testb $0x8, 0x1(%rax,%rdi,2)
jne 0x2177
leaq 0x2368(%rip), %rsi      # 0x4208
movq %r14, %rdi
callq 0x1120
testl %eax, %eax
je 0x1ebd
leaq 0x235d(%rip), %rdi      # 0x4210
movq %r14, %rsi
xorl %eax, %eax
callq 0x170c
movq %rbx, %rdi
callq 0x2190
testq %rax, %rax
je 0x2165
movq %rax, %rbp
leaq 0x3b2(%rip), %r12       # 0x228a
movq %r15, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x2210
movq %rbx, %rdi
callq 0x10e0
cmpl $0x3a, %eax
je 0x1f22
cmpl $-0x1, %eax
jne 0x1f0b
leaq 0x234a(%rip), %rdi      # 0x424c
xorl %eax, %eax
callq 0x170c
jmp 0x1f22
movl 0x5237(%rip), %esi      # 0x7148
leaq 0x234b(%rip), %rdi      # 0x4263
movq %rbp, %rdx
xorl %eax, %eax
callq 0x170c
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x2210
movq %rbx, %rdi
callq 0x10e0
movq %rbx, %rdi
cmpl $0x22, %eax
jne 0x1fe2
callq 0x10e0
movl %eax, %r14d
leal -0x1(%r14), %eax
cmpl $-0x3, %eax
ja 0x200f
xorl %r12d, %r12d
xorl %eax, %eax
cmpl $0x22, %r14d
jne 0x1f6b
testl %eax, %eax
je 0x203c
movl %r14d, %ecx
xorl $0x5c, %ecx
xorl %r15d, %r15d
orl %eax, %ecx
sete %r13b
cmpl $0xa, %r14d
jne 0x1f86
incl 0x51c2(%rip)            # 0x7148
cmpq $0xfff, %r12            # imm = 0xFFF
jne 0x1fb0
movb $0x0, 0x100f(%rsp)
movl 0x51ab(%rip), %esi      # 0x7148
leaq 0x2568(%rip), %rdi      # 0x450c
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x170c
movb %r13b, %r15b
movb %r14b, 0x10(%rsp,%r12)
incq %r12
movq %rbx, %rdi
callq 0x10e0
movl %eax, %r14d
movl %eax, %ecx
decl %ecx
movl %r15d, %eax
cmpl $-0x2, %ecx
jb 0x1f5d
movl %r12d, %eax
movq (%rsp), %r15
leaq 0x2aa(%rip), %r12       # 0x228a
jmp 0x2011
movl %eax, %esi
callq 0x2fa6
movq %rax, %r14
cmpb $0x25, (%rax)
jne 0x205f
cmpb $0x25, 0x1(%r14)
jne 0x205f
cmpb $0x0, 0x2(%r14)
jne 0x205f
leaq 0x24e0(%rip), %rdi      # 0x44e6
xorl %eax, %eax
callq 0x170c
jmp 0x205f
xorl %eax, %eax
xorl %ecx, %ecx
movb %cl, 0x10(%rsp,%rax)
movb %cl, 0x100f(%rsp)
movl 0x5124(%rip), %esi      # 0x7148
leaq 0x24ff(%rip), %rdi      # 0x452a
leaq 0x10(%rsp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x170c
jmp 0x2054
movl %r12d, %eax
movb $0x0, 0x10(%rsp,%rax)
movq (%rsp), %r15
leaq 0x23b(%rip), %r12       # 0x228a
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x180e
movq %rax, %r14
movq %rbp, %rdi
leaq 0x2228(%rip), %rsi      # 0x4291
callq 0x1120
testl %eax, %eax
je 0x20d0
movq %rbp, %rdi
leaq 0x224b(%rip), %rsi      # 0x42c7
callq 0x1120
testl %eax, %eax
je 0x20e9
movq %rbp, %rdi
leaq 0x2268(%rip), %rsi      # 0x42f7
callq 0x1120
testl %eax, %eax
je 0x2102
movq %rbp, %rdi
leaq 0x2291(%rip), %rsi      # 0x4333
callq 0x1120
testl %eax, %eax
je 0x211b
movq %rbp, %rdi
leaq 0x22c0(%rip), %rsi      # 0x4375
callq 0x1120
testl %eax, %eax
je 0x2134
movq %r15, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq *0x8(%rsp)
jmp 0x2151
movq %r14, %rdi
callq 0x11f0
movl %eax, 0xc(%r15)
testl %eax, %eax
jns 0x2151
leaq 0x21b2(%rip), %rdi      # 0x4299
jmp 0x214a
movq %r14, %rdi
callq 0x11f0
movl %eax, 0x10(%r15)
testl %eax, %eax
jns 0x2151
leaq 0x21cc(%rip), %rdi      # 0x42cc
jmp 0x214a
movq %r14, %rdi
callq 0x11f0
movl %eax, 0x4(%r15)
testl %eax, %eax
jg 0x2151
leaq 0x21e9(%rip), %rdi      # 0x4302
jmp 0x214a
movq %r14, %rdi
callq 0x11f0
movl %eax, 0x8(%r15)
testl %eax, %eax
jg 0x2151
leaq 0x220f(%rip), %rdi      # 0x4341
jmp 0x214a
movq %r14, %rdi
callq 0x11f0
movl %eax, (%r15)
testl %eax, %eax
jg 0x2151
leaq 0x2234(%rip), %rdi      # 0x437e
xorl %eax, %eax
callq 0x170c
movq %rbx, %rdi
callq 0x2190
movq %rax, %rbp
testq %rax, %rax
jne 0x1edc
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rsi
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1190