// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1120
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1170
movq 0x3aa6(%rip), %rax      # 0x6ff8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1120
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0xeb3(%rip), %rsi       # 0x4423
movb $0x0, %al
callq 0x1110
movq -0x8(%rbp), %rdi
callq 0x2490
movq %rax, -0x18(%rbp)
movq 0x3a6d(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0xe95(%rip), %rsi       # 0x442e
movb $0x0, %al
callq 0x1110
movq -0x18(%rbp), %rdi
leaq 0xc2d(%rip), %rsi       # 0x41d8
callq 0x10f0
cmpl $0x0, %eax
jne 0x35cd
movq 0x3a3c(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0xe78(%rip), %rsi       # 0x443e
movb $0x0, %al
callq 0x1110
movq -0x8(%rbp), %rdi
callq 0x2490
movq %rax, -0x18(%rbp)
movq 0x3a17(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0xe3f(%rip), %rsi       # 0x442e
movb $0x0, %al
callq 0x1110
cmpq $0x0, -0x18(%rbp)
je 0x36ed
movq -0x18(%rbp), %rdi
leaq 0xc55(%rip), %rsi       # 0x4261
callq 0x10f0
cmpl $0x0, %eax
jne 0x36bf
movq -0x8(%rbp), %rdi
leaq 0xe2b(%rip), %rsi       # 0x4450
movb $0x0, %al
callq 0x1110
movl -0xc(%rbp), %edi
callq 0x3360
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
subl -0x1c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
movl $0x1, %edx
callq 0x1170
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0xb1f(%rip), %rsi       # 0x417d
movb $0x0, %al
callq 0x1110
movq -0x8(%rbp), %rdi
movq $-0x1, %rsi
movl $0x1, %edx
callq 0x1170
movq -0x8(%rbp), %rdi
callq 0x2490
movq %rax, -0x18(%rbp)
movq 0x396a(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0xd92(%rip), %rsi       # 0x442e
movb $0x0, %al
callq 0x1110
movq -0x18(%rbp), %rdi
leaq 0xbb3(%rip), %rsi       # 0x4261
callq 0x10f0
cmpl $0x0, %eax
jne 0x36bd
jmp 0x35f6
jmp 0x36ed
movq 0x3932(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0xd5a(%rip), %rsi       # 0x442e
movb $0x0, %al
callq 0x1110
movq -0x8(%rbp), %rdi
callq 0x2490
movq %rax, -0x18(%rbp)
jmp 0x35f6
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x1170
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)