#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);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main() {
  int A[30], x;
  srand(time(0));
  for (x = 1; x <= 30; x++) {
    A[x] = 100 + rand() % (999 - 100);
  }
  for (x = 0; x < 30; x++) {
    printf("%i\n\n", A[x]);
  }
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x1,-0x84(%rbp)
cmpl   $0x1e,-0x84(%rbp)
jg     11b8 <main+0x68>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x383,%ecx
cltd
idiv   %ecx
add    $0x64,%edx
movslq -0x84(%rbp),%rax
mov    %edx,-0x80(%rbp,%rax,4)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    117a <main+0x2a>
movl   $0x0,-0x84(%rbp)
cmpl   $0x1e,-0x84(%rbp)
jge    11fa <main+0xaa>
movslq -0x84(%rbp),%rax
mov    -0x80(%rbp,%rax,4),%esi
lea    0xe1f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    11c2 <main+0x72>
lea    0xe04(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffff91cc2c6d,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x9,%ecx
add    %edx,%ecx
imul   $0x383,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x64,%eax
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x1f,%rbx
jne    1170 <main+0x20>
xor    %ebx,%ebx
lea    0xe4d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rsp,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x1e,%rbx
jne    11c0 <main+0x70>
lea    0xe29(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%i\0A\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32 0)
%5 = call i32 @srand(i32 %4)
store i32 1, i32* %3
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 30
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 899
%12 = add nsw i32 100, %11
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %14
store i32 %12, i32* %15
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
store i32 0, i32* %3
br label %20
20: ; preds = %29, %19
%21 = load i32, i32* %3
%22 = icmp slt i32 %21, 30
br i1 %22, label %23, label %32
23: ; preds = %20
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %23
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %20
32: ; preds = %20
%33 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%i\0A\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [30 x i32]
%2 = bitcast [30 x i32]* %1 to i8*
%3 = tail call i32 @time(i32 0)
%4 = tail call i32 @srand(i32 %3)
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 1, %0 ], [ %11, %5 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 899
%9 = add nsw i32 %8, 100
%10 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 0, i64 %6
store i32 %9, i32* %10
%11 = add nuw nsw i64 %6, 1
%12 = icmp eq i64 %11, 31
br i1 %12, label %13, label %5
13: ; preds = %5, %13
%14 = phi i64 [ %18, %13 ], [ 0, %5 ]
%15 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = add nuw nsw i64 %14, 1
%19 = icmp eq i64 %18, 30
br i1 %19, label %20, label %13
20: ; preds = %13
%21 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}