#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 max_numbers, max_value, a, j;
  int size[max_numbers];
  printf("Enter range: ");
  scanf("%d", &max_value);
  printf("Enter length: ");
  scanf("%d", &max_numbers);
  printf("Enter numbers: ");
  for (j = 0; j < max_numbers; j++) {
    scanf("%d", &size[j]);
  }
  for (a = 0; a <= max_value; a++) {
    printf("%d: ", a);
    for (j = 0; j < max_numbers; j++) {
      if (a == size[j]) {
        printf("*");
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%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    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe85(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11dc <main+0xbc>
mov    -0x30(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe45(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a7 <main+0x87>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1264 <main+0x144>
mov    -0x10(%rbp),%esi
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1248 <main+0x128>
mov    -0x30(%rbp),%rcx
mov    -0x10(%rbp),%eax
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1235 <main+0x115>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123a <main+0x11a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1207 <main+0xe7>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e3 <main+0xc3>
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   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%r15
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x10(%rsp)
jle    11bd <main+0x8d>
mov    %rsp,%r12
xor    %ebx,%ebx
lea    0xe72(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0x10(%rsp),%rax
add    $0x4,%r12
cmp    %rax,%rbx
jl     11a0 <main+0x70>
cmpl   $0x0,0x14(%rsp)
js     1232 <main+0x102>
lea    0xe65(%rip),%r14
xor    %r12d,%r12d
jmp    11e9 <main+0xb9>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r12),%eax
cmp    0x14(%rsp),%r12d
mov    %eax,%r12d
jge    1232 <main+0x102>
mov    %r14,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%eax
test   %eax,%eax
jle    11d0 <main+0xa0>
xor    %ebx,%ebx
jmp    121c <main+0xec>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbx
movslq %eax,%rcx
cmp    %rcx,%rbx
jge    11d0 <main+0xa0>
cmp    (%rsp),%r12d
jne    1210 <main+0xe0>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%eax
jmp    1210 <main+0xe0>
mov    %r15,%rsp
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter range: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"Enter length: \00"
@.str.3 = [16 x i8] c"Enter numbers: \00"
@.str.4 = [5 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 i8*
%7 = alloca i64
store i32 0, i32* %1
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %6
%11 = alloca i32, i64 %9
store i64 %9, i64* %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, 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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %5
br label %17
17: ; preds = %26, %0
%18 = load i32, i32* %5
%19 = load i32, i32* %2
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %29
21: ; preds = %17
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %11, i64 %23
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %24)
br label %26
26: ; preds = %21
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %17
29: ; preds = %17
store i32 0, i32* %4
br label %30
30: ; preds = %56, %29
%31 = load i32, i32* %4
%32 = load i32, i32* %3
%33 = icmp sle i32 %31, %32
br i1 %33, label %34, label %59
34: ; preds = %30
%35 = load i32, i32* %4
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %35)
store i32 0, i32* %5
br label %37
37: ; preds = %51, %34
%38 = load i32, i32* %5
%39 = load i32, i32* %2
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %54
41: ; preds = %37
%42 = load i32, i32* %4
%43 = load i32, i32* %5
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %11, i64 %44
%46 = load i32, i32* %45
%47 = icmp eq i32 %42, %46
br i1 %47, label %48, label %50
48: ; preds = %41
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %50
50: ; preds = %48, %41
br label %51
51: ; preds = %50
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
br label %37
54: ; preds = %37
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %56
56: ; preds = %54
%57 = load i32, i32* %4
%58 = add nsw i32 %57, 1
store i32 %58, i32* %4
br label %30
59: ; preds = %30
store i32 0, i32* %1
%60 = load i8*, i8** %6
%61 = load i32, i32* %1
ret i32 %61
}

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