#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 */
typedef int time_t;
struct drand48_data {
  int dummy;
};

/* Variables and functions */
long INT32_MAX;
long INT32_MIN;
double drand48();
scalar_t__ drand48_r(struct drand48_data *, double *);
double erand48(unsigned short *);
scalar_t__ erand48_r(unsigned short *, struct drand48_data *, double *);
long jrand48(unsigned short *);
scalar_t__ jrand48_r(unsigned short *, struct drand48_data *, long *);
long lrand48();
scalar_t__ lrand48_r(struct drand48_data *, long *);
long mrand48();
scalar_t__ mrand48_r(struct drand48_data *, long *);
long nrand48(unsigned short *);
scalar_t__ nrand48_r(unsigned short *, struct drand48_data *, long *);
int /*<<< orphan*/ printf(char *, int, long);
int /*<<< orphan*/ srand48(long);
int /*<<< orphan*/ srand48_r(long, struct drand48_data *);
int time(int /*<<< orphan*/ *);
int main(void) {
  time_t t = time(NULL);
  int i, ret = 0;
  double d;
  long int l;
  struct drand48_data data;
  unsigned short int buf[3];
  srand48((long int)t);
  for (i = 0; i < 50; i++)
    if ((d = drand48()) < 0.0 || d >= 1.0) {
      printf("drand48 %d %g\n", i, d);
      ret = 1;
    }
  srand48_r((long int)t, &data);
  for (i = 0; i < 50; i++)
    if (drand48_r(&data, &d) != 0 || d < 0.0 || d >= 1.0) {
      printf("drand48_r %d %g\n", i, d);
      ret = 1;
    }
  buf[2] = (t & 0xffff0000) >> 16;
  buf[1] = (t & 0xffff);
  buf[0] = 0x330e;
  for (i = 0; i < 50; i++)
    if ((d = erand48(buf)) < 0.0 || d >= 1.0) {
      printf("erand48 %d %g\n", i, d);
      ret = 1;
    }
  buf[2] = (t & 0xffff0000) >> 16;
  buf[1] = (t & 0xffff);
  buf[0] = 0x330e;
  for (i = 0; i < 50; i++)
    if (erand48_r(buf, &data, &d) != 0 || d < 0.0 || d >= 1.0) {
      printf("erand48_r %d %g\n", i, d);
      ret = 1;
    }
  srand48((long int)t);
  for (i = 0; i < 50; i++)
    if ((l = lrand48()) < 0 || l > INT32_MAX) {
      printf("lrand48 %d %ld\n", i, l);
      ret = 1;
    }
  srand48_r((long int)t, &data);
  for (i = 0; i < 50; i++)
    if (lrand48_r(&data, &l) != 0 || l < 0 || l > INT32_MAX) {
      printf("lrand48_r %d %ld\n", i, l);
      ret = 1;
    }
  buf[2] = (t & 0xffff0000) >> 16;
  buf[1] = (t & 0xffff);
  buf[0] = 0x330e;
  for (i = 0; i < 50; i++)
    if ((l = nrand48(buf)) < 0 || l > INT32_MAX) {
      printf("nrand48 %d %ld\n", i, l);
      ret = 1;
    }
  buf[2] = (t & 0xffff0000) >> 16;
  buf[1] = (t & 0xffff);
  buf[0] = 0x330e;
  for (i = 0; i < 50; i++)
    if (nrand48_r(buf, &data, &l) != 0 || l < 0 || l > INT32_MAX) {
      printf("nrand48_r %d %ld\n", i, l);
      ret = 1;
    }
  srand48((long int)t);
  for (i = 0; i < 50; i++)
    if ((l = mrand48()) < INT32_MIN || l > INT32_MAX) {
      printf("mrand48 %d %ld\n", i, l);
      ret = 1;
    }
  srand48_r((long int)t, &data);
  for (i = 0; i < 50; i++)
    if (mrand48_r(&data, &l) != 0 || l < INT32_MIN || l > INT32_MAX) {
      printf("mrand48_r %d %ld\n", i, l);
      ret = 1;
    }
  buf[2] = (t & 0xffff0000) >> 16;
  buf[1] = (t & 0xffff);
  buf[0] = 0x330e;
  for (i = 0; i < 50; i++)
    if ((l = jrand48(buf)) < INT32_MIN || l > INT32_MAX) {
      printf("jrand48 %d %ld\n", i, l);
      ret = 1;
    }
  buf[2] = (t & 0xffff0000) >> 16;
  buf[1] = (t & 0xffff);
  buf[0] = 0x330e;
  for (i = 0; i < 50; i++)
    if (jrand48_r(buf, &data, &l) != 0 || l < INT32_MIN || l > INT32_MAX) {
      printf("jrand48_r %d %ld\n", i, l);
      ret = 1;
    }
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movslq -0x8(%rbp),%rdi
call   10c0 <srand48@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    129e <main+0x9e>
mov    $0x0,%al
call   1120 <drand48@plt>
movaps %xmm0,%xmm1
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     126f <main+0x6f>
movsd  -0x18(%rbp),%xmm0
movsd  0xd9b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     128b <main+0x8b>
mov    -0xc(%rbp),%esi
cvttsd2si -0x18(%rbp),%rdx
lea    0xd89(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    1290 <main+0x90>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1232 <main+0x32>
movslq -0x8(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   10d0 <srand48_r@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1327 <main+0x127>
lea    -0x28(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1110 <drand48_r@plt>
cmp    $0x0,%rax
jne    12f8 <main+0xf8>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     12f8 <main+0xf8>
movsd  -0x18(%rbp),%xmm0
movsd  0xd12(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1314 <main+0x114>
mov    -0xc(%rbp),%esi
cvttsd2si -0x18(%rbp),%rdx
lea    0xd0f(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    1319 <main+0x119>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12b2 <main+0xb2>
mov    -0x8(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    %ax,-0x2a(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0x2c(%rbp)
movw   $0x330e,-0x2e(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    13bd <main+0x1bd>
lea    -0x2e(%rbp),%rdi
call   10f0 <erand48@plt>
movaps %xmm0,%xmm1
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     138e <main+0x18e>
movsd  -0x18(%rbp),%xmm0
movsd  0xc7c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     13aa <main+0x1aa>
mov    -0xc(%rbp),%esi
cvttsd2si -0x18(%rbp),%rdx
lea    0xc8a(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    13af <main+0x1af>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    134f <main+0x14f>
mov    -0x8(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    %ax,-0x2a(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0x2c(%rbp)
movw   $0x330e,-0x2e(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    145e <main+0x25e>
lea    -0x2e(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   10e0 <erand48_r@plt>
cmp    $0x0,%rax
jne    142f <main+0x22f>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     142f <main+0x22f>
movsd  -0x18(%rbp),%xmm0
movsd  0xbdb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     144b <main+0x24b>
mov    -0xc(%rbp),%esi
cvttsd2si -0x18(%rbp),%rdx
lea    0xbf8(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    1450 <main+0x250>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13e5 <main+0x1e5>
movslq -0x8(%rbp),%rdi
call   10c0 <srand48@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    14ce <main+0x2ce>
mov    $0x0,%al
call   10b0 <lrand48@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jl     14a1 <main+0x2a1>
mov    -0x20(%rbp),%rax
mov    0x2b48(%rip),%rcx
cmp    (%rcx),%rax
jle    14bb <main+0x2bb>
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xb99(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    14c0 <main+0x2c0>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    146e <main+0x26e>
movslq -0x8(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   10d0 <srand48_r@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    154f <main+0x34f>
lea    -0x28(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1080 <lrand48_r@plt>
cmp    $0x0,%rax
jne    1522 <main+0x322>
cmpq   $0x0,-0x20(%rbp)
jl     1522 <main+0x322>
mov    -0x20(%rbp),%rax
mov    0x2ac7(%rip),%rcx
cmp    (%rcx),%rax
jle    153c <main+0x33c>
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xb28(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    1541 <main+0x341>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    14e2 <main+0x2e2>
mov    -0x8(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    %ax,-0x2a(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0x2c(%rbp)
movw   $0x330e,-0x2e(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    15d9 <main+0x3d9>
lea    -0x2e(%rbp),%rdi
call   1030 <nrand48@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jl     15ac <main+0x3ac>
mov    -0x20(%rbp),%rax
mov    0x2a3d(%rip),%rcx
cmp    (%rcx),%rax
jle    15c6 <main+0x3c6>
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xab0(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    15cb <main+0x3cb>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1577 <main+0x377>
mov    -0x8(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    %ax,-0x2a(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0x2c(%rbp)
movw   $0x330e,-0x2e(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1672 <main+0x472>
lea    -0x2e(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   10a0 <nrand48_r@plt>
cmp    $0x0,%rax
jne    1645 <main+0x445>
cmpq   $0x0,-0x20(%rbp)
jl     1645 <main+0x445>
mov    -0x20(%rbp),%rax
mov    0x29a4(%rip),%rcx
cmp    (%rcx),%rax
jle    165f <main+0x45f>
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xa27(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    1664 <main+0x464>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1601 <main+0x401>
movslq -0x8(%rbp),%rdi
call   10c0 <srand48@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    16e8 <main+0x4e8>
mov    $0x0,%al
call   1060 <mrand48@plt>
mov    %rax,-0x20(%rbp)
mov    0x293a(%rip),%rcx
cmp    (%rcx),%rax
jl     16bb <main+0x4bb>
mov    -0x20(%rbp),%rax
mov    0x292e(%rip),%rcx
cmp    (%rcx),%rax
jle    16d5 <main+0x4d5>
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0x9c3(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    16da <main+0x4da>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1682 <main+0x482>
movslq -0x8(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   10d0 <srand48_r@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1772 <main+0x572>
lea    -0x28(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <mrand48_r@plt>
cmp    $0x0,%rax
jne    1745 <main+0x545>
mov    -0x20(%rbp),%rax
mov    0x28b0(%rip),%rcx
cmp    (%rcx),%rax
jl     1745 <main+0x545>
mov    -0x20(%rbp),%rax
mov    0x28a4(%rip),%rcx
cmp    (%rcx),%rax
jle    175f <main+0x55f>
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0x949(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    1764 <main+0x564>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    16fc <main+0x4fc>
mov    -0x8(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    %ax,-0x2a(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0x2c(%rbp)
movw   $0x330e,-0x2e(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1802 <main+0x602>
lea    -0x2e(%rbp),%rdi
call   1100 <jrand48@plt>
mov    %rax,-0x20(%rbp)
mov    0x2820(%rip),%rcx
cmp    (%rcx),%rax
jl     17d5 <main+0x5d5>
mov    -0x20(%rbp),%rax
mov    0x2814(%rip),%rcx
cmp    (%rcx),%rax
jle    17ef <main+0x5ef>
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0x8cb(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    17f4 <main+0x5f4>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    179a <main+0x59a>
mov    -0x8(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    %ax,-0x2a(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0x2c(%rbp)
movw   $0x330e,-0x2e(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    18a4 <main+0x6a4>
lea    -0x2e(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1090 <jrand48_r@plt>
cmp    $0x0,%rax
jne    1877 <main+0x677>
mov    -0x20(%rbp),%rax
mov    0x277e(%rip),%rcx
cmp    (%rcx),%rax
jl     1877 <main+0x677>
mov    -0x20(%rbp),%rax
mov    0x2772(%rip),%rcx
cmp    (%rcx),%rax
jle    1891 <main+0x691>
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0x839(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    1896 <main+0x696>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    182a <main+0x62a>
mov    -0x10(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
xor    %edi,%edi
call   1070 <time@plt>
movslq %eax,%r12
mov    %r12,%rdi
call   10c0 <srand48@plt>
lea    0xde9(%rip),%r14
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    1258 <main+0x58>
nopl   (%rax)
cvttsd2si %xmm1,%rdx
mov    %r14,%rdi
mov    %ebx,%esi
movsd  %xmm1,0x28(%rsp)
call   1050 <printf@plt>
movsd  0x28(%rsp),%xmm1
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     1279 <main+0x79>
xor    %eax,%eax
call   1120 <drand48@plt>
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1230 <main+0x30>
ucomisd 0xd8b(%rip),%xmm1
jb     1250 <main+0x50>
jmp    1230 <main+0x30>
movsd  %xmm1,0x30(%rsp)
lea    0x10(%rsp),%r15
mov    %r12,0x28(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
call   10d0 <srand48_r@plt>
xor    %ebx,%ebx
lea    0x30(%rsp),%r12
lea    0xd7d(%rip),%r14
jmp    12cc <main+0xcc>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cvttsd2si %xmm0,%rdx
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     12f8 <main+0xf8>
mov    %r15,%rdi
mov    %r12,%rsi
call   1110 <drand48_r@plt>
movsd  0x30(%rsp),%xmm0
test   %rax,%rax
jne    12b0 <main+0xb0>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     12b0 <main+0xb0>
ucomisd 0xd0c(%rip),%xmm0
jb     12c4 <main+0xc4>
jmp    12b0 <main+0xb0>
mov    0x28(%rsp),%r12
mov    %r12d,%eax
shr    $0x10,%eax
mov    %eax,0x24(%rsp)
mov    %r12d,0xc(%rsp)
movw   $0x330e,0xa(%rsp)
xor    %ebx,%ebx
lea    0xa(%rsp),%r14
lea    0xd0f(%rip),%r15
jmp    134c <main+0x14c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cvttsd2si %xmm0,%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     1370 <main+0x170>
mov    %r14,%rdi
call   10f0 <erand48@plt>
movsd  %xmm0,0x30(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     1330 <main+0x130>
ucomisd 0xc94(%rip),%xmm0
jb     1344 <main+0x144>
jmp    1330 <main+0x130>
mov    0x24(%rsp),%eax
mov    %ax,0xe(%rsp)
mov    %r12w,0xc(%rsp)
movw   $0x330e,0xa(%rsp)
xor    %ebx,%ebx
lea    0xa(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0x30(%rsp),%r13
lea    0xca1(%rip),%r14
jmp    13bc <main+0x1bc>
cvttsd2si %xmm0,%rdx
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     13eb <main+0x1eb>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   10e0 <erand48_r@plt>
movsd  0x30(%rsp),%xmm0
test   %rax,%rax
jne    13a0 <main+0x1a0>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     13a0 <main+0x1a0>
ucomisd 0xc19(%rip),%xmm0
jb     13b4 <main+0x1b4>
jmp    13a0 <main+0x1a0>
mov    0x28(%rsp),%r15
mov    %r15,%rdi
call   10c0 <srand48@plt>
lea    0xc51(%rip),%r14
xor    %ebx,%ebx
jmp    142a <main+0x22a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1050 <printf@plt>
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     1449 <main+0x249>
xor    %eax,%eax
call   10b0 <lrand48@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
js     1410 <main+0x210>
mov    0x2b9e(%rip),%rcx
cmp    (%rcx),%rax
jle    1422 <main+0x222>
jmp    1410 <main+0x210>
lea    0x10(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   10d0 <srand48_r@plt>
xor    %ebx,%ebx
lea    0x18(%rsp),%r15
lea    0xbf9(%rip),%r12
jmp    1487 <main+0x287>
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     14af <main+0x2af>
mov    %r14,%rdi
mov    %r15,%rsi
call   1080 <lrand48_r@plt>
mov    0x18(%rsp),%rdx
test   %rax,%rax
jne    1470 <main+0x270>
test   %rdx,%rdx
js     1470 <main+0x270>
mov    0x2b38(%rip),%rax
cmp    (%rax),%rdx
jle    147f <main+0x27f>
jmp    1470 <main+0x270>
mov    0x24(%rsp),%eax
mov    %ax,0xe(%rsp)
mov    0x28(%rsp),%r12
mov    %r12w,0xc(%rsp)
movw   $0x330e,0xa(%rsp)
xor    %ebx,%ebx
lea    0xa(%rsp),%r14
lea    0xb9a(%rip),%r15
jmp    14fa <main+0x2fa>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1050 <printf@plt>
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     151a <main+0x31a>
mov    %r14,%rdi
call   1030 <nrand48@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
js     14e0 <main+0x2e0>
mov    0x2acd(%rip),%rcx
cmp    (%rcx),%rax
jle    14f2 <main+0x2f2>
jmp    14e0 <main+0x2e0>
mov    0x24(%rsp),%eax
mov    %ax,0xe(%rsp)
mov    %r12w,0xc(%rsp)
movw   $0x330e,0xa(%rsp)
xor    %ebx,%ebx
lea    0xa(%rsp),%r15
lea    0x10(%rsp),%r14
lea    0x18(%rsp),%r12
lea    0xb3a(%rip),%r13
jmp    1567 <main+0x367>
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     1592 <main+0x392>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   10a0 <nrand48_r@plt>
mov    0x18(%rsp),%rdx
test   %rax,%rax
jne    1550 <main+0x350>
test   %rdx,%rdx
js     1550 <main+0x350>
mov    0x2a55(%rip),%rax
cmp    (%rax),%rdx
jle    155f <main+0x35f>
jmp    1550 <main+0x350>
mov    0x28(%rsp),%r15
mov    %r15,%rdi
call   10c0 <srand48@plt>
mov    0x2a32(%rip),%r13
lea    0xae7(%rip),%r14
xor    %ebx,%ebx
jmp    15da <main+0x3da>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1050 <printf@plt>
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     15fa <main+0x3fa>
xor    %eax,%eax
call   1060 <mrand48@plt>
mov    %rax,0x18(%rsp)
cmp    0x0(%r13),%rax
jl     15c0 <main+0x3c0>
mov    0x29ed(%rip),%rcx
cmp    (%rcx),%rax
jle    15d2 <main+0x3d2>
jmp    15c0 <main+0x3c0>
lea    0x10(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   10d0 <srand48_r@plt>
xor    %ebx,%ebx
lea    0x18(%rsp),%r15
lea    0xa8c(%rip),%r12
jmp    1637 <main+0x437>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     1660 <main+0x460>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <mrand48_r@plt>
mov    0x18(%rsp),%rdx
test   %rax,%rax
jne    1620 <main+0x420>
cmp    0x0(%r13),%rdx
jl     1620 <main+0x420>
mov    0x2987(%rip),%rax
cmp    (%rax),%rdx
jle    162f <main+0x42f>
jmp    1620 <main+0x420>
mov    0x24(%rsp),%eax
mov    %ax,0xe(%rsp)
mov    0x28(%rsp),%r12
mov    %r12w,0xc(%rsp)
movw   $0x330e,0xa(%rsp)
xor    %ebx,%ebx
lea    0xa(%rsp),%r14
lea    0xa2d(%rip),%r15
jmp    16aa <main+0x4aa>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1050 <printf@plt>
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     16cb <main+0x4cb>
mov    %r14,%rdi
call   1100 <jrand48@plt>
mov    %rax,0x18(%rsp)
cmp    0x0(%r13),%rax
jl     1690 <main+0x490>
mov    0x291c(%rip),%rcx
cmp    (%rcx),%rax
jle    16a2 <main+0x4a2>
jmp    1690 <main+0x490>
mov    0x24(%rsp),%eax
mov    %ax,0xe(%rsp)
mov    %r12w,0xc(%rsp)
movw   $0x330e,0xa(%rsp)
xor    %ebx,%ebx
lea    0xa(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0x18(%rsp),%r12
jmp    171b <main+0x51b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x9bf(%rip),%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
mov    $0x1,%ebp
add    $0x1,%ebx
cmp    $0x32,%ebx
je     1747 <main+0x547>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1090 <jrand48_r@plt>
mov    0x18(%rsp),%rdx
test   %rax,%rax
jne    1700 <main+0x500>
cmp    0x0(%r13),%rdx
jl     1700 <main+0x500>
mov    0x28a0(%rip),%rax
cmp    (%rax),%rdx
jle    1713 <main+0x513>
jmp    1700 <main+0x500>
mov    %ebp,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.drand48_data = type { i32 }
@.str = [15 x i8] c"drand48 %d %g\0A\00"
@.str.1 = [17 x i8] c"drand48_r %d %g\0A\00"
@.str.2 = [15 x i8] c"erand48 %d %g\0A\00"
@.str.3 = [17 x i8] c"erand48_r %d %g\0A\00"
@INT32_MAX = global i64 0
@.str.4 = [16 x i8] c"lrand48 %d %ld\0A\00"
@.str.5 = [18 x i8] c"lrand48_r %d %ld\0A\00"
@.str.6 = [16 x i8] c"nrand48 %d %ld\0A\00"
@.str.7 = [18 x i8] c"nrand48_r %d %ld\0A\00"
@INT32_MIN = global i64 0
@.str.8 = [16 x i8] c"mrand48 %d %ld\0A\00"
@.str.9 = [18 x i8] c"mrand48_r %d %ld\0A\00"
@.str.10 = [16 x i8] c"jrand48 %d %ld\0A\00"
@.str.11 = [18 x i8] c"jrand48_r %d %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca i64
%7 = alloca %struct.drand48_data
%8 = alloca [3 x i16]
store i32 0, i32* %1
%9 = call i32 @time(i32* null)
store i32 %9, i32* %2
store i32 0, i32* %4
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = call i32 @srand48(i64 %11)
store i32 0, i32* %3
br label %13
13: ; preds = %28, %0
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 50
br i1 %15, label %16, label %31
16: ; preds = %13
%17 = call double (...) @drand48()
store double %17, double* %5
%18 = fcmp olt double %17, 0.000000e+00
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load double, double* %5
%21 = fcmp oge double %20, 1.000000e+00
br i1 %21, label %22, label %27
22: ; preds = %19, %16
%23 = load i32, i32* %3
%24 = load double, double* %5
%25 = fptosi double %24 to i64
%26 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %23, i64 %25)
store i32 1, i32* %4
br label %27
27: ; preds = %22, %19
br label %28
28: ; preds = %27
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %13
31: ; preds = %13
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = call i32 @srand48_r(i64 %33, %struct.drand48_data* %7)
store i32 0, i32* %3
br label %35
35: ; preds = %53, %31
%36 = load i32, i32* %3
%37 = icmp slt i32 %36, 50
br i1 %37, label %38, label %56
38: ; preds = %35
%39 = call i64 @drand48_r(%struct.drand48_data* %7, double* %5)
%40 = icmp ne i64 %39, 0
br i1 %40, label %47, label %41
41: ; preds = %38
%42 = load double, double* %5
%43 = fcmp olt double %42, 0.000000e+00
br i1 %43, label %47, label %44
44: ; preds = %41
%45 = load double, double* %5
%46 = fcmp oge double %45, 1.000000e+00
br i1 %46, label %47, label %52
47: ; preds = %44, %41, %38
%48 = load i32, i32* %3
%49 = load double, double* %5
%50 = fptosi double %49 to i64
%51 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %48, i64 %50)
store i32 1, i32* %4
br label %52
52: ; preds = %47, %44
br label %53
53: ; preds = %52
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %35
56: ; preds = %35
%57 = load i32, i32* %2
%58 = and i32 %57, -65536
%59 = lshr i32 %58, 16
%60 = trunc i32 %59 to i16
%61 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 2
store i16 %60, i16* %61
%62 = load i32, i32* %2
%63 = and i32 %62, 65535
%64 = trunc i32 %63 to i16
%65 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 1
store i16 %64, i16* %65
%66 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
store i16 13070, i16* %66
store i32 0, i32* %3
br label %67
67: ; preds = %83, %56
%68 = load i32, i32* %3
%69 = icmp slt i32 %68, 50
br i1 %69, label %70, label %86
70: ; preds = %67
%71 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
%72 = call double @erand48(i16* %71)
store double %72, double* %5
%73 = fcmp olt double %72, 0.000000e+00
br i1 %73, label %77, label %74
74: ; preds = %70
%75 = load double, double* %5
%76 = fcmp oge double %75, 1.000000e+00
br i1 %76, label %77, label %82
77: ; preds = %74, %70
%78 = load i32, i32* %3
%79 = load double, double* %5
%80 = fptosi double %79 to i64
%81 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %78, i64 %80)
store i32 1, i32* %4
br label %82
82: ; preds = %77, %74
br label %83
83: ; preds = %82
%84 = load i32, i32* %3
%85 = add nsw i32 %84, 1
store i32 %85, i32* %3
br label %67
86: ; preds = %67
%87 = load i32, i32* %2
%88 = and i32 %87, -65536
%89 = lshr i32 %88, 16
%90 = trunc i32 %89 to i16
%91 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 2
store i16 %90, i16* %91
%92 = load i32, i32* %2
%93 = and i32 %92, 65535
%94 = trunc i32 %93 to i16
%95 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 1
store i16 %94, i16* %95
%96 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
store i16 13070, i16* %96
store i32 0, i32* %3
br label %97
97: ; preds = %116, %86
%98 = load i32, i32* %3
%99 = icmp slt i32 %98, 50
br i1 %99, label %100, label %119
100: ; preds = %97
%101 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
%102 = call i64 @erand48_r(i16* %101, %struct.drand48_data* %7, double* %5)
%103 = icmp ne i64 %102, 0
br i1 %103, label %110, label %104
104: ; preds = %100
%105 = load double, double* %5
%106 = fcmp olt double %105, 0.000000e+00
br i1 %106, label %110, label %107
107: ; preds = %104
%108 = load double, double* %5
%109 = fcmp oge double %108, 1.000000e+00
br i1 %109, label %110, label %115
110: ; preds = %107, %104, %100
%111 = load i32, i32* %3
%112 = load double, double* %5
%113 = fptosi double %112 to i64
%114 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %111, i64 %113)
store i32 1, i32* %4
br label %115
115: ; preds = %110, %107
br label %116
116: ; preds = %115
%117 = load i32, i32* %3
%118 = add nsw i32 %117, 1
store i32 %118, i32* %3
br label %97
119: ; preds = %97
%120 = load i32, i32* %2
%121 = sext i32 %120 to i64
%122 = call i32 @srand48(i64 %121)
store i32 0, i32* %3
br label %123
123: ; preds = %138, %119
%124 = load i32, i32* %3
%125 = icmp slt i32 %124, 50
br i1 %125, label %126, label %141
126: ; preds = %123
%127 = call i64 (...) @lrand48()
store i64 %127, i64* %6
%128 = icmp slt i64 %127, 0
br i1 %128, label %133, label %129
129: ; preds = %126
%130 = load i64, i64* %6
%131 = load i64, i64* @INT32_MAX
%132 = icmp sgt i64 %130, %131
br i1 %132, label %133, label %137
133: ; preds = %129, %126
%134 = load i32, i32* %3
%135 = load i64, i64* %6
%136 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %134, i64 %135)
store i32 1, i32* %4
br label %137
137: ; preds = %133, %129
br label %138
138: ; preds = %137
%139 = load i32, i32* %3
%140 = add nsw i32 %139, 1
store i32 %140, i32* %3
br label %123
141: ; preds = %123
%142 = load i32, i32* %2
%143 = sext i32 %142 to i64
%144 = call i32 @srand48_r(i64 %143, %struct.drand48_data* %7)
store i32 0, i32* %3
br label %145
145: ; preds = %163, %141
%146 = load i32, i32* %3
%147 = icmp slt i32 %146, 50
br i1 %147, label %148, label %166
148: ; preds = %145
%149 = call i64 @lrand48_r(%struct.drand48_data* %7, i64* %6)
%150 = icmp ne i64 %149, 0
br i1 %150, label %158, label %151
151: ; preds = %148
%152 = load i64, i64* %6
%153 = icmp slt i64 %152, 0
br i1 %153, label %158, label %154
154: ; preds = %151
%155 = load i64, i64* %6
%156 = load i64, i64* @INT32_MAX
%157 = icmp sgt i64 %155, %156
br i1 %157, label %158, label %162
158: ; preds = %154, %151, %148
%159 = load i32, i32* %3
%160 = load i64, i64* %6
%161 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %159, i64 %160)
store i32 1, i32* %4
br label %162
162: ; preds = %158, %154
br label %163
163: ; preds = %162
%164 = load i32, i32* %3
%165 = add nsw i32 %164, 1
store i32 %165, i32* %3
br label %145
166: ; preds = %145
%167 = load i32, i32* %2
%168 = and i32 %167, -65536
%169 = lshr i32 %168, 16
%170 = trunc i32 %169 to i16
%171 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 2
store i16 %170, i16* %171
%172 = load i32, i32* %2
%173 = and i32 %172, 65535
%174 = trunc i32 %173 to i16
%175 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 1
store i16 %174, i16* %175
%176 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
store i16 13070, i16* %176
store i32 0, i32* %3
br label %177
177: ; preds = %193, %166
%178 = load i32, i32* %3
%179 = icmp slt i32 %178, 50
br i1 %179, label %180, label %196
180: ; preds = %177
%181 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
%182 = call i64 @nrand48(i16* %181)
store i64 %182, i64* %6
%183 = icmp slt i64 %182, 0
br i1 %183, label %188, label %184
184: ; preds = %180
%185 = load i64, i64* %6
%186 = load i64, i64* @INT32_MAX
%187 = icmp sgt i64 %185, %186
br i1 %187, label %188, label %192
188: ; preds = %184, %180
%189 = load i32, i32* %3
%190 = load i64, i64* %6
%191 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %189, i64 %190)
store i32 1, i32* %4
br label %192
192: ; preds = %188, %184
br label %193
193: ; preds = %192
%194 = load i32, i32* %3
%195 = add nsw i32 %194, 1
store i32 %195, i32* %3
br label %177
196: ; preds = %177
%197 = load i32, i32* %2
%198 = and i32 %197, -65536
%199 = lshr i32 %198, 16
%200 = trunc i32 %199 to i16
%201 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 2
store i16 %200, i16* %201
%202 = load i32, i32* %2
%203 = and i32 %202, 65535
%204 = trunc i32 %203 to i16
%205 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 1
store i16 %204, i16* %205
%206 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
store i16 13070, i16* %206
store i32 0, i32* %3
br label %207
207: ; preds = %226, %196
%208 = load i32, i32* %3
%209 = icmp slt i32 %208, 50
br i1 %209, label %210, label %229
210: ; preds = %207
%211 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
%212 = call i64 @nrand48_r(i16* %211, %struct.drand48_data* %7, i64* %6)
%213 = icmp ne i64 %212, 0
br i1 %213, label %221, label %214
214: ; preds = %210
%215 = load i64, i64* %6
%216 = icmp slt i64 %215, 0
br i1 %216, label %221, label %217
217: ; preds = %214
%218 = load i64, i64* %6
%219 = load i64, i64* @INT32_MAX
%220 = icmp sgt i64 %218, %219
br i1 %220, label %221, label %225
221: ; preds = %217, %214, %210
%222 = load i32, i32* %3
%223 = load i64, i64* %6
%224 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %222, i64 %223)
store i32 1, i32* %4
br label %225
225: ; preds = %221, %217
br label %226
226: ; preds = %225
%227 = load i32, i32* %3
%228 = add nsw i32 %227, 1
store i32 %228, i32* %3
br label %207
229: ; preds = %207
%230 = load i32, i32* %2
%231 = sext i32 %230 to i64
%232 = call i32 @srand48(i64 %231)
store i32 0, i32* %3
br label %233
233: ; preds = %249, %229
%234 = load i32, i32* %3
%235 = icmp slt i32 %234, 50
br i1 %235, label %236, label %252
236: ; preds = %233
%237 = call i64 (...) @mrand48()
store i64 %237, i64* %6
%238 = load i64, i64* @INT32_MIN
%239 = icmp slt i64 %237, %238
br i1 %239, label %244, label %240
240: ; preds = %236
%241 = load i64, i64* %6
%242 = load i64, i64* @INT32_MAX
%243 = icmp sgt i64 %241, %242
br i1 %243, label %244, label %248
244: ; preds = %240, %236
%245 = load i32, i32* %3
%246 = load i64, i64* %6
%247 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %245, i64 %246)
store i32 1, i32* %4
br label %248
248: ; preds = %244, %240
br label %249
249: ; preds = %248
%250 = load i32, i32* %3
%251 = add nsw i32 %250, 1
store i32 %251, i32* %3
br label %233
252: ; preds = %233
%253 = load i32, i32* %2
%254 = sext i32 %253 to i64
%255 = call i32 @srand48_r(i64 %254, %struct.drand48_data* %7)
store i32 0, i32* %3
br label %256
256: ; preds = %275, %252
%257 = load i32, i32* %3
%258 = icmp slt i32 %257, 50
br i1 %258, label %259, label %278
259: ; preds = %256
%260 = call i64 @mrand48_r(%struct.drand48_data* %7, i64* %6)
%261 = icmp ne i64 %260, 0
br i1 %261, label %270, label %262
262: ; preds = %259
%263 = load i64, i64* %6
%264 = load i64, i64* @INT32_MIN
%265 = icmp slt i64 %263, %264
br i1 %265, label %270, label %266
266: ; preds = %262
%267 = load i64, i64* %6
%268 = load i64, i64* @INT32_MAX
%269 = icmp sgt i64 %267, %268
br i1 %269, label %270, label %274
270: ; preds = %266, %262, %259
%271 = load i32, i32* %3
%272 = load i64, i64* %6
%273 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 %271, i64 %272)
store i32 1, i32* %4
br label %274
274: ; preds = %270, %266
br label %275
275: ; preds = %274
%276 = load i32, i32* %3
%277 = add nsw i32 %276, 1
store i32 %277, i32* %3
br label %256
278: ; preds = %256
%279 = load i32, i32* %2
%280 = and i32 %279, -65536
%281 = lshr i32 %280, 16
%282 = trunc i32 %281 to i16
%283 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 2
store i16 %282, i16* %283
%284 = load i32, i32* %2
%285 = and i32 %284, 65535
%286 = trunc i32 %285 to i16
%287 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 1
store i16 %286, i16* %287
%288 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
store i16 13070, i16* %288
store i32 0, i32* %3
br label %289
289: ; preds = %306, %278
%290 = load i32, i32* %3
%291 = icmp slt i32 %290, 50
br i1 %291, label %292, label %309
292: ; preds = %289
%293 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
%294 = call i64 @jrand48(i16* %293)
store i64 %294, i64* %6
%295 = load i64, i64* @INT32_MIN
%296 = icmp slt i64 %294, %295
br i1 %296, label %301, label %297
297: ; preds = %292
%298 = load i64, i64* %6
%299 = load i64, i64* @INT32_MAX
%300 = icmp sgt i64 %298, %299
br i1 %300, label %301, label %305
301: ; preds = %297, %292
%302 = load i32, i32* %3
%303 = load i64, i64* %6
%304 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 %302, i64 %303)
store i32 1, i32* %4
br label %305
305: ; preds = %301, %297
br label %306
306: ; preds = %305
%307 = load i32, i32* %3
%308 = add nsw i32 %307, 1
store i32 %308, i32* %3
br label %289
309: ; preds = %289
%310 = load i32, i32* %2
%311 = and i32 %310, -65536
%312 = lshr i32 %311, 16
%313 = trunc i32 %312 to i16
%314 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 2
store i16 %313, i16* %314
%315 = load i32, i32* %2
%316 = and i32 %315, 65535
%317 = trunc i32 %316 to i16
%318 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 1
store i16 %317, i16* %318
%319 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
store i16 13070, i16* %319
store i32 0, i32* %3
br label %320
320: ; preds = %340, %309
%321 = load i32, i32* %3
%322 = icmp slt i32 %321, 50
br i1 %322, label %323, label %343
323: ; preds = %320
%324 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
%325 = call i64 @jrand48_r(i16* %324, %struct.drand48_data* %7, i64* %6)
%326 = icmp ne i64 %325, 0
br i1 %326, label %335, label %327
327: ; preds = %323
%328 = load i64, i64* %6
%329 = load i64, i64* @INT32_MIN
%330 = icmp slt i64 %328, %329
br i1 %330, label %335, label %331
331: ; preds = %327
%332 = load i64, i64* %6
%333 = load i64, i64* @INT32_MAX
%334 = icmp sgt i64 %332, %333
br i1 %334, label %335, label %339
335: ; preds = %331, %327, %323
%336 = load i32, i32* %3
%337 = load i64, i64* %6
%338 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %336, i64 %337)
store i32 1, i32* %4
br label %339
339: ; preds = %335, %331
br label %340
340: ; preds = %339
%341 = load i32, i32* %3
%342 = add nsw i32 %341, 1
store i32 %342, i32* %3
br label %320
343: ; preds = %320
%344 = load i32, i32* %4
ret i32 %344
}

LLVM IR (-O2):
%struct.drand48_data = type { i32 }
@.str = [15 x i8] c"drand48 %d %g\0A\00"
@.str.1 = [17 x i8] c"drand48_r %d %g\0A\00"
@.str.2 = [15 x i8] c"erand48 %d %g\0A\00"
@.str.3 = [17 x i8] c"erand48_r %d %g\0A\00"
@INT32_MAX = global i64 0
@.str.4 = [16 x i8] c"lrand48 %d %ld\0A\00"
@.str.5 = [18 x i8] c"lrand48_r %d %ld\0A\00"
@.str.6 = [16 x i8] c"nrand48 %d %ld\0A\00"
@.str.7 = [18 x i8] c"nrand48_r %d %ld\0A\00"
@INT32_MIN = global i64 0
@.str.8 = [16 x i8] c"mrand48 %d %ld\0A\00"
@.str.9 = [18 x i8] c"mrand48_r %d %ld\0A\00"
@.str.10 = [16 x i8] c"jrand48 %d %ld\0A\00"
@.str.11 = [18 x i8] c"jrand48_r %d %ld\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca i64
%3 = alloca %struct.drand48_data
%4 = alloca [3 x i16]
%5 = tail call i32 @time(i32* null)
%6 = bitcast double* %1 to i8*
%7 = bitcast i64* %2 to i8*
%8 = bitcast %struct.drand48_data* %3 to i8*
%9 = bitcast [3 x i16]* %4 to i8*
%10 = sext i32 %5 to i64
%11 = tail call i32 @srand48(i64 %10)
br label %12
12: ; preds = %0, %22
%13 = phi i32 [ 0, %0 ], [ %23, %22 ]
%14 = phi i32 [ 0, %0 ], [ %24, %22 ]
%15 = tail call double (...) @drand48()
%16 = fcmp olt double %15, 0.000000e+00
%17 = fcmp oge double %15, 1.000000e+00
%18 = or i1 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = fptosi double %15 to i64
%21 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %14, i64 %20)
br label %22
22: ; preds = %19, %12
%23 = phi i32 [ 1, %19 ], [ %13, %12 ]
%24 = add nuw nsw i32 %14, 1
%25 = icmp eq i32 %24, 50
br i1 %25, label %26, label %12
26: ; preds = %22
store double %15, double* %1
%27 = call i32 @srand48_r(i64 %10, %struct.drand48_data* %3)
br label %28
28: ; preds = %26, %41
%29 = phi i32 [ %23, %26 ], [ %42, %41 ]
%30 = phi i32 [ 0, %26 ], [ %43, %41 ]
%31 = call i64 @drand48_r(%struct.drand48_data* %3, double* %1)
%32 = icmp ne i64 %31, 0
%33 = load double, double* %1
%34 = fcmp olt double %33, 0.000000e+00
%35 = select i1 %32, i1 true, i1 %34
%36 = fcmp oge double %33, 1.000000e+00
%37 = select i1 %35, i1 true, i1 %36
br i1 %37, label %38, label %41
38: ; preds = %28
%39 = fptosi double %33 to i64
%40 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %30, i64 %39)
br label %41
41: ; preds = %38, %28
%42 = phi i32 [ 1, %38 ], [ %29, %28 ]
%43 = add nuw nsw i32 %30, 1
%44 = icmp eq i32 %43, 50
br i1 %44, label %45, label %28
45: ; preds = %41
%46 = lshr i32 %5, 16
%47 = trunc i32 %46 to i16
%48 = getelementptr inbounds [3 x i16], [3 x i16]* %4, i64 0, i64 2
store i16 %47, i16* %48
%49 = trunc i32 %5 to i16
%50 = getelementptr inbounds [3 x i16], [3 x i16]* %4, i64 0, i64 1
store i16 %49, i16* %50
%51 = getelementptr inbounds [3 x i16], [3 x i16]* %4, i64 0, i64 0
store i16 13070, i16* %51
br label %52
52: ; preds = %45, %62
%53 = phi i32 [ %42, %45 ], [ %63, %62 ]
%54 = phi i32 [ 0, %45 ], [ %64, %62 ]
%55 = call double @erand48(i16* %51)
store double %55, double* %1
%56 = fcmp olt double %55, 0.000000e+00
%57 = fcmp oge double %55, 1.000000e+00
%58 = or i1 %56, %57
br i1 %58, label %59, label %62
59: ; preds = %52
%60 = fptosi double %55 to i64
%61 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %54, i64 %60)
br label %62
62: ; preds = %59, %52
%63 = phi i32 [ 1, %59 ], [ %53, %52 ]
%64 = add nuw nsw i32 %54, 1
%65 = icmp eq i32 %64, 50
br i1 %65, label %66, label %52
66: ; preds = %62
store i16 %47, i16* %48
store i16 %49, i16* %50
store i16 13070, i16* %51
br label %67
67: ; preds = %66, %80
%68 = phi i32 [ %63, %66 ], [ %81, %80 ]
%69 = phi i32 [ 0, %66 ], [ %82, %80 ]
%70 = call i64 @erand48_r(i16* %51, %struct.drand48_data* %3, double* %1)
%71 = icmp ne i64 %70, 0
%72 = load double, double* %1
%73 = fcmp olt double %72, 0.000000e+00
%74 = select i1 %71, i1 true, i1 %73
%75 = fcmp oge double %72, 1.000000e+00
%76 = select i1 %74, i1 true, i1 %75
br i1 %76, label %77, label %80
77: ; preds = %67
%78 = fptosi double %72 to i64
%79 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %69, i64 %78)
br label %80
80: ; preds = %77, %67
%81 = phi i32 [ 1, %77 ], [ %68, %67 ]
%82 = add nuw nsw i32 %69, 1
%83 = icmp eq i32 %82, 50
br i1 %83, label %84, label %67
84: ; preds = %80
%85 = call i32 @srand48(i64 %10)
br label %86
86: ; preds = %84, %96
%87 = phi i32 [ %81, %84 ], [ %97, %96 ]
%88 = phi i32 [ 0, %84 ], [ %98, %96 ]
%89 = call i64 (...) @lrand48()
store i64 %89, i64* %2
%90 = icmp slt i64 %89, 0
%91 = load i64, i64* @INT32_MAX
%92 = icmp sgt i64 %89, %91
%93 = select i1 %90, i1 true, i1 %92
br i1 %93, label %94, label %96
94: ; preds = %86
%95 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %88, i64 %89)
br label %96
96: ; preds = %86, %94
%97 = phi i32 [ 1, %94 ], [ %87, %86 ]
%98 = add nuw nsw i32 %88, 1
%99 = icmp eq i32 %98, 50
br i1 %99, label %100, label %86
100: ; preds = %96
%101 = call i32 @srand48_r(i64 %10, %struct.drand48_data* %3)
br label %102
102: ; preds = %100, %115
%103 = phi i32 [ %97, %100 ], [ %116, %115 ]
%104 = phi i32 [ 0, %100 ], [ %117, %115 ]
%105 = call i64 @lrand48_r(%struct.drand48_data* %3, i64* %2)
%106 = icmp ne i64 %105, 0
%107 = load i64, i64* %2
%108 = icmp slt i64 %107, 0
%109 = select i1 %106, i1 true, i1 %108
%110 = load i64, i64* @INT32_MAX
%111 = icmp sgt i64 %107, %110
%112 = select i1 %109, i1 true, i1 %111
br i1 %112, label %113, label %115
113: ; preds = %102
%114 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %104, i64 %107)
br label %115
115: ; preds = %102, %113
%116 = phi i32 [ 1, %113 ], [ %103, %102 ]
%117 = add nuw nsw i32 %104, 1
%118 = icmp eq i32 %117, 50
br i1 %118, label %119, label %102
119: ; preds = %115
store i16 %47, i16* %48
store i16 %49, i16* %50
store i16 13070, i16* %51
br label %120
120: ; preds = %119, %130
%121 = phi i32 [ %116, %119 ], [ %131, %130 ]
%122 = phi i32 [ 0, %119 ], [ %132, %130 ]
%123 = call i64 @nrand48(i16* %51)
store i64 %123, i64* %2
%124 = icmp slt i64 %123, 0
%125 = load i64, i64* @INT32_MAX
%126 = icmp sgt i64 %123, %125
%127 = select i1 %124, i1 true, i1 %126
br i1 %127, label %128, label %130
128: ; preds = %120
%129 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %122, i64 %123)
br label %130
130: ; preds = %120, %128
%131 = phi i32 [ 1, %128 ], [ %121, %120 ]
%132 = add nuw nsw i32 %122, 1
%133 = icmp eq i32 %132, 50
br i1 %133, label %134, label %120
134: ; preds = %130
store i16 %47, i16* %48
store i16 %49, i16* %50
store i16 13070, i16* %51
br label %135
135: ; preds = %134, %148
%136 = phi i32 [ %131, %134 ], [ %149, %148 ]
%137 = phi i32 [ 0, %134 ], [ %150, %148 ]
%138 = call i64 @nrand48_r(i16* %51, %struct.drand48_data* %3, i64* %2)
%139 = icmp ne i64 %138, 0
%140 = load i64, i64* %2
%141 = icmp slt i64 %140, 0
%142 = select i1 %139, i1 true, i1 %141
%143 = load i64, i64* @INT32_MAX
%144 = icmp sgt i64 %140, %143
%145 = select i1 %142, i1 true, i1 %144
br i1 %145, label %146, label %148
146: ; preds = %135
%147 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %137, i64 %140)
br label %148
148: ; preds = %135, %146
%149 = phi i32 [ 1, %146 ], [ %136, %135 ]
%150 = add nuw nsw i32 %137, 1
%151 = icmp eq i32 %150, 50
br i1 %151, label %152, label %135
152: ; preds = %148
%153 = call i32 @srand48(i64 %10)
br label %154
154: ; preds = %152, %165
%155 = phi i32 [ %149, %152 ], [ %166, %165 ]
%156 = phi i32 [ 0, %152 ], [ %167, %165 ]
%157 = call i64 (...) @mrand48()
store i64 %157, i64* %2
%158 = load i64, i64* @INT32_MIN
%159 = icmp slt i64 %157, %158
%160 = load i64, i64* @INT32_MAX
%161 = icmp sgt i64 %157, %160
%162 = select i1 %159, i1 true, i1 %161
br i1 %162, label %163, label %165
163: ; preds = %154
%164 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %156, i64 %157)
br label %165
165: ; preds = %154, %163
%166 = phi i32 [ 1, %163 ], [ %155, %154 ]
%167 = add nuw nsw i32 %156, 1
%168 = icmp eq i32 %167, 50
br i1 %168, label %169, label %154
169: ; preds = %165
%170 = call i32 @srand48_r(i64 %10, %struct.drand48_data* %3)
br label %171
171: ; preds = %169, %185
%172 = phi i32 [ %166, %169 ], [ %186, %185 ]
%173 = phi i32 [ 0, %169 ], [ %187, %185 ]
%174 = call i64 @mrand48_r(%struct.drand48_data* %3, i64* %2)
%175 = icmp eq i64 %174, 0
%176 = load i64, i64* %2
br i1 %175, label %177, label %183
177: ; preds = %171
%178 = load i64, i64* @INT32_MIN
%179 = icmp slt i64 %176, %178
%180 = load i64, i64* @INT32_MAX
%181 = icmp sgt i64 %176, %180
%182 = select i1 %179, i1 true, i1 %181
br i1 %182, label %183, label %185
183: ; preds = %171, %177
%184 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 %173, i64 %176)
br label %185
185: ; preds = %177, %183
%186 = phi i32 [ 1, %183 ], [ %172, %177 ]
%187 = add nuw nsw i32 %173, 1
%188 = icmp eq i32 %187, 50
br i1 %188, label %189, label %171
189: ; preds = %185
store i16 %47, i16* %48
store i16 %49, i16* %50
store i16 13070, i16* %51
br label %190
190: ; preds = %189, %201
%191 = phi i32 [ %186, %189 ], [ %202, %201 ]
%192 = phi i32 [ 0, %189 ], [ %203, %201 ]
%193 = call i64 @jrand48(i16* %51)
store i64 %193, i64* %2
%194 = load i64, i64* @INT32_MIN
%195 = icmp slt i64 %193, %194
%196 = load i64, i64* @INT32_MAX
%197 = icmp sgt i64 %193, %196
%198 = select i1 %195, i1 true, i1 %197
br i1 %198, label %199, label %201
199: ; preds = %190
%200 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 %192, i64 %193)
br label %201
201: ; preds = %190, %199
%202 = phi i32 [ 1, %199 ], [ %191, %190 ]
%203 = add nuw nsw i32 %192, 1
%204 = icmp eq i32 %203, 50
br i1 %204, label %205, label %190
205: ; preds = %201
store i16 %47, i16* %48
store i16 %49, i16* %50
store i16 13070, i16* %51
br label %206
206: ; preds = %205, %220
%207 = phi i32 [ %202, %205 ], [ %221, %220 ]
%208 = phi i32 [ 0, %205 ], [ %222, %220 ]
%209 = call i64 @jrand48_r(i16* %51, %struct.drand48_data* %3, i64* %2)
%210 = icmp eq i64 %209, 0
%211 = load i64, i64* %2
br i1 %210, label %212, label %218
212: ; preds = %206
%213 = load i64, i64* @INT32_MIN
%214 = icmp slt i64 %211, %213
%215 = load i64, i64* @INT32_MAX
%216 = icmp sgt i64 %211, %215
%217 = select i1 %214, i1 true, i1 %216
br i1 %217, label %218, label %220
218: ; preds = %206, %212
%219 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %208, i64 %211)
br label %220
220: ; preds = %212, %218
%221 = phi i32 [ 1, %218 ], [ %207, %212 ]
%222 = add nuw nsw i32 %208, 1
%223 = icmp eq i32 %222, 50
br i1 %223, label %224, label %206
224: ; preds = %220
ret i32 %221
}