// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x20d6
leaq -0x3c2(%rip), %rax      # 0x1d10
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2490
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x20f8
leaq 0x20b3(%rip), %rdi      # 0x41a4
movb $0x0, %al
callq 0x1580
callq 0x1200
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x212d
movq -0x28(%rbp), %rax
movsbl (%rax), %edi
movq -0x8(%rbp), %rsi
callq 0x1160
jmp 0x2347
movq -0x28(%rbp), %rdi
leaq 0x20a0(%rip), %rsi      # 0x41d8
callq 0x10f0
cmpl $0x0, %eax
je 0x2154
movq -0x28(%rbp), %rsi
leaq 0x2093(%rip), %rdi      # 0x41e0
movb $0x0, %al
callq 0x1580
movq -0x8(%rbp), %rdi
callq 0x2490
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2347
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x4a5(%rip), %rdx       # 0x2620
callq 0x2550
movq -0x8(%rbp), %rdi
callq 0x10c0
movl %eax, -0x1c(%rbp)
cmpl $-0x1, -0x1c(%rbp)
jne 0x21a2
leaq 0x2083(%rip), %rdi      # 0x421c
movb $0x0, %al
callq 0x1580
jmp 0x21c2
cmpl $0x3a, -0x1c(%rbp)
je 0x21c0
movl 0x4f7a(%rip), %esi      # 0x7128
movq -0x28(%rbp), %rdx
leaq 0x207a(%rip), %rdi      # 0x4233
movb $0x0, %al
callq 0x1580
jmp 0x21c2
movq -0x8(%rbp), %rdi
callq 0x2670
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x2087(%rip), %rsi      # 0x4261
callq 0x10f0
cmpl $0x0, %eax
jne 0x2213
movq -0x30(%rbp), %rdi
callq 0x11c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jge 0x220e
leaq 0x2062(%rip), %rdi      # 0x4269
movb $0x0, %al
callq 0x1580
jmp 0x2335
movq -0x28(%rbp), %rdi
leaq 0x2079(%rip), %rsi      # 0x4297
callq 0x10f0
cmpl $0x0, %eax
jne 0x2257
movq -0x30(%rbp), %rdi
callq 0x11c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jge 0x2252
leaq 0x2051(%rip), %rdi      # 0x429c
movb $0x0, %al
callq 0x1580
jmp 0x2333
movq -0x28(%rbp), %rdi
leaq 0x2065(%rip), %rsi      # 0x42c7
callq 0x10f0
cmpl $0x0, %eax
jne 0x229b
movq -0x30(%rbp), %rdi
callq 0x11c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x4(%rax)
jge 0x2296
leaq 0x2043(%rip), %rdi      # 0x42d2
movb $0x0, %al
callq 0x1580
jmp 0x2331
movq -0x28(%rbp), %rdi
leaq 0x205d(%rip), %rsi      # 0x4303
callq 0x10f0
cmpl $0x0, %eax
jne 0x22dc
movq -0x30(%rbp), %rdi
callq 0x11c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jge 0x22da
leaq 0x203e(%rip), %rdi      # 0x4311
movb $0x0, %al
callq 0x1580
jmp 0x232f
movq -0x28(%rbp), %rdi
leaq 0x205e(%rip), %rsi      # 0x4345
callq 0x10f0
cmpl $0x0, %eax
jne 0x231b
movq -0x30(%rbp), %rdi
callq 0x11c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
cmpl $0x1, (%rax)
jge 0x2319
leaq 0x203c(%rip), %rdi      # 0x434e
movb $0x0, %al
callq 0x1580
jmp 0x232d
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq *%rax
jmp 0x232f
jmp 0x2331
jmp 0x2333
jmp 0x2335
movq -0x8(%rbp), %rdi
callq 0x2490
movq %rax, -0x28(%rbp)
jmp 0x2161
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)