#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_unlocked(char);
void print_bar(long count, long total) {
  int i;
  (void)putchar_unlocked(count ? '*' : ' ');
  for (i = 1; i < (32 * count) / total; i++)
    (void)putchar_unlocked('*');
  for (; i < 32; i++)
    (void)putchar_unlocked(' ');
}


x86 assembly (clang, -O0):
<print_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x20,%eax
mov    $0x2a,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar_unlocked@plt>
movl   $0x1,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jge    1182 <print_bar+0x72>
mov    $0x2a,%edi
call   1030 <putchar_unlocked@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <print_bar+0x34>
jmp    1187 <print_bar+0x77>
cmpl   $0x20,-0x14(%rbp)
jge    11a9 <print_bar+0x99>
mov    $0x20,%edi
call   1030 <putchar_unlocked@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1187 <print_bar+0x77>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bar>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
mov    $0x20,%eax
mov    $0x2a,%edi
cmove  %eax,%edi
call   1030 <putchar_unlocked@plt>
shl    $0x5,%rbx
mov    %rbx,%rax
or     %r14,%rax
shr    $0x20,%rax
je     114c <print_bar+0x3c>
mov    %rbx,%rax
cqto
idiv   %r14
mov    %rax,%rbx
jmp    1155 <print_bar+0x45>
mov    %ebx,%eax
xor    %edx,%edx
div    %r14d
mov    %eax,%ebx
mov    $0x1,%ebp
cmp    $0x2,%rbx
jl     1187 <print_bar+0x77>
lea    -0x1(%rbx),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar_unlocked@plt>
add    $0xffffffffffffffff,%rbp
jne    1170 <print_bar+0x60>
mov    %ebx,%ebp
cmp    $0x1f,%ebx
ja     119e <print_bar+0x8e>
add    $0xffffffe0,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar_unlocked@plt>
inc    %ebp
jne    1190 <print_bar+0x80>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @print_bar(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 42, i32 32
%10 = trunc i32 %9 to i8
%11 = call i32 @putchar_unlocked(i8 signext %10)
store i32 1, i32* %5
br label %12
12: ; preds = %22, %2
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = load i64, i64* %3
%16 = mul nsw i64 32, %15
%17 = load i64, i64* %4
%18 = sdiv i64 %16, %17
%19 = icmp slt i64 %14, %18
br i1 %19, label %20, label %25
20: ; preds = %12
%21 = call i32 @putchar_unlocked(i8 signext 42)
br label %22
22: ; preds = %20
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %12
25: ; preds = %12
br label %26
26: ; preds = %31, %25
%27 = load i32, i32* %5
%28 = icmp slt i32 %27, 32
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = call i32 @putchar_unlocked(i8 signext 32)
br label %31
31: ; preds = %29
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %26
34: ; preds = %26
ret void
}

LLVM IR (-O2):
define void @print_bar(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = select i1 %3, i8 32, i8 42
%5 = tail call i32 @putchar_unlocked(i8 signext %4)
%6 = shl nsw i64 %0, 5
%7 = sdiv i64 %6, %1
%8 = icmp sgt i64 %7, 1
br i1 %8, label %14, label %12
9: ; preds = %14
%10 = trunc i64 %7 to i32
%11 = icmp ult i32 %10, 32
br i1 %11, label %12, label %24
12: ; preds = %2, %9
%13 = phi i32 [ 1, %2 ], [ %10, %9 ]
br label %19
14: ; preds = %2, %14
%15 = phi i64 [ %17, %14 ], [ 1, %2 ]
%16 = tail call i32 @putchar_unlocked(i8 signext 42)
%17 = add nuw nsw i64 %15, 1
%18 = icmp eq i64 %17, %7
br i1 %18, label %9, label %14
19: ; preds = %12, %19
%20 = phi i32 [ %22, %19 ], [ %13, %12 ]
%21 = tail call i32 @putchar_unlocked(i8 signext 32)
%22 = add i32 %20, 1
%23 = icmp eq i32 %22, 32
br i1 %23, label %24, label %19
24: ; preds = %19, %9
ret void
}