#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*/ putchar(char);
void print_bar(float perc, int char_available) {
  int i;
  int num;
  num = (char_available / 100.0) * perc;
  for (i = 0; i < num - 1; i++) {
    putchar('=');
  }
  putchar('>');
  i++;
  for (; i < char_available; i++)
    putchar(' ');
}


x86 assembly (clang, -O0):
<print_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
divsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1175 <print_bar+0x65>
mov    $0x3d,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <print_bar+0x3c>
mov    $0x3e,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ac <print_bar+0x9c>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1188 <print_bar+0x78>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bar>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
cvtsi2sd %edi,%xmm1
divsd  0xede(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r14d
mov    $0x1,%ebp
cmp    $0x2,%r14d
jl     1152 <print_bar+0x42>
lea    -0x1(%r14),%ebp
xchg   %ax,%ax
mov    $0x3d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1140 <print_bar+0x30>
mov    %r14d,%ebp
mov    $0x3e,%edi
call   1030 <putchar@plt>
cmp    %ebx,%ebp
jge    117f <print_bar+0x6f>
sub    %ebp,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1170 <print_bar+0x60>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @print_bar(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+02
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = fmul double %9, %11
%13 = fptosi double %12 to i32
store i32 %13, i32* %6
store i32 0, i32* %5
br label %14
14: ; preds = %21, %2
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = sub nsw i32 %16, 1
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %24
19: ; preds = %14
%20 = call i32 @putchar(i8 signext 61)
br label %21
21: ; preds = %19
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %14
24: ; preds = %14
%25 = call i32 @putchar(i8 signext 62)
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %28
28: ; preds = %34, %24
%29 = load i32, i32* %5
%30 = load i32, i32* %4
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = call i32 @putchar(i8 signext 32)
br label %34
34: ; preds = %32
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %28
37: ; preds = %28
ret void
}

LLVM IR (-O2):
define void @print_bar(float %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fdiv double %3, 1.000000e+02
%5 = fpext float %0 to double
%6 = fmul double %4, %5
%7 = fptosi double %6 to i32
%8 = add i32 %7, -1
%9 = icmp sgt i32 %7, 1
br i1 %9, label %10, label %15
10: ; preds = %2, %10
%11 = phi i32 [ %13, %10 ], [ 0, %2 ]
%12 = tail call i32 @putchar(i8 signext 61)
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %10
15: ; preds = %10, %2
%16 = phi i32 [ 1, %2 ], [ %7, %10 ]
%17 = tail call i32 @putchar(i8 signext 62)
%18 = icmp slt i32 %16, %1
br i1 %18, label %19, label %24
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %16, %15 ]
%21 = tail call i32 @putchar(i8 signext 32)
%22 = add nuw i32 %20, 1
%23 = icmp eq i32 %22, %1
br i1 %23, label %24, label %19
24: ; preds = %19, %15
ret void
}