#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int graph[5], *pt, i, z;
  pt = graph;
  for (i = 0; i < 5; i++) {
    printf("graph[%d] ===> ", i);
    scanf("%d", (pt + i));
  }
  printf("----- 横棒グラフ -----\n");
  for (i = 0; i < 5; i++) {
    printf("%d ", *(pt + i));
    for (z = 0; z < *(pt + i); z++) {
      printf("*");
    }
    puts("");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jge    1192 <main+0x62>
mov    -0x2c(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe91(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    114e <main+0x1e>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jge    121b <main+0xeb>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x28(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1201 <main+0xd1>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11d1 <main+0xa1>
lea    0xe27(%rip),%rdi
call   1030 <puts@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11a7 <main+0x77>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xeb1(%rip),%r14
xor    %ebp,%ebp
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeac(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe31(%rip),%rdi
call   1040 <puts@plt>
mov    (%rsp),%esi
lea    0xe1e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,(%rsp)
jle    1222 <main+0xe2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    (%rsp),%ebp
jl     1210 <main+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%esi
lea    0xddc(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1263 <main+0x123>
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jl     1250 <main+0x110>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%esi
lea    0xd9b(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x8(%rsp)
jle    12a3 <main+0x163>
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x8(%rsp),%ebx
jl     1290 <main+0x150>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%esi
lea    0xd5b(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    12e3 <main+0x1a3>
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jl     12d0 <main+0x190>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%esi
lea    0xd1b(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x10(%rsp)
jle    1323 <main+0x1e3>
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x10(%rsp),%ebx
jl     1310 <main+0x1d0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"graph[%d] ===> \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"%d \00"
@str = [28 x i8] c"----- \E6\A8\AA\E6\A3\92\E3\82\B0\E3\83\A9\E3\83\95 -----\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2)
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 3)
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 4)
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%19 = load i32, i32* %4
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %29
23: ; preds = %0, %23
%24 = phi i32 [ %26, %23 ], [ 0, %0 ]
%25 = call i32 @putchar(i32 42)
%26 = add nuw nsw i32 %24, 1
%27 = load i32, i32* %4
%28 = icmp slt i32 %26, %27
br i1 %28, label %23, label %29
29: ; preds = %23, %0
%30 = call i32 @putchar(i32 10)
%31 = load i32, i32* %7
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %7
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %29, %35
%36 = phi i32 [ %38, %35 ], [ 0, %29 ]
%37 = call i32 @putchar(i32 42)
%38 = add nuw nsw i32 %36, 1
%39 = load i32, i32* %7
%40 = icmp slt i32 %38, %39
br i1 %40, label %35, label %41
41: ; preds = %35, %29
%42 = call i32 @putchar(i32 10)
%43 = load i32, i32* %10
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %43)
%45 = load i32, i32* %10
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %53
47: ; preds = %41, %47
%48 = phi i32 [ %50, %47 ], [ 0, %41 ]
%49 = call i32 @putchar(i32 42)
%50 = add nuw nsw i32 %48, 1
%51 = load i32, i32* %10
%52 = icmp slt i32 %50, %51
br i1 %52, label %47, label %53
53: ; preds = %47, %41
%54 = call i32 @putchar(i32 10)
%55 = load i32, i32* %13
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %55)
%57 = load i32, i32* %13
%58 = icmp sgt i32 %57, 0
br i1 %58, label %59, label %65
59: ; preds = %53, %59
%60 = phi i32 [ %62, %59 ], [ 0, %53 ]
%61 = call i32 @putchar(i32 42)
%62 = add nuw nsw i32 %60, 1
%63 = load i32, i32* %13
%64 = icmp slt i32 %62, %63
br i1 %64, label %59, label %65
65: ; preds = %59, %53
%66 = call i32 @putchar(i32 10)
%67 = load i32, i32* %16
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %67)
%69 = load i32, i32* %16
%70 = icmp sgt i32 %69, 0
br i1 %70, label %71, label %77
71: ; preds = %65, %71
%72 = phi i32 [ %74, %71 ], [ 0, %65 ]
%73 = call i32 @putchar(i32 42)
%74 = add nuw nsw i32 %72, 1
%75 = load i32, i32* %16
%76 = icmp slt i32 %74, %75
br i1 %76, label %71, label %77
77: ; preds = %71, %65
%78 = call i32 @putchar(i32 10)
ret i32 0
}