// File: /workspace/github_c_makefile_star2_O1/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 -0x394(%rip), %rax      # 0x1a91
cmovneq %rdx, %rax
movq %rax, (%rsp)
callq 0x213c
movq %rax, %r14
testq %rax, %rax
jne 0x1e48
leaq 0x1393(%rip), %rdi      # 0x31d4
xorl %eax, %eax
callq 0x16e0
callq 0x1240
movq (%rax), %rax
movsbq (%r14), %rdi
testb $0x8, 0x1(%rax,%rdi,2)
jne 0x2123
leaq 0x13a2(%rip), %rsi      # 0x3208
movq %r14, %rdi
callq 0x1120
testl %eax, %eax
je 0x1e83
leaq 0x1397(%rip), %rdi      # 0x3210
movq %r14, %rsi
xorl %eax, %eax
callq 0x16e0
movq %rbx, %rdi
callq 0x213c
testq %rax, %rax
je 0x2111
movq %rax, %rbp
leaq 0x39c(%rip), %r12       # 0x223a
movq %r15, 0x8(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x21c0
movq %rbx, %rdi
callq 0x10e0
cmpl $0x3a, %eax
je 0x1ee9
cmpl $-0x1, %eax
jne 0x1ed2
leaq 0x1383(%rip), %rdi      # 0x324c
xorl %eax, %eax
callq 0x16e0
jmp 0x1ee9
movl 0x4270(%rip), %esi      # 0x6148
leaq 0x1384(%rip), %rdi      # 0x3263
movq %rbp, %rdx
xorl %eax, %eax
callq 0x16e0
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x21c0
movq %rbx, %rdi
callq 0x10e0
movq %rbx, %rdi
cmpl $0x22, %eax
jne 0x1fa4
callq 0x10e0
movl %eax, %r14d
decl %eax
cmpl $-0x3, %eax
ja 0x1fd1
xorl %r12d, %r12d
xorl %eax, %eax
cmpl $0x22, %r14d
jne 0x1f2c
testl %eax, %eax
je 0x1f93
movl %r14d, %ecx
xorl $0x5c, %ecx
xorl %r15d, %r15d
orl %eax, %ecx
sete %r13b
cmpl $0xa, %r14d
jne 0x1f47
incl 0x4201(%rip)            # 0x6148
cmpq $0xfff, %r12            # imm = 0xFFF
jne 0x1f71
movb $0x0, 0x100f(%rsp)
movl 0x41ea(%rip), %esi      # 0x6148
leaq 0x15aa(%rip), %rdi      # 0x350f
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x16e0
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 0x1f22
movl %r12d, %eax
movq 0x8(%rsp), %r15
leaq 0x298(%rip), %r12       # 0x223a
jmp 0x1fd3
movl %eax, %esi
callq 0x2f1f
movq %rax, %r14
movq %rax, %rdi
leaq 0x1509(%rip), %rsi      # 0x34c1
callq 0x1120
testl %eax, %eax
jne 0x200c
leaq 0x1521(%rip), %rdi      # 0x34e9
xorl %eax, %eax
callq 0x16e0
jmp 0x200c
xorl %eax, %eax
movb $0x0, 0x10(%rsp,%rax)
cmpl $0x22, %r14d
je 0x1fff
movb $0x0, 0x100f(%rsp)
movl 0x415c(%rip), %esi      # 0x6148
leaq 0x153a(%rip), %rdi      # 0x352d
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x16e0
leaq 0x10(%rsp), %rdi
callq 0x17f0
movq %rax, %r14
movq %rbp, %rdi
leaq 0x127b(%rip), %rsi      # 0x3291
callq 0x1120
testl %eax, %eax
je 0x207c
movq %rbp, %rdi
leaq 0x129e(%rip), %rsi      # 0x32c7
callq 0x1120
testl %eax, %eax
je 0x2095
movq %rbp, %rdi
leaq 0x12bb(%rip), %rsi      # 0x32f7
callq 0x1120
testl %eax, %eax
je 0x20ae
movq %rbp, %rdi
leaq 0x12e4(%rip), %rsi      # 0x3333
callq 0x1120
testl %eax, %eax
je 0x20c7
movq %rbp, %rdi
leaq 0x1313(%rip), %rsi      # 0x3375
callq 0x1120
testl %eax, %eax
je 0x20e0
movq %r15, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq *(%rsp)
jmp 0x20fd
movq %r14, %rdi
callq 0x11f0
movl %eax, 0xc(%r15)
testl %eax, %eax
jns 0x20fd
leaq 0x1206(%rip), %rdi      # 0x3299
jmp 0x20f6
movq %r14, %rdi
callq 0x11f0
movl %eax, 0x10(%r15)
testl %eax, %eax
jns 0x20fd
leaq 0x1220(%rip), %rdi      # 0x32cc
jmp 0x20f6
movq %r14, %rdi
callq 0x11f0
movl %eax, 0x4(%r15)
testl %eax, %eax
jg 0x20fd
leaq 0x123d(%rip), %rdi      # 0x3302
jmp 0x20f6
movq %r14, %rdi
callq 0x11f0
movl %eax, 0x8(%r15)
testl %eax, %eax
jg 0x20fd
leaq 0x1263(%rip), %rdi      # 0x3341
jmp 0x20f6
movq %r14, %rdi
callq 0x11f0
movl %eax, (%r15)
testl %eax, %eax
jg 0x20fd
leaq 0x1288(%rip), %rdi      # 0x337e
xorl %eax, %eax
callq 0x16e0
movq %rbx, %rdi
callq 0x213c
movq %rax, %rbp
testq %rax, %rax
jne 0x1ea3
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