#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*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void print_histogram_vertical(int size_of_words[]) {
  int i, biggest;
  biggest = 0;
  for (i = 0; i < 10; i++) {
    if (biggest < size_of_words[i])
      biggest = size_of_words[i];
  }
  while (biggest > 0) {
    for (i = 0; i < 10; i++) {
      if (size_of_words[i] < biggest)
        printf(" ");
      else if (biggest == size_of_words[i]) {
        printf("#");
        --size_of_words[i];
      }
    }
    biggest--;
    putchar('\n');
  }
  putchar('\n');
  return;
}


x86 assembly (clang, -O0):
<print_histogram_vertical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1179 <print_histogram_vertical+0x59>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1166 <print_histogram_vertical+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
jmp    116b <print_histogram_vertical+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <print_histogram_vertical+0x1a>
jmp    117e <print_histogram_vertical+0x5e>
cmpl   $0x0,-0x10(%rbp)
jle    121f <print_histogram_vertical+0xff>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1207 <print_histogram_vertical+0xe7>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jge    11be <print_histogram_vertical+0x9e>
lea    0xe4c(%rip),%rdi
call   1040 <printf@plt>
jmp    11f4 <print_histogram_vertical+0xd4>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    11ef <print_histogram_vertical+0xcf>
lea    0xe29(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0xffffffff,%edx
mov    %edx,(%rax,%rcx,4)
jmp    11f4 <print_histogram_vertical+0xd4>
jmp    11f9 <print_histogram_vertical+0xd9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118f <print_histogram_vertical+0x6f>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    117e <print_histogram_vertical+0x5e>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_histogram_vertical>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
xor    %r14d,%r14d
test   %eax,%eax
cmovns %eax,%r14d
cmp    %ecx,%r14d
cmovl  %ecx,%r14d
mov    0x8(%rdi),%eax
cmp    %eax,%r14d
cmovl  %eax,%r14d
mov    0xc(%rdi),%eax
cmp    %eax,%r14d
cmovl  %eax,%r14d
mov    0x10(%rdi),%eax
cmp    %eax,%r14d
cmovl  %eax,%r14d
mov    0x14(%rdi),%eax
cmp    %eax,%r14d
cmovl  %eax,%r14d
mov    0x18(%rdi),%eax
cmp    %eax,%r14d
cmovl  %eax,%r14d
mov    0x1c(%rdi),%eax
cmp    %eax,%r14d
cmovl  %eax,%r14d
mov    0x20(%rdi),%eax
cmp    %eax,%r14d
cmovl  %eax,%r14d
mov    0x24(%rdi),%eax
cmp    %eax,%r14d
cmovl  %eax,%r14d
test   %r14d,%r14d
je     11e0 <print_histogram_vertical+0xd0>
mov    %rdi,%r15
jmp    11a7 <print_histogram_vertical+0x97>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x1(%r14),%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x1,%r14d
mov    %ebx,%r14d
jle    11e0 <print_histogram_vertical+0xd0>
xor    %ebx,%ebx
jmp    11c4 <print_histogram_vertical+0xb4>
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0xa,%rbx
je     1190 <print_histogram_vertical+0x80>
mov    (%r15,%rbx,4),%eax
cmp    %r14d,%eax
jl     11b0 <print_histogram_vertical+0xa0>
jne    11ba <print_histogram_vertical+0xaa>
mov    $0x23,%edi
call   1030 <putchar@plt>
addl   $0xffffffff,(%r15,%rbx,4)
jmp    11ba <print_histogram_vertical+0xaa>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"#\00"
define void @print_histogram_vertical(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %23, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = icmp slt i32 %9, %14
br i1 %15, label %16, label %22
16: ; preds = %8
%17 = load i32*, i32** %2
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
store i32 %21, i32* %4
br label %22
22: ; preds = %16, %8
br label %23
23: ; preds = %22
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %5
26: ; preds = %5
br label %27
27: ; preds = %65, %26
%28 = load i32, i32* %4
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %69
30: ; preds = %27
store i32 0, i32* %3
br label %31
31: ; preds = %62, %30
%32 = load i32, i32* %3
%33 = icmp slt i32 %32, 10
br i1 %33, label %34, label %65
34: ; preds = %31
%35 = load i32*, i32** %2
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %35, i64 %37
%39 = load i32, i32* %38
%40 = load i32, i32* %4
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %44
42: ; preds = %34
%43 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %61
44: ; preds = %34
%45 = load i32, i32* %4
%46 = load i32*, i32** %2
%47 = load i32, i32* %3
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %46, i64 %48
%50 = load i32, i32* %49
%51 = icmp eq i32 %45, %50
br i1 %51, label %52, label %60
52: ; preds = %44
%53 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%54 = load i32*, i32** %2
%55 = load i32, i32* %3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %54, i64 %56
%58 = load i32, i32* %57
%59 = add nsw i32 %58, -1
store i32 %59, i32* %57
br label %60
60: ; preds = %52, %44
br label %61
61: ; preds = %60, %42
br label %62
62: ; preds = %61
%63 = load i32, i32* %3
%64 = add nsw i32 %63, 1
store i32 %64, i32* %3
br label %31
65: ; preds = %31
%66 = load i32, i32* %4
%67 = add nsw i32 %66, -1
store i32 %67, i32* %4
%68 = call i32 @putchar(i8 signext 10)
br label %27
69: ; preds = %27
%70 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @print_histogram_vertical(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = select i1 %7, i32 %6, i32 %4
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = icmp slt i32 %8, %10
%12 = select i1 %11, i32 %10, i32 %8
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = load i32, i32* %13
%15 = icmp slt i32 %12, %14
%16 = select i1 %15, i32 %14, i32 %12
%17 = getelementptr inbounds i32, i32* %0, i64 4
%18 = load i32, i32* %17
%19 = icmp slt i32 %16, %18
%20 = select i1 %19, i32 %18, i32 %16
%21 = getelementptr inbounds i32, i32* %0, i64 5
%22 = load i32, i32* %21
%23 = icmp slt i32 %20, %22
%24 = select i1 %23, i32 %22, i32 %20
%25 = getelementptr inbounds i32, i32* %0, i64 6
%26 = load i32, i32* %25
%27 = icmp slt i32 %24, %26
%28 = select i1 %27, i32 %26, i32 %24
%29 = getelementptr inbounds i32, i32* %0, i64 7
%30 = load i32, i32* %29
%31 = icmp slt i32 %28, %30
%32 = select i1 %31, i32 %30, i32 %28
%33 = getelementptr inbounds i32, i32* %0, i64 8
%34 = load i32, i32* %33
%35 = icmp slt i32 %32, %34
%36 = select i1 %35, i32 %34, i32 %32
%37 = getelementptr inbounds i32, i32* %0, i64 9
%38 = load i32, i32* %37
%39 = icmp slt i32 %36, %38
%40 = select i1 %39, i32 %38, i32 %36
%41 = icmp eq i32 %40, 0
br i1 %41, label %64, label %42
42: ; preds = %1, %60
%43 = phi i32 [ %61, %60 ], [ %40, %1 ]
br label %44
44: ; preds = %42, %57
%45 = phi i64 [ 0, %42 ], [ %58, %57 ]
%46 = getelementptr inbounds i32, i32* %0, i64 %45
%47 = load i32, i32* %46
%48 = icmp slt i32 %47, %43
br i1 %48, label %49, label %51
49: ; preds = %44
%50 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 32)
br label %57
51: ; preds = %44
%52 = icmp eq i32 %43, %47
br i1 %52, label %53, label %57
53: ; preds = %51
%54 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 35)
%55 = load i32, i32* %46
%56 = add nsw i32 %55, -1
store i32 %56, i32* %46
br label %57
57: ; preds = %49, %53, %51
%58 = add nuw nsw i64 %45, 1
%59 = icmp eq i64 %58, 10
br i1 %59, label %60, label %44
60: ; preds = %57
%61 = add nsw i32 %43, -1
%62 = tail call i32 @putchar(i8 signext 10)
%63 = icmp sgt i32 %43, 1
br i1 %63, label %42, label %64
64: ; preds = %60, %1
%65 = tail call i32 @putchar(i8 signext 10)
ret void
}