#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*/ fflush(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *);
int rand();
int /*<<< orphan*/ random_tag();
int /*<<< orphan*/ srand(int);
int time(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int tc, seed;
  printf("<HTML>\n");
  printf("<HEAD>\n");
  seed = (time(0) ^ (getpid() << 16));
  srand(seed);
  tc = (rand() % (100)) + 1;
  while (tc--)
    random_tag();
  fflush(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
shl    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1060 <srand@plt>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     11f9 <main+0x89>
mov    $0x0,%al
call   1050 <random_tag@plt>
jmp    11d9 <main+0x69>
xor    %edi,%edi
call   1080 <fflush@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
lea    0xe83(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getpid@plt>
shl    $0x10,%eax
xor    %eax,%ebx
mov    %ebx,%edi
call   1060 <srand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%rbx
imul   $0x51eb851f,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ebx
inc    %ebx
je     11dc <main+0x6c>
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <random_tag@plt>
add    $0xffffffff,%ebx
jne    11d0 <main+0x60>
xor    %edi,%edi
call   1080 <fflush@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"<HTML>\0A\00"
@.str.1 = [8 x i8] c"<HEAD>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @time(i32 0)
%11 = call i32 (...) @getpid()
%12 = shl i32 %11, 16
%13 = xor i32 %10, %12
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @srand(i32 %14)
%16 = call i32 (...) @rand()
%17 = srem i32 %16, 100
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %19
19: ; preds = %23, %2
%20 = load i32, i32* %6
%21 = add nsw i32 %20, -1
store i32 %21, i32* %6
%22 = icmp ne i32 %20, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 (...) @random_tag()
br label %19
25: ; preds = %19
%26 = call i32 @fflush(i32 0)
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"<HTML>\00"
@str.2 = [7 x i8] c"<HEAD>\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @time(i32 0)
%6 = tail call i32 (...) @getpid()
%7 = shl i32 %6, 16
%8 = xor i32 %7, %5
%9 = tail call i32 @srand(i32 %8)
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, 100
%12 = add nsw i32 %11, 1
%13 = icmp eq i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %2, %14
%15 = phi i32 [ %16, %14 ], [ %12, %2 ]
%16 = add nsw i32 %15, -1
%17 = tail call i32 (...) @random_tag()
%18 = icmp eq i32 %16, 0
br i1 %18, label %19, label %14
19: ; preds = %14, %2
%20 = tail call i32 @fflush(i32 0)
ret i32 0
}