#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double, int);
int lround(double);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
void DispPro(double pro, int step) {
  for (int k = 0; k < 77; k++)
    putchar('\b');
  for (int j = 0; j < lround(pro / 2); j++)
    putchar('+');
  for (int j = 1; j <= 50 - lround(pro / 2); j++)
    putchar('-');
  fprintf(stdout, "  %6.2f%%   STEP=%-8d", pro, step);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<DispPro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4d,-0x10(%rbp)
jge    1179 <DispPro+0x39>
mov    $0x8,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1157 <DispPro+0x17>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe6d(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <lround@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    11c1 <DispPro+0x81>
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1180 <DispPro+0x40>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe25(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <lround@plt>
mov    %eax,%edx
mov    -0x20(%rbp),%eax
mov    $0x32,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jg     1210 <DispPro+0xd0>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11c8 <DispPro+0x88>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edx
lea    0xde0(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DispPro>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
movsd  %xmm0,0x10(%rsp)
mov    $0x4d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x8,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1160 <DispPro+0x20>
movsd  0xe89(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <lround@plt>
test   %eax,%eax
jle    11ac <DispPro+0x6c>
xor    %ebp,%ebp
xchg   %ax,%ax
mov    $0x2b,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
movsd  0x8(%rsp),%xmm0
call   1040 <lround@plt>
cmp    %eax,%ebp
jl     1190 <DispPro+0x50>
movsd  0x8(%rsp),%xmm0
call   1040 <lround@plt>
cmp    $0x31,%eax
jg     11e3 <DispPro+0xa3>
xor    %ebp,%ebp
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
movsd  0x8(%rsp),%xmm0
call   1040 <lround@plt>
mov    $0x32,%ecx
sub    %eax,%ecx
add    $0x1,%ebp
cmp    %ecx,%ebp
jl     11c0 <DispPro+0x80>
mov    0x2df6(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xe14(%rip),%rsi
movsd  0x10(%rsp),%xmm0
mov    %ebx,%edx
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [22 x i8] c" %6.2f%% STEP=%-8d\00"
define void @DispPro(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %13, %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 77
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = call i32 @putchar(i8 signext 8)
br label %13
13: ; preds = %11
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %8
16: ; preds = %8
store i32 0, i32* %6
br label %17
17: ; preds = %25, %16
%18 = load i32, i32* %6
%19 = load double, double* %3
%20 = fdiv double %19, 2.000000e+00
%21 = call i32 @lround(double %20)
%22 = icmp slt i32 %18, %21
br i1 %22, label %23, label %28
23: ; preds = %17
%24 = call i32 @putchar(i8 signext 43)
br label %25
25: ; preds = %23
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %17
28: ; preds = %17
store i32 1, i32* %7
br label %29
29: ; preds = %38, %28
%30 = load i32, i32* %7
%31 = load double, double* %3
%32 = fdiv double %31, 2.000000e+00
%33 = call i32 @lround(double %32)
%34 = sub nsw i32 50, %33
%35 = icmp sle i32 %30, %34
br i1 %35, label %36, label %41
36: ; preds = %29
%37 = call i32 @putchar(i8 signext 45)
br label %38
38: ; preds = %36
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
br label %29
41: ; preds = %29
%42 = load i32, i32* @stdout
%43 = load double, double* %3
%44 = load i32, i32* %4
%45 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %43, i32 %44)
%46 = load i32, i32* @stdout
%47 = call i32 @fflush(i32 %46)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [22 x i8] c" %6.2f%% STEP=%-8d\00"
define void @DispPro(double %0, i32 %1) {
br label %7
3: ; preds = %7
%4 = fmul double %0, 5.000000e-01
%5 = tail call i32 @lround(double %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %15, label %12
7: ; preds = %2, %7
%8 = phi i32 [ 0, %2 ], [ %10, %7 ]
%9 = tail call i32 @putchar(i8 signext 8)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, 77
br i1 %11, label %3, label %7
12: ; preds = %15, %3
%13 = tail call i32 @lround(double %4)
%14 = icmp sgt i32 %13, 49
br i1 %14, label %21, label %26
15: ; preds = %3, %15
%16 = phi i32 [ %18, %15 ], [ 0, %3 ]
%17 = tail call i32 @putchar(i8 signext 43)
%18 = add nuw nsw i32 %16, 1
%19 = tail call i32 @lround(double %4)
%20 = icmp slt i32 %18, %19
br i1 %20, label %15, label %12
21: ; preds = %26, %12
%22 = load i32, i32* @stdout
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %0, i32 %1)
%24 = load i32, i32* @stdout
%25 = tail call i32 @fflush(i32 %24)
ret void
26: ; preds = %12, %26
%27 = phi i32 [ %29, %26 ], [ 1, %12 ]
%28 = tail call i32 @putchar(i8 signext 45)
%29 = add nuw nsw i32 %27, 1
%30 = tail call i32 @lround(double %4)
%31 = sub nsw i32 50, %30
%32 = icmp slt i32 %27, %31
br i1 %32, label %26, label %21
}