#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 get_rand(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  printf("100\n");
  for (int i = 0; i < 100; ++i) {
    for (int j = 0; j < 100; ++j) {
      if (i == (j - 1)) {
        printf("%u ", 10);
      } else {
        printf("%u ", get_rand(10, 1000));
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1206 <main+0xc6>
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    11ea <main+0xaa>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    11b8 <main+0x78>
lea    0xe5e(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d7 <main+0x97>
mov    $0xa,%edi
mov    $0x3e8,%esi
call   1040 <get_rand@plt>
mov    %eax,%esi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dc <main+0x9c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1185 <main+0x45>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <main+0x34>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xe8b(%rip),%rdi
call   1040 <puts@plt>
lea    0xe7b(%rip),%r14
xor    %ebp,%ebp
jmp    11a2 <main+0x42>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x64,%ebp
je     11de <main+0x7e>
mov    $0xffffffff,%ebx
jmp    11c2 <main+0x62>
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0x63,%ebx
je     1190 <main+0x30>
mov    $0xa,%esi
cmp    %ebx,%ebp
je     11b0 <main+0x50>
mov    $0xa,%edi
mov    $0x3e8,%esi
call   1060 <get_rand@plt>
mov    %eax,%esi
jmp    11b0 <main+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%u \00"
@str = [4 x i8] c"100\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %0, %7
%5 = phi i32 [ 0, %0 ], [ %9, %7 ]
br label %11
6: ; preds = %7
ret i32 0
7: ; preds = %17
%8 = tail call i32 @putchar(i32 10)
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, 100
br i1 %10, label %6, label %4
11: ; preds = %4, %17
%12 = phi i32 [ 0, %4 ], [ %20, %17 ]
%13 = add nsw i32 %12, -1
%14 = icmp eq i32 %5, %13
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 @get_rand(i32 10, i32 1000)
br label %17
17: ; preds = %11, %15
%18 = phi i32 [ %16, %15 ], [ 10, %11 ]
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = add nuw nsw i32 %12, 1
%21 = icmp eq i32 %20, 100
br i1 %21, label %7, label %11
}