#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 n, l, i, ix;
  printf("Enter range:\n");
  scanf("%d", &n);
  while (n < 0) {
    scanf("%d", &n);
  }
  printf("Enter length:\n");
  scanf("%d", &l);
  while (l < 0) {
    scanf("%d", &l);
  }
  int whatev[l];
  printf("Enter array values:\n");
  for (i = 0; i <= l - 1; i++) {
    scanf("%d", &whatev[i]);
    while (whatev[i] < 0) {
      scanf("%d", &whatev[i]);
    }
  }
  for (i = 0; i <= n; i++) {
    printf("\n%d:", i);
    for (ix = 0; ix < l; ix++) {
      if (whatev[ix] == i) {
        printf("*");
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    116c <main+0x4c>
lea    0xeb0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    114d <main+0x2d>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8d(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jge    11a9 <main+0x89>
lea    0xe73(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
jmp    118a <main+0x6a>
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1256 <main+0x136>
mov    -0x30(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe02(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x30(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    1243 <main+0x123>
mov    -0x30(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdd5(%rip),%rdi
call   1040 <scanf@plt>
jmp    1211 <main+0xf1>
jmp    1248 <main+0x128>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e5 <main+0xc5>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     12d5 <main+0x1b5>
mov    -0x10(%rbp),%esi
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12c2 <main+0x1a2>
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jne    12af <main+0x18f>
lea    0xd92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b4 <main+0x194>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1281 <main+0x161>
jmp    12c7 <main+0x1a7>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    125d <main+0x13d>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeb3(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9f(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,-0x30(%rbp)
jns    1191 <main+0x51>
lea    0xe89(%rip),%r14
lea    -0x30(%rbp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
cmpl   $0x0,-0x30(%rbp)
js     1180 <main+0x40>
lea    0xe7d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe5c(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x2c(%rbp),%eax
test   %eax,%eax
jns    11d2 <main+0x92>
lea    0xe45(%rip),%r14
lea    -0x2c(%rbp),%rbx
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    -0x2c(%rbp),%eax
test   %eax,%eax
js     11c0 <main+0x80>
mov    %rsp,%r15
mov    %eax,%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
lea    0xe30(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    1252 <main+0x112>
xor    %r13d,%r13d
lea    0xdf8(%rip),%r14
jmp    121d <main+0xdd>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r13
movslq -0x2c(%rbp),%rax
cmp    %rax,%r13
jge    1252 <main+0x112>
lea    (%r12,%r13,4),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
cmpl   $0x0,(%r12,%r13,4)
jns    1210 <main+0xd0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
cmpl   $0x0,(%rbx)
js     1240 <main+0x100>
jmp    1210 <main+0xd0>
cmpl   $0x0,-0x30(%rbp)
js     12c1 <main+0x181>
lea    0xda4(%rip),%r14
xor    %r13d,%r13d
jmp    127d <main+0x13d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x1(%r13),%eax
cmp    -0x30(%rbp),%r13d
mov    %eax,%r13d
jge    12c1 <main+0x181>
mov    %r14,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x2c(%rbp),%eax
test   %eax,%eax
jle    1270 <main+0x130>
xor    %ebx,%ebx
jmp    12ac <main+0x16c>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
movslq %eax,%rcx
cmp    %rcx,%rbx
jge    1270 <main+0x130>
cmp    %r13d,(%r12,%rbx,4)
jne    12a0 <main+0x160>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0x2c(%rbp),%eax
jmp    12a0 <main+0x160>
mov    %r15,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter range:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"Enter length:\0A\00"
@.str.3 = [21 x i8] c"Enter array values:\0A\00"
@.str.4 = [5 x i8] c"\0A%d:\00"
@.str.5 = [2 x i8] c"*\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 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)
br label %10
10: ; preds = %13, %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %10
15: ; preds = %10
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %18
18: ; preds = %21, %15
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %18
23: ; preds = %18
%24 = load i32, i32* %3
%25 = zext i32 %24 to i64
%26 = call i8* @llvm.stacksave()
store i8* %26, i8** %6
%27 = alloca i32, i64 %25
store i64 %25, i64* %7
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
br label %29
29: ; preds = %51, %23
%30 = load i32, i32* %4
%31 = load i32, i32* %3
%32 = sub nsw i32 %31, 1
%33 = icmp sle i32 %30, %32
br i1 %33, label %34, label %54
34: ; preds = %29
%35 = load i32, i32* %4
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %27, i64 %36
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %37)
br label %39
39: ; preds = %45, %34
%40 = load i32, i32* %4
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %27, i64 %41
%43 = load i32, i32* %42
%44 = icmp slt i32 %43, 0
br i1 %44, label %45, label %50
45: ; preds = %39
%46 = load i32, i32* %4
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %27, i64 %47
%49 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %48)
br label %39
50: ; preds = %39
br label %51
51: ; preds = %50
%52 = load i32, i32* %4
%53 = add nsw i32 %52, 1
store i32 %53, i32* %4
br label %29
54: ; preds = %29
store i32 0, i32* %4
br label %55
55: ; preds = %80, %54
%56 = load i32, i32* %4
%57 = load i32, i32* %2
%58 = icmp sle i32 %56, %57
br i1 %58, label %59, label %83
59: ; preds = %55
%60 = load i32, i32* %4
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %60)
store i32 0, i32* %5
br label %62
62: ; preds = %76, %59
%63 = load i32, i32* %5
%64 = load i32, i32* %3
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %79
66: ; preds = %62
%67 = load i32, i32* %5
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %27, i64 %68
%70 = load i32, i32* %69
%71 = load i32, i32* %4
%72 = icmp eq i32 %70, %71
br i1 %72, label %73, label %75
73: ; preds = %66
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %75
75: ; preds = %73, %66
br label %76
76: ; preds = %75
%77 = load i32, i32* %5
%78 = add nsw i32 %77, 1
store i32 %78, i32* %5
br label %62
79: ; preds = %62
br label %80
80: ; preds = %79
%81 = load i32, i32* %4
%82 = add nsw i32 %81, 1
store i32 %82, i32* %4
br label %55
83: ; preds = %55
store i32 0, i32* %1
%84 = load i8*, i8** %6
%85 = load i32, i32* %1
ret i32 %85
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [5 x i8] c"\0A%d:\00"
@str = [13 x i8] c"Enter range:\00"
@str.6 = [14 x i8] c"Enter length:\00"
@str.7 = [20 x i8] c"Enter array values:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %0, %9
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %9, %0
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %13, %18
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 0
br i1 %21, label %18, label %22
22: ; preds = %18, %13
%23 = phi i32 [ %16, %13 ], [ %20, %18 ]
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
%26 = alloca i32, i64 %24
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
%28 = load i32, i32* %2
%29 = icmp sgt i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %43, %22
%31 = load i32, i32* %1
%32 = icmp slt i32 %31, 0
br i1 %32, label %71, label %48
33: ; preds = %22, %43
%34 = phi i64 [ %44, %43 ], [ 0, %22 ]
%35 = getelementptr inbounds i32, i32* %26, i64 %34
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %35)
%37 = load i32, i32* %35
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %33, %39
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %35)
%41 = load i32, i32* %35
%42 = icmp slt i32 %41, 0
br i1 %42, label %39, label %43
43: ; preds = %39, %33
%44 = add nuw nsw i64 %34, 1
%45 = load i32, i32* %2
%46 = sext i32 %45 to i64
%47 = icmp slt i64 %44, %46
br i1 %47, label %33, label %30
48: ; preds = %30, %67
%49 = phi i32 [ %68, %67 ], [ 0, %30 ]
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %2
%52 = icmp sgt i32 %51, 0
br i1 %52, label %53, label %67
53: ; preds = %48, %62
%54 = phi i32 [ %63, %62 ], [ %51, %48 ]
%55 = phi i64 [ %64, %62 ], [ 0, %48 ]
%56 = getelementptr inbounds i32, i32* %26, i64 %55
%57 = load i32, i32* %56
%58 = icmp eq i32 %57, %49
br i1 %58, label %59, label %62
59: ; preds = %53
%60 = call i32 @putchar(i32 42)
%61 = load i32, i32* %2
br label %62
62: ; preds = %53, %59
%63 = phi i32 [ %54, %53 ], [ %61, %59 ]
%64 = add nuw nsw i64 %55, 1
%65 = sext i32 %63 to i64
%66 = icmp slt i64 %64, %65
br i1 %66, label %53, label %67
67: ; preds = %62, %48
%68 = add nuw nsw i32 %49, 1
%69 = load i32, i32* %1
%70 = icmp slt i32 %49, %69
br i1 %70, label %48, label %71
71: ; preds = %67, %30
ret i32 0
}