#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  printf("Enter ten numbers: ");
  int numbers[10];
  int i = 0;
  int j;
  while (i < 10) {
    scanf("%d", &numbers[i]);
    i++;
  }
  i = 0;
  while (i < 10) {
    j = 0;
    while (j < numbers[i]) {
      printf("*");
      j++;
    }
    printf("\n");
    i++;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    117c <main+0x5c>
movslq -0x44(%rbp),%rax
lea    -0x40(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1149 <main+0x29>
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    11d9 <main+0xb9>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
movslq -0x44(%rbp),%rcx
cmp    -0x40(%rbp,%rcx,4),%eax
jge    11bf <main+0x9f>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1194 <main+0x74>
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1183 <main+0x63>
mov    0x2e00(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xecc(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    11e2 <main+0xb2>
xor    %ebx,%ebx
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    (%rsp),%ebx
jl     11d0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    1213 <main+0xe3>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jl     1200 <main+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x8(%rsp)
jle    1243 <main+0x113>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x8(%rsp),%ebx
jl     1230 <main+0x100>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0xc(%rsp)
jle    1273 <main+0x143>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jl     1260 <main+0x130>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x10(%rsp)
jle    12a3 <main+0x173>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x10(%rsp),%ebx
jl     1290 <main+0x160>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x14(%rsp)
jle    12d3 <main+0x1a3>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x14(%rsp),%ebx
jl     12c0 <main+0x190>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x18(%rsp)
jle    1303 <main+0x1d3>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x18(%rsp),%ebx
jl     12f0 <main+0x1c0>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x1c(%rsp)
jle    1333 <main+0x203>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x1c(%rsp),%ebx
jl     1320 <main+0x1f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x20(%rsp)
jle    1363 <main+0x233>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x20(%rsp),%ebx
jl     1350 <main+0x220>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x24(%rsp)
jle    1393 <main+0x263>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x24(%rsp),%ebx
jl     1380 <main+0x250>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2c3c(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter ten numbers: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c"\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i32]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %10
10: ; preds = %13, %2
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
br label %10
20: ; preds = %10
store i32 0, i32* %7
br label %21
21: ; preds = %36, %20
%22 = load i32, i32* %7
%23 = icmp slt i32 %22, 10
br i1 %23, label %24, label %40
24: ; preds = %21
store i32 0, i32* %8
br label %25
25: ; preds = %32, %24
%26 = load i32, i32* %8
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = icmp slt i32 %26, %30
br i1 %31, label %32, label %36
32: ; preds = %25
%33 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%34 = load i32, i32* %8
%35 = add nsw i32 %34, 1
store i32 %35, i32* %8
br label %25
36: ; preds = %25
%37 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %21
40: ; preds = %21
%41 = load i32, i32* @EXIT_SUCCESS
ret i32 %41
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter ten numbers: \00"
@.str.1 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i32]
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = bitcast [10 x i32]* %3 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %3, 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 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 5
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 6
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 7
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %20)
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 8
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %22)
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 9
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %24)
%26 = load i32, i32* %6
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %2, %28
%29 = phi i32 [ %31, %28 ], [ 0, %2 ]
%30 = call i32 @putchar(i32 42)
%31 = add nuw nsw i32 %29, 1
%32 = load i32, i32* %6
%33 = icmp slt i32 %31, %32
br i1 %33, label %28, label %34
34: ; preds = %28, %2
%35 = call i32 @putchar(i32 10)
%36 = load i32, i32* %8
%37 = icmp sgt i32 %36, 0
br i1 %37, label %38, label %44
38: ; preds = %34, %38
%39 = phi i32 [ %41, %38 ], [ 0, %34 ]
%40 = call i32 @putchar(i32 42)
%41 = add nuw nsw i32 %39, 1
%42 = load i32, i32* %8
%43 = icmp slt i32 %41, %42
br i1 %43, label %38, label %44
44: ; preds = %38, %34
%45 = call i32 @putchar(i32 10)
%46 = load i32, i32* %10
%47 = icmp sgt i32 %46, 0
br i1 %47, label %48, label %54
48: ; preds = %44, %48
%49 = phi i32 [ %51, %48 ], [ 0, %44 ]
%50 = call i32 @putchar(i32 42)
%51 = add nuw nsw i32 %49, 1
%52 = load i32, i32* %10
%53 = icmp slt i32 %51, %52
br i1 %53, label %48, label %54
54: ; preds = %48, %44
%55 = call i32 @putchar(i32 10)
%56 = load i32, i32* %12
%57 = icmp sgt i32 %56, 0
br i1 %57, label %58, label %64
58: ; preds = %54, %58
%59 = phi i32 [ %61, %58 ], [ 0, %54 ]
%60 = call i32 @putchar(i32 42)
%61 = add nuw nsw i32 %59, 1
%62 = load i32, i32* %12
%63 = icmp slt i32 %61, %62
br i1 %63, label %58, label %64
64: ; preds = %58, %54
%65 = call i32 @putchar(i32 10)
%66 = load i32, i32* %14
%67 = icmp sgt i32 %66, 0
br i1 %67, label %68, label %74
68: ; preds = %64, %68
%69 = phi i32 [ %71, %68 ], [ 0, %64 ]
%70 = call i32 @putchar(i32 42)
%71 = add nuw nsw i32 %69, 1
%72 = load i32, i32* %14
%73 = icmp slt i32 %71, %72
br i1 %73, label %68, label %74
74: ; preds = %68, %64
%75 = call i32 @putchar(i32 10)
%76 = load i32, i32* %16
%77 = icmp sgt i32 %76, 0
br i1 %77, label %78, label %84
78: ; preds = %74, %78
%79 = phi i32 [ %81, %78 ], [ 0, %74 ]
%80 = call i32 @putchar(i32 42)
%81 = add nuw nsw i32 %79, 1
%82 = load i32, i32* %16
%83 = icmp slt i32 %81, %82
br i1 %83, label %78, label %84
84: ; preds = %78, %74
%85 = call i32 @putchar(i32 10)
%86 = load i32, i32* %18
%87 = icmp sgt i32 %86, 0
br i1 %87, label %88, label %94
88: ; preds = %84, %88
%89 = phi i32 [ %91, %88 ], [ 0, %84 ]
%90 = call i32 @putchar(i32 42)
%91 = add nuw nsw i32 %89, 1
%92 = load i32, i32* %18
%93 = icmp slt i32 %91, %92
br i1 %93, label %88, label %94
94: ; preds = %88, %84
%95 = call i32 @putchar(i32 10)
%96 = load i32, i32* %20
%97 = icmp sgt i32 %96, 0
br i1 %97, label %98, label %104
98: ; preds = %94, %98
%99 = phi i32 [ %101, %98 ], [ 0, %94 ]
%100 = call i32 @putchar(i32 42)
%101 = add nuw nsw i32 %99, 1
%102 = load i32, i32* %20
%103 = icmp slt i32 %101, %102
br i1 %103, label %98, label %104
104: ; preds = %98, %94
%105 = call i32 @putchar(i32 10)
%106 = load i32, i32* %22
%107 = icmp sgt i32 %106, 0
br i1 %107, label %108, label %114
108: ; preds = %104, %108
%109 = phi i32 [ %111, %108 ], [ 0, %104 ]
%110 = call i32 @putchar(i32 42)
%111 = add nuw nsw i32 %109, 1
%112 = load i32, i32* %22
%113 = icmp slt i32 %111, %112
br i1 %113, label %108, label %114
114: ; preds = %108, %104
%115 = call i32 @putchar(i32 10)
%116 = load i32, i32* %24
%117 = icmp sgt i32 %116, 0
br i1 %117, label %118, label %124
118: ; preds = %114, %118
%119 = phi i32 [ %121, %118 ], [ 0, %114 ]
%120 = call i32 @putchar(i32 42)
%121 = add nuw nsw i32 %119, 1
%122 = load i32, i32* %24
%123 = icmp slt i32 %121, %122
br i1 %123, label %118, label %124
124: ; preds = %118, %114
%125 = call i32 @putchar(i32 10)
%126 = load i32, i32* @EXIT_SUCCESS
ret i32 %126
}