#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*/ scanf(char *, int *);
int main() {
  int l;
  int n;
  printf("Input the lenght\n");
  scanf("%d", &l);
  printf("input the range\n");
  scanf("%d", &n);
  int i = 0;
  int num;
  int array[100];
  for (i = 0; i < l; i++) {
    printf("input a number\n");
    scanf("%d", &array[i]);
  }
  int b;
  for (b = 0; b <= n; b++) {
    printf("%d:", b);
    for (i = 0; i <= l - 1; i++) {
      if (b == array[i]) {
        printf("*");
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c2 <main+0xa2>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x10(%rbp),%rax
lea    -0x1b0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe63(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117c <main+0x5c>
movl   $0x0,-0x1b4(%rbp)
mov    -0x1b4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1261 <main+0x141>
mov    -0x1b4(%rbp),%esi
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     123f <main+0x11f>
mov    -0x1b4(%rbp),%eax
movslq -0x10(%rbp),%rcx
cmp    -0x1b0(%rbp,%rcx,4),%eax
jne    122c <main+0x10c>
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1231 <main+0x111>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11f6 <main+0xd6>
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    11cc <main+0xac>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1a8,%rsp
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9f(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11d5 <main+0x95>
lea    0x10(%rsp),%r12
xor    %ebx,%ebx
lea    0xe8c(%rip),%r14
lea    0xe5d(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r12
cmp    %rax,%rbx
jl     11b0 <main+0x70>
cmpl   $0x0,0xc(%rsp)
js     1253 <main+0x113>
lea    0xe20(%rip),%r14
xor    %r15d,%r15d
jmp    1208 <main+0xc8>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%eax
cmp    0xc(%rsp),%r15d
mov    %eax,%r15d
jge    1253 <main+0x113>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    11f0 <main+0xb0>
xor    %ebx,%ebx
jmp    123c <main+0xfc>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
movslq %eax,%rcx
cmp    %rcx,%rbx
jge    11f0 <main+0xb0>
cmp    0x10(%rsp,%rbx,4),%r15d
jne    1230 <main+0xf0>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%eax
jmp    1230 <main+0xf0>
xor    %eax,%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [4 x i8] c"%d:\00"
@str = [17 x i8] c"Input the lenght\00"
@str.7 = [16 x i8] c"input the range\00"
@str.8 = [15 x i8] c"input a number\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i32]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.7, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = bitcast [100 x i32]* %3 to i8*
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %16, %0
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 0
br i1 %15, label %49, label %25
16: ; preds = %0, %16
%17 = phi i64 [ %21, %16 ], [ 0, %0 ]
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.8, i64 0, i64 0))
%19 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %17
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %19)
%21 = add nuw nsw i64 %17, 1
%22 = load i32, i32* %1
%23 = sext i32 %22 to i64
%24 = icmp slt i64 %21, %23
br i1 %24, label %16, label %13
25: ; preds = %13, %44
%26 = phi i32 [ %46, %44 ], [ 0, %13 ]
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %1
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %44
30: ; preds = %25, %39
%31 = phi i32 [ %40, %39 ], [ %28, %25 ]
%32 = phi i64 [ %41, %39 ], [ 0, %25 ]
%33 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = icmp eq i32 %26, %34
br i1 %35, label %36, label %39
36: ; preds = %30
%37 = call i32 @putchar(i32 42)
%38 = load i32, i32* %1
br label %39
39: ; preds = %30, %36
%40 = phi i32 [ %31, %30 ], [ %38, %36 ]
%41 = add nuw nsw i64 %32, 1
%42 = sext i32 %40 to i64
%43 = icmp slt i64 %41, %42
br i1 %43, label %30, label %44
44: ; preds = %39, %25
%45 = call i32 @putchar(i32 10)
%46 = add nuw nsw i32 %26, 1
%47 = load i32, i32* %2
%48 = icmp slt i32 %26, %47
br i1 %48, label %25, label %49
49: ; preds = %44, %13
ret i32 0
}