#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*/ atoi(char *);
int /*<<< orphan*/ gen_text();
int /*<<< orphan*/ gen_time(float *, float);
int get_random(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  int item, items;
  float t = 0.0f;
  if (argc == 1 || *argv[1] != '-') {
    srand(argc == 1 ? time(NULL) : atoi(argv[1]));
    items = argc == 1 ? 262144 : get_random(256);
    for (item = 1; item <= items; ++item) {
      printf("%d\n", item);
      gen_time(&t, 0.5f);
      printf(" --> ");
      gen_time(&t, 2.5f);
      printf("\n");
      gen_text();
      printf("\n");
    }
  } else {
    for (item = 0; item <= 1000; ++item) {
      printf("%d\n", item + 1);
      t = (float)item / 1000.0f;
      gen_time(&t, 0.0f);
      printf(" --> ");
      t += 2.5f;
      gen_time(&t, 0.0f);
      printf("\n");
      printf("Text.\n");
      printf("\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     11ac <main+0x3c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1293 <main+0x123>
cmpl   $0x1,-0x8(%rbp)
jne    11c7 <main+0x57>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,-0x20(%rbp)
jmp    11d7 <main+0x67>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
call   1050 <srand@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11f6 <main+0x86>
mov    $0x40000,%eax
mov    %eax,-0x24(%rbp)
jmp    1203 <main+0x93>
mov    $0x100,%edi
call   1030 <get_random@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     128e <main+0x11e>
mov    -0x14(%rbp),%esi
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1c(%rbp),%rdi
movss  0xdcf(%rip),%xmm0
call   1090 <gen_time@plt>
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1c(%rbp),%rdi
movss  0xda8(%rip),%xmm0
call   1090 <gen_time@plt>
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <gen_text@plt>
lea    0xda2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1210 <main+0xa0>
jmp    1346 <main+0x1d6>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jg     1341 <main+0x1d1>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
lea    0xd58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cvtsi2ssl -0x14(%rbp),%xmm0
movss  0xd3c(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
xorps  %xmm0,%xmm0
call   1090 <gen_time@plt>
lea    0xd2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  0xd0d(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
xorps  %xmm0,%xmm0
call   1090 <gen_time@plt>
lea    0xd0b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcf8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    129a <main+0x12a>
jmp    1346 <main+0x1d6>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
cmp    $0x1,%edi
jne    11c1 <main+0x31>
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    $0x40000,%r15d
jmp    1294 <main+0x104>
mov    0x8(%rsi),%rdi
cmpb   $0x2d,(%rdi)
jne    1273 <main+0xe3>
lea    0xe37(%rip),%r14
lea    0x4(%rsp),%r13
lea    0xe2f(%rip),%r15
lea    0xe2e(%rip),%r12
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
divss  0xdf2(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
mov    %r13,%rdi
call   10b0 <gen_time@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movss  0x4(%rsp),%xmm0
addss  0xdcd(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
mov    %r13,%rdi
call   10b0 <gen_time@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebp,%ebx
cmp    $0x3e9,%ebp
jne    11f0 <main+0x60>
jmp    1314 <main+0x184>
call   10a0 <atoi@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    $0x100,%edi
call   1050 <get_random@plt>
mov    %eax,%r15d
test   %eax,%eax
jle    1314 <main+0x184>
neg    %r15d
mov    $0x1,%ebx
lea    0xd69(%rip),%r14
lea    0x4(%rsp),%r12
lea    0xd61(%rip),%r13
nop
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
movss  0xd41(%rip),%xmm0
call   10b0 <gen_time@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
movss  0xd23(%rip),%xmm0
call   10b0 <gen_time@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1080 <gen_text@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    12b0 <main+0x120>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c" --> \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [7 x i8] c"Text.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0.000000e+00, float* %8
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
br i1 %10, label %18, label %11
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 45
br i1 %17, label %18, label %55
18: ; preds = %11, %2
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @time(i32* null)
br label %28
23: ; preds = %18
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
br label %28
28: ; preds = %23, %21
%29 = phi i32 [ %22, %21 ], [ %27, %23 ]
%30 = call i32 @srand(i32 %29)
%31 = load i32, i32* %4
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %34
33: ; preds = %28
br label %36
34: ; preds = %28
%35 = call i32 @get_random(i32 256)
br label %36
36: ; preds = %34, %33
%37 = phi i32 [ 262144, %33 ], [ %35, %34 ]
store i32 %37, i32* %7
store i32 1, i32* %6
br label %38
38: ; preds = %51, %36
%39 = load i32, i32* %6
%40 = load i32, i32* %7
%41 = icmp sle i32 %39, %40
br i1 %41, label %42, label %54
42: ; preds = %38
%43 = load i32, i32* %6
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %43)
%45 = call i32 @gen_time(float* %8, float 5.000000e-01)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%47 = call i32 @gen_time(float* %8, float 2.500000e+00)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%49 = call i32 (...) @gen_text()
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %51
51: ; preds = %42
%52 = load i32, i32* %6
%53 = add nsw i32 %52, 1
store i32 %53, i32* %6
br label %38
54: ; preds = %38
br label %78
55: ; preds = %11
store i32 0, i32* %6
br label %56
56: ; preds = %74, %55
%57 = load i32, i32* %6
%58 = icmp sle i32 %57, 1000
br i1 %58, label %59, label %77
59: ; preds = %56
%60 = load i32, i32* %6
%61 = add nsw i32 %60, 1
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %61)
%63 = load i32, i32* %6
%64 = sitofp i32 %63 to float
%65 = fdiv float %64, 1.000000e+03
store float %65, float* %8
%66 = call i32 @gen_time(float* %8, float 0.000000e+00)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%68 = load float, float* %8
%69 = fadd float %68, 2.500000e+00
store float %69, float* %8
%70 = call i32 @gen_time(float* %8, float 0.000000e+00)
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %74
74: ; preds = %59
%75 = load i32, i32* %6
%76 = add nsw i32 %75, 1
store i32 %76, i32* %6
br label %56
77: ; preds = %56
br label %78
78: ; preds = %77, %54
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c" --> \00"
@str = [6 x i8] c"Text.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%5 = icmp eq i32 %0, 1
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 45
br i1 %10, label %32, label %14
11: ; preds = %2
%12 = tail call i32 @time(i32* null)
%13 = tail call i32 @srand(i32 %12)
br label %19
14: ; preds = %6
%15 = tail call i32 @atoi(i8* %8)
%16 = tail call i32 @srand(i32 %15)
%17 = tail call i32 @get_random(i32 256)
%18 = icmp slt i32 %17, 1
br i1 %18, label %47, label %19
19: ; preds = %11, %14
%20 = phi i32 [ 262144, %11 ], [ %17, %14 ]
br label %21
21: ; preds = %19, %21
%22 = phi i32 [ %30, %21 ], [ 1, %19 ]
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = call i32 @gen_time(float* %3, float 5.000000e-01)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%26 = call i32 @gen_time(float* %3, float 2.500000e+00)
%27 = call i32 @putchar(i32 10)
%28 = call i32 (...) @gen_text()
%29 = call i32 @putchar(i32 10)
%30 = add nuw i32 %22, 1
%31 = icmp eq i32 %22, %20
br i1 %31, label %47, label %21
32: ; preds = %6, %32
%33 = phi i32 [ %34, %32 ], [ 0, %6 ]
%34 = add nuw nsw i32 %33, 1
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = sitofp i32 %33 to float
%37 = fdiv float %36, 1.000000e+03
store float %37, float* %3
%38 = call i32 @gen_time(float* %3, float 0.000000e+00)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%40 = load float, float* %3
%41 = fadd float %40, 2.500000e+00
store float %41, float* %3
%42 = call i32 @gen_time(float* %3, float 0.000000e+00)
%43 = call i32 @putchar(i32 10)
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%45 = call i32 @putchar(i32 10)
%46 = icmp eq i32 %34, 1001
br i1 %46, label %47, label %32
47: ; preds = %32, %21, %14
ret i32 0
}