#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*/ printf(char *);
int /*<<< orphan*/ stdout;
void print_bar(int *i, int *j, int Niter) {
  int shell_size = 75;
  int nb = (((*j) + 1) * shell_size) / Niter;
  (*j)++;
  while (*i < nb) {
    (*i)++;
    printf("=");
  }
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x4b,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
imul   -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0x1c(%rbp),%eax
jge    1184 <print_bar+0x64>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
jmp    1159 <print_bar+0x39>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bar>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ecx
mov    %rdi,%rbx
mov    (%rsi),%edi
add    $0x1,%edi
imul   $0x4b,%edi,%eax
cltd
idiv   %ecx
mov    %eax,%ebp
mov    %edi,(%rsi)
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%eax
cmp    %ebp,%eax
jge    1157 <print_bar+0x37>
add    $0x1,%eax
mov    %eax,(%rbx)
mov    $0x3d,%edi
call   1030 <putchar@plt>
jmp    1140 <print_bar+0x20>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define void @print_bar(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %5, 75
%7 = sdiv i32 %6, %2
store i32 %5, i32* %1
%8 = load i32, i32* %0
%9 = icmp slt i32 %8, %7
br i1 %9, label %10, label %16
10: ; preds = %3, %10
%11 = phi i32 [ %14, %10 ], [ %8, %3 ]
%12 = add nsw i32 %11, 1
store i32 %12, i32* %0
%13 = tail call i32 @putchar(i32 61)
%14 = load i32, i32* %0
%15 = icmp slt i32 %14, %7
br i1 %15, label %10, label %16
16: ; preds = %10, %3
%17 = load i32, i32* @stdout
%18 = tail call i32 @fflush(i32 %17)
ret void
}