#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 genrand();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ sgenrand(int);
int main() {
  int j;
  sgenrand(4357);
  for (j = 0; j < 32; j++) {
    printf("0x%08x ", genrand());
    if (j % 4 == 3)
      putchar('\n');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1105,%edi
call   1060 <sgenrand@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    11b0 <main+0x70>
mov    $0x0,%al
call   1030 <genrand@plt>
mov    %eax,%esi
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x3,%edx
jne    119d <main+0x5d>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    11a2 <main+0x62>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1160 <main+0x20>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1105,%edi
call   1060 <sgenrand@plt>
lea    0xeac(%rip),%rbx
xor    %ebp,%ebp
jmp    1168 <main+0x28>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    $0x20,%ebp
je     118d <main+0x4d>
xor    %eax,%eax
call   1030 <genrand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %ebp,%eax
not    %eax
test   $0x3,%al
jne    1160 <main+0x20>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1160 <main+0x20>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"0x%08x \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sgenrand(i32 4357)
store i32 0, i32* %2
br label %4
4: ; preds = %16, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = call i32 (...) @genrand()
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
%11 = srem i32 %10, 4
%12 = icmp eq i32 %11, 3
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 @putchar(i8 signext 10)
br label %15
15: ; preds = %13, %7
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %4
19: ; preds = %4
%20 = call i32 @putchar(i8 signext 10)
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str = [8 x i8] c"0x%08x \00"
define i32 @main() {
%1 = tail call i32 @sgenrand(i32 4357)
br label %2
2: ; preds = %0, %10
%3 = phi i32 [ 0, %0 ], [ %11, %10 ]
%4 = tail call i32 (...) @genrand()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = and i32 %3, 3
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @putchar(i8 signext 10)
br label %10
10: ; preds = %2, %8
%11 = add nuw nsw i32 %3, 1
%12 = icmp eq i32 %11, 32
br i1 %12, label %13, label %2
13: ; preds = %10
%14 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}