#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 Benchmark_printProgress(int isPrintingProcess, unsigned current_step,
                             unsigned max, int overhead, int newline) {
  if (isPrintingProcess) {
    if (overhead) {
      fprintf(stderr, "\r - Overhead computation process : %3d%% (%d/%d)",
              (current_step * 100) / (max), current_step, max);
    } else {
      fprintf(stderr, "\r - Benchmark computation process : %3d%% (%d/%d)",
              (current_step * 100) / (max), current_step, max);
    }
    if (newline) {
      fprintf(stderr, "\n");
    }
  }
}


x86 assembly (clang, -O0):
<Benchmark_printProgress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11b9 <Benchmark_printProgress+0xa9>
cmpl   $0x0,-0x10(%rbp)
je     116a <Benchmark_printProgress+0x5a>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
imul   $0x64,-0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %eax,%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xea2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1193 <Benchmark_printProgress+0x83>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
imul   $0x64,-0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %eax,%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xea5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     11b4 <Benchmark_printProgress+0xa4>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11b9 <Benchmark_printProgress+0xa9>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Benchmark_printProgress>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     116a <Benchmark_printProgress+0x5a>
mov    %r8d,%ebp
mov    %edx,%r8d
mov    %esi,%ebx
imul   $0x64,%esi,%eax
xor    %edx,%edx
div    %r8d
test   %ecx,%ecx
mov    0x2eaf(%rip),%r14
mov    (%r14),%edi
lea    0xef6(%rip),%rcx
lea    0xebe(%rip),%rsi
cmove  %rcx,%rsi
mov    %eax,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %ebp,%ebp
je     116a <Benchmark_printProgress+0x5a>
mov    (%r14),%edi
lea    0xf04(%rip),%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"\0D - Overhead computation process : %3d%% (%d/%d)\00"
@.str.1 = [50 x i8] c"\0D - Benchmark computation process : %3d%% (%d/%d)\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @Benchmark_printProgress(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %41
13: ; preds = %5
%14 = load i32, i32* %9
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i32, i32* @stderr
%18 = load i32, i32* %7
%19 = mul i32 %18, 100
%20 = load i32, i32* %8
%21 = udiv i32 %19, %20
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %22, i32 %23)
br label %34
25: ; preds = %13
%26 = load i32, i32* @stderr
%27 = load i32, i32* %7
%28 = mul i32 %27, 100
%29 = load i32, i32* %8
%30 = udiv i32 %28, %29
%31 = load i32, i32* %7
%32 = load i32, i32* %8
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %30, i32 %31, i32 %32)
br label %34
34: ; preds = %25, %16
%35 = load i32, i32* %10
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %37, %34
br label %41
41: ; preds = %40, %5
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"\0D - Overhead computation process : %3d%% (%d/%d)\00"
@.str.1 = [50 x i8] c"\0D - Benchmark computation process : %3d%% (%d/%d)\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @Benchmark_printProgress(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp eq i32 %0, 0
br i1 %6, label %18, label %7
7: ; preds = %5
%8 = icmp eq i32 %3, 0
%9 = load i32, i32* @stderr
%10 = mul i32 %1, 100
%11 = udiv i32 %10, %2
%12 = select i1 %8, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* %12, i32 %11, i32 %1, i32 %2)
%14 = icmp eq i32 %4, 0
br i1 %14, label %18, label %15
15: ; preds = %7
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %7, %15, %5
ret void
}