#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 *, ...);
void create_graph(int data[]) {
  int scale = 2;
  int largest = 0;
  int size = 0;
  int space_between_bars = 1;
  int bar_size = 2;
  int result = 0;
  for (int i = 0; data[i] != 0; i += 2) {
    printf("%d ", data[i]);
    result = data[i + 1] / scale;
    for (int n = 0; n <= result; n++) {
      printf("#");
    }
    printf(" %d\n", data[i + 1]);
  }
}


x86 assembly (clang, -O0):
<create_graph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11ea <create_graph+0xda>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     11be <create_graph+0xae>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1196 <create_graph+0x86>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    114d <create_graph+0x3d>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_graph>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%esi
test   %esi,%esi
je     11a5 <create_graph+0x85>
mov    %rdi,%r12
lea    0xec5(%rip),%r14
lea    0xec2(%rip),%r15
xor    %ebx,%ebx
jmp    1167 <create_graph+0x47>
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%r12,%rbx,4),%esi
add    $0x2,%rbx
test   %esi,%esi
je     11a5 <create_graph+0x85>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%r13
or     $0x1,%r13
mov    (%r12,%r13,4),%esi
cmp    $0xffffffff,%esi
jl     1150 <create_graph+0x30>
mov    %esi,%ebp
shr    $0x1f,%ebp
add    %esi,%ebp
sar    %ebp
add    $0x1,%ebp
nopl   (%rax)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1190 <create_graph+0x70>
mov    (%r12,%r13,4),%esi
jmp    1150 <create_graph+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"#\00"
@.str.2 = [5 x i8] c" %d\0A\00"
define void @create_graph(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %2
store i32 2, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 1, i32* %6
store i32 2, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %11
11: ; preds = %50, %1
%12 = load i32*, i32** %2
%13 = load i32, i32* %9
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %53
18: ; preds = %11
%19 = load i32*, i32** %2
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i32*, i32** %2
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %25, i64 %28
%30 = load i32, i32* %29
%31 = load i32, i32* %3
%32 = sdiv i32 %30, %31
store i32 %32, i32* %8
store i32 0, i32* %10
br label %33
33: ; preds = %39, %18
%34 = load i32, i32* %10
%35 = load i32, i32* %8
%36 = icmp sle i32 %34, %35
br i1 %36, label %37, label %42
37: ; preds = %33
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %39
39: ; preds = %37
%40 = load i32, i32* %10
%41 = add nsw i32 %40, 1
store i32 %41, i32* %10
br label %33
42: ; preds = %33
%43 = load i32*, i32** %2
%44 = load i32, i32* %9
%45 = add nsw i32 %44, 1
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i32, i32* %43, i64 %46
%48 = load i32, i32* %47
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %42
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 2
store i32 %52, i32* %9
br label %11
53: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.2 = [5 x i8] c" %d\0A\00"
define void @create_graph(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %17, %1
ret void
5: ; preds = %1, %17
%6 = phi i64 [ %20, %17 ], [ 0, %1 ]
%7 = phi i32 [ %22, %17 ], [ %2, %1 ]
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = or i64 %6, 1
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp slt i32 %11, -1
br i1 %12, label %17, label %13
13: ; preds = %5
%14 = sdiv i32 %11, 2
br label %24
15: ; preds = %24
%16 = load i32, i32* %10
br label %17
17: ; preds = %15, %5
%18 = phi i32 [ %16, %15 ], [ %11, %5 ]
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = add nuw i64 %6, 2
%21 = getelementptr inbounds i32, i32* %0, i64 %20
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 0
br i1 %23, label %4, label %5
24: ; preds = %13, %24
%25 = phi i32 [ %27, %24 ], [ 0, %13 ]
%26 = tail call i32 @putchar(i32 35)
%27 = add nuw nsw i32 %25, 1
%28 = icmp eq i32 %25, %14
br i1 %28, label %15, label %24
}