// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/lib/rra.c
// Function: updateRRAHeader
void
updateRRAHeader(FILE *fp, int samples)
    {
    char *attribute;
    int digits;
    long tmp = ftell(fp);
    fseek(fp,0L,SEEK_SET);
    fprintf(stderr,"fp = %ld \n",ftell(fp));

    attribute = readAttribute(fp);
    fprintf(stderr,"attribute : %s\n",attribute);

    if(!strcmp(attribute,"RRAUDIO"))
        fprintf(stderr,"Its an RRA file \n");
    

    attribute = readAttribute(fp);
    fprintf(stderr,"attribute : %s\n",attribute);
    while(attribute != 0)
        {
        if(strcmp(attribute,"samples") == 0)
            {
            fprintf(fp,": 000000000000000\n");
            digits = determineDigits(samples);
            fseek(fp,-digits-1,SEEK_CUR);
            fprintf(fp,"%d\n",samples);
            fseek(fp,-1,SEEK_CUR);
            attribute = readAttribute(fp);
            fprintf(stderr,"attribute : %s\n",attribute);
            if(!strcmp(attribute,"samples"))
                continue;
            break;
            }
        fprintf(stderr,"attribute : %s\n",attribute);
        attribute = readAttribute(fp);
        }
    fseek(fp,tmp,SEEK_SET);         
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x1150
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x11a0
movq 0x5ccf(%rip), %r15      # 0x6ff8
movq (%r15), %r12
movq %rbx, %rdi
callq 0x1150
leaq 0x310d(%rip), %rsi      # 0x4448
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1140
movq %rbx, %rdi
callq 0x2190
movq %rax, %r12
movq (%r15), %rdi
leaq 0x30f6(%rip), %rsi      # 0x4453
movq %rax, %rdx
xorl %eax, %eax
callq 0x1140
leaq 0x2e9a(%rip), %rsi      # 0x4208
movq %r12, %rdi
callq 0x1120
testl %eax, %eax
jne 0x138f
movq (%r15), %rcx
leaq 0x30df(%rip), %rdi      # 0x4463
pushq $0x11
popq %rsi
pushq $0x1
popq %rdx
callq 0x1210
movq %rbx, %rdi
callq 0x2190
movq %rax, %rbp
movq (%r15), %rdi
leaq 0x30af(%rip), %rsi      # 0x4453
movq %rax, %rdx
xorl %eax, %eax
callq 0x1140
testq %rbp, %rbp
je 0x14a4
leal 0x9(%r14), %eax
movl %eax, 0xc(%rsp)
leaq 0x2ecb(%rip), %r12      # 0x4291
pushq $0xa
popq %r13
movq %rbp, %rdi
movq %r12, %rsi
callq 0x1120
testl %eax, %eax
jne 0x147c
leaq 0x3091(%rip), %rdi      # 0x4475
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x1210
pushq $-0x2
popq %rsi
cmpl $0x13, 0xc(%rsp)
jb 0x1415
pushq $-0x2
popq %rcx
movl %r14d, %eax
cltd
idivl %r13d
movl %eax, %edx
addl $0x9, %edx
decl %ecx
cmpl $0x12, %edx
ja 0x1402
movslq %ecx, %rsi
movq %rbx, %rdi
pushq $0x1
popq %rbp
movl %ebp, %edx
callq 0x11a0
movq %rbx, %rdi
leaq 0x2d81(%rip), %rsi      # 0x41ad
movl %r14d, %edx
xorl %eax, %eax
callq 0x1140
movq %rbx, %rdi
pushq $-0x1
popq %rsi
movl %ebp, %edx
callq 0x11a0
movq %rbx, %rdi
callq 0x2190
movq %rax, %rbp
movq (%r15), %rdi
leaq 0x2ffb(%rip), %rsi      # 0x4453
movq %rax, %rdx
xorl %eax, %eax
callq 0x1140
movq %rbp, %rdi
movq %r12, %rsi
callq 0x1120
testq %rbp, %rbp
je 0x14a4
testl %eax, %eax
je 0x13ca
jmp 0x14a4
movq (%r15), %rdi
leaq 0x2fcd(%rip), %rsi      # 0x4453
movq %rbp, %rdx
xorl %eax, %eax
callq 0x1140
movq %rbx, %rdi
callq 0x2190
movq %rax, %rbp
testq %rax, %rax
jne 0x13ca
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11a0
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)