#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_printDataSavingProgress(int isPrintingProcess,
                                       unsigned current_step, unsigned max,
                                       unsigned times, unsigned offset,
                                       int newline) {
  if (isPrintingProcess) {
    fprintf(stderr, "\r - Data saving... %3d%%",
            (current_step * times) / max + offset);
    if (newline) {
      fprintf(stderr, "\n");
    }
  }
}


x86 assembly (clang, -O0):
<Benchmark_printDataSavingProgress>:
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)
mov    %r9d,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1184 <Benchmark_printDataSavingProgress+0x74>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %eax,%edx
add    -0x14(%rbp),%edx
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x0,-0x18(%rbp)
je     117f <Benchmark_printDataSavingProgress+0x6f>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1184 <Benchmark_printDataSavingProgress+0x74>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Benchmark_printDataSavingProgress>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1160 <Benchmark_printDataSavingProgress+0x50>
mov    %r9d,%ebx
mov    %ecx,%eax
mov    %edx,%ecx
mov    0x2eba(%rip),%r14
mov    (%r14),%edi
imul   %esi,%eax
xor    %edx,%edx
div    %ecx
add    %eax,%r8d
lea    0xec6(%rip),%rsi
mov    %r8d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %ebx,%ebx
je     1160 <Benchmark_printDataSavingProgress+0x50>
mov    (%r14),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"\0D - Data saving... %3d%%\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @Benchmark_printDataSavingProgress(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %31
15: ; preds = %6
%16 = load i32, i32* @stderr
%17 = load i32, i32* %8
%18 = load i32, i32* %10
%19 = mul i32 %17, %18
%20 = load i32, i32* %9
%21 = udiv i32 %19, %20
%22 = load i32, i32* %11
%23 = add i32 %21, %22
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %12
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %15
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %27, %15
br label %31
31: ; preds = %30, %6
ret void
}

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