#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*/ genrand();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int j;
  for (j = 0; j < 50; j++) {
    printf("%12lu ", genrand());
    if (j % 5 == 4)
      printf("\n");
  }
  printf("\n");
  genrand();
  for (++j; j < 999; j++) {
    genrand();
  }
  printf(" 1000: %08lx\n", genrand());
  for (++j; j < 4999; j++) {
    genrand();
  }
  printf(" 5000: %08lx\n", genrand());
  for (++j; j < 9999; j++) {
    genrand();
  }
  printf("10000: %08lx\n", genrand());
  for (++j; j < 19999; j++) {
    genrand();
  }
  printf("20000: %08lx\n", genrand());
  for (++j; j < 29999; j++) {
    genrand();
  }
  printf("30000: %08lx\n", genrand());
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    118c <main+0x6c>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x4,%edx
jne    1179 <main+0x59>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    117e <main+0x5e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3e7,-0x8(%rbp)
jge    11cc <main+0xac>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11aa <main+0x8a>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    %eax,%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1387,-0x8(%rbp)
jge    120e <main+0xee>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ec <main+0xcc>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    %eax,%esi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x270f,-0x8(%rbp)
jge    1250 <main+0x130>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    122e <main+0x10e>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    %eax,%esi
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x4e1f,-0x8(%rbp)
jge    1292 <main+0x172>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1270 <main+0x150>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    %eax,%esi
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x752f,-0x8(%rbp)
jge    12d4 <main+0x1b4>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12b2 <main+0x192>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    %eax,%esi
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%r14
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    115c <main+0x2c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xffffffff,%ebx
add    $0x1,%bpl
cmp    $0xffffffce,%ebx
je     1196 <main+0x66>
movzbl %bpl,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
lea    (%rax,%rax,4),%eax
mov    $0xfc,%r15b
sub    %al,%r15b
xor    %eax,%eax
call   1030 <genrand@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %bl,%r15b
jne    1150 <main+0x20>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1150 <main+0x20>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1030 <genrand@plt>
mov    $0x3b4,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <genrand@plt>
add    $0xffffffff,%ebx
jne    11b0 <main+0x80>
xor    %eax,%eax
call   1030 <genrand@plt>
lea    0xe3d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xf9f,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <genrand@plt>
add    $0xffffffff,%ebx
jne    11e0 <main+0xb0>
xor    %eax,%eax
call   1030 <genrand@plt>
lea    0xe1b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1387,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <genrand@plt>
add    $0xffffffff,%ebx
jne    1210 <main+0xe0>
xor    %eax,%eax
call   1030 <genrand@plt>
lea    0xdf9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x270f,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <genrand@plt>
add    $0xffffffff,%ebx
jne    1240 <main+0x110>
xor    %eax,%eax
call   1030 <genrand@plt>
lea    0xdd7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x270f,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <genrand@plt>
add    $0xffffffff,%ebx
jne    1270 <main+0x140>
xor    %eax,%eax
call   1030 <genrand@plt>
lea    0xdb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%12lu \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [14 x i8] c" 1000: %08lx\0A\00"
@.str.3 = [14 x i8] c" 5000: %08lx\0A\00"
@.str.4 = [14 x i8] c"10000: %08lx\0A\00"
@.str.5 = [14 x i8] c"20000: %08lx\0A\00"
@.str.6 = [14 x i8] c"30000: %08lx\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 50
br i1 %5, label %6, label %18
6: ; preds = %3
%7 = call i32 (...) @genrand()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = srem i32 %9, 5
%11 = icmp eq i32 %10, 4
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
br label %15
15: ; preds = %14
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %3
18: ; preds = %3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 (...) @genrand()
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %23
23: ; preds = %28, %18
%24 = load i32, i32* %2
%25 = icmp slt i32 %24, 999
br i1 %25, label %26, label %31
26: ; preds = %23
%27 = call i32 (...) @genrand()
br label %28
28: ; preds = %26
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %23
31: ; preds = %23
%32 = call i32 (...) @genrand()
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %36
36: ; preds = %41, %31
%37 = load i32, i32* %2
%38 = icmp slt i32 %37, 4999
br i1 %38, label %39, label %44
39: ; preds = %36
%40 = call i32 (...) @genrand()
br label %41
41: ; preds = %39
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
br label %36
44: ; preds = %36
%45 = call i32 (...) @genrand()
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %49
49: ; preds = %54, %44
%50 = load i32, i32* %2
%51 = icmp slt i32 %50, 9999
br i1 %51, label %52, label %57
52: ; preds = %49
%53 = call i32 (...) @genrand()
br label %54
54: ; preds = %52
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 1
store i32 %56, i32* %2
br label %49
57: ; preds = %49
%58 = call i32 (...) @genrand()
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %58)
%60 = load i32, i32* %2
%61 = add nsw i32 %60, 1
store i32 %61, i32* %2
br label %62
62: ; preds = %67, %57
%63 = load i32, i32* %2
%64 = icmp slt i32 %63, 19999
br i1 %64, label %65, label %70
65: ; preds = %62
%66 = call i32 (...) @genrand()
br label %67
67: ; preds = %65
%68 = load i32, i32* %2
%69 = add nsw i32 %68, 1
store i32 %69, i32* %2
br label %62
70: ; preds = %62
%71 = call i32 (...) @genrand()
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %71)
%73 = load i32, i32* %2
%74 = add nsw i32 %73, 1
store i32 %74, i32* %2
br label %75
75: ; preds = %80, %70
%76 = load i32, i32* %2
%77 = icmp slt i32 %76, 29999
br i1 %77, label %78, label %83
78: ; preds = %75
%79 = call i32 (...) @genrand()
br label %80
80: ; preds = %78
%81 = load i32, i32* %2
%82 = add nsw i32 %81, 1
store i32 %82, i32* %2
br label %75
83: ; preds = %75
%84 = call i32 (...) @genrand()
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %84)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%12lu \00"
@.str.2 = [14 x i8] c" 1000: %08lx\0A\00"
@.str.3 = [14 x i8] c" 5000: %08lx\0A\00"
@.str.4 = [14 x i8] c"10000: %08lx\0A\00"
@.str.5 = [14 x i8] c"20000: %08lx\0A\00"
@.str.6 = [14 x i8] c"30000: %08lx\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %10
%2 = phi i32 [ 0, %0 ], [ %11, %10 ]
%3 = tail call i32 (...) @genrand()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = trunc i32 %2 to i8
%6 = urem i8 %5, 5
%7 = icmp eq i8 %6, 4
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @putchar(i32 10)
br label %10
10: ; preds = %1, %8
%11 = add nuw nsw i32 %2, 1
%12 = icmp eq i32 %11, 50
br i1 %12, label %13, label %1
13: ; preds = %10
%14 = tail call i32 @putchar(i32 10)
%15 = tail call i32 (...) @genrand()
br label %16
16: ; preds = %13, %16
%17 = phi i32 [ %18, %16 ], [ 50, %13 ]
%18 = add nuw nsw i32 %17, 1
%19 = tail call i32 (...) @genrand()
%20 = icmp eq i32 %18, 998
br i1 %20, label %21, label %16
21: ; preds = %16
%22 = tail call i32 (...) @genrand()
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %21, %24
%25 = phi i32 [ %27, %24 ], [ 1000, %21 ]
%26 = tail call i32 (...) @genrand()
%27 = add nuw nsw i32 %25, 1
%28 = icmp eq i32 %27, 4999
br i1 %28, label %29, label %24
29: ; preds = %24
%30 = tail call i32 (...) @genrand()
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %29, %32
%33 = phi i32 [ %34, %32 ], [ 4999, %29 ]
%34 = add nuw nsw i32 %33, 1
%35 = tail call i32 (...) @genrand()
%36 = icmp eq i32 %34, 9998
br i1 %36, label %37, label %32
37: ; preds = %32
%38 = tail call i32 (...) @genrand()
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %37, %40
%41 = phi i32 [ %43, %40 ], [ 10000, %37 ]
%42 = tail call i32 (...) @genrand()
%43 = add nuw nsw i32 %41, 1
%44 = icmp eq i32 %43, 19999
br i1 %44, label %45, label %40
45: ; preds = %40
%46 = tail call i32 (...) @genrand()
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %45, %48
%49 = phi i32 [ %50, %48 ], [ 19999, %45 ]
%50 = add nuw nsw i32 %49, 1
%51 = tail call i32 (...) @genrand()
%52 = icmp eq i32 %50, 29998
br i1 %52, label %53, label %48
53: ; preds = %48
%54 = tail call i32 (...) @genrand()
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %54)
ret i32 0
}