#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void PrintPercentCompleteShort(double percent) {
  fprintf(stderr, "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
  if (percent < 10.0) {
    fprintf(stderr, "\b\b\b\b");
  } else if (percent < 100.0) {
    fprintf(stderr, "\b\b\b\b\b");
  } else {
    fprintf(stderr, "\b\b\b\b\b\b");
  }
  fprintf(stderr, "%3.2lf percent complete", percent);
}


x86 assembly (clang, -O0):
<PrintPercentCompleteShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movsd  0xec4(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1163 <PrintPercentCompleteShort+0x53>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11ae <PrintPercentCompleteShort+0x9e>
movsd  0xe9d(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1192 <PrintPercentCompleteShort+0x82>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11a9 <PrintPercentCompleteShort+0x99>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11ae <PrintPercentCompleteShort+0x9e>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
lea    0xe5f(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintPercentCompleteShort>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    0x2ebe(%rip),%rbx
mov    (%rbx),%edi
lea    0xee5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
movsd  0x8(%rsp),%xmm1
movsd  0xec0(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1151 <PrintPercentCompleteShort+0x41>
mov    (%rbx),%edi
lea    0xece(%rip),%rsi
jmp    1171 <PrintPercentCompleteShort+0x61>
movsd  0xeaf(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    (%rbx),%edi
jbe    116a <PrintPercentCompleteShort+0x5a>
lea    0xeb4(%rip),%rsi
jmp    1171 <PrintPercentCompleteShort+0x61>
lea    0xeaa(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xea1(%rip),%rsi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
add    $0x10,%rsp
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\00"
@.str.1 = [5 x i8] c"\08\08\08\08\00"
@.str.2 = [6 x i8] c"\08\08\08\08\08\00"
@.str.3 = [7 x i8] c"\08\08\08\08\08\08\00"
@.str.4 = [24 x i8] c"%3.2lf percent complete\00"
define void @PrintPercentCompleteShort(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load double, double* %2
%6 = fcmp olt double %5, 1.000000e+01
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %20
10: ; preds = %1
%11 = load double, double* %2
%12 = fcmp olt double %11, 1.000000e+02
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* @stderr
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %19
16: ; preds = %10
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %16, %13
br label %20
20: ; preds = %19, %7
%21 = load i32, i32* @stderr
%22 = load double, double* %2
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), double %22)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\00"
@.str.1 = [5 x i8] c"\08\08\08\08\00"
@.str.2 = [6 x i8] c"\08\08\08\08\08\00"
@.str.3 = [7 x i8] c"\08\08\08\08\08\08\00"
@.str.4 = [24 x i8] c"%3.2lf percent complete\00"
define void @PrintPercentCompleteShort(double %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = fcmp olt double %0, 1.000000e+01
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %15
8: ; preds = %1
%9 = fcmp olt double %0, 1.000000e+02
%10 = load i32, i32* @stderr
br i1 %9, label %11, label %13
11: ; preds = %8
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %15
13: ; preds = %8
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %11, %13, %5
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), double %0)
ret void
}