// File: /workspace/github_c_makefile_star2_O0/otrtool[P]otrtool/src/main.c
// Function: showProgress
void showProgress(long long position, long long length) {
  static long long oldpos = 0;
  static unsigned int blocknum = 0;
  const char progressbar[41] = "========================================";
  const char *rotatingFoo = "|/-\\";

  if (logfilemode)
    return;
  if (length > 0) {
    if (oldpos > position) {
      oldpos = 0;
      blocknum = 0;
    }
    if (position - oldpos >= 2097152 || position == 0) {
      if (opts.guimode == 0) {
        fprintf(stderr, "[%-40.*s] %3i%% %c\r", (int)(position*40/length),
            progressbar, (int)(position*100/length),
            rotatingFoo[blocknum++ % 4]);
      } else {
        fprintf(stdout, "gui> %7.3f\n", position*100.0/length);
        fflush(stdout);
      }
      fflush(stderr);
      oldpos = position;
    }
  } else {
    if (opts.guimode == 0) {
      fputs("[========================================] 100%    \n", stderr);
    } else {
      fputs("gui> Finished\n", stdout);
      fflush(stdout);
    }
    oldpos = 0;
    blocknum = 0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x40(%rbp), %rdi
leaq 0x5fb5(%rip), %rsi      # 0xb020
movl $0x29, %edx
callq 0x2170
leaq 0x5283(%rip), %rax      # 0xa2ff
movq %rax, -0x48(%rbp)
cmpl $0x0, 0x8215(%rip)      # 0xd29c
je 0x508e
jmp 0x51fb
cmpq $0x0, -0x10(%rbp)
jle 0x51a0
movq 0x81f0(%rip), %rax      # 0xd290
cmpq -0x8(%rbp), %rax
jle 0x50bb
movq $0x0, 0x81df(%rip) # 0xd290
movl $0x0, 0x81dd(%rip)      # 0xd298
movq -0x8(%rbp), %rax
subq 0x81ca(%rip), %rax      # 0xd290
cmpq $0x200000, %rax         # imm = 0x200000
jge 0x50d9
cmpq $0x0, -0x8(%rbp)
jne 0x519e
cmpl $0x0, 0x81c8(%rip)      # 0xd2a8
jne 0x5141
movq 0x7eef(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
imulq $0x28, -0x8(%rbp), %rax
cqto
idivq -0x10(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rcx
imulq $0x64, -0x8(%rbp), %rax
cqto
idivq -0x10(%rbp)
movl -0x4c(%rbp), %edx
movl %eax, %r8d
movq -0x48(%rbp), %rax
movl 0x817f(%rip), %esi      # 0xd298
movl %esi, %r9d
addl $0x1, %r9d
movl %r9d, 0x8171(%rip)      # 0xd298
andl $0x3, %esi
movl %esi, %esi
movsbl (%rax,%rsi), %r9d
leaq 0x51cc(%rip), %rsi      # 0xa304
movb $0x0, %al
callq 0x2330
jmp 0x5184
movq 0x7e68(%rip), %rax      # 0xcfb0
movq (%rax), %rdi
cvtsi2sdq -0x8(%rbp), %xmm0
movsd 0x4eff(%rip), %xmm1     # 0xa058
mulsd %xmm1, %xmm0
cvtsi2sdq -0x10(%rbp), %xmm1
divsd %xmm1, %xmm0
leaq 0x51aa(%rip), %rsi      # 0xa318
movb $0x1, %al
callq 0x2330
movq 0x7e34(%rip), %rax      # 0xcfb0
movq (%rax), %rdi
callq 0x2260
movq 0x7e4d(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
callq 0x2260
movq -0x8(%rbp), %rax
movq %rax, 0x80f2(%rip)      # 0xd290
jmp 0x51fb
cmpl $0x0, 0x8101(%rip)      # 0xd2a8
jne 0x51c1
movq 0x7e28(%rip), %rax      # 0xcfd8
movq (%rax), %rsi
leaq 0x516a(%rip), %rdi      # 0xa324
callq 0x2240
jmp 0x51e6
movq 0x7de8(%rip), %rax      # 0xcfb0
movq (%rax), %rsi
leaq 0x5187(%rip), %rdi      # 0xa359
callq 0x2240
movq 0x7dd2(%rip), %rax      # 0xcfb0
movq (%rax), %rdi
callq 0x2260
movq $0x0, 0x809f(%rip) # 0xd290
movl $0x0, 0x809d(%rip)      # 0xd298
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)