#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) {
      gen_time(&t, 0.5f);
      gen_text();
    }
  } else {
    for (item = 0; item <= 100; ++item) {
      t = (float)item / 100.0f;
      gen_time(&t, 0.0f);
      printf("Text.\n");
    }
  }
  gen_time(&t, 0.0f);
  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     1247 <main+0xd7>
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     1242 <main+0xd2>
lea    -0x1c(%rbp),%rdi
movss  0xddc(%rip),%xmm0
call   1090 <gen_time@plt>
mov    $0x0,%al
call   1060 <gen_text@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1210 <main+0xa0>
jmp    1299 <main+0x129>
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     1294 <main+0x124>
cvtsi2ssl -0x14(%rbp),%xmm0
movss  0xd9b(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
xorps  %xmm0,%xmm0
call   1090 <gen_time@plt>
lea    0xd87(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    124e <main+0xde>
jmp    1299 <main+0x129>
lea    -0x1c(%rbp),%rdi
xorps  %xmm0,%xmm0
call   1090 <gen_time@plt>
lea    0xd61(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
cmp    $0x1,%edi
jne    11aa <main+0x2a>
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x40000,%ebx
jmp    121e <main+0x9e>
mov    0x8(%rsi),%rdi
cmpb   $0x2d,(%rdi)
jne    1202 <main+0x82>
xor    %ebp,%ebp
lea    0xc(%rsp),%r14
lea    0xe47(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
divss  0xe21(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
mov    %r14,%rdi
call   10a0 <gen_time@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    11d0 <main+0x50>
jmp    124c <main+0xcc>
call   1090 <atoi@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x100,%edi
call   1050 <get_random@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    124c <main+0xcc>
lea    0xc(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
movss  0xdc9(%rip),%xmm0
call   10a0 <gen_time@plt>
xor    %eax,%eax
call   1070 <gen_text@plt>
add    $0xffffffff,%ebx
jne    1230 <main+0xb0>
lea    0xc(%rsp),%rdi
xorps  %xmm0,%xmm0
call   10a0 <gen_time@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Text.\0A\00"
@.str.1 = [2 x i8] c"\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 %49
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 = %45, %36
%39 = load i32, i32* %6
%40 = load i32, i32* %7
%41 = icmp sle i32 %39, %40
br i1 %41, label %42, label %48
42: ; preds = %38
%43 = call i32 @gen_time(float* %8, float 5.000000e-01)
%44 = call i32 (...) @gen_text()
br label %45
45: ; preds = %42
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %38
48: ; preds = %38
br label %63
49: ; preds = %11
store i32 0, i32* %6
br label %50
50: ; preds = %59, %49
%51 = load i32, i32* %6
%52 = icmp sle i32 %51, 100
br i1 %52, label %53, label %62
53: ; preds = %50
%54 = load i32, i32* %6
%55 = sitofp i32 %54 to float
%56 = fdiv float %55, 1.000000e+02
store float %56, float* %8
%57 = call i32 @gen_time(float* %8, float 0.000000e+00)
%58 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %59
59: ; preds = %53
%60 = load i32, i32* %6
%61 = add nsw i32 %60, 1
store i32 %61, i32* %6
br label %50
62: ; preds = %50
br label %63
63: ; preds = %62, %48
%64 = call i32 @gen_time(float* %8, float 0.000000e+00)
%65 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@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 %27, 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 %35, label %19
19: ; preds = %11, %14
%20 = phi i32 [ 262144, %11 ], [ %17, %14 ]
br label %21
21: ; preds = %19, %21
%22 = phi i32 [ %25, %21 ], [ 1, %19 ]
%23 = call i32 @gen_time(float* %3, float 5.000000e-01)
%24 = call i32 (...) @gen_text()
%25 = add nuw i32 %22, 1
%26 = icmp eq i32 %22, %20
br i1 %26, label %35, label %21
27: ; preds = %6, %27
%28 = phi i32 [ %33, %27 ], [ 0, %6 ]
%29 = sitofp i32 %28 to float
%30 = fdiv float %29, 1.000000e+02
store float %30, float* %3
%31 = call i32 @gen_time(float* %3, float 0.000000e+00)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%33 = add nuw nsw i32 %28, 1
%34 = icmp eq i32 %33, 101
br i1 %34, label %35, label %27
35: ; preds = %27, %21, %14
%36 = call i32 @gen_time(float* %3, float 0.000000e+00)
%37 = call i32 @putchar(i32 10)
ret i32 0
}