#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*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, ...);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  freopen("input.txt", "w", stdout);
  srand(time(NULL));
  for (int i = 5; i < 10000; i += 5) {
    printf("%d\n", i);
    for (int j = 0; j < i; j++) {
      printf("%4d%4d\n", rand() % 100 + 1, rand() % 100 + 1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edx
lea    0xe91(%rip),%rdi
lea    0xe94(%rip),%rsi
call   1040 <freopen@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x5,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    121c <main+0xcc>
mov    -0x8(%rbp),%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1209 <main+0xb9>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    -0x10(%rbp),%esi
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b7 <main+0x67>
jmp    120e <main+0xbe>
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
jmp    1192 <main+0x42>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
lea    0xe98(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1040 <freopen@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x5,%r15d
lea    0xe7d(%rip),%r14
lea    0xe7a(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15d,%ebx
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x1,%edx
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    11b0 <main+0x60>
lea    0x5(%r15),%eax
cmp    $0x270b,%r15d
mov    %eax,%r15d
jb     11a0 <main+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [8 x i8] c"%4d%4d\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
br label %6
5: ; preds = %9
ret i32 0
6: ; preds = %0, %9
%7 = phi i32 [ 5, %0 ], [ %10, %9 ]
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %7)
br label %12
9: ; preds = %12
%10 = add nuw nsw i32 %7, 5
%11 = icmp ult i32 %7, 9995
br i1 %11, label %6, label %5
12: ; preds = %6, %12
%13 = phi i32 [ 0, %6 ], [ %21, %12 ]
%14 = tail call i32 (...) @rand()
%15 = srem i32 %14, 100
%16 = add nsw i32 %15, 1
%17 = tail call i32 (...) @rand()
%18 = srem i32 %17, 100
%19 = add nsw i32 %18, 1
%20 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %16, i32 %19)
%21 = add nuw nsw i32 %13, 1
%22 = icmp eq i32 %21, %7
br i1 %22, label %9, label %12
}