#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 */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printarray(int *, int);
int /*<<< orphan*/ printarrayc(char *, int);
int /*<<< orphan*/ printstring(char *);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int a[10] = {0};
  char c[] = {'A', 'J', 'A', 0};
  srand(time(NULL));
  for (int i = 0; i < (sizeof(a) / sizeof(int)); ++i)
    a[i] = rand() % 100;
  printarray(a, 10);
  printarrayc(c, 10);
  printstring("AJA");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
mov    0xe6b(%rip),%eax
mov    %eax,-0x34(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0x38(%rbp)
movslq -0x38(%rbp),%rax
cmp    $0xa,%rax
jae    11e2 <main+0x72>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
movslq -0x38(%rbp),%rax
mov    %edx,-0x30(%rbp,%rax,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11af <main+0x3f>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1080 <printarray@plt>
lea    -0x34(%rbp),%rdi
mov    $0xa,%esi
call   1030 <printarrayc@plt>
lea    0xdfb(%rip),%rdi
call   1060 <printstring@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movl   $0x414a41,0xc(%rsp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x10(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x14(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x18(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x1c(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x20(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x24(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x28(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x2c(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x30(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x34(%rsp)
lea    0x10(%rsp),%rdi
mov    $0xa,%esi
call   1070 <printarray@plt>
lea    0xc(%rsp),%rdi
mov    $0xa,%esi
call   1030 <printarrayc@plt>
lea    0xcc7(%rip),%rdi
call   1050 <printstring@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.c = [4 x i8] c"AJA\00"
@.str = [4 x i8] c"AJA\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [4 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
%6 = bitcast [4 x i8]* %3 to i8*
%7 = call i32 @time(i32* null)
%8 = call i32 @srand(i32 %7)
store i32 0, i32* %4
br label %9
9: ; preds = %19, %0
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %11, 10
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 100
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %17
store i32 %15, i32* %18
br label %19
19: ; preds = %13
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %9
22: ; preds = %9
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%24 = call i32 @printarray(i32* %23, i32 10)
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%26 = call i32 @printarrayc(i8* %25, i32 10)
%27 = call i32 @printstring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"AJA\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 4278849, i32* %2
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 @srand(i32 %5)
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 100
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32 %8, i32* %9
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, 100
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
store i32 %11, i32* %12
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 100
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
store i32 %14, i32* %15
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 100
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
store i32 %17, i32* %18
%19 = tail call i32 (...) @rand()
%20 = srem i32 %19, 100
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
store i32 %20, i32* %21
%22 = tail call i32 (...) @rand()
%23 = srem i32 %22, 100
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
store i32 %23, i32* %24
%25 = tail call i32 (...) @rand()
%26 = srem i32 %25, 100
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
store i32 %26, i32* %27
%28 = tail call i32 (...) @rand()
%29 = srem i32 %28, 100
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
store i32 %29, i32* %30
%31 = tail call i32 (...) @rand()
%32 = srem i32 %31, 100
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 %32, i32* %33
%34 = tail call i32 (...) @rand()
%35 = srem i32 %34, 100
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 %35, i32* %36
%37 = call i32 @printarray(i32* %9, i32 10)
%38 = call i32 @printarrayc(i8* %4, i32 10)
%39 = call i32 @printstring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}