#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 /*<<< orphan*/ FILE;

/* Variables and functions */
double atof(char *);
int atoi(char *);
int /*<<< orphan*/ exit(int);
double log(double);
int /*<<< orphan*/ *openfile_or_exit(char *, char *, int);
int pow(int, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_slap(int /*<<< orphan*/ *, unsigned int *,
                             unsigned int *, unsigned int **, unsigned int **);
int /*<<< orphan*/ read_slap_w(int /*<<< orphan*/ *, unsigned int *,
                               unsigned int *, unsigned int **, unsigned int **,
                               double **);
int main(int argc, char *argv[]) {
  if (argc < 6) {
    printf("Usage: %s <layer1> <layer2> <overlapping network> <N nodes> <b1> "
           "<b2>\n",
           argv[0]);
    exit(1);
  }
  FILE *filein0, *filein1, *filein, *fileout;
  unsigned int N0, K0, N1, K1, N, K;
  unsigned int *J_slap0, *r_slap0, *J_slap1, *r_slap1, *J_slap, *r_slap;
  double *w_slap;
  int i, j;
  double c_i, d_i, f_i, f_i_2;
  double alpha = (atof(argv[5]));
  double beta = (atof(argv[6]));
  int ov;
  int deg0, deg1;
  double degM, part, f_j, f_j_2;
  double degMrid, maxdegM = 200.0;
  double num1, num2, den, h;
  int number_nodes = (atoi(argv[4]));
  double M = 2.0;
  filein0 = openfile_or_exit(argv[1], "r", 2);
  read_slap(filein0, &K0, &N0, &J_slap0, &r_slap0);
  filein1 = openfile_or_exit(argv[2], "r", 2);
  read_slap(filein1, &K1, &N1, &J_slap1, &r_slap1);
  filein = openfile_or_exit(argv[3], "r", 2);
  read_slap_w(filein, &K, &N, &J_slap, &r_slap, &w_slap);
  int r_slap0_n[N + 1], r_slap1_n[N + 1];
  for (i = 0; i <= N; i++) {
    if (i <= N0) {
      r_slap0_n[i] = r_slap0[i];
    } else {
      r_slap0_n[i] = r_slap0[N0];
    }
    if (i <= N1) {
      r_slap1_n[i] = r_slap1[i];
    } else {
      r_slap1_n[i] = r_slap1[N1];
    }
  }
  double c_i_vec[N];
  double d_i_vec[N];
  double f_i_vec[N];
  for (i = 0; i < N; i++) {
    c_i = 0;
    d_i = 0;
    for (j = r_slap[i]; j < r_slap[i + 1]; j++) {
      ov = w_slap[j];
      deg0 = r_slap0_n[J_slap[j] + 1] - r_slap0_n[J_slap[j]];
      deg1 = r_slap1_n[J_slap[j] + 1] - r_slap1_n[J_slap[j]];
      degM = (deg0 + deg1) * 1.0;
      part = (M / (M - 1)) *
             (1 - (pow((deg0 / degM), 2)) - (pow((deg1 / degM), 2)));
      if (deg0 > 0.0000000001) {
        f_j = pow(deg0, alpha);
      } else {
        f_j = 0;
      }
      if (deg1 > 0.0000000001) {
        f_j_2 = pow(deg1, beta);
      } else {
        f_j_2 = 0;
      }
      c_i += ov * (f_j + f_j_2);
      d_i += ov * (f_j + f_j_2) * log((ov * (f_j + f_j_2)));
    }
    c_i_vec[i] = c_i;
    d_i_vec[i] = d_i;
    deg0 = r_slap0_n[i + 1] - r_slap0_n[i];
    deg1 = r_slap1_n[i + 1] - r_slap1_n[i];
    degM = (deg0 + deg1) * 1.0;
    part =
        (M / (M - 1)) * (1 - (pow((deg0 / degM), 2)) - (pow((deg1 / degM), 2)));
    if (deg0 > 0.0000000001) {
      f_i = pow(deg0, alpha);
    } else {
      f_i = 0;
    }
    if (deg1 > 0.0000000001) {
      f_i_2 = pow(deg1, beta);
    } else {
      f_i_2 = 0;
    }
    f_i_vec[i] = f_i + f_i_2;
  }
  num1 = 0;
  num2 = 0;
  den = 0;
  for (i = 0; i < N; i++) {
    if (c_i_vec[i] > 0.0) {
      num1 += f_i_vec[i] * c_i_vec[i] * log(c_i_vec[i]);
    }
    num2 = num2 + f_i_vec[i] * d_i_vec[i];
    den = den + f_i_vec[i] * c_i_vec[i];
  }
  h = (num1 - num2) / den;
  printf("%f %f %f\n", h, alpha, beta);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    11d2 <main+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movabs $0x4069000000000000,%rax
mov    %rax,-0xf8(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x11c(%rbp)
movabs $0x4000000000000000,%rax
mov    %rax,-0x128(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe1f(%rip),%rsi
mov    %rsi,-0x178(%rbp)
mov    $0x2,%edx
mov    %edx,-0x16c(%rbp)
call   1030 <openfile_or_exit@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x34(%rbp),%rdx
lea    -0x50(%rbp),%rcx
lea    -0x58(%rbp),%r8
call   10b0 <read_slap@plt>
mov    -0x178(%rbp),%rsi
mov    -0x16c(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <openfile_or_exit@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    -0x68(%rbp),%r8
call   10b0 <read_slap@plt>
mov    -0x178(%rbp),%rsi
mov    -0x16c(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <openfile_or_exit@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x48(%rbp),%rsi
lea    -0x44(%rbp),%rdx
lea    -0x70(%rbp),%rcx
lea    -0x78(%rbp),%r8
lea    -0x80(%rbp),%r9
call   1060 <read_slap_w@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x130(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x168(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x138(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x160(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x140(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x44(%rbp),%eax
ja     1410 <main+0x280>
mov    -0x84(%rbp),%eax
cmp    -0x34(%rbp),%eax
ja     138e <main+0x1fe>
mov    -0x168(%rbp),%rax
mov    -0x58(%rbp),%rcx
movslq -0x84(%rbp),%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x84(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    13a9 <main+0x219>
mov    -0x168(%rbp),%rax
mov    -0x58(%rbp),%rcx
mov    -0x34(%rbp),%edx
mov    (%rcx,%rdx,4),%edx
movslq -0x84(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x84(%rbp),%eax
cmp    -0x3c(%rbp),%eax
ja     13dc <main+0x24c>
mov    -0x160(%rbp),%rax
mov    -0x68(%rbp),%rcx
movslq -0x84(%rbp),%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x84(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    13f7 <main+0x267>
mov    -0x160(%rbp),%rax
mov    -0x68(%rbp),%rcx
mov    -0x3c(%rbp),%edx
mov    (%rcx,%rdx,4),%edx
movslq -0x84(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    13fc <main+0x26c>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    134c <main+0x1bc>
mov    -0x44(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x190(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x148(%rbp)
mov    -0x44(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x188(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x150(%rbp)
mov    -0x44(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x180(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x158(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x44(%rbp),%eax
jae    1967 <main+0x7d7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x78(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    -0x78(%rbp),%rcx
mov    -0x84(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jae    175f <main+0x5cf>
mov    -0x160(%rbp),%rcx
mov    -0x168(%rbp),%rdx
mov    -0x80(%rbp),%rax
movslq -0x88(%rbp),%rsi
cvttsd2si (%rax,%rsi,8),%eax
mov    %eax,-0xbc(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x88(%rbp),%rsi
mov    (%rax,%rsi,4),%eax
add    $0x1,%eax
mov    %eax,%eax
mov    (%rdx,%rax,4),%eax
mov    -0x70(%rbp),%rsi
movslq -0x88(%rbp),%rdi
mov    (%rsi,%rdi,4),%esi
sub    (%rdx,%rsi,4),%eax
mov    %eax,-0xc0(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x88(%rbp),%rdx
mov    (%rax,%rdx,4),%eax
add    $0x1,%eax
mov    %eax,%eax
mov    (%rcx,%rax,4),%eax
mov    -0x70(%rbp),%rdx
movslq -0x88(%rbp),%rsi
mov    (%rdx,%rsi,4),%edx
sub    (%rcx,%rdx,4),%eax
mov    %eax,-0xc4(%rbp)
mov    -0xc0(%rbp),%eax
add    -0xc4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xa96(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x128(%rbp),%xmm0
ff
movsd  -0x128(%rbp),%xmm1
ff
movsd  0xa72(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x1a0(%rbp)
ff
cvtsi2sdl -0xc0(%rbp),%xmm0
ff
divsd  -0xd0(%rbp),%xmm0
ff
cvttsd2si %xmm0,%edi
movsd  0xa3e(%rip),%xmm0
call   1080 <pow@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    %eax,-0x194(%rbp)
cvtsi2sdl -0xc4(%rbp),%xmm0
ff
divsd  -0xd0(%rbp),%xmm0
ff
cvttsd2si %xmm0,%edi
movsd  0xa0e(%rip),%xmm0
call   1080 <pow@plt>
movsd  -0x1a0(%rbp),%xmm0
ff
mov    %eax,%ecx
mov    -0x194(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
cvtsi2sdl -0xc0(%rbp),%xmm0
ff
movsd  0x9cf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    165f <main+0x4cf>
mov    -0xc0(%rbp),%edi
movsd  -0xb0(%rbp),%xmm0
ff
call   1080 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
jmp    166a <main+0x4da>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
cvtsi2sdl -0xc4(%rbp),%xmm0
ff
movsd  0x986(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    16a8 <main+0x518>
mov    -0xc4(%rbp),%edi
movsd  -0xb8(%rbp),%xmm0
ff
call   1080 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
jmp    16b3 <main+0x523>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
cvtsi2sdl -0xbc(%rbp),%xmm0
ff
movsd  -0xe0(%rbp),%xmm2
ff
addsd  -0xe8(%rbp),%xmm2
ff
movsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
cvtsi2sdl -0xbc(%rbp),%xmm0
ff
movsd  -0xe0(%rbp),%xmm1
ff
addsd  -0xe8(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1a8(%rbp)
ff
cvtsi2sdl -0xbc(%rbp),%xmm0
ff
movsd  -0xe0(%rbp),%xmm1
ff
addsd  -0xe8(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm2
movsd  -0x1a8(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    14c5 <main+0x335>
mov    -0x160(%rbp),%rcx
mov    -0x168(%rbp),%rdx
mov    -0x188(%rbp),%rax
mov    -0x190(%rbp),%rsi
movsd  -0x90(%rbp),%xmm0
ff
movslq -0x84(%rbp),%rdi
movsd  %xmm0,(%rsi,%rdi,8)
movsd  -0x98(%rbp),%xmm0
ff
movslq -0x84(%rbp),%rsi
movsd  %xmm0,(%rax,%rsi,8)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
cltq
mov    (%rdx,%rax,4),%eax
movslq -0x84(%rbp),%rsi
sub    (%rdx,%rsi,4),%eax
mov    %eax,-0xc0(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
cltq
mov    (%rcx,%rax,4),%eax
movslq -0x84(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
mov    %eax,-0xc4(%rbp)
mov    -0xc0(%rbp),%eax
add    -0xc4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0x819(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x128(%rbp),%xmm0
ff
movsd  -0x128(%rbp),%xmm1
ff
movsd  0x7f5(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x1b8(%rbp)
ff
cvtsi2sdl -0xc0(%rbp),%xmm0
ff
divsd  -0xd0(%rbp),%xmm0
ff
cvttsd2si %xmm0,%edi
movsd  0x7c1(%rip),%xmm0
call   1080 <pow@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    %eax,-0x1ac(%rbp)
cvtsi2sdl -0xc4(%rbp),%xmm0
ff
divsd  -0xd0(%rbp),%xmm0
ff
cvttsd2si %xmm0,%edi
movsd  0x791(%rip),%xmm0
call   1080 <pow@plt>
movsd  -0x1b8(%rbp),%xmm0
ff
mov    %eax,%ecx
mov    -0x1ac(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
cvtsi2sdl -0xc0(%rbp),%xmm0
ff
movsd  0x752(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    18dc <main+0x74c>
mov    -0xc0(%rbp),%edi
movsd  -0xb0(%rbp),%xmm0
ff
call   1080 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    18e7 <main+0x757>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
cvtsi2sdl -0xc4(%rbp),%xmm0
ff
movsd  0x709(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1925 <main+0x795>
mov    -0xc4(%rbp),%edi
movsd  -0xb8(%rbp),%xmm0
ff
call   1080 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    1930 <main+0x7a0>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x180(%rbp),%rax
movsd  -0xa0(%rbp),%xmm0
ff
addsd  -0xa8(%rbp),%xmm0
ff
movslq -0x84(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    148c <main+0x2fc>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x44(%rbp),%eax
jae    1aac <main+0x91c>
mov    -0x190(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1a23 <main+0x893>
mov    -0x190(%rbp),%rax
mov    -0x180(%rbp),%rcx
movslq -0x84(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
movslq -0x84(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x1c0(%rbp)
ff
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm2
movsd  -0x1c0(%rbp),%xmm0
ff
movsd  -0x100(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
mov    -0x190(%rbp),%rax
mov    -0x180(%rbp),%rcx
mov    -0x188(%rbp),%rdx
movsd  -0x108(%rbp),%xmm1
ff
movslq -0x84(%rbp),%rsi
movsd  (%rcx,%rsi,8),%xmm0
movslq -0x84(%rbp),%rsi
movsd  (%rdx,%rsi,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x110(%rbp),%xmm1
ff
movslq -0x84(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1992 <main+0x802>
movsd  -0x100(%rbp),%xmm0
ff
subsd  -0x108(%rbp),%xmm0
ff
divsd  -0x110(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm2
ff
lea    0x576(%rip),%rdi
mov    $0x3,%al
call   1050 <printf@plt>
mov    -0x130(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    %rsi,%rbx
cmp    $0x5,%edi
jle    173e <main+0x5be>
mov    0x28(%rbx),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x58(%rbp)
mov    0x30(%rbx),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x50(%rbp)
mov    0x8(%rbx),%rdi
lea    0xe90(%rip),%r14
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <openfile_or_exit@plt>
lea    -0xfc(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0xf0(%rbp),%r8
mov    %rax,%rdi
call   10a0 <read_slap@plt>
mov    0x10(%rbx),%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <openfile_or_exit@plt>
lea    -0xf8(%rbp),%rsi
lea    -0x5c(%rbp),%rdx
lea    -0x108(%rbp),%rcx
lea    -0xe8(%rbp),%r8
mov    %rax,%rdi
call   10a0 <read_slap@plt>
mov    0x18(%rbx),%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <openfile_or_exit@plt>
lea    -0xf4(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
lea    -0xe0(%rbp),%rcx
lea    -0x88(%rbp),%r8
lea    -0xd8(%rbp),%r9
mov    %rax,%rdi
call   1060 <read_slap_w@plt>
mov    %rsp,%r14
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    -0x2c(%rbp),%r8d
lea    0x1(%r8),%r9d
mov    %rsp,%r13
lea    0xf(,%r9,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    -0x60(%rbp),%edx
mov    -0x5c(%rbp),%esi
mov    -0xf0(%rbp),%r11
mov    -0xe8(%rbp),%rbx
test   %r8,%r8
je     172d <main+0x5ad>
mov    %r9d,%r10d
and    $0xfffffffe,%r10d
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rcx,%rax
lea    -0x1(%rcx),%rdi
cmp    %rdx,%rdi
mov    %rdi,%rcx
cmova  %rdx,%rcx
mov    (%r11,%rcx,4),%ecx
mov    %ecx,-0x4(%r12,%rax,4)
cmp    %rsi,%rdi
cmova  %rsi,%rdi
mov    (%rbx,%rdi,4),%ecx
cmp    %rdx,%rax
mov    %rax,%rdi
cmova  %rdx,%rdi
mov    %ecx,-0x4(%r13,%rax,4)
mov    (%r11,%rdi,4),%ecx
mov    %ecx,(%r12,%rax,4)
cmp    %rsi,%rax
mov    %rax,%rcx
cmova  %rsi,%rcx
mov    (%rbx,%rcx,4),%ecx
mov    %ecx,0x0(%r13,%rax,4)
lea    0x2(%rax),%rcx
add    $0x1,%rax
cmp    %r10,%rax
jne    12d0 <main+0x150>
add    $0xffffffffffffffff,%rcx
test   $0x1,%r9b
je     1352 <main+0x1d2>
cmp    %rdx,%rcx
cmovbe %rcx,%rdx
cmp    %rsi,%rcx
cmovbe %rcx,%rsi
mov    (%r11,%rdx,4),%eax
mov    %eax,(%r12,%rcx,4)
mov    (%rbx,%rsi,4),%eax
mov    %eax,0x0(%r13,%rcx,4)
mov    %rsp,%rcx
lea    0xf(,%r8,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
movsd  0xc73(%rip),%xmm1
test   %r8,%r8
je     16fd <main+0x57d>
mov    %r14,-0xc8(%rbp)
xor    %ecx,%ecx
mov    %r13,-0x80(%rbp)
jmp    13d1 <main+0x251>
cs nopw 0x0(%rax,%rax,1)
nop
addsd  %xmm0,%xmm1
mov    -0x68(%rbp),%rax
movsd  %xmm1,(%rax,%r15,8)
mov    -0x2c(%rbp),%eax
mov    -0x48(%rbp),%rdx
mov    %rdx,%rcx
cmp    %rax,%rdx
jae    1626 <main+0x4a6>
mov    -0x88(%rbp),%rax
movslq (%rax,%rcx,4),%r15
lea    0x1(%rcx),%rdx
mov    %rdx,-0x48(%rbp)
xorpd  %xmm0,%xmm0
cmp    0x4(%rax,%rcx,4),%r15d
jae    1562 <main+0x3e2>
mov    %rcx,-0xd0(%rbp)
mov    %r12,%r13
xorpd  %xmm1,%xmm1
jmp    147c <main+0x2fc>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm2,%xmm2
cvtsi2sd %r12d,%xmm2
movapd %xmm2,-0xb0(%rbp)
ff
addsd  %xmm1,%xmm0
movapd %xmm0,-0x40(%rbp)
mulsd  %xmm2,%xmm0
movapd %xmm0,-0xa0(%rbp)
ff
call   1070 <log@plt>
movapd -0xa0(%rbp),%xmm1
ff
unpcklpd -0xb0(%rbp),%xmm1
ff
unpcklpd -0x40(%rbp),%xmm0
mulpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
movapd -0xc0(%rbp),%xmm2
ff
addpd  %xmm2,%xmm1
add    $0x1,%r15
mov    -0x88(%rbp),%rax
mov    -0x48(%rbp),%rcx
cmp    %r15d,(%rax,%rcx,4)
jbe    1550 <main+0x3d0>
mov    -0xd8(%rbp),%rax
cvttsd2si (%rax,%r15,8),%r12d
mov    -0xe0(%rbp),%rax
mov    (%rax,%r15,4),%eax
lea    0x1(%rax),%ecx
mov    0x0(%r13,%rcx,4),%ebx
sub    0x0(%r13,%rax,4),%ebx
mov    -0x80(%rbp),%rdx
mov    (%rdx,%rcx,4),%r14d
sub    (%rdx,%rax,4),%r14d
lea    (%r14,%rbx,1),%eax
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movsd  %xmm2,-0x40(%rbp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movapd %xmm1,-0xc0(%rbp)
ff
divsd  %xmm2,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xb2c(%rip),%xmm0
call   1080 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
divsd  -0x40(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xb0e(%rip),%xmm0
call   1080 <pow@plt>
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
test   %ebx,%ebx
jle    1522 <main+0x3a2>
mov    %ebx,%edi
movsd  -0x58(%rbp),%xmm0
call   1080 <pow@plt>
xorpd  %xmm1,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
test   %r14d,%r14d
jle    1410 <main+0x290>
mov    %r14d,%edi
movapd %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1080 <pow@plt>
movapd -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
jmp    1410 <main+0x290>
xchg   %ax,%ax
addpd  %xmm2,%xmm0
mov    %r13,%r12
mov    -0x80(%rbp),%r13
mov    -0xd0(%rbp),%rcx
mov    -0x78(%rbp),%rax
movhpd %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
mov    (%r12,%rax,4),%ebx
sub    (%r12,%rcx,4),%ebx
mov    0x0(%r13,%rax,4),%r14d
sub    0x0(%r13,%rcx,4),%r14d
lea    (%r14,%rbx,1),%eax
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movsd  %xmm2,-0x40(%rbp)
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mov    -0x70(%rbp),%rax
mov    %rcx,%r15
movlpd %xmm0,(%rax,%rcx,8)
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
movsd  0xa54(%rip),%xmm0
call   1080 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
divsd  -0x40(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xa36(%rip),%xmm0
call   1080 <pow@plt>
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
test   %ebx,%ebx
jle    15fa <main+0x47a>
mov    %ebx,%edi
movsd  -0x58(%rbp),%xmm0
call   1080 <pow@plt>
xorpd  %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
test   %r14d,%r14d
jle    13b0 <main+0x230>
mov    %r14d,%edi
movsd  -0x50(%rbp),%xmm0
movsd  %xmm1,-0x40(%rbp)
call   1080 <pow@plt>
movsd  -0x40(%rbp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    13b0 <main+0x230>
test   %eax,%eax
mov    -0xc8(%rbp),%r14
movsd  0x9c9(%rip),%xmm1
je     16fd <main+0x57d>
xorpd  %xmm2,%xmm2
xorpd  %xmm0,%xmm0
xor    %ebx,%ebx
xorpd  %xmm1,%xmm1
jmp    1670 <main+0x4f0>
nopl   (%rax)
unpcklpd %xmm4,%xmm4
mov    -0x70(%rbp),%rcx
movhpd (%rcx,%rbx,8),%xmm3
mulpd  %xmm4,%xmm3
addpd  %xmm3,%xmm2
add    $0x1,%rbx
mov    %eax,%ecx
cmp    %rcx,%rbx
jae    16ed <main+0x56d>
mov    -0x78(%rbp),%rcx
movsd  (%rcx,%rbx,8),%xmm3
ucomisd %xmm0,%xmm3
mov    -0x68(%rbp),%rcx
movsd  (%rcx,%rbx,8),%xmm4
jbe    1650 <main+0x4d0>
movapd %xmm3,%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,-0x48(%rbp)
movapd %xmm3,%xmm0
movsd  %xmm1,-0x40(%rbp)
movapd %xmm2,-0xc0(%rbp)
ff
movapd %xmm3,-0xb0(%rbp)
ff
movapd %xmm4,-0xa0(%rbp)
ff
call   1070 <log@plt>
movapd -0xa0(%rbp),%xmm4
ff
movapd -0xb0(%rbp),%xmm3
ff
movapd -0xc0(%rbp),%xmm2
ff
movsd  -0x40(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm0
addsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
mov    -0x2c(%rbp),%eax
jmp    1650 <main+0x4d0>
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
subsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
lea    0x955(%rip),%rdi
movapd %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
mov    $0x3,%al
call   1050 <printf@plt>
mov    %r14,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ecx,%ecx
test   $0x1,%r9b
jne    1334 <main+0x1b4>
jmp    1352 <main+0x1d2>
mov    (%rbx),%rsi
lea    0x8c8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"Usage: %s <layer1> <layer2> <overlapping network> <N nodes> <b1> <b2>\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"%f %f %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca double*
%23 = alloca i32
%24 = alloca i32
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
%41 = alloca double
%42 = alloca double
%43 = alloca double
%44 = alloca i32
%45 = alloca double
%46 = alloca i8*
%47 = alloca i64
%48 = alloca i64
%49 = alloca i64
%50 = alloca i64
%51 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%52 = load i32, i32* %4
%53 = icmp slt i32 %52, 6
br i1 %53, label %54, label %60
54: ; preds = %2
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 0
%57 = load i8*, i8** %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %57)
%59 = call i32 @exit(i32 1)
unreachable
60: ; preds = %2
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 5
%63 = load i8*, i8** %62
%64 = call double @atof(i8* %63)
store double %64, double* %29
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 6
%67 = load i8*, i8** %66
%68 = call double @atof(i8* %67)
store double %68, double* %30
store double 2.000000e+02, double* %39
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 4
%71 = load i8*, i8** %70
%72 = call i32 @atoi(i8* %71)
store i32 %72, i32* %44
store double 2.000000e+00, double* %45
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 1
%75 = load i8*, i8** %74
%76 = call i32* @openfile_or_exit(i8* %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
store i32* %76, i32** %6
%77 = load i32*, i32** %6
%78 = call i32 @read_slap(i32* %77, i32* %11, i32* %10, i32** %16, i32** %17)
%79 = load i8**, i8*** %5
%80 = getelementptr inbounds i8*, i8** %79, i64 2
%81 = load i8*, i8** %80
%82 = call i32* @openfile_or_exit(i8* %81, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
store i32* %82, i32** %7
%83 = load i32*, i32** %7
%84 = call i32 @read_slap(i32* %83, i32* %13, i32* %12, i32** %18, i32** %19)
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 3
%87 = load i8*, i8** %86
%88 = call i32* @openfile_or_exit(i8* %87, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
store i32* %88, i32** %8
%89 = load i32*, i32** %8
%90 = call i32 @read_slap_w(i32* %89, i32* %15, i32* %14, i32** %20, i32** %21, double** %22)
%91 = load i32, i32* %14
%92 = add i32 %91, 1
%93 = zext i32 %92 to i64
%94 = call i8* @llvm.stacksave()
store i8* %94, i8** %46
%95 = alloca i32, i64 %93
store i64 %93, i64* %47
%96 = load i32, i32* %14
%97 = add i32 %96, 1
%98 = zext i32 %97 to i64
%99 = alloca i32, i64 %98
store i64 %98, i64* %48
store i32 0, i32* %23
br label %100
100: ; preds = %149, %60
%101 = load i32, i32* %23
%102 = load i32, i32* %14
%103 = icmp ule i32 %101, %102
br i1 %103, label %104, label %152
104: ; preds = %100
%105 = load i32, i32* %23
%106 = load i32, i32* %10
%107 = icmp ule i32 %105, %106
br i1 %107, label %108, label %117
108: ; preds = %104
%109 = load i32*, i32** %17
%110 = load i32, i32* %23
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i32, i32* %109, i64 %111
%113 = load i32, i32* %112
%114 = load i32, i32* %23
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i32, i32* %95, i64 %115
store i32 %113, i32* %116
br label %126
117: ; preds = %104
%118 = load i32*, i32** %17
%119 = load i32, i32* %10
%120 = zext i32 %119 to i64
%121 = getelementptr inbounds i32, i32* %118, i64 %120
%122 = load i32, i32* %121
%123 = load i32, i32* %23
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i32, i32* %95, i64 %124
store i32 %122, i32* %125
br label %126
126: ; preds = %117, %108
%127 = load i32, i32* %23
%128 = load i32, i32* %12
%129 = icmp ule i32 %127, %128
br i1 %129, label %130, label %139
130: ; preds = %126
%131 = load i32*, i32** %19
%132 = load i32, i32* %23
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i32, i32* %131, i64 %133
%135 = load i32, i32* %134
%136 = load i32, i32* %23
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i32, i32* %99, i64 %137
store i32 %135, i32* %138
br label %148
139: ; preds = %126
%140 = load i32*, i32** %19
%141 = load i32, i32* %12
%142 = zext i32 %141 to i64
%143 = getelementptr inbounds i32, i32* %140, i64 %142
%144 = load i32, i32* %143
%145 = load i32, i32* %23
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i32, i32* %99, i64 %146
store i32 %144, i32* %147
br label %148
148: ; preds = %139, %130
br label %149
149: ; preds = %148
%150 = load i32, i32* %23
%151 = add nsw i32 %150, 1
store i32 %151, i32* %23
br label %100
152: ; preds = %100
%153 = load i32, i32* %14
%154 = zext i32 %153 to i64
%155 = alloca double, i64 %154
store i64 %154, i64* %49
%156 = load i32, i32* %14
%157 = zext i32 %156 to i64
%158 = alloca double, i64 %157
store i64 %157, i64* %50
%159 = load i32, i32* %14
%160 = zext i32 %159 to i64
%161 = alloca double, i64 %160
store i64 %160, i64* %51
store i32 0, i32* %23
br label %162
162: ; preds = %374, %152
%163 = load i32, i32* %23
%164 = load i32, i32* %14
%165 = icmp ult i32 %163, %164
br i1 %165, label %166, label %377
166: ; preds = %162
store double 0.000000e+00, double* %25
store double 0.000000e+00, double* %26
%167 = load i32*, i32** %21
%168 = load i32, i32* %23
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds i32, i32* %167, i64 %169
%171 = load i32, i32* %170
store i32 %171, i32* %24
br label %172
172: ; preds = %291, %166
%173 = load i32, i32* %24
%174 = load i32*, i32** %21
%175 = load i32, i32* %23
%176 = add nsw i32 %175, 1
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds i32, i32* %174, i64 %177
%179 = load i32, i32* %178
%180 = icmp ult i32 %173, %179
br i1 %180, label %181, label %294
181: ; preds = %172
%182 = load double*, double** %22
%183 = load i32, i32* %24
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %182, i64 %184
%186 = load double, double* %185
%187 = fptosi double %186 to i32
store i32 %187, i32* %31
%188 = load i32*, i32** %20
%189 = load i32, i32* %24
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i32, i32* %188, i64 %190
%192 = load i32, i32* %191
%193 = add i32 %192, 1
%194 = zext i32 %193 to i64
%195 = getelementptr inbounds i32, i32* %95, i64 %194
%196 = load i32, i32* %195
%197 = load i32*, i32** %20
%198 = load i32, i32* %24
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds i32, i32* %197, i64 %199
%201 = load i32, i32* %200
%202 = zext i32 %201 to i64
%203 = getelementptr inbounds i32, i32* %95, i64 %202
%204 = load i32, i32* %203
%205 = sub nsw i32 %196, %204
store i32 %205, i32* %32
%206 = load i32*, i32** %20
%207 = load i32, i32* %24
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds i32, i32* %206, i64 %208
%210 = load i32, i32* %209
%211 = add i32 %210, 1
%212 = zext i32 %211 to i64
%213 = getelementptr inbounds i32, i32* %99, i64 %212
%214 = load i32, i32* %213
%215 = load i32*, i32** %20
%216 = load i32, i32* %24
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds i32, i32* %215, i64 %217
%219 = load i32, i32* %218
%220 = zext i32 %219 to i64
%221 = getelementptr inbounds i32, i32* %99, i64 %220
%222 = load i32, i32* %221
%223 = sub nsw i32 %214, %222
store i32 %223, i32* %33
%224 = load i32, i32* %32
%225 = load i32, i32* %33
%226 = add nsw i32 %224, %225
%227 = sitofp i32 %226 to double
%228 = fmul double %227, 1.000000e+00
store double %228, double* %34
%229 = load double, double* %45
%230 = load double, double* %45
%231 = fsub double %230, 1.000000e+00
%232 = fdiv double %229, %231
%233 = load i32, i32* %32
%234 = sitofp i32 %233 to double
%235 = load double, double* %34
%236 = fdiv double %234, %235
%237 = fptosi double %236 to i32
%238 = call i32 @pow(i32 %237, double 2.000000e+00)
%239 = sub nsw i32 1, %238
%240 = load i32, i32* %33
%241 = sitofp i32 %240 to double
%242 = load double, double* %34
%243 = fdiv double %241, %242
%244 = fptosi double %243 to i32
%245 = call i32 @pow(i32 %244, double 2.000000e+00)
%246 = sub nsw i32 %239, %245
%247 = sitofp i32 %246 to double
%248 = fmul double %232, %247
store double %248, double* %35
%249 = load i32, i32* %32
%250 = sitofp i32 %249 to double
%251 = fcmp ogt double %250, 1.000000e-10
br i1 %251, label %252, label %257
252: ; preds = %181
%253 = load i32, i32* %32
%254 = load double, double* %29
%255 = call i32 @pow(i32 %253, double %254)
%256 = sitofp i32 %255 to double
store double %256, double* %36
br label %258
257: ; preds = %181
store double 0.000000e+00, double* %36
br label %258
258: ; preds = %257, %252
%259 = load i32, i32* %33
%260 = sitofp i32 %259 to double
%261 = fcmp ogt double %260, 1.000000e-10
br i1 %261, label %262, label %267
262: ; preds = %258
%263 = load i32, i32* %33
%264 = load double, double* %30
%265 = call i32 @pow(i32 %263, double %264)
%266 = sitofp i32 %265 to double
store double %266, double* %37
br label %268
267: ; preds = %258
store double 0.000000e+00, double* %37
br label %268
268: ; preds = %267, %262
%269 = load i32, i32* %31
%270 = sitofp i32 %269 to double
%271 = load double, double* %36
%272 = load double, double* %37
%273 = fadd double %271, %272
%274 = load double, double* %25
%275 = call double @llvm.fmuladd.f64(double %270, double %273, double %274)
store double %275, double* %25
%276 = load i32, i32* %31
%277 = sitofp i32 %276 to double
%278 = load double, double* %36
%279 = load double, double* %37
%280 = fadd double %278, %279
%281 = fmul double %277, %280
%282 = load i32, i32* %31
%283 = sitofp i32 %282 to double
%284 = load double, double* %36
%285 = load double, double* %37
%286 = fadd double %284, %285
%287 = fmul double %283, %286
%288 = call double @log(double %287)
%289 = load double, double* %26
%290 = call double @llvm.fmuladd.f64(double %281, double %288, double %289)
store double %290, double* %26
br label %291
291: ; preds = %268
%292 = load i32, i32* %24
%293 = add nsw i32 %292, 1
store i32 %293, i32* %24
br label %172
294: ; preds = %172
%295 = load double, double* %25
%296 = load i32, i32* %23
%297 = sext i32 %296 to i64
%298 = getelementptr inbounds double, double* %155, i64 %297
store double %295, double* %298
%299 = load double, double* %26
%300 = load i32, i32* %23
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds double, double* %158, i64 %301
store double %299, double* %302
%303 = load i32, i32* %23
%304 = add nsw i32 %303, 1
%305 = sext i32 %304 to i64
%306 = getelementptr inbounds i32, i32* %95, i64 %305
%307 = load i32, i32* %306
%308 = load i32, i32* %23
%309 = sext i32 %308 to i64
%310 = getelementptr inbounds i32, i32* %95, i64 %309
%311 = load i32, i32* %310
%312 = sub nsw i32 %307, %311
store i32 %312, i32* %32
%313 = load i32, i32* %23
%314 = add nsw i32 %313, 1
%315 = sext i32 %314 to i64
%316 = getelementptr inbounds i32, i32* %99, i64 %315
%317 = load i32, i32* %316
%318 = load i32, i32* %23
%319 = sext i32 %318 to i64
%320 = getelementptr inbounds i32, i32* %99, i64 %319
%321 = load i32, i32* %320
%322 = sub nsw i32 %317, %321
store i32 %322, i32* %33
%323 = load i32, i32* %32
%324 = load i32, i32* %33
%325 = add nsw i32 %323, %324
%326 = sitofp i32 %325 to double
%327 = fmul double %326, 1.000000e+00
store double %327, double* %34
%328 = load double, double* %45
%329 = load double, double* %45
%330 = fsub double %329, 1.000000e+00
%331 = fdiv double %328, %330
%332 = load i32, i32* %32
%333 = sitofp i32 %332 to double
%334 = load double, double* %34
%335 = fdiv double %333, %334
%336 = fptosi double %335 to i32
%337 = call i32 @pow(i32 %336, double 2.000000e+00)
%338 = sub nsw i32 1, %337
%339 = load i32, i32* %33
%340 = sitofp i32 %339 to double
%341 = load double, double* %34
%342 = fdiv double %340, %341
%343 = fptosi double %342 to i32
%344 = call i32 @pow(i32 %343, double 2.000000e+00)
%345 = sub nsw i32 %338, %344
%346 = sitofp i32 %345 to double
%347 = fmul double %331, %346
store double %347, double* %35
%348 = load i32, i32* %32
%349 = sitofp i32 %348 to double
%350 = fcmp ogt double %349, 1.000000e-10
br i1 %350, label %351, label %356
351: ; preds = %294
%352 = load i32, i32* %32
%353 = load double, double* %29
%354 = call i32 @pow(i32 %352, double %353)
%355 = sitofp i32 %354 to double
store double %355, double* %27
br label %357
356: ; preds = %294
store double 0.000000e+00, double* %27
br label %357
357: ; preds = %356, %351
%358 = load i32, i32* %33
%359 = sitofp i32 %358 to double
%360 = fcmp ogt double %359, 1.000000e-10
br i1 %360, label %361, label %366
361: ; preds = %357
%362 = load i32, i32* %33
%363 = load double, double* %30
%364 = call i32 @pow(i32 %362, double %363)
%365 = sitofp i32 %364 to double
store double %365, double* %28
br label %367
366: ; preds = %357
store double 0.000000e+00, double* %28
br label %367
367: ; preds = %366, %361
%368 = load double, double* %27
%369 = load double, double* %28
%370 = fadd double %368, %369
%371 = load i32, i32* %23
%372 = sext i32 %371 to i64
%373 = getelementptr inbounds double, double* %161, i64 %372
store double %370, double* %373
br label %374
374: ; preds = %367
%375 = load i32, i32* %23
%376 = add nsw i32 %375, 1
store i32 %376, i32* %23
br label %162
377: ; preds = %162
store double 0.000000e+00, double* %40
store double 0.000000e+00, double* %41
store double 0.000000e+00, double* %42
store i32 0, i32* %23
br label %378
378: ; preds = %426, %377
%379 = load i32, i32* %23
%380 = load i32, i32* %14
%381 = icmp ult i32 %379, %380
br i1 %381, label %382, label %429
382: ; preds = %378
%383 = load i32, i32* %23
%384 = sext i32 %383 to i64
%385 = getelementptr inbounds double, double* %155, i64 %384
%386 = load double, double* %385
%387 = fcmp ogt double %386, 0.000000e+00
br i1 %387, label %388, label %405
388: ; preds = %382
%389 = load i32, i32* %23
%390 = sext i32 %389 to i64
%391 = getelementptr inbounds double, double* %161, i64 %390
%392 = load double, double* %391
%393 = load i32, i32* %23
%394 = sext i32 %393 to i64
%395 = getelementptr inbounds double, double* %155, i64 %394
%396 = load double, double* %395
%397 = fmul double %392, %396
%398 = load i32, i32* %23
%399 = sext i32 %398 to i64
%400 = getelementptr inbounds double, double* %155, i64 %399
%401 = load double, double* %400
%402 = call double @log(double %401)
%403 = load double, double* %40
%404 = call double @llvm.fmuladd.f64(double %397, double %402, double %403)
store double %404, double* %40
br label %405
405: ; preds = %388, %382
%406 = load double, double* %41
%407 = load i32, i32* %23
%408 = sext i32 %407 to i64
%409 = getelementptr inbounds double, double* %161, i64 %408
%410 = load double, double* %409
%411 = load i32, i32* %23
%412 = sext i32 %411 to i64
%413 = getelementptr inbounds double, double* %158, i64 %412
%414 = load double, double* %413
%415 = call double @llvm.fmuladd.f64(double %410, double %414, double %406)
store double %415, double* %41
%416 = load double, double* %42
%417 = load i32, i32* %23
%418 = sext i32 %417 to i64
%419 = getelementptr inbounds double, double* %161, i64 %418
%420 = load double, double* %419
%421 = load i32, i32* %23
%422 = sext i32 %421 to i64
%423 = getelementptr inbounds double, double* %155, i64 %422
%424 = load double, double* %423
%425 = call double @llvm.fmuladd.f64(double %420, double %424, double %416)
store double %425, double* %42
br label %426
426: ; preds = %405
%427 = load i32, i32* %23
%428 = add nsw i32 %427, 1
store i32 %428, i32* %23
br label %378
429: ; preds = %378
%430 = load double, double* %40
%431 = load double, double* %41
%432 = fsub double %430, %431
%433 = load double, double* %42
%434 = fdiv double %432, %433
store double %434, double* %43
%435 = load double, double* %43
%436 = load double, double* %29
%437 = load double, double* %30
%438 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %435, double %436, double %437)
%439 = load i8*, i8** %46
%440 = load i32, i32* %3
ret i32 %440
}

LLVM IR (-O2):
@.str = [71 x i8] c"Usage: %s <layer1> <layer2> <overlapping network> <N nodes> <b1> <b2>\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"%f %f %f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca double*
%16 = icmp slt i32 %0, 6
br i1 %16, label %17, label %21
17: ; preds = %2
%18 = load i8*, i8** %1
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = bitcast i32* %3 to i8*
%23 = bitcast i32* %4 to i8*
%24 = bitcast i32* %5 to i8*
%25 = bitcast i32* %6 to i8*
%26 = bitcast i32* %7 to i8*
%27 = bitcast i32* %8 to i8*
%28 = bitcast i32** %9 to i8*
%29 = bitcast i32** %10 to i8*
%30 = bitcast i32** %11 to i8*
%31 = bitcast i32** %12 to i8*
%32 = bitcast i32** %13 to i8*
%33 = bitcast i32** %14 to i8*
%34 = bitcast double** %15 to i8*
%35 = getelementptr inbounds i8*, i8** %1, i64 5
%36 = load i8*, i8** %35
%37 = tail call double @atof(i8* %36)
%38 = getelementptr inbounds i8*, i8** %1, i64 6
%39 = load i8*, i8** %38
%40 = tail call double @atof(i8* %39)
%41 = getelementptr inbounds i8*, i8** %1, i64 1
%42 = load i8*, i8** %41
%43 = tail call i32* @openfile_or_exit(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
%44 = call i32 @read_slap(i32* %43, i32* %4, i32* %3, i32** %9, i32** %10)
%45 = getelementptr inbounds i8*, i8** %1, i64 2
%46 = load i8*, i8** %45
%47 = call i32* @openfile_or_exit(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
%48 = call i32 @read_slap(i32* %47, i32* %6, i32* %5, i32** %11, i32** %12)
%49 = getelementptr inbounds i8*, i8** %1, i64 3
%50 = load i8*, i8** %49
%51 = call i32* @openfile_or_exit(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
%52 = call i32 @read_slap_w(i32* %51, i32* %8, i32* %7, i32** %13, i32** %14, double** %15)
%53 = load i32, i32* %7
%54 = add i32 %53, 1
%55 = zext i32 %54 to i64
%56 = call i8* @llvm.stacksave()
%57 = alloca i32, i64 %55
%58 = load i32, i32* %7
%59 = add i32 %58, 1
%60 = zext i32 %59 to i64
%61 = alloca i32, i64 %60
%62 = load i32, i32* %3
%63 = load i32, i32* %5
%64 = load i32*, i32** %10
%65 = zext i32 %62 to i64
%66 = load i32*, i32** %12
%67 = zext i32 %63 to i64
%68 = and i64 %60, 1
%69 = icmp eq i32 %58, 0
br i1 %69, label %99, label %70
70: ; preds = %21
%71 = and i64 %60, 4294967294
br label %72
72: ; preds = %72, %70
%73 = phi i64 [ 0, %70 ], [ %96, %72 ]
%74 = phi i64 [ 0, %70 ], [ %97, %72 ]
%75 = icmp ugt i64 %73, %65
%76 = select i1 %75, i64 %65, i64 %73
%77 = getelementptr inbounds i32, i32* %64, i64 %76
%78 = load i32, i32* %77
%79 = getelementptr inbounds i32, i32* %57, i64 %73
store i32 %78, i32* %79
%80 = icmp ugt i64 %73, %67
%81 = select i1 %80, i64 %67, i64 %73
%82 = getelementptr inbounds i32, i32* %66, i64 %81
%83 = load i32, i32* %82
%84 = getelementptr inbounds i32, i32* %61, i64 %73
store i32 %83, i32* %84
%85 = or i64 %73, 1
%86 = icmp ugt i64 %85, %65
%87 = select i1 %86, i64 %65, i64 %85
%88 = getelementptr inbounds i32, i32* %64, i64 %87
%89 = load i32, i32* %88
%90 = getelementptr inbounds i32, i32* %57, i64 %85
store i32 %89, i32* %90
%91 = icmp ugt i64 %85, %67
%92 = select i1 %91, i64 %67, i64 %85
%93 = getelementptr inbounds i32, i32* %66, i64 %92
%94 = load i32, i32* %93
%95 = getelementptr inbounds i32, i32* %61, i64 %85
store i32 %94, i32* %95
%96 = add nuw nsw i64 %73, 2
%97 = add i64 %74, 2
%98 = icmp eq i64 %97, %71
br i1 %98, label %99, label %72
99: ; preds = %72, %21
%100 = phi i64 [ 0, %21 ], [ %96, %72 ]
%101 = icmp eq i64 %68, 0
br i1 %101, label %113, label %102
102: ; preds = %99
%103 = icmp ugt i64 %100, %65
%104 = select i1 %103, i64 %65, i64 %100
%105 = getelementptr inbounds i32, i32* %64, i64 %104
%106 = load i32, i32* %105
%107 = getelementptr inbounds i32, i32* %57, i64 %100
store i32 %106, i32* %107
%108 = icmp ugt i64 %100, %67
%109 = select i1 %108, i64 %67, i64 %100
%110 = getelementptr inbounds i32, i32* %66, i64 %109
%111 = load i32, i32* %110
%112 = getelementptr inbounds i32, i32* %61, i64 %100
store i32 %111, i32* %112
br label %113
113: ; preds = %99, %102
%114 = zext i32 %58 to i64
%115 = alloca double, i64 %114
%116 = alloca double, i64 %114
%117 = alloca double, i64 %114
%118 = icmp eq i32 %58, 0
br i1 %118, label %270, label %121
119: ; preds = %230
%120 = icmp eq i32 %234, 0
br i1 %120, label %270, label %237
121: ; preds = %113, %230
%122 = phi i64 [ %126, %230 ], [ 0, %113 ]
%123 = load i32*, i32** %14
%124 = getelementptr inbounds i32, i32* %123, i64 %122
%125 = load i32, i32* %124
%126 = add nuw nsw i64 %122, 1
%127 = getelementptr inbounds i32, i32* %123, i64 %126
%128 = load i32, i32* %127
%129 = icmp ult i32 %125, %128
br i1 %129, label %130, label %194
130: ; preds = %121
%131 = sext i32 %125 to i64
br label %132
132: ; preds = %130, %175
%133 = phi i64 [ %131, %130 ], [ %186, %175 ]
%134 = phi <2 x double> [ zeroinitializer, %130 ], [ %185, %175 ]
%135 = load double*, double** %15
%136 = getelementptr inbounds double, double* %135, i64 %133
%137 = load double, double* %136
%138 = fptosi double %137 to i32
%139 = load i32*, i32** %13
%140 = getelementptr inbounds i32, i32* %139, i64 %133
%141 = load i32, i32* %140
%142 = add i32 %141, 1
%143 = zext i32 %142 to i64
%144 = getelementptr inbounds i32, i32* %57, i64 %143
%145 = load i32, i32* %144
%146 = zext i32 %141 to i64
%147 = getelementptr inbounds i32, i32* %57, i64 %146
%148 = load i32, i32* %147
%149 = sub nsw i32 %145, %148
%150 = getelementptr inbounds i32, i32* %61, i64 %143
%151 = load i32, i32* %150
%152 = getelementptr inbounds i32, i32* %61, i64 %146
%153 = load i32, i32* %152
%154 = sub nsw i32 %151, %153
%155 = add nsw i32 %154, %149
%156 = sitofp i32 %155 to double
%157 = sitofp i32 %149 to double
%158 = fdiv double %157, %156
%159 = fptosi double %158 to i32
%160 = call i32 @pow(i32 %159, double 2.000000e+00)
%161 = sitofp i32 %154 to double
%162 = fdiv double %161, %156
%163 = fptosi double %162 to i32
%164 = call i32 @pow(i32 %163, double 2.000000e+00)
%165 = icmp sgt i32 %149, 0
br i1 %165, label %166, label %169
166: ; preds = %132
%167 = call i32 @pow(i32 %149, double %37)
%168 = sitofp i32 %167 to double
br label %169
169: ; preds = %132, %166
%170 = phi double [ %168, %166 ], [ 0.000000e+00, %132 ]
%171 = icmp sgt i32 %154, 0
br i1 %171, label %172, label %175
172: ; preds = %169
%173 = call i32 @pow(i32 %154, double %40)
%174 = sitofp i32 %173 to double
br label %175
175: ; preds = %169, %172
%176 = phi double [ %174, %172 ], [ 0.000000e+00, %169 ]
%177 = sitofp i32 %138 to double
%178 = fadd double %170, %176
%179 = fmul double %178, %177
%180 = call double @log(double %179)
%181 = insertelement <2 x double> poison, double %179, i64 0
%182 = insertelement <2 x double> %181, double %177, i64 1
%183 = insertelement <2 x double> poison, double %180, i64 0
%184 = insertelement <2 x double> %183, double %178, i64 1
%185 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %182, <2 x double> %184, <2 x double> %134)
%186 = add nsw i64 %133, 1
%187 = load i32*, i32** %14
%188 = getelementptr inbounds i32, i32* %187, i64 %126
%189 = load i32, i32* %188
%190 = trunc i64 %186 to i32
%191 = icmp ugt i32 %189, %190
br i1 %191, label %132, label %192
192: ; preds = %175
%193 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %182, <2 x double> %184, <2 x double> %134)
br label %194
194: ; preds = %192, %121
%195 = phi <2 x double> [ zeroinitializer, %121 ], [ %193, %192 ]
%196 = getelementptr inbounds double, double* %115, i64 %122
%197 = extractelement <2 x double> %195, i64 1
store double %197, double* %196
%198 = getelementptr inbounds double, double* %116, i64 %122
%199 = extractelement <2 x double> %195, i64 0
store double %199, double* %198
%200 = getelementptr inbounds i32, i32* %57, i64 %126
%201 = load i32, i32* %200
%202 = getelementptr inbounds i32, i32* %57, i64 %122
%203 = load i32, i32* %202
%204 = sub nsw i32 %201, %203
%205 = getelementptr inbounds i32, i32* %61, i64 %126
%206 = load i32, i32* %205
%207 = getelementptr inbounds i32, i32* %61, i64 %122
%208 = load i32, i32* %207
%209 = sub nsw i32 %206, %208
%210 = add nsw i32 %209, %204
%211 = sitofp i32 %210 to double
%212 = sitofp i32 %204 to double
%213 = fdiv double %212, %211
%214 = fptosi double %213 to i32
%215 = call i32 @pow(i32 %214, double 2.000000e+00)
%216 = sitofp i32 %209 to double
%217 = fdiv double %216, %211
%218 = fptosi double %217 to i32
%219 = call i32 @pow(i32 %218, double 2.000000e+00)
%220 = icmp sgt i32 %204, 0
br i1 %220, label %221, label %224
221: ; preds = %194
%222 = call i32 @pow(i32 %204, double %37)
%223 = sitofp i32 %222 to double
br label %224
224: ; preds = %194, %221
%225 = phi double [ %223, %221 ], [ 0.000000e+00, %194 ]
%226 = icmp sgt i32 %209, 0
br i1 %226, label %227, label %230
227: ; preds = %224
%228 = call i32 @pow(i32 %209, double %40)
%229 = sitofp i32 %228 to double
br label %230
230: ; preds = %224, %227
%231 = phi double [ %229, %227 ], [ 0.000000e+00, %224 ]
%232 = fadd double %225, %231
%233 = getelementptr inbounds double, double* %117, i64 %122
store double %232, double* %233
%234 = load i32, i32* %7
%235 = zext i32 %234 to i64
%236 = icmp ult i64 %126, %235
br i1 %236, label %121, label %119
237: ; preds = %119, %252
%238 = phi i32 [ %253, %252 ], [ %234, %119 ]
%239 = phi i64 [ %262, %252 ], [ 0, %119 ]
%240 = phi double [ %254, %252 ], [ 0.000000e+00, %119 ]
%241 = phi <2 x double> [ %261, %252 ], [ zeroinitializer, %119 ]
%242 = getelementptr inbounds double, double* %115, i64 %239
%243 = load double, double* %242
%244 = fcmp ogt double %243, 0.000000e+00
%245 = getelementptr inbounds double, double* %117, i64 %239
%246 = load double, double* %245
br i1 %244, label %247, label %252
247: ; preds = %237
%248 = fmul double %243, %246
%249 = call double @log(double %243)
%250 = call double @llvm.fmuladd.f64(double %248, double %249, double %240)
%251 = load i32, i32* %7
br label %252
252: ; preds = %237, %247
%253 = phi i32 [ %251, %247 ], [ %238, %237 ]
%254 = phi double [ %250, %247 ], [ %240, %237 ]
%255 = getelementptr inbounds double, double* %116, i64 %239
%256 = load double, double* %255
%257 = insertelement <2 x double> poison, double %246, i64 0
%258 = shufflevector <2 x double> %257, <2 x double> poison, <2 x i32> zeroinitializer
%259 = insertelement <2 x double> poison, double %243, i64 0
%260 = insertelement <2 x double> %259, double %256, i64 1
%261 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %258, <2 x double> %260, <2 x double> %241)
%262 = add nuw nsw i64 %239, 1
%263 = zext i32 %253 to i64
%264 = icmp ult i64 %262, %263
br i1 %264, label %237, label %265
265: ; preds = %252
%266 = extractelement <2 x double> %261, i64 1
%267 = fsub double %254, %266
%268 = extractelement <2 x double> %261, i64 0
%269 = fdiv double %267, %268
br label %270
270: ; preds = %113, %265, %119
%271 = phi double [ %269, %265 ], [ 0x7FF8000000000000, %119 ], [ 0x7FF8000000000000, %113 ]
%272 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %271, double %37, double %40)
ret i32 0
}