// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/progressbar.c
// Function: refresh_progressbar
static void refresh_progressbar(void)
{
  time_t seconds, minutes, hours, eta_diff;
  char buf[MAXIMUM_WINDOW_SIZE + 1];
  int bar_length, width;
  double percent;
  processed_counter = *computation_counter;
  /* percent */
  if (last_computation)
    percent = ((double) processed_counter / (double) last_computation);
  else
    percent = 1.0;
  (void) snprintf(buf, window_size, "\r%3d%% ", (int) (percent * 100.0));
  /* the bar */
  bar_length = window_size - 22; /* 5 + 2 + 14 + 1 (for '\0') */
  if (bar_length >= 2) { /* make sure the bar is at least 2 '*' wide */
    width = (int) (percent * bar_length);
    (void) snprintf(buf + strlen(buf), window_size - strlen(buf),
                    "|%.*s%*s|", width,
                    "**************************************************"
                    "**************************************************"
                    "**************************************************"
                    "**************************************************"
                    "**************************************************"
                    "**************************************************"
                    "**************************************************"
                    "**************************************************"
                    "**************************************************"
                    "**************************************************",
                    bar_length - width, "");
  }

#define SPLIT_SECONDS            \
        hours = seconds / 3600;  \
        seconds -= hours * 3600; \
        minutes = seconds / 60;  \
        seconds -= minutes * 60;

  /* ETA */
  if (processed_counter == last_computation) {
    /* computation is finished -> show elapsed time */
    seconds = gt_xtime(NULL) - computation_start;
    SPLIT_SECONDS;
    if (hours) {
      (void) snprintf(buf + strlen(buf), window_size - strlen(buf),
                      " %2u:%02u:%02u", (unsigned int) hours,
                      (unsigned int) minutes, (unsigned int) seconds);
    }
    else {
      (void) snprintf(buf + strlen(buf), window_size - strlen(buf),
                      "    %02u:%02u", (unsigned int) minutes,
                      (unsigned int) seconds);
    }
  }
  else if (processed_counter == 0) {
    (void) snprintf(buf + strlen(buf), window_size - strlen(buf),
                    "    --:-- ETA");
  }
  else {
    if (computed_eta != processed_counter) {
      /* compute new ETA */
      computed_eta = processed_counter;
      computed_eta_time = gt_xtime(NULL);
      eta = (time_t)
            (((double) (computed_eta_time - computation_start) /
              (double) (processed_counter)) *
             (last_computation - processed_counter));
      seconds = eta;
    }
    else {
      /* use previous ETA */
      eta_diff = gt_xtime(NULL) - computed_eta_time;
      if (eta_diff >= eta)
        seconds = 0;
      else
        seconds = eta - eta_diff;
    }
    if (seconds) {
      SPLIT_SECONDS;
      if (hours) {
        (void) snprintf(buf + strlen(buf), window_size - strlen(buf),
                        " %2u:%02u:%02u ETA", (unsigned int) hours,
                        (unsigned int) minutes, (unsigned int) seconds);
      }
      else {
        (void) snprintf(buf + strlen(buf), window_size - strlen(buf),
                        "    %02u:%02u ETA", (unsigned int) minutes,
                        (unsigned int) seconds);
      }
    }
    else {
      (void) snprintf(buf + strlen(buf), window_size - strlen(buf),
                      "    --:-- ETA");
    }
  }

  /* file line with blanks */
  (void) snprintf(buf + strlen(buf), window_size - strlen(buf), "%*s",
                  window_size - (int) strlen(buf), "");
  gt_xwrite(STDOUT_FILENO, buf, strlen(buf));
}

