#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_horizontal(int size_of_words[]) {
  int size, i;
  for (i = 0; i < 10; i++) {
    size = size_of_words[i];
    while (size > 0) {
      printf("#");
      size--;
    }
    putchar('\n');
  }
  putchar('\n');
  return;
}


x86 assembly (clang, -O0):
<print_histogram_horizontal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1187 <print_histogram_horizontal+0x67>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    116f <print_histogram_horizontal+0x4f>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <print_histogram_horizontal+0x2b>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <print_histogram_horizontal+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_histogram_horizontal>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%ebp
test   %ebp,%ebp
jle    1132 <print_histogram_horizontal+0x22>
add    $0x1,%ebp
nop
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <print_histogram_horizontal+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rbx),%ebp
test   %ebp,%ebp
jle    1162 <print_histogram_horizontal+0x52>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1150 <print_histogram_horizontal+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rbx),%ebp
test   %ebp,%ebp
jle    1192 <print_histogram_horizontal+0x82>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1180 <print_histogram_horizontal+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rbx),%ebp
test   %ebp,%ebp
jle    11c2 <print_histogram_horizontal+0xb2>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     11b0 <print_histogram_horizontal+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rbx),%ebp
test   %ebp,%ebp
jle    11f2 <print_histogram_horizontal+0xe2>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     11e0 <print_histogram_horizontal+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x14(%rbx),%ebp
test   %ebp,%ebp
jle    1222 <print_histogram_horizontal+0x112>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1210 <print_histogram_horizontal+0x100>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rbx),%ebp
test   %ebp,%ebp
jle    1252 <print_histogram_horizontal+0x142>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1240 <print_histogram_horizontal+0x130>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x1c(%rbx),%ebp
test   %ebp,%ebp
jle    1282 <print_histogram_horizontal+0x172>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1270 <print_histogram_horizontal+0x160>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x20(%rbx),%ebp
test   %ebp,%ebp
jle    12b2 <print_histogram_horizontal+0x1a2>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     12a0 <print_histogram_horizontal+0x190>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x24(%rbx),%ebx
test   %ebx,%ebx
jle    12e2 <print_histogram_horizontal+0x1d2>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     12d0 <print_histogram_horizontal+0x1c0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_histogram_horizontal(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 35)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %1
%10 = tail call i32 @putchar(i8 signext 10)
%11 = getelementptr inbounds i32, i32* %0, i64 1
%12 = load i32, i32* %11
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %9, %14
%15 = phi i32 [ %17, %14 ], [ %12, %9 ]
%16 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 35)
%17 = add nsw i32 %15, -1
%18 = icmp ugt i32 %15, 1
br i1 %18, label %14, label %19
19: ; preds = %14, %9
%20 = tail call i32 @putchar(i8 signext 10)
%21 = getelementptr inbounds i32, i32* %0, i64 2
%22 = load i32, i32* %21
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %19, %24
%25 = phi i32 [ %27, %24 ], [ %22, %19 ]
%26 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 35)
%27 = add nsw i32 %25, -1
%28 = icmp ugt i32 %25, 1
br i1 %28, label %24, label %29
29: ; preds = %24, %19
%30 = tail call i32 @putchar(i8 signext 10)
%31 = getelementptr inbounds i32, i32* %0, i64 3
%32 = load i32, i32* %31
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %29, %34
%35 = phi i32 [ %37, %34 ], [ %32, %29 ]
%36 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 35)
%37 = add nsw i32 %35, -1
%38 = icmp ugt i32 %35, 1
br i1 %38, label %34, label %39
39: ; preds = %34, %29
%40 = tail call i32 @putchar(i8 signext 10)
%41 = getelementptr inbounds i32, i32* %0, i64 4
%42 = load i32, i32* %41
%43 = icmp sgt i32 %42, 0
br i1 %43, label %44, label %49
44: ; preds = %39, %44
%45 = phi i32 [ %47, %44 ], [ %42, %39 ]
%46 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 35)
%47 = add nsw i32 %45, -1
%48 = icmp ugt i32 %45, 1
br i1 %48, label %44, label %49
49: ; preds = %44, %39
%50 = tail call i32 @putchar(i8 signext 10)
%51 = getelementptr inbounds i32, i32* %0, i64 5
%52 = load i32, i32* %51
%53 = icmp sgt i32 %52, 0
br i1 %53, label %54, label %59
54: ; preds = %49, %54
%55 = phi i32 [ %57, %54 ], [ %52, %49 ]
%56 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 35)
%57 = add nsw i32 %55, -1
%58 = icmp ugt i32 %55, 1
br i1 %58, label %54, label %59
59: ; preds = %54, %49
%60 = tail call i32 @putchar(i8 signext 10)
%61 = getelementptr inbounds i32, i32* %0, i64 6
%62 = load i32, i32* %61
%63 = icmp sgt i32 %62, 0
br i1 %63, label %64, label %69
64: ; preds = %59, %64
%65 = phi i32 [ %67, %64 ], [ %62, %59 ]
%66 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 35)
%67 = add nsw i32 %65, -1
%68 = icmp ugt i32 %65, 1
br i1 %68, label %64, label %69
69: ; preds = %64, %59
%70 = tail call i32 @putchar(i8 signext 10)
%71 = getelementptr inbounds i32, i32* %0, i64 7
%72 = load i32, i32* %71
%73 = icmp sgt i32 %72, 0
br i1 %73, label %74, label %79
74: ; preds = %69, %74
%75 = phi i32 [ %77, %74 ], [ %72, %69 ]
%76 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 35)
%77 = add nsw i32 %75, -1
%78 = icmp ugt i32 %75, 1
br i1 %78, label %74, label %79
79: ; preds = %74, %69
%80 = tail call i32 @putchar(i8 signext 10)
%81 = getelementptr inbounds i32, i32* %0, i64 8
%82 = load i32, i32* %81
%83 = icmp sgt i32 %82, 0
br i1 %83, label %84, label %89
84: ; preds = %79, %84
%85 = phi i32 [ %87, %84 ], [ %82, %79 ]
%86 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 35)
%87 = add nsw i32 %85, -1
%88 = icmp ugt i32 %85, 1
br i1 %88, label %84, label %89
89: ; preds = %84, %79
%90 = tail call i32 @putchar(i8 signext 10)
%91 = getelementptr inbounds i32, i32* %0, i64 9
%92 = load i32, i32* %91
%93 = icmp sgt i32 %92, 0
br i1 %93, label %94, label %99
94: ; preds = %89, %94
%95 = phi i32 [ %97, %94 ], [ %92, %89 ]
%96 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 35)
%97 = add nsw i32 %95, -1
%98 = icmp ugt i32 %95, 1
br i1 %98, label %94, label %99
99: ; preds = %94, %89
%100 = tail call i32 @putchar(i8 signext 10)
%101 = tail call i32 @putchar(i8 signext 10)
ret void
}