#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*/ free_matrix(float **, int, int, int, int);
int irbit1(unsigned long *);
int irbit2(unsigned long *);
int /*<<< orphan*/ kendl2(float **, int, int, float *, float *, float *);
float **matrix(int, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int ifunc, i = 8, j = 8, k, l, m, n, twoton;
  unsigned long iseed;
  float prob, tau, z, **tab;
  static char *txt[8] = {"000", "001", "010", "011",
                         "100", "101", "110", "111"};
  tab = matrix(1, 8, 1, 8);
  printf("Are ones followed by zeros and vice-versa?\n");
  for (ifunc = 1; ifunc <= 2; ifunc++) {
    iseed = 2468;
    if (ifunc == 1)
      printf("test of irbit1:\n");
    else
      printf("test of irbit2:\n");
    for (k = 1; k <= i; k++)
      for (l = 1; l <= j; l++)
        tab[k][l] = 0.0;
    for (m = 1; m <= 1000; m++) {
      k = 1;
      twoton = 1;
      for (n = 0; n <= 2; n++) {
        if (ifunc == 1)
          k += (irbit1(&iseed) * twoton);
        else
          k += (irbit2(&iseed) * twoton);
        twoton *= 2;
      }
      l = 1;
      twoton = 1;
      for (n = 0; n <= 2; n++) {
        if (ifunc == 1)
          l += (irbit1(&iseed) * twoton);
        else
          l += (irbit2(&iseed) * twoton);
        twoton *= 2;
      }
      ++tab[k][l];
    }
    kendl2(tab, i, j, &tau, &z, &prob);
    printf("    ");
    for (n = 0; n <= 7; n++)
      printf("%6s", txt[n]);
    printf("\n");
    for (n = 1; n <= 8; n++) {
      printf("%3s", txt[n - 1]);
      for (m = 1; m <= 8; m++)
        printf("%6d", (int)(0.5 + tab[n][m]));
      printf("\n");
    }
    printf("\n%17s %14s %16s\n", "kendall tau", "std. dev.", "probability");
    printf("%15.6f %15.6f %15.6f\n\n", tau, z, prob);
  }
  free_matrix(tab, 1, 8, 1, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0xc(%rbp)
movl   $0x8,-0x10(%rbp)
mov    $0x1,%edx
mov    $0x8,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1080 <matrix@plt>
mov    %rax,-0x48(%rbp)
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     14d1 <main+0x371>
movq   $0x9a4,-0x30(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11d8 <main+0x78>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11e6 <main+0x86>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1245 <main+0xe5>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1232 <main+0xd2>
mov    -0x48(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1200 <main+0xa0>
jmp    1237 <main+0xd7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ed <main+0x8d>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x3e8,-0x1c(%rbp)
jg     135f <main+0x1ff>
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x2,-0x20(%rbp)
jg     12c4 <main+0x164>
cmpl   $0x1,-0x8(%rbp)
jne    129a <main+0x13a>
lea    -0x30(%rbp),%rdi
call   1070 <irbit1@plt>
imul   -0x24(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    12ad <main+0x14d>
lea    -0x30(%rbp),%rdi
call   1030 <irbit2@plt>
imul   -0x24(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    126e <main+0x10e>
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x2,-0x20(%rbp)
jg     132f <main+0x1cf>
cmpl   $0x1,-0x8(%rbp)
jne    1305 <main+0x1a5>
lea    -0x30(%rbp),%rdi
call   1070 <irbit1@plt>
imul   -0x24(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1318 <main+0x1b8>
lea    -0x30(%rbp),%rdi
call   1030 <irbit2@plt>
imul   -0x24(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12d9 <main+0x179>
mov    -0x48(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movss  0xcc1(%rip),%xmm0
addss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    124c <main+0xec>
mov    -0x48(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x38(%rbp),%rcx
lea    -0x3c(%rbp),%r8
lea    -0x34(%rbp),%r9
call   1060 <kendl2@plt>
lea    0xcf9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x7,-0x20(%rbp)
jg     13c4 <main+0x264>
movslq -0x20(%rbp),%rcx
lea    0x2cbc(%rip),%rax
mov    (%rax,%rcx,8),%rsi
lea    0xcd0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    138f <main+0x22f>
lea    0xd08(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x20(%rbp)
cmpl   $0x8,-0x20(%rbp)
jg     1477 <main+0x317>
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2c6d(%rip),%rax
mov    (%rax,%rcx,8),%rsi
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jg     145b <main+0x2fb>
mov    -0x48(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xbc9(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xc41(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    140c <main+0x2ac>
lea    0xc71(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13d9 <main+0x279>
lea    0xc0d(%rip),%rdi
lea    0xc17(%rip),%rsi
lea    0xc1c(%rip),%rdx
lea    0xc1f(%rip),%rcx
mov    $0x0,%al
call   1050 <printf@plt>
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x3c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x34(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xc02(%rip),%rdi
mov    $0x3,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a9 <main+0x49>
mov    -0x48(%rbp),%rdi
mov    $0x1,%ecx
mov    $0x8,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1040 <free_matrix@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x1,%r13d
mov    $0x1,%edi
mov    $0x8,%esi
mov    $0x1,%edx
mov    $0x8,%ecx
call   10a0 <matrix@plt>
mov    %rax,%r14
lea    0xef4(%rip),%rdi
call   1050 <puts@plt>
nopl   0x0(%rax)
movq   $0x9a4,0x10(%rsp)
cmp    $0x1,%r13d
lea    0xf02(%rip),%rdi
lea    0xf0b(%rip),%rax
cmove  %rax,%rdi
call   1050 <puts@plt>
mov    0x8(%r14),%rax
xorps  %xmm0,%xmm0
movups %xmm0,0x4(%rax)
movups %xmm0,0x14(%rax)
mov    0x10(%r14),%rax
movups %xmm0,0x4(%rax)
movups %xmm0,0x14(%rax)
mov    0x18(%r14),%rax
movups %xmm0,0x4(%rax)
movups %xmm0,0x14(%rax)
mov    0x20(%r14),%rax
movups %xmm0,0x4(%rax)
movups %xmm0,0x14(%rax)
mov    0x28(%r14),%rax
movups %xmm0,0x4(%rax)
movups %xmm0,0x14(%rax)
mov    0x30(%r14),%rax
movups %xmm0,0x4(%rax)
movups %xmm0,0x14(%rax)
mov    0x38(%r14),%rax
movups %xmm0,0x4(%rax)
movups %xmm0,0x14(%rax)
mov    0x40(%r14),%rax
movups %xmm0,0x4(%rax)
movups %xmm0,0x14(%rax)
mov    $0x3e8,%r15d
mov    %r13d,(%rsp)
jmp    12d9 <main+0x159>
cs nopw 0x0(%rax,%rax,1)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1090 <irbit1@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1090 <irbit1@plt>
lea    0x1(%rbp,%rax,2),%r12d
mov    %rbx,%rdi
call   1090 <irbit1@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1090 <irbit1@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1090 <irbit1@plt>
lea    0x1(%rbp,%rax,2),%ebp
mov    %rbx,%rdi
call   1090 <irbit1@plt>
lea    0x0(%rbp,%rax,4),%eax
lea    (%r12,%r13,4),%ecx
movslq %ecx,%rcx
mov    (%r14,%rcx,8),%rcx
cltq
movss  (%rcx,%rax,4),%xmm0
addss  0xd3d(%rip),%xmm0
movss  %xmm0,(%rcx,%rax,4)
add    $0xffffffff,%r15d
mov    (%rsp),%r13d
lea    0xd86(%rip),%rbx
je     1330 <main+0x1b0>
cmp    $0x1,%r13d
je     1260 <main+0xe0>
lea    0x10(%rsp),%r12
mov    %r12,%rdi
call   1030 <irbit2@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1030 <irbit2@plt>
lea    0x1(%rbp,%rax,2),%ebx
mov    %r12,%rdi
call   1030 <irbit2@plt>
mov    %eax,%r13d
mov    %r12,%rdi
call   1030 <irbit2@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1030 <irbit2@plt>
lea    0x1(%rbp,%rax,2),%ebp
mov    %r12,%rdi
call   1030 <irbit2@plt>
mov    %rbx,%r12
jmp    12a5 <main+0x125>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x8,%edx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
lea    0xc(%rsp),%r9
call   1080 <kendl2@plt>
lea    0xcf8(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xcef(%rip),%rbp
mov    %rbp,%rdi
lea    0xcc0(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
lea    0xcb3(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
lea    0xca6(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
lea    0xc99(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
lea    0xc8c(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
lea    0xc7f(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
lea    0xc72(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
lea    0xc65(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %ebp,%ebp
lea    0xc0f(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq 0x0(%rbp,%r15,1),%rsi
add    %r15,%rsi
lea    0xc3a(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%r14,%rbp,2),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xbcc(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%r14,%rbp,2),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xba4(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%r14,%rbp,2),%rax
movss  0xc(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xb80(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%r14,%rbp,2),%rax
movss  0x10(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xb5c(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%r14,%rbp,2),%rax
movss  0x14(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xb38(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%r14,%rbp,2),%rax
movss  0x18(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xb14(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%r14,%rbp,2),%rax
movss  0x1c(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xaf0(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%r14,%rbp,2),%rax
movss  0x20(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xacc(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
add    $0x4,%rbp
cmp    $0x20,%rbp
jne    1410 <main+0x290>
lea    0xaf8(%rip),%rdi
lea    0xb02(%rip),%rsi
lea    0xb07(%rip),%rdx
lea    0xb0a(%rip),%rcx
xor    %eax,%eax
call   1070 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0xc(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xaea(%rip),%rdi
mov    $0x3,%al
call   1070 <printf@plt>
add    $0x1,%r13d
cmp    $0x3,%r13d
jne    11c0 <main+0x40>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    $0x1,%ecx
mov    $0x8,%r8d
call   1060 <free_matrix@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@main.txt = internal global [8 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0)]
@.str = [4 x i8] c"000\00"
@.str.1 = [4 x i8] c"001\00"
@.str.2 = [4 x i8] c"010\00"
@.str.3 = [4 x i8] c"011\00"
@.str.4 = [4 x i8] c"100\00"
@.str.5 = [4 x i8] c"101\00"
@.str.6 = [4 x i8] c"110\00"
@.str.7 = [4 x i8] c"111\00"
@.str.8 = [44 x i8] c"Are ones followed by zeros and vice-versa?\0A\00"
@.str.9 = [17 x i8] c"test of irbit1:\0A\00"
@.str.10 = [17 x i8] c"test of irbit2:\0A\00"
@.str.11 = [5 x i8] c" \00"
@.str.12 = [4 x i8] c"%6s\00"
@.str.13 = [2 x i8] c"\0A\00"
@.str.14 = [4 x i8] c"%3s\00"
@.str.15 = [4 x i8] c"%6d\00"
@.str.16 = [17 x i8] c"\0A%17s %14s %16s\0A\00"
@.str.17 = [12 x i8] c"kendall tau\00"
@.str.18 = [10 x i8] c"std. dev.\00"
@.str.19 = [12 x i8] c"probability\00"
@.str.20 = [23 x i8] c"%15.6f %15.6f %15.6f\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float**
store i32 0, i32* %1
store i32 8, i32* %3
store i32 8, i32* %4
%15 = call float** @matrix(i32 1, i32 8, i32 1, i32 8)
store float** %15, float*** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %2
br label %17
17: ; preds = %185, %0
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 2
br i1 %19, label %20, label %188
20: ; preds = %17
store i64 2468, i64* %10
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
br label %27
25: ; preds = %20
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
store i32 1, i32* %5
br label %28
28: ; preds = %50, %27
%29 = load i32, i32* %5
%30 = load i32, i32* %3
%31 = icmp sle i32 %29, %30
br i1 %31, label %32, label %53
32: ; preds = %28
store i32 1, i32* %6
br label %33
33: ; preds = %46, %32
%34 = load i32, i32* %6
%35 = load i32, i32* %4
%36 = icmp sle i32 %34, %35
br i1 %36, label %37, label %49
37: ; preds = %33
%38 = load float**, float*** %14
%39 = load i32, i32* %5
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds float*, float** %38, i64 %40
%42 = load float*, float** %41
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds float, float* %42, i64 %44
store float 0.000000e+00, float* %45
br label %46
46: ; preds = %37
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
br label %33
49: ; preds = %33
br label %50
50: ; preds = %49
%51 = load i32, i32* %5
%52 = add nsw i32 %51, 1
store i32 %52, i32* %5
br label %28
53: ; preds = %28
store i32 1, i32* %7
br label %54
54: ; preds = %118, %53
%55 = load i32, i32* %7
%56 = icmp sle i32 %55, 1000
br i1 %56, label %57, label %121
57: ; preds = %54
store i32 1, i32* %5
store i32 1, i32* %9
store i32 0, i32* %8
br label %58
58: ; preds = %79, %57
%59 = load i32, i32* %8
%60 = icmp sle i32 %59, 2
br i1 %60, label %61, label %82
61: ; preds = %58
%62 = load i32, i32* %2
%63 = icmp eq i32 %62, 1
br i1 %63, label %64, label %70
64: ; preds = %61
%65 = call i32 @irbit1(i64* %10)
%66 = load i32, i32* %9
%67 = mul nsw i32 %65, %66
%68 = load i32, i32* %5
%69 = add nsw i32 %68, %67
store i32 %69, i32* %5
br label %76
70: ; preds = %61
%71 = call i32 @irbit2(i64* %10)
%72 = load i32, i32* %9
%73 = mul nsw i32 %71, %72
%74 = load i32, i32* %5
%75 = add nsw i32 %74, %73
store i32 %75, i32* %5
br label %76
76: ; preds = %70, %64
%77 = load i32, i32* %9
%78 = mul nsw i32 %77, 2
store i32 %78, i32* %9
br label %79
79: ; preds = %76
%80 = load i32, i32* %8
%81 = add nsw i32 %80, 1
store i32 %81, i32* %8
br label %58
82: ; preds = %58
store i32 1, i32* %6
store i32 1, i32* %9
store i32 0, i32* %8
br label %83
83: ; preds = %104, %82
%84 = load i32, i32* %8
%85 = icmp sle i32 %84, 2
br i1 %85, label %86, label %107
86: ; preds = %83
%87 = load i32, i32* %2
%88 = icmp eq i32 %87, 1
br i1 %88, label %89, label %95
89: ; preds = %86
%90 = call i32 @irbit1(i64* %10)
%91 = load i32, i32* %9
%92 = mul nsw i32 %90, %91
%93 = load i32, i32* %6
%94 = add nsw i32 %93, %92
store i32 %94, i32* %6
br label %101
95: ; preds = %86
%96 = call i32 @irbit2(i64* %10)
%97 = load i32, i32* %9
%98 = mul nsw i32 %96, %97
%99 = load i32, i32* %6
%100 = add nsw i32 %99, %98
store i32 %100, i32* %6
br label %101
101: ; preds = %95, %89
%102 = load i32, i32* %9
%103 = mul nsw i32 %102, 2
store i32 %103, i32* %9
br label %104
104: ; preds = %101
%105 = load i32, i32* %8
%106 = add nsw i32 %105, 1
store i32 %106, i32* %8
br label %83
107: ; preds = %83
%108 = load float**, float*** %14
%109 = load i32, i32* %5
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds float*, float** %108, i64 %110
%112 = load float*, float** %111
%113 = load i32, i32* %6
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds float, float* %112, i64 %114
%116 = load float, float* %115
%117 = fadd float %116, 1.000000e+00
store float %117, float* %115
br label %118
118: ; preds = %107
%119 = load i32, i32* %7
%120 = add nsw i32 %119, 1
store i32 %120, i32* %7
br label %54
121: ; preds = %54
%122 = load float**, float*** %14
%123 = load i32, i32* %3
%124 = load i32, i32* %4
%125 = call i32 @kendl2(float** %122, i32 %123, i32 %124, float* %12, float* %13, float* %11)
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %8
br label %127
127: ; preds = %136, %121
%128 = load i32, i32* %8
%129 = icmp sle i32 %128, 7
br i1 %129, label %130, label %139
130: ; preds = %127
%131 = load i32, i32* %8
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [8 x i8*], [8 x i8*]* @main.txt, i64 0, i64 %132
%134 = load i8*, i8** %133
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %134)
br label %136
136: ; preds = %130
%137 = load i32, i32* %8
%138 = add nsw i32 %137, 1
store i32 %138, i32* %8
br label %127
139: ; preds = %127
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
store i32 1, i32* %8
br label %141
141: ; preds = %173, %139
%142 = load i32, i32* %8
%143 = icmp sle i32 %142, 8
br i1 %143, label %144, label %176
144: ; preds = %141
%145 = load i32, i32* %8
%146 = sub nsw i32 %145, 1
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [8 x i8*], [8 x i8*]* @main.txt, i64 0, i64 %147
%149 = load i8*, i8** %148
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8* %149)
store i32 1, i32* %7
br label %151
151: ; preds = %168, %144
%152 = load i32, i32* %7
%153 = icmp sle i32 %152, 8
br i1 %153, label %154, label %171
154: ; preds = %151
%155 = load float**, float*** %14
%156 = load i32, i32* %8
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds float*, float** %155, i64 %157
%159 = load float*, float** %158
%160 = load i32, i32* %7
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds float, float* %159, i64 %161
%163 = load float, float* %162
%164 = fpext float %163 to double
%165 = fadd double 5.000000e-01, %164
%166 = fptosi double %165 to i32
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %166)
br label %168
168: ; preds = %154
%169 = load i32, i32* %7
%170 = add nsw i32 %169, 1
store i32 %170, i32* %7
br label %151
171: ; preds = %151
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %173
173: ; preds = %171
%174 = load i32, i32* %8
%175 = add nsw i32 %174, 1
store i32 %175, i32* %8
br label %141
176: ; preds = %141
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0))
%178 = load float, float* %12
%179 = fpext float %178 to double
%180 = load float, float* %13
%181 = fpext float %180 to double
%182 = load float, float* %11
%183 = fpext float %182 to double
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0), double %179, double %181, double %183)
br label %185
185: ; preds = %176
%186 = load i32, i32* %2
%187 = add nsw i32 %186, 1
store i32 %187, i32* %2
br label %17
188: ; preds = %17
%189 = load float**, float*** %14
%190 = call i32 @free_matrix(float** %189, i32 1, i32 8, i32 1, i32 8)
ret i32 0
}

LLVM IR (-O2):
@reltable.main = internal unnamed_addr constant [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.7 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32)]
@.str = [4 x i8] c"000\00"
@.str.1 = [4 x i8] c"001\00"
@.str.2 = [4 x i8] c"010\00"
@.str.3 = [4 x i8] c"011\00"
@.str.4 = [4 x i8] c"100\00"
@.str.5 = [4 x i8] c"101\00"
@.str.6 = [4 x i8] c"110\00"
@.str.7 = [4 x i8] c"111\00"
@.str.11 = [5 x i8] c" \00"
@.str.12 = [4 x i8] c"%6s\00"
@.str.14 = [4 x i8] c"%3s\00"
@.str.15 = [4 x i8] c"%6d\00"
@.str.16 = [17 x i8] c"\0A%17s %14s %16s\0A\00"
@.str.17 = [12 x i8] c"kendall tau\00"
@.str.18 = [10 x i8] c"std. dev.\00"
@.str.19 = [12 x i8] c"probability\00"
@.str.20 = [23 x i8] c"%15.6f %15.6f %15.6f\0A\0A\00"
@str = [43 x i8] c"Are ones followed by zeros and vice-versa?\00"
@str.21 = [16 x i8] c"test of irbit2:\00"
@str.22 = [16 x i8] c"test of irbit1:\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast i64* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = tail call float** @matrix(i32 1, i32 8, i32 1, i32 8)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%11 = getelementptr inbounds float*, float** %9, i64 1
%12 = getelementptr inbounds float*, float** %9, i64 2
%13 = getelementptr inbounds float*, float** %9, i64 3
%14 = getelementptr inbounds float*, float** %9, i64 4
%15 = getelementptr inbounds float*, float** %9, i64 5
%16 = getelementptr inbounds float*, float** %9, i64 6
%17 = getelementptr inbounds float*, float** %9, i64 7
%18 = getelementptr inbounds float*, float** %9, i64 8
br label %19
19: ; preds = %0, %172
%20 = phi i32 [ 1, %0 ], [ %181, %172 ]
store i64 2468, i64* %1
%21 = icmp eq i32 %20, 1
%22 = select i1 %21, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.22, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.21, i64 0, i64 0)
%23 = call i32 @puts(i8* dereferenceable(1) %22)
%24 = load float*, float** %11
%25 = getelementptr float, float* %24, i64 1
%26 = bitcast float* %25 to i8*
%27 = load float*, float** %12
%28 = getelementptr float, float* %27, i64 1
%29 = bitcast float* %28 to i8*
%30 = load float*, float** %13
%31 = getelementptr float, float* %30, i64 1
%32 = bitcast float* %31 to i8*
%33 = load float*, float** %14
%34 = getelementptr float, float* %33, i64 1
%35 = bitcast float* %34 to i8*
%36 = load float*, float** %15
%37 = getelementptr float, float* %36, i64 1
%38 = bitcast float* %37 to i8*
%39 = load float*, float** %16
%40 = getelementptr float, float* %39, i64 1
%41 = bitcast float* %40 to i8*
%42 = load float*, float** %17
%43 = getelementptr float, float* %42, i64 1
%44 = bitcast float* %43 to i8*
%45 = load float*, float** %18
%46 = getelementptr float, float* %45, i64 1
%47 = bitcast float* %46 to i8*
br label %48
48: ; preds = %19, %76
%49 = phi i32 [ %92, %76 ], [ 1, %19 ]
br i1 %21, label %63, label %50
50: ; preds = %48
%51 = call i32 @irbit2(i64* %1)
%52 = add nsw i32 %51, 1
%53 = call i32 @irbit2(i64* %1)
%54 = shl nsw i32 %53, 1
%55 = add nsw i32 %54, %52
%56 = call i32 @irbit2(i64* %1)
%57 = call i32 @irbit2(i64* %1)
%58 = add nsw i32 %57, 1
%59 = call i32 @irbit2(i64* %1)
%60 = shl nsw i32 %59, 1
%61 = add nsw i32 %60, %58
%62 = call i32 @irbit2(i64* %1)
br label %76
63: ; preds = %48
%64 = call i32 @irbit1(i64* %1)
%65 = add nsw i32 %64, 1
%66 = call i32 @irbit1(i64* %1)
%67 = shl nsw i32 %66, 1
%68 = add nsw i32 %67, %65
%69 = call i32 @irbit1(i64* %1)
%70 = call i32 @irbit1(i64* %1)
%71 = add nsw i32 %70, 1
%72 = call i32 @irbit1(i64* %1)
%73 = shl nsw i32 %72, 1
%74 = add nsw i32 %73, %71
%75 = call i32 @irbit1(i64* %1)
br label %76
76: ; preds = %63, %50
%77 = phi i32 [ %74, %63 ], [ %61, %50 ]
%78 = phi i32 [ %69, %63 ], [ %56, %50 ]
%79 = phi i32 [ %68, %63 ], [ %55, %50 ]
%80 = phi i32 [ %75, %63 ], [ %62, %50 ]
%81 = shl nsw i32 %78, 2
%82 = shl nsw i32 %80, 2
%83 = add nsw i32 %82, %77
%84 = add nsw i32 %81, %79
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds float*, float** %9, i64 %85
%87 = load float*, float** %86
%88 = sext i32 %83 to i64
%89 = getelementptr inbounds float, float* %87, i64 %88
%90 = load float, float* %89
%91 = fadd float %90, 1.000000e+00
store float %91, float* %89
%92 = add nuw nsw i32 %49, 1
%93 = icmp eq i32 %92, 1001
br i1 %93, label %94, label %48
94: ; preds = %76
%95 = call i32 @kendl2(float** %9, i32 8, i32 8, float* %3, float* %4, float* %2)
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%105 = call i32 @putchar(i32 10)
br label %106
106: ; preds = %94, %106
%107 = phi i64 [ 1, %94 ], [ %170, %106 ]
%108 = add nsw i64 %107, -1
%109 = shl i64 %108, 2
%110 = call i8* @llvm.load.relative.i64(i8* bitcast ([8 x i32]* @reltable.main to i8*), i64 %109)
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8* %110)
%112 = getelementptr inbounds float*, float** %9, i64 %107
%113 = load float*, float** %112
%114 = getelementptr inbounds float, float* %113, i64 1
%115 = load float, float* %114
%116 = fpext float %115 to double
%117 = fadd double %116, 5.000000e-01
%118 = fptosi double %117 to i32
%119 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %118)
%120 = load float*, float** %112
%121 = getelementptr inbounds float, float* %120, i64 2
%122 = load float, float* %121
%123 = fpext float %122 to double
%124 = fadd double %123, 5.000000e-01
%125 = fptosi double %124 to i32
%126 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %125)
%127 = load float*, float** %112
%128 = getelementptr inbounds float, float* %127, i64 3
%129 = load float, float* %128
%130 = fpext float %129 to double
%131 = fadd double %130, 5.000000e-01
%132 = fptosi double %131 to i32
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %132)
%134 = load float*, float** %112
%135 = getelementptr inbounds float, float* %134, i64 4
%136 = load float, float* %135
%137 = fpext float %136 to double
%138 = fadd double %137, 5.000000e-01
%139 = fptosi double %138 to i32
%140 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %139)
%141 = load float*, float** %112
%142 = getelementptr inbounds float, float* %141, i64 5
%143 = load float, float* %142
%144 = fpext float %143 to double
%145 = fadd double %144, 5.000000e-01
%146 = fptosi double %145 to i32
%147 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %146)
%148 = load float*, float** %112
%149 = getelementptr inbounds float, float* %148, i64 6
%150 = load float, float* %149
%151 = fpext float %150 to double
%152 = fadd double %151, 5.000000e-01
%153 = fptosi double %152 to i32
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %153)
%155 = load float*, float** %112
%156 = getelementptr inbounds float, float* %155, i64 7
%157 = load float, float* %156
%158 = fpext float %157 to double
%159 = fadd double %158, 5.000000e-01
%160 = fptosi double %159 to i32
%161 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %160)
%162 = load float*, float** %112
%163 = getelementptr inbounds float, float* %162, i64 8
%164 = load float, float* %163
%165 = fpext float %164 to double
%166 = fadd double %165, 5.000000e-01
%167 = fptosi double %166 to i32
%168 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 %167)
%169 = call i32 @putchar(i32 10)
%170 = add nuw nsw i64 %107, 1
%171 = icmp eq i64 %170, 9
br i1 %171, label %172, label %106
172: ; preds = %106
%173 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0))
%174 = load float, float* %3
%175 = fpext float %174 to double
%176 = load float, float* %4
%177 = fpext float %176 to double
%178 = load float, float* %2
%179 = fpext float %178 to double
%180 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i64 0, i64 0), double %175, double %177, double %179)
%181 = add nuw nsw i32 %20, 1
%182 = icmp eq i32 %181, 3
br i1 %182, label %183, label %19
183: ; preds = %172
%184 = call i32 @free_matrix(float** %9, i32 1, i32 8, i32 1, i32 8)
ret i32 0
}