// Assembly:
subq $0x318, %rsp            # imm = 0x318
movq 0x1270aa(%rip), %rax    # 0x1b64b8
movq (%rax), %rax
movq %rax, 0x1270c0(%rip)    # 0x1b64d8
cmpq $0x0, 0x1270a0(%rip)    # 0x1b64c0
je 0x8f476
movq 0x1270ae(%rip), %xmm0   # 0x1b64d8
movaps 0xcf04f(%rip), %xmm3    # 0x15e480
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0xcf053(%rip), %xmm2    # 0x15e490
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0x12706c(%rip), %xmm1   # 0x1b64c0
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xe0(%rsp)
jmp 0x8f487
movsd 0xcf38a(%rip), %xmm0    # 0x15e808
movsd %xmm0, 0xe0(%rsp)
leaq 0xf0(%rsp), %rdi
movslq 0x12704a(%rip), %rsi    # 0x1b64e0
movsd 0xd9502(%rip), %xmm0    # 0x1689a0
mulsd 0xe0(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
leaq 0xe047c(%rip), %rdx     # 0x16f92e
movb $0x0, %al
callq 0xb9d0
movl 0x127021(%rip), %eax    # 0x1b64e0
subl $0x16, %eax
movl %eax, 0xec(%rsp)
cmpl $0x2, 0xec(%rsp)
jl 0x8f591
movsd 0xe0(%rsp), %xmm0
cvtsi2sdl 0xec(%rsp), %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0xe8(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq %rax, %rcx
movq 0xc8(%rsp), %rax
addq %rcx, %rax
movq %rax, 0xd8(%rsp)
movslq 0x126fae(%rip), %rax    # 0x1b64e0
movq %rax, 0xd0(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdi
subq %rax, %rsi
movl 0xe8(%rsp), %ecx
movl 0xec(%rsp), %r9d
subl 0xe8(%rsp), %r9d
leaq 0xe03be(%rip), %rdx     # 0x16f936
leaq 0xe03c1(%rip), %r8      # 0x16f940
leaq 0xdc95d(%rip), %rax     # 0x16bee3
movq %rax, (%rsp)
movb $0x0, %al
callq 0xb9d0
movq 0x126f40(%rip), %rax    # 0x1b64d8
cmpq 0x126f21(%rip), %rax    # 0x1b64c0
jne 0x8f75a
xorl %eax, %eax
movl %eax, %edi
callq 0xa30a0
subq 0x126f1b(%rip), %rax    # 0x1b64d0
movq %rax, 0x310(%rsp)
movq 0x310(%rsp), %rax
movl $0xe10, %ecx            # imm = 0xE10
cqto
idivq %rcx
movq %rax, 0x300(%rsp)
imulq $0xe10, 0x300(%rsp), %rcx # imm = 0xE10
movq 0x310(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x310(%rsp)
movq 0x310(%rsp), %rax
movl $0x3c, %ecx
cqto
idivq %rcx
movq %rax, 0x308(%rsp)
imulq $0x3c, 0x308(%rsp), %rcx
movq 0x310(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x310(%rsp)
cmpq $0x0, 0x300(%rsp)
je 0x8f6d0
leaq 0xf0(%rsp), %rax
movq %rax, 0xb0(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq %rax, %rcx
movq 0xb0(%rsp), %rax
addq %rcx, %rax
movq %rax, 0xc0(%rsp)
movslq 0x126e6b(%rip), %rax    # 0x1b64e0
movq %rax, 0xb8(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdi
subq %rax, %rsi
movq 0x300(%rsp), %rax
movl %eax, %ecx
movq 0x308(%rsp), %rax
movl %eax, %r8d
movq 0x310(%rsp), %rax
movl %eax, %r9d
leaq 0xe0471(%rip), %rdx     # 0x16fb35
movb $0x0, %al
callq 0xb9d0
jmp 0x8f755
leaq 0xf0(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq %rax, %rcx
movq 0x98(%rsp), %rax
addq %rcx, %rax
movq %rax, 0xa8(%rsp)
movslq 0x126dd6(%rip), %rax    # 0x1b64e0
movq %rax, 0xa0(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdi
subq %rax, %rsi
movq 0x308(%rsp), %rax
movl %eax, %ecx
movq 0x310(%rsp), %rax
movl %eax, %r8d
leaq 0xe03f6(%rip), %rdx     # 0x16fb44
movb $0x0, %al
callq 0xb9d0
jmp 0x8faca
cmpq $0x0, 0x126d76(%rip)    # 0x1b64d8
jne 0x8f7d9
leaq 0xf0(%rsp), %rax
movq %rax, 0x80(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq %rax, %rcx
movq 0x80(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movslq 0x126d42(%rip), %rax    # 0x1b64e0
movq %rax, 0x88(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdi
subq %rax, %rsi
leaq 0xe0385(%rip), %rdx     # 0x16fb52
movb $0x0, %al
callq 0xb9d0
jmp 0x8fac8
movq 0x126ce8(%rip), %rax    # 0x1b64c8
cmpq 0x126cf1(%rip), %rax    # 0x1b64d8
je 0x8f896
movq 0x126ce4(%rip), %rax    # 0x1b64d8
movq %rax, 0x126ccd(%rip)    # 0x1b64c8
xorl %eax, %eax
movl %eax, %edi
callq 0xa30a0
movq %rax, 0x126cdd(%rip)    # 0x1b64e8
movq 0x126cd6(%rip), %rax    # 0x1b64e8
movq 0x126cb7(%rip), %rcx    # 0x1b64d0
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movq 0x126cb0(%rip), %rcx    # 0x1b64d8
movq %rcx, %xmm1
movaps 0xcec4c(%rip), %xmm3    # 0x15e480
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
movapd 0xcec50(%rip), %xmm2    # 0x15e490
subpd %xmm2, %xmm1
movaps %xmm1, %xmm4
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm4, %xmm1
divsd %xmm1, %xmm0
movq 0x126c66(%rip), %rax    # 0x1b64c0
subq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, 0x126c6b(%rip)    # 0x1b64f0
movq 0x126c64(%rip), %rax    # 0x1b64f0
movq %rax, 0x310(%rsp)
jmp 0x8f8e6
xorl %eax, %eax
movl %eax, %edi
callq 0xa30a0
subq 0x126c42(%rip), %rax    # 0x1b64e8
movq %rax, 0x2f8(%rsp)
movq 0x2f8(%rsp), %rax
cmpq 0x126c33(%rip), %rax    # 0x1b64f0
jl 0x8f8cd
movq $0x0, 0x310(%rsp)
jmp 0x8f8e4
movq 0x126c1c(%rip), %rax    # 0x1b64f0
subq 0x2f8(%rsp), %rax
movq %rax, 0x310(%rsp)
jmp 0x8f8e6
cmpq $0x0, 0x310(%rsp)
je 0x8fa68
movq 0x310(%rsp), %rax
movl $0xe10, %ecx            # imm = 0xE10
cqto
idivq %rcx
movq %rax, 0x300(%rsp)
imulq $0xe10, 0x300(%rsp), %rcx # imm = 0xE10
movq 0x310(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x310(%rsp)
movq 0x310(%rsp), %rax
movl $0x3c, %ecx
cqto
idivq %rcx
movq %rax, 0x308(%rsp)
imulq $0x3c, 0x308(%rsp), %rcx
movq 0x310(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x310(%rsp)
cmpq $0x0, 0x300(%rsp)
je 0x8f9f3
leaq 0xf0(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq %rax, %rcx
movq 0x68(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x78(%rsp)
movslq 0x126b3c(%rip), %rax    # 0x1b64e0
movq %rax, 0x70(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdi
subq %rax, %rsi
movq 0x300(%rsp), %rax
movl %eax, %ecx
movq 0x308(%rsp), %rax
movl %eax, %r8d
movq 0x310(%rsp), %rax
movl %eax, %r9d
leaq 0xe0176(%rip), %rdx     # 0x16fb60
movb $0x0, %al
callq 0xb9d0
jmp 0x8fa66
leaq 0xf0(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq %rax, %rcx
movq 0x50(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movslq 0x126abc(%rip), %rax    # 0x1b64e0
movq %rax, 0x58(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdi
subq %rax, %rsi
movq 0x308(%rsp), %rax
movl %eax, %ecx
movq 0x310(%rsp), %rax
movl %eax, %r8d
leaq 0xe0114(%rip), %rdx     # 0x16fb73
movb $0x0, %al
callq 0xb9d0
jmp 0x8fac6
leaq 0xf0(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq %rax, %rcx
movq 0x38(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x48(%rsp)
movslq 0x126a47(%rip), %rax    # 0x1b64e0
movq %rax, 0x40(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdi
subq %rax, %rsi
leaq 0xe0093(%rip), %rdx     # 0x16fb52
movb $0x0, %al
callq 0xb9d0
jmp 0x8fac8
jmp 0x8faca
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq %rax, %rcx
movq 0x8(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movslq 0x1269e5(%rip), %rax    # 0x1b64e0
movq %rax, 0x10(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq %rax, %rcx
movq 0x10(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x28(%rsp)
movl 0x1269bd(%rip), %eax    # 0x1b64e0
movl %eax, 0x1c(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movl 0x1c(%rsp), %ecx
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
subl %eax, %ecx
leaq 0xe003a(%rip), %rdx     # 0x16fb85
leaq 0xdc391(%rip), %r8      # 0x16bee3
movb $0x0, %al
callq 0xb9d0
leaq 0xf0(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb240
movq 0x30(%rsp), %rsi
movq %rax, %rdx
movl $0x1, %edi
callq 0xa3150
addq $0x318, %rsp            # imm = 0x318
retq
nopl (%rax)