#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_int32();
int /*<<< orphan*/ init_by_array(unsigned long *, unsigned long);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int i;
  unsigned long init[4] = {0x123, 0x234, 0x345, 0x456}, length = 4;
  init_by_array(init, length);
  for (i = 0; i < 20; i++) {
    printf("%10lu ", genrand_int32());
    if (i % 5 == 4)
      printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0x4,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1050 <init_by_array@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    11dd <main+0xad>
mov    $0x0,%al
call   1030 <genrand_int32@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x4,%edx
jne    11ca <main+0x9a>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11cf <main+0x9f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1187 <main+0x57>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
movaps 0xebf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1060 <init_by_array@plt>
lea    0xeab(%rip),%r14
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    118c <main+0x4c>
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ebx
add    $0x1,%bpl
cmp    $0xffffffec,%ebx
je     11c6 <main+0x86>
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   1040 <genrand_int32@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %bl,%r15b
jne    1180 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1180 <main+0x40>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.init = [4 x i64] [i64 291, i64 564, i64 837, i64 1110]
@.str = [7 x i8] c"%10lu \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x i64]
%4 = alloca i64
store i32 0, i32* %1
%5 = bitcast [4 x i64]* %3 to i8*
store i64 4, i64* %4
%6 = getelementptr inbounds [4 x i64], [4 x i64]* %3, i64 0, i64 0
%7 = load i64, i64* %4
%8 = call i32 @init_by_array(i64* %6, i64 %7)
store i32 0, i32* %2
br label %9
9: ; preds = %21, %0
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 20
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = call i32 (...) @genrand_int32()
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %2
%16 = srem i32 %15, 5
%17 = icmp eq i32 %16, 4
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %9
24: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@__const.main.init = [4 x i64] [i64 291, i64 564, i64 837, i64 1110]
@.str = [7 x i8] c"%10lu \00"
define i32 @main() {
%1 = alloca [4 x i64]
%2 = bitcast [4 x i64]* %1 to i8*
%3 = getelementptr inbounds [4 x i64], [4 x i64]* %1, i64 0, i64 0
%4 = call i32 @init_by_array(i64* %3, i64 4)
br label %5
5: ; preds = %0, %14
%6 = phi i32 [ 0, %0 ], [ %15, %14 ]
%7 = call i32 (...) @genrand_int32()
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = trunc i32 %6 to i8
%10 = urem i8 %9, 5
%11 = icmp eq i8 %10, 4
br i1 %11, label %12, label %14
12: ; preds = %5
%13 = call i32 @putchar(i32 10)
br label %14
14: ; preds = %5, %12
%15 = add nuw nsw i32 %6, 1
%16 = icmp eq i32 %15, 20
br i1 %16, label %17, label %5
17: ; preds = %14
ret i32 0
}