#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 range;
  printf("\nInsert range : ");
  scanf("%d", &range);
  if (range < 0) {
    scanf("%d", &range);
  }
  int length;
  printf("Insert length : ");
  scanf("%d", &length);
  if (length < 0) {
    scanf("%d", &length);
  }
  printf("Insert numbers : ");
  int i, arr[length];
  for (i = 0; i < length; i++) {
    scanf("%d", &arr[i]);
    if (arr[i] > range) {
      scanf("%d", &arr[i]);
    }
  }
  for (i = 0; i <= range; i++) {
    int b;
    printf("\n%d: ", i);
    for (b = 0; b < length; b++) {
      if (arr[b] == i) {
        printf("*");
      }
    }
  }
  printf("\nN: %d\n ", range);
  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    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1167 <main+0x47>
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jge    119f <main+0x7f>
lea    0xe7b(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1244 <main+0x124>
mov    -0x30(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe14(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x30(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jle    1231 <main+0x111>
mov    -0x30(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xde5(%rip),%rdi
call   1040 <scanf@plt>
jmp    1236 <main+0x116>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11db <main+0xbb>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     12c3 <main+0x1a3>
mov    -0x10(%rbp),%esi
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12b0 <main+0x190>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jne    129d <main+0x17d>
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a2 <main+0x182>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    126f <main+0x14f>
jmp    12b5 <main+0x195>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    124b <main+0x12b>
mov    -0x8(%rbp),%esi
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%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    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x30(%rbp)
jns    1172 <main+0x42>
lea    0xea8(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x2c(%rbp)
jns    11a6 <main+0x76>
lea    0xe74(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe78(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%r15
mov    -0x2c(%rbp),%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
cmpl   $0x0,-0x2c(%rbp)
jle    1220 <main+0xf0>
xor    %r13d,%r13d
lea    0xe32(%rip),%r14
mov    %r12,%rbx
jmp    1201 <main+0xd1>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r13
movslq -0x2c(%rbp),%rax
add    $0x4,%rbx
cmp    %rax,%r13
jge    1220 <main+0xf0>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    (%rbx),%eax
cmp    -0x30(%rbp),%eax
jle    11f0 <main+0xc0>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
jmp    11f0 <main+0xc0>
mov    -0x30(%rbp),%esi
test   %esi,%esi
js     1291 <main+0x161>
lea    0xe09(%rip),%r14
xor    %r13d,%r13d
jmp    124f <main+0x11f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%r13),%eax
mov    -0x30(%rbp),%esi
cmp    %esi,%r13d
mov    %eax,%r13d
jge    1291 <main+0x161>
mov    %r14,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x2c(%rbp),%eax
test   %eax,%eax
jle    1240 <main+0x110>
xor    %ebx,%ebx
jmp    127c <main+0x14c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
movslq %eax,%rcx
cmp    %rcx,%rbx
jge    1240 <main+0x110>
cmp    %r13d,(%r12,%rbx,4)
jne    1270 <main+0x140>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0x2c(%rbp),%eax
jmp    1270 <main+0x140>
lea    0xda5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
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 = [17 x i8] c"\0AInsert range : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Insert length : \00"
@.str.3 = [18 x i8] c"Insert numbers : \00"
@.str.4 = [6 x i8] c"\0A%d: \00"
@.str.5 = [2 x i8] c"*\00"
@.str.6 = [9 x i8] c"\0AN: %d\0A \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 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 = load i32, i32* %2
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %14
14: ; preds = %12, %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %21
21: ; preds = %19, %14
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%23 = load i32, i32* %3
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %5
%26 = alloca i32, i64 %24
store i64 %24, i64* %6
store i32 0, i32* %4
br label %27
27: ; preds = %48, %21
%28 = load i32, i32* %4
%29 = load i32, i32* %3
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %51
31: ; preds = %27
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %26, i64 %33
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %34)
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %26, i64 %37
%39 = load i32, i32* %38
%40 = load i32, i32* %2
%41 = icmp sgt i32 %39, %40
br i1 %41, label %42, label %47
42: ; preds = %31
%43 = load i32, i32* %4
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %26, i64 %44
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %45)
br label %47
47: ; preds = %42, %31
br label %48
48: ; preds = %47
%49 = load i32, i32* %4
%50 = add nsw i32 %49, 1
store i32 %50, i32* %4
br label %27
51: ; preds = %27
store i32 0, i32* %4
br label %52
52: ; preds = %77, %51
%53 = load i32, i32* %4
%54 = load i32, i32* %2
%55 = icmp sle i32 %53, %54
br i1 %55, label %56, label %80
56: ; preds = %52
%57 = load i32, i32* %4
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %57)
store i32 0, i32* %7
br label %59
59: ; preds = %73, %56
%60 = load i32, i32* %7
%61 = load i32, i32* %3
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %76
63: ; preds = %59
%64 = load i32, i32* %7
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %26, i64 %65
%67 = load i32, i32* %66
%68 = load i32, i32* %4
%69 = icmp eq i32 %67, %68
br i1 %69, label %70, label %72
70: ; preds = %63
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %72
72: ; preds = %70, %63
br label %73
73: ; preds = %72
%74 = load i32, i32* %7
%75 = add nsw i32 %74, 1
store i32 %75, i32* %7
br label %59
76: ; preds = %59
br label %77
77: ; preds = %76
%78 = load i32, i32* %4
%79 = add nsw i32 %78, 1
store i32 %79, i32* %4
br label %52
80: ; preds = %52
%81 = load i32, i32* %2
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %81)
store i32 0, i32* %1
%83 = load i8*, i8** %5
%84 = load i32, i32* %1
ret i32 %84
}

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