#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 RAND_MAX;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *, ...);
int gaus();
int /*<<< orphan*/ printf(char *);
int rand();
int /*<<< orphan*/ srand(int);
int time(int /*<<< orphan*/ *);
int main() {
  double rnd_x, rnd_y, gauss, ratioC, Csig, Rsig, Cn, Rn, C0, R0;
  double e = 2.7182818, rmax = 2147483647;
  int i, cy, cx, size, seed;
  FILE *f0, *f1, *f2, *f3;
  if (f0 = fopen("parameters.ini", "r"))
    fscanf(f0, "%d %lf %lf %lf %lf %lf", &size, &ratioC, &C0, &Csig, &R0,
           &Rsig);
  else {
    f0 = fopen("parameters.ini", "w");
    fprintf(f0, "50 0.4 1 0.333 1 0.333\nN_vert_comps ratio_C C0 "
                "sigma_C(fraction of C0) R0 sigma_R(fraction of R0)");
    printf("Edit Values in \"parameters.ini\" then rerun");
    return 0;
  }
  fscanf(f0, "%d %lf %lf %lf %lf %lf", &size, &ratioC, &C0, &Csig, &R0, &Rsig);
  fclose(f0);
  rmax = RAND_MAX;
  if (f1 = fopen("seed", "r")) {
    fscanf(f1, "%d", &seed);
    srand(seed);
    fclose(f1);
  } else
    srand(time(NULL));
  f1 = fopen("seed", "w");
  fprintf(f1, "%d", rand());
  fclose(f1);
  f0 = fopen("circuit.cir", "w");
  f2 = fopen("capacitors.txt", "w");
  f3 = fopen("resistors.txt", "w");
  fprintf(f0, "Random RC Network\n");
  for (cy = 0; cy < size; cy++)
    for (cx = 1; cx < size - 1; cx++) {
      if ((cy + cx) % 2 == 1) {
        Cn = C0 * (1 + gaus() * 3 * Csig);
        fprintf(f0, "Cx%dy%dX x%dy%d x%dy%d %en\n", cx, cy, cx, cy, cx + 1, cy,
                Cn);
        fprintf(f0, "Rx%dy%dX x%dy%d x%dy%d 1G\n", cx, cy, cx, cy, cx + 1, cy);
        fprintf(f2, "%d %d %e\n%d %d %e\n\n", cx, cy, Cn, cx + 1, cy, Cn);
      } else {
        Rn = R0 * (1 + gaus() * 3 * Rsig);
        fprintf(f0, "Rx%dy%dX x%dy%d x%dy%d %ek\n", cx, cy, cx, cy, cx + 1, cy,
                Rn);
        fprintf(f3, "%d %d %e\n%d %d %e\n\n", cx, cy, Rn, cx + 1, cy, Rn);
      }
      fprintf(f2, "\n");
      fprintf(f3, "\n");
    }
  fprintf(f2, "\n");
  fprintf(f3, "\n");
  for (cy = 0; cy < size - 1; cy++)
    for (cx = 1; cx < size; cx++) {
      if ((cy + cx) % 2 == 0) {
        Cn = C0 * (1 + gaus() * 3 * Csig);
        fprintf(f0, "Cx%dy%dY x%dy%d x%dy%d %en\n", cx, cy, cx, cy, cx, cy + 1,
                Cn);
        fprintf(f0, "Rx%dy%dY x%dy%d x%dy%d 1G\n", cx, cy, cx, cy, cx, cy + 1);
        fprintf(f2, "%d %d %e\n%d %d %e\n\n", cx, cy, Cn, cx, cy + 1, Cn);
      } else {
        Rn = R0 * (1 + gaus() * 3 * Rsig);
        fprintf(f0, "Rx%dy%dY x%dy%d x%dy%d %ek\n", cx, cy, cx, cy, cx, cy + 1,
                Rn);
        fprintf(f3, "%d %d %e\n%d %d %e\n\n", cx, cy, Rn, cx, cy + 1, Rn);
      }
      fprintf(f2, "\n");
      fprintf(f3, "\n");
    }
  fprintf(f2, "\n");
  fprintf(f3, "\n");
  for (cy = 0; cy < size; cy++) {
    if ((cy) % 2 == 1) {
      Cn = C0 * (1 + gaus() * 3 * Csig);
      fprintf(f0, "Cx0y%dX 0 x1y%d %en\n", cy, cy, Cn);
      fprintf(f0, "Rx0y%dX 0 x1y%d 1G\n", cy, cy);
      fprintf(f2, "0 %d %e\n1 %d %e\n\n", cy, Cn, cy, Cn);
    } else {
      Rn = R0 * (1 + gaus() * 3 * Rsig);
      fprintf(f0, "Rx0y%dX 0 x1y%d %ek\n", cy, cy, Rn);
      fprintf(f3, "0 %d %e\n1 %d %e\n\n", cy, Rn, cy, Rn);
    }
    fprintf(f2, "\n");
    fprintf(f3, "\n");
    if ((cy + size) % 2 == 0) {
      Cn = C0 * (1 + gaus() * 3 * Csig);
      fprintf(f0, "Cx%dy%dX x%dy%d VOUT %en\n", size - 1, cy, size - 1, cy, Cn);
      fprintf(f0, "Rx%dy%dX x%dy%d VOUT 1G\n", size - 1, cy, size - 1, cy);
      fprintf(f2, "%d %d %e\n%d %d %e\n\n", size - 1, cy, Cn, size, cy, Cn);
    } else {
      Rn = R0 * (1 + gaus() * 3 * Rsig);
      fprintf(f0, "Rx%dy%dX x%dy%d VOUT %ek\n", size - 1, cy, size - 1, cy, Rn);
      fprintf(f3, "%d %d %e\n%d %d %e\n\n", size - 1, cy, Rn, size, cy, Rn);
    }
    fprintf(f2, "\n");
    fprintf(f3, "\n");
  }
  fprintf(f0, "V1 R1_N 0 AC 50\nR1 VOUT R1_N 100Meg\n");
  fclose(f0);
  fclose(f2);
  fclose(f3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xe5e(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe49(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
lea    0xe55(%rip),%rdi
lea    0xf15(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x88(%rbp)
cmp    $0x0,%rax
je     121b <main+0x8b>
mov    -0x88(%rbp),%rdi
lea    0xe39(%rip),%rsi
lea    -0x78(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x50(%rbp),%r8
lea    -0x30(%rbp),%r9
lea    -0x58(%rbp),%r10
lea    -0x38(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1050 <fscanf@plt>
jmp    1262 <main+0xd2>
lea    0xdf6(%rip),%rdi
lea    0xe15(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
lea    0xdfd(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1bdf <main+0xa4f>
mov    -0x88(%rbp),%rdi
lea    0xdb7(%rip),%rsi
lea    -0x78(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x50(%rbp),%r8
lea    -0x30(%rbp),%r9
lea    -0x58(%rbp),%r10
lea    -0x38(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1050 <fscanf@plt>
mov    -0x88(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2d3d(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
lea    0xe12(%rip),%rdi
lea    0xe1d(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x90(%rbp)
cmp    $0x0,%rax
je     130a <main+0x17a>
mov    -0x90(%rbp),%rdi
lea    0xdec(%rip),%rsi
lea    -0x7c(%rbp),%rdx
mov    $0x0,%al
call   1050 <fscanf@plt>
mov    -0x7c(%rbp),%edi
call   1060 <srand@plt>
mov    -0x90(%rbp),%rdi
call   1030 <fclose@plt>
jmp    131a <main+0x18a>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    0xdac(%rip),%rdi
lea    0xd16(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    $0x0,%al
call   10b0 <rand@plt>
mov    -0xa8(%rbp),%rdi
mov    %eax,%edx
lea    0xd79(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x90(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xd62(%rip),%rdi
lea    0xcc4(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x88(%rbp)
lea    0xd54(%rip),%rdi
lea    0xcaa(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x98(%rbp)
lea    0xd49(%rip),%rdi
lea    0xc90(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x88(%rbp),%rdi
lea    0xd36(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    15f1 <main+0x461>
movl   $0x1,-0x74(%rbp)
mov    -0x74(%rbp),%eax
mov    -0x78(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    15de <main+0x44e>
mov    -0x70(%rbp),%eax
add    -0x74(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    14f9 <main+0x369>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    $0x0,%al
call   10a0 <gaus@plt>
movsd  -0xb0(%rbp),%xmm0
ff
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xbcb(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x70(%rbp),%ecx
mov    -0x74(%rbp),%r8d
mov    -0x70(%rbp),%r9d
mov    -0x74(%rbp),%r10d
add    $0x1,%r10d
mov    -0x70(%rbp),%eax
movsd  -0x40(%rbp),%xmm0
lea    0xc93(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0x88(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x70(%rbp),%ecx
mov    -0x74(%rbp),%r8d
mov    -0x70(%rbp),%r9d
mov    -0x74(%rbp),%r10d
add    $0x1,%r10d
mov    -0x70(%rbp),%eax
lea    0xc79(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x98(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x70(%rbp),%ecx
movsd  -0x40(%rbp),%xmm0
mov    -0x74(%rbp),%r8d
add    $0x1,%r8d
mov    -0x70(%rbp),%r9d
movsd  -0x40(%rbp),%xmm1
lea    0xc5b(%rip),%rsi
mov    $0x2,%al
call   1070 <fprintf@plt>
jmp    15a6 <main+0x416>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    $0x0,%al
call   10a0 <gaus@plt>
movsd  -0xb8(%rbp),%xmm0
ff
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xae3(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x70(%rbp),%ecx
mov    -0x74(%rbp),%r8d
mov    -0x70(%rbp),%r9d
mov    -0x74(%rbp),%r10d
add    $0x1,%r10d
mov    -0x70(%rbp),%eax
movsd  -0x48(%rbp),%xmm0
lea    0xbf6(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x70(%rbp),%ecx
movsd  -0x48(%rbp),%xmm0
mov    -0x74(%rbp),%r8d
add    $0x1,%r8d
mov    -0x70(%rbp),%r9d
movsd  -0x48(%rbp),%xmm1
lea    0xba9(%rip),%rsi
mov    $0x2,%al
call   1070 <fprintf@plt>
mov    -0x98(%rbp),%rdi
lea    0xc50(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
lea    0xc3b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    13e9 <main+0x259>
jmp    15e3 <main+0x453>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    13d6 <main+0x246>
mov    -0x98(%rbp),%rdi
lea    0xc05(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
lea    0xbf0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
mov    -0x78(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    183a <main+0x6aa>
movl   $0x1,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    1827 <main+0x697>
mov    -0x70(%rbp),%eax
add    -0x74(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1743 <main+0x5b3>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    $0x0,%al
call   10a0 <gaus@plt>
movsd  -0xc0(%rbp),%xmm0
ff
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x97f(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x70(%rbp),%ecx
mov    -0x74(%rbp),%r8d
mov    -0x70(%rbp),%r9d
mov    -0x74(%rbp),%r10d
mov    -0x70(%rbp),%eax
add    $0x1,%eax
movsd  -0x40(%rbp),%xmm0
lea    0xaaf(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0x88(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x70(%rbp),%ecx
mov    -0x74(%rbp),%r8d
mov    -0x70(%rbp),%r9d
mov    -0x74(%rbp),%r10d
mov    -0x70(%rbp),%eax
add    $0x1,%eax
lea    0xa96(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x98(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x70(%rbp),%ecx
movsd  -0x40(%rbp),%xmm0
mov    -0x74(%rbp),%r8d
mov    -0x70(%rbp),%r9d
add    $0x1,%r9d
movsd  -0x40(%rbp),%xmm1
lea    0xa11(%rip),%rsi
mov    $0x2,%al
call   1070 <fprintf@plt>
jmp    17ef <main+0x65f>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    $0x0,%al
call   10a0 <gaus@plt>
movsd  -0xc8(%rbp),%xmm0
ff
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x899(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x70(%rbp),%ecx
mov    -0x74(%rbp),%r8d
mov    -0x70(%rbp),%r9d
mov    -0x74(%rbp),%r10d
mov    -0x70(%rbp),%eax
add    $0x1,%eax
movsd  -0x48(%rbp),%xmm0
lea    0xa00(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x70(%rbp),%ecx
movsd  -0x48(%rbp),%xmm0
mov    -0x74(%rbp),%r8d
mov    -0x70(%rbp),%r9d
add    $0x1,%r9d
movsd  -0x48(%rbp),%xmm1
lea    0x960(%rip),%rsi
mov    $0x2,%al
call   1070 <fprintf@plt>
mov    -0x98(%rbp),%rdi
lea    0xa07(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
lea    0x9f2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    163a <main+0x4aa>
jmp    182c <main+0x69c>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1622 <main+0x492>
mov    -0x98(%rbp),%rdi
lea    0x9bc(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
lea    0x9a7(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    1b9f <main+0xa0f>
mov    -0x70(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1931 <main+0x7a1>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    $0x0,%al
call   10a0 <gaus@plt>
movsd  -0xd0(%rbp),%xmm0
ff
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x751(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x70(%rbp),%edx
mov    -0x70(%rbp),%ecx
movsd  -0x40(%rbp),%xmm0
lea    0x8e6(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0x88(%rbp),%rdi
mov    -0x70(%rbp),%edx
mov    -0x70(%rbp),%ecx
lea    0x8e0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x98(%rbp),%rdi
mov    -0x70(%rbp),%edx
movsd  -0x40(%rbp),%xmm0
mov    -0x70(%rbp),%ecx
movsd  -0x40(%rbp),%xmm1
lea    0x8cf(%rip),%rsi
mov    $0x2,%al
call   1070 <fprintf@plt>
jmp    19b7 <main+0x827>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
mov    $0x0,%al
call   10a0 <gaus@plt>
movsd  -0xd8(%rbp),%xmm0
ff
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x6ab(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x70(%rbp),%edx
mov    -0x70(%rbp),%ecx
movsd  -0x48(%rbp),%xmm0
lea    0x87b(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x70(%rbp),%edx
movsd  -0x48(%rbp),%xmm0
mov    -0x70(%rbp),%ecx
movsd  -0x48(%rbp),%xmm1
lea    0x844(%rip),%rsi
mov    $0x2,%al
call   1070 <fprintf@plt>
mov    -0x98(%rbp),%rdi
lea    0x83f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
lea    0x82a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x70(%rbp),%eax
add    -0x78(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1ac7 <main+0x937>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
mov    $0x0,%al
call   10a0 <gaus@plt>
movsd  -0xe0(%rbp),%xmm0
ff
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x5e4(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x78(%rbp),%edx
sub    $0x1,%edx
mov    -0x70(%rbp),%ecx
mov    -0x78(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x70(%rbp),%r9d
movsd  -0x40(%rbp),%xmm0
lea    0x7ba(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0x88(%rbp),%rdi
mov    -0x78(%rbp),%edx
sub    $0x1,%edx
mov    -0x70(%rbp),%ecx
mov    -0x78(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x70(%rbp),%r9d
lea    0x7aa(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x98(%rbp),%rdi
mov    -0x78(%rbp),%edx
sub    $0x1,%edx
mov    -0x70(%rbp),%ecx
movsd  -0x40(%rbp),%xmm0
mov    -0x78(%rbp),%r8d
mov    -0x70(%rbp),%r9d
movsd  -0x40(%rbp),%xmm1
lea    0x68d(%rip),%rsi
mov    $0x2,%al
call   1070 <fprintf@plt>
jmp    1b67 <main+0x9d7>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
mov    $0x0,%al
call   10a0 <gaus@plt>
movsd  -0xe8(%rbp),%xmm0
ff
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x515(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x78(%rbp),%edx
sub    $0x1,%edx
mov    -0x70(%rbp),%ecx
mov    -0x78(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x70(%rbp),%r9d
movsd  -0x48(%rbp),%xmm0
lea    0x71e(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x78(%rbp),%edx
sub    $0x1,%edx
mov    -0x70(%rbp),%ecx
movsd  -0x48(%rbp),%xmm0
mov    -0x78(%rbp),%r8d
mov    -0x70(%rbp),%r9d
movsd  -0x48(%rbp),%xmm1
lea    0x5e8(%rip),%rsi
mov    $0x2,%al
call   1070 <fprintf@plt>
mov    -0x98(%rbp),%rdi
lea    0x68f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
lea    0x67a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    186b <main+0x6db>
mov    -0x88(%rbp),%rdi
lea    0x6bb(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x88(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x98(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xa0(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xe43(%rip),%rdi
lea    0xf03(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1293 <main+0xe3>
mov    %rax,%r14
lea    0x18(%rsp),%r10
lea    0x20(%rsp),%rbp
lea    0xe29(%rip),%rsi
lea    0x14(%rsp),%rbx
lea    0x40(%rsp),%r15
lea    0x28(%rsp),%r12
lea    0x30(%rsp),%r13
mov    %rax,%rdi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r12,%r8
mov    %r13,%r9
xor    %eax,%eax
push   %r10
push   %rbp
call   1050 <fscanf@plt>
add    $0x10,%rsp
mov    %r14,%rdi
lea    0xdee(%rip),%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r12,%r8
mov    %r13,%r9
xor    %eax,%eax
lea    0x18(%rsp),%rbx
push   %rbx
push   %rbp
call   1050 <fscanf@plt>
add    $0x10,%rsp
mov    %r14,%rdi
call   1030 <fclose@plt>
lea    0xe67(%rip),%rdi
lea    0xe72(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     12d0 <main+0x120>
mov    %rax,%rbx
lea    0xe51(%rip),%rsi
lea    0x3c(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1050 <fscanf@plt>
mov    0x3c(%rsp),%edi
call   1070 <srand@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
jmp    12de <main+0x12e>
lea    0xd6e(%rip),%rdi
lea    0xd8d(%rip),%rsi
call   10a0 <fopen@plt>
lea    0xd83(%rip),%rdi
mov    $0x61,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10b0 <fwrite@plt>
lea    0xdcc(%rip),%rdi
call   1040 <printf@plt>
jmp    1935 <main+0x785>
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xdd8(%rip),%rdi
lea    0xd42(%rip),%rbx
mov    %rbx,%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbp
xor    %eax,%eax
call   10d0 <rand@plt>
lea    0xdbd(%rip),%rsi
mov    %rbp,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbp,%rdi
call   1030 <fclose@plt>
lea    0xda5(%rip),%rdi
mov    %rbx,%rsi
call   10a0 <fopen@plt>
mov    %rax,%r14
lea    0xd9f(%rip),%rdi
mov    %rbx,%rsi
call   10a0 <fopen@plt>
mov    %rax,%r15
lea    0xd9c(%rip),%rdi
mov    %rbx,%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
lea    0xd98(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    0x14(%rsp),%eax
test   %eax,%eax
jle    14ea <main+0x33a>
xor    %r13d,%r13d
jmp    138d <main+0x1dd>
nopl   0x0(%rax)
add    $0x1,%r13d
cmp    %eax,%r13d
jge    14ea <main+0x33a>
cmp    $0x3,%eax
jl     1380 <main+0x1d0>
mov    $0x1,%r12d
jmp    1452 <main+0x2a2>
nopl   (%rax)
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10c0 <gaus@plt>
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0xc35(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x1(%r12),%ebp
mov    %r14,%rdi
lea    0xd66(%rip),%rsi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %r13d,%r9d
mov    $0x1,%al
push   %r13
push   %rbp
call   1080 <fprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
lea    0xd2e(%rip),%rsi
mov    %r12d,%edx
mov    %r13d,%ecx
movsd  0x8(%rsp),%xmm0
mov    %ebp,%r8d
mov    %r13d,%r9d
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1080 <fprintf@plt>
mov    %ebp,%r12d
mov    $0xa,%edi
mov    %r15,%rsi
call   1060 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
mov    0x14(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    %ecx,%ebp
jge    1380 <main+0x1d0>
lea    (%r12,%r13,1),%eax
test   $0x1,%al
je     13a0 <main+0x1f0>
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10c0 <gaus@plt>
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x30(%rsp),%xmm0
addsd  0xb77(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x1(%r12),%ebp
mov    %r14,%rdi
lea    0xc5d(%rip),%rsi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %r13d,%r9d
mov    $0x1,%al
push   %r13
push   %rbp
call   1080 <fprintf@plt>
add    $0x10,%rsp
mov    %r14,%rdi
lea    0xc55(%rip),%rsi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %r13d,%r9d
xor    %eax,%eax
push   %r13
push   %rbp
call   1080 <fprintf@plt>
add    $0x10,%rsp
mov    %r15,%rdi
jmp    1403 <main+0x253>
mov    $0xa,%edi
mov    %r15,%rsi
call   1060 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
mov    0x14(%rsp),%eax
cmp    $0x2,%eax
jl     168a <main+0x4da>
xor    %r13d,%r13d
jmp    152f <main+0x37f>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rax),%ecx
mov    %r12d,%r13d
cmp    %ecx,%r12d
jge    168a <main+0x4da>
lea    0x1(%r13),%r12d
cmp    $0x2,%eax
jl     1520 <main+0x370>
mov    $0x1,%ebp
jmp    15f8 <main+0x448>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10c0 <gaus@plt>
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0xa85(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
lea    0xc0e(%rip),%rsi
mov    %ebp,%edx
mov    %r13d,%ecx
mov    %ebp,%r8d
mov    %r13d,%r9d
mov    $0x1,%al
push   %r12
push   %rbp
call   1080 <fprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
lea    0xb84(%rip),%rsi
mov    %ebp,%edx
mov    %r13d,%ecx
movsd  0x8(%rsp),%xmm0
mov    %ebp,%r8d
mov    %r12d,%r9d
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1080 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1060 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
add    $0x1,%ebp
mov    0x14(%rsp),%eax
cmp    %eax,%ebp
jge    1520 <main+0x370>
lea    0x0(%r13,%rbp,1),%eax
test   $0x1,%al
jne    1550 <main+0x3a0>
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10c0 <gaus@plt>
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x30(%rsp),%xmm0
addsd  0x9d0(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
lea    0xb22(%rip),%rsi
mov    %ebp,%edx
mov    %r13d,%ecx
mov    %ebp,%r8d
mov    %r13d,%r9d
mov    $0x1,%al
push   %r12
push   %rbp
call   1080 <fprintf@plt>
add    $0x10,%rsp
mov    %r14,%rdi
lea    0xb1b(%rip),%rsi
mov    %ebp,%edx
mov    %r13d,%ecx
mov    %ebp,%r8d
mov    %r13d,%r9d
xor    %eax,%eax
push   %r12
push   %rbp
call   1080 <fprintf@plt>
add    $0x10,%rsp
mov    %r15,%rdi
jmp    15ad <main+0x3fd>
mov    $0xa,%edi
mov    %r15,%rsi
call   1060 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
cmpl   $0x0,0x14(%rsp)
jle    1904 <main+0x754>
lea    0xb2e(%rip),%r13
lea    0xa7b(%rip),%rbp
xor    %r12d,%r12d
jmp    1776 <main+0x5c6>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10c0 <gaus@plt>
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0x905(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    0x14(%rsp),%edx
add    $0xffffffff,%edx
mov    %r14,%rdi
lea    0xb26(%rip),%rsi
mov    %r12d,%ecx
mov    %edx,%r8d
mov    %r12d,%r9d
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    0x14(%rsp),%r8d
lea    -0x1(%r8),%edx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r12d,%ecx
movsd  0x8(%rsp),%xmm0
mov    %r12d,%r9d
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1080 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1060 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
add    $0x1,%r12d
cmp    0x14(%rsp),%r12d
jge    1904 <main+0x754>
test   $0x1,%r12b
jne    17d0 <main+0x620>
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10c0 <gaus@plt>
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0x859(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
lea    0xa39(%rip),%rsi
mov    %r12d,%edx
mov    %r12d,%ecx
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    %rbx,%rdi
jmp    1838 <main+0x688>
nop
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10c0 <gaus@plt>
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x30(%rsp),%xmm0
addsd  0x805(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
lea    0x9aa(%rip),%rsi
mov    %r12d,%edx
mov    %r12d,%ecx
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    %r14,%rdi
lea    0x9a8(%rip),%rsi
mov    %r12d,%edx
mov    %r12d,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r12d,%edx
movsd  0x8(%rsp),%xmm0
mov    %r12d,%ecx
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1080 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1060 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
mov    0x14(%rsp),%eax
add    %r12d,%eax
test   $0x1,%al
jne    16d0 <main+0x520>
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10c0 <gaus@plt>
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x30(%rsp),%xmm0
addsd  0x75b(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    0x14(%rsp),%edx
add    $0xffffffff,%edx
mov    %r14,%rdi
lea    0x949(%rip),%rsi
mov    %r12d,%ecx
mov    %edx,%r8d
mov    %r12d,%r9d
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    0x14(%rsp),%edx
add    $0xffffffff,%edx
mov    %r14,%rdi
lea    0x942(%rip),%rsi
mov    %r12d,%ecx
mov    %edx,%r8d
mov    %r12d,%r9d
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x14(%rsp),%r8d
lea    -0x1(%r8),%edx
mov    %r15,%rdi
jmp    1734 <main+0x584>
lea    0x94d(%rip),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"parameters.ini\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [23 x i8] c"%d %lf %lf %lf %lf %lf\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [98 x i8] c"50 0.4 1 0.333 1 0.333\0AN_vert_comps ratio_C C0 sigma_C(fraction of C0) R0 sigma_R(fraction of R0)\00"
@.str.5 = [43 x i8] c"Edit Values in \22parameters.ini\22 then rerun\00"
@RAND_MAX = global double 0.000000e+00
@.str.6 = [5 x i8] c"seed\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [12 x i8] c"circuit.cir\00"
@.str.9 = [15 x i8] c"capacitors.txt\00"
@.str.10 = [14 x i8] c"resistors.txt\00"
@.str.11 = [19 x i8] c"Random RC Network\0A\00"
@.str.12 = [28 x i8] c"Cx%dy%dX x%dy%d x%dy%d %en\0A\00"
@.str.13 = [27 x i8] c"Rx%dy%dX x%dy%d x%dy%d 1G\0A\00"
@.str.14 = [20 x i8] c"%d %d %e\0A%d %d %e\0A\0A\00"
@.str.15 = [28 x i8] c"Rx%dy%dX x%dy%d x%dy%d %ek\0A\00"
@.str.16 = [2 x i8] c"\0A\00"
@.str.17 = [28 x i8] c"Cx%dy%dY x%dy%d x%dy%d %en\0A\00"
@.str.18 = [27 x i8] c"Rx%dy%dY x%dy%d x%dy%d 1G\0A\00"
@.str.19 = [28 x i8] c"Rx%dy%dY x%dy%d x%dy%d %ek\0A\00"
@.str.20 = [21 x i8] c"Cx0y%dX 0 x1y%d %en\0A\00"
@.str.21 = [20 x i8] c"Rx0y%dX 0 x1y%d 1G\0A\00"
@.str.22 = [18 x i8] c"0 %d %e\0A1 %d %e\0A\0A\00"
@.str.23 = [21 x i8] c"Rx0y%dX 0 x1y%d %ek\0A\00"
@.str.24 = [26 x i8] c"Cx%dy%dX x%dy%d VOUT %en\0A\00"
@.str.25 = [25 x i8] c"Rx%dy%dX x%dy%d VOUT 1G\0A\00"
@.str.26 = [26 x i8] c"Rx%dy%dX x%dy%d VOUT %ek\0A\00"
@.str.27 = [37 x i8] c"V1 R1_N 0 AC 50\0AR1 VOUT R1_N 100Meg\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%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 i32*
store i32 0, i32* %1
store double 0x4005BF0A87427F01, double* %12
store double 0x41DFFFFFFFC00000, double* %13
%23 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %19
%24 = icmp ne i32* %23, null
br i1 %24, label %25, label %28
25: ; preds = %0
%26 = load i32*, i32** %19
%27 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %26, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32* %17, double* %5, double* %10, double* %6, double* %11, double* %7)
br label %33
28: ; preds = %0
%29 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %29, i32** %19
%30 = load i32*, i32** %19
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %1
br label %392
33: ; preds = %25
%34 = load i32*, i32** %19
%35 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %34, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32* %17, double* %5, double* %10, double* %6, double* %11, double* %7)
%36 = load i32*, i32** %19
%37 = call i32 @fclose(i32* %36)
%38 = load double, double* @RAND_MAX
store double %38, double* %13
%39 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %39, i32** %20
%40 = icmp ne i32* %39, null
br i1 %40, label %41, label %48
41: ; preds = %33
%42 = load i32*, i32** %20
%43 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %18)
%44 = load i32, i32* %18
%45 = call i32 @srand(i32 %44)
%46 = load i32*, i32** %20
%47 = call i32 @fclose(i32* %46)
br label %51
48: ; preds = %33
%49 = call i32 @time(i32* null)
%50 = call i32 @srand(i32 %49)
br label %51
51: ; preds = %48, %41
%52 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %52, i32** %20
%53 = load i32*, i32** %20
%54 = call i32 (...) @rand()
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %54)
%56 = load i32*, i32** %20
%57 = call i32 @fclose(i32* %56)
%58 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %58, i32** %19
%59 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %59, i32** %21
%60 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %60, i32** %22
%61 = load i32*, i32** %19
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %15
br label %63
63: ; preds = %151, %51
%64 = load i32, i32* %15
%65 = load i32, i32* %17
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %154
67: ; preds = %63
store i32 1, i32* %16
br label %68
68: ; preds = %147, %67
%69 = load i32, i32* %16
%70 = load i32, i32* %17
%71 = sub nsw i32 %70, 1
%72 = icmp slt i32 %69, %71
br i1 %72, label %73, label %150
73: ; preds = %68
%74 = load i32, i32* %15
%75 = load i32, i32* %16
%76 = add nsw i32 %74, %75
%77 = srem i32 %76, 2
%78 = icmp eq i32 %77, 1
br i1 %78, label %79, label %115
79: ; preds = %73
%80 = load double, double* %10
%81 = call i32 (...) @gaus()
%82 = mul nsw i32 %81, 3
%83 = sitofp i32 %82 to double
%84 = load double, double* %6
%85 = call double @llvm.fmuladd.f64(double %83, double %84, double 1.000000e+00)
%86 = fmul double %80, %85
store double %86, double* %8
%87 = load i32*, i32** %19
%88 = load i32, i32* %16
%89 = load i32, i32* %15
%90 = load i32, i32* %16
%91 = load i32, i32* %15
%92 = load i32, i32* %16
%93 = add nsw i32 %92, 1
%94 = load i32, i32* %15
%95 = load double, double* %8
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %87, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), i32 %88, i32 %89, i32 %90, i32 %91, i32 %93, i32 %94, double %95)
%97 = load i32*, i32** %19
%98 = load i32, i32* %16
%99 = load i32, i32* %15
%100 = load i32, i32* %16
%101 = load i32, i32* %15
%102 = load i32, i32* %16
%103 = add nsw i32 %102, 1
%104 = load i32, i32* %15
%105 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i32 %98, i32 %99, i32 %100, i32 %101, i32 %103, i32 %104)
%106 = load i32*, i32** %21
%107 = load i32, i32* %16
%108 = load i32, i32* %15
%109 = load double, double* %8
%110 = load i32, i32* %16
%111 = add nsw i32 %110, 1
%112 = load i32, i32* %15
%113 = load double, double* %8
%114 = call i32 (i32*, i8*, ...) @fprintf(i32* %106, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %107, i32 %108, double %109, i32 %111, i32 %112, double %113)
br label %142
115: ; preds = %73
%116 = load double, double* %11
%117 = call i32 (...) @gaus()
%118 = mul nsw i32 %117, 3
%119 = sitofp i32 %118 to double
%120 = load double, double* %7
%121 = call double @llvm.fmuladd.f64(double %119, double %120, double 1.000000e+00)
%122 = fmul double %116, %121
store double %122, double* %9
%123 = load i32*, i32** %19
%124 = load i32, i32* %16
%125 = load i32, i32* %15
%126 = load i32, i32* %16
%127 = load i32, i32* %15
%128 = load i32, i32* %16
%129 = add nsw i32 %128, 1
%130 = load i32, i32* %15
%131 = load double, double* %9
%132 = call i32 (i32*, i8*, ...) @fprintf(i32* %123, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 %124, i32 %125, i32 %126, i32 %127, i32 %129, i32 %130, double %131)
%133 = load i32*, i32** %22
%134 = load i32, i32* %16
%135 = load i32, i32* %15
%136 = load double, double* %9
%137 = load i32, i32* %16
%138 = add nsw i32 %137, 1
%139 = load i32, i32* %15
%140 = load double, double* %9
%141 = call i32 (i32*, i8*, ...) @fprintf(i32* %133, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %134, i32 %135, double %136, i32 %138, i32 %139, double %140)
br label %142
142: ; preds = %115, %79
%143 = load i32*, i32** %21
%144 = call i32 (i32*, i8*, ...) @fprintf(i32* %143, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%145 = load i32*, i32** %22
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %145, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
br label %147
147: ; preds = %142
%148 = load i32, i32* %16
%149 = add nsw i32 %148, 1
store i32 %149, i32* %16
br label %68
150: ; preds = %68
br label %151
151: ; preds = %150
%152 = load i32, i32* %15
%153 = add nsw i32 %152, 1
store i32 %153, i32* %15
br label %63
154: ; preds = %63
%155 = load i32*, i32** %21
%156 = call i32 (i32*, i8*, ...) @fprintf(i32* %155, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%157 = load i32*, i32** %22
%158 = call i32 (i32*, i8*, ...) @fprintf(i32* %157, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
store i32 0, i32* %15
br label %159
159: ; preds = %247, %154
%160 = load i32, i32* %15
%161 = load i32, i32* %17
%162 = sub nsw i32 %161, 1
%163 = icmp slt i32 %160, %162
br i1 %163, label %164, label %250
164: ; preds = %159
store i32 1, i32* %16
br label %165
165: ; preds = %243, %164
%166 = load i32, i32* %16
%167 = load i32, i32* %17
%168 = icmp slt i32 %166, %167
br i1 %168, label %169, label %246
169: ; preds = %165
%170 = load i32, i32* %15
%171 = load i32, i32* %16
%172 = add nsw i32 %170, %171
%173 = srem i32 %172, 2
%174 = icmp eq i32 %173, 0
br i1 %174, label %175, label %211
175: ; preds = %169
%176 = load double, double* %10
%177 = call i32 (...) @gaus()
%178 = mul nsw i32 %177, 3
%179 = sitofp i32 %178 to double
%180 = load double, double* %6
%181 = call double @llvm.fmuladd.f64(double %179, double %180, double 1.000000e+00)
%182 = fmul double %176, %181
store double %182, double* %8
%183 = load i32*, i32** %19
%184 = load i32, i32* %16
%185 = load i32, i32* %15
%186 = load i32, i32* %16
%187 = load i32, i32* %15
%188 = load i32, i32* %16
%189 = load i32, i32* %15
%190 = add nsw i32 %189, 1
%191 = load double, double* %8
%192 = call i32 (i32*, i8*, ...) @fprintf(i32* %183, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), i32 %184, i32 %185, i32 %186, i32 %187, i32 %188, i32 %190, double %191)
%193 = load i32*, i32** %19
%194 = load i32, i32* %16
%195 = load i32, i32* %15
%196 = load i32, i32* %16
%197 = load i32, i32* %15
%198 = load i32, i32* %16
%199 = load i32, i32* %15
%200 = add nsw i32 %199, 1
%201 = call i32 (i32*, i8*, ...) @fprintf(i32* %193, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0), i32 %194, i32 %195, i32 %196, i32 %197, i32 %198, i32 %200)
%202 = load i32*, i32** %21
%203 = load i32, i32* %16
%204 = load i32, i32* %15
%205 = load double, double* %8
%206 = load i32, i32* %16
%207 = load i32, i32* %15
%208 = add nsw i32 %207, 1
%209 = load double, double* %8
%210 = call i32 (i32*, i8*, ...) @fprintf(i32* %202, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %203, i32 %204, double %205, i32 %206, i32 %208, double %209)
br label %238
211: ; preds = %169
%212 = load double, double* %11
%213 = call i32 (...) @gaus()
%214 = mul nsw i32 %213, 3
%215 = sitofp i32 %214 to double
%216 = load double, double* %7
%217 = call double @llvm.fmuladd.f64(double %215, double %216, double 1.000000e+00)
%218 = fmul double %212, %217
store double %218, double* %9
%219 = load i32*, i32** %19
%220 = load i32, i32* %16
%221 = load i32, i32* %15
%222 = load i32, i32* %16
%223 = load i32, i32* %15
%224 = load i32, i32* %16
%225 = load i32, i32* %15
%226 = add nsw i32 %225, 1
%227 = load double, double* %9
%228 = call i32 (i32*, i8*, ...) @fprintf(i32* %219, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0), i32 %220, i32 %221, i32 %222, i32 %223, i32 %224, i32 %226, double %227)
%229 = load i32*, i32** %22
%230 = load i32, i32* %16
%231 = load i32, i32* %15
%232 = load double, double* %9
%233 = load i32, i32* %16
%234 = load i32, i32* %15
%235 = add nsw i32 %234, 1
%236 = load double, double* %9
%237 = call i32 (i32*, i8*, ...) @fprintf(i32* %229, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %230, i32 %231, double %232, i32 %233, i32 %235, double %236)
br label %238
238: ; preds = %211, %175
%239 = load i32*, i32** %21
%240 = call i32 (i32*, i8*, ...) @fprintf(i32* %239, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%241 = load i32*, i32** %22
%242 = call i32 (i32*, i8*, ...) @fprintf(i32* %241, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
br label %243
243: ; preds = %238
%244 = load i32, i32* %16
%245 = add nsw i32 %244, 1
store i32 %245, i32* %16
br label %165
246: ; preds = %165
br label %247
247: ; preds = %246
%248 = load i32, i32* %15
%249 = add nsw i32 %248, 1
store i32 %249, i32* %15
br label %159
250: ; preds = %159
%251 = load i32*, i32** %21
%252 = call i32 (i32*, i8*, ...) @fprintf(i32* %251, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%253 = load i32*, i32** %22
%254 = call i32 (i32*, i8*, ...) @fprintf(i32* %253, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
store i32 0, i32* %15
br label %255
255: ; preds = %380, %250
%256 = load i32, i32* %15
%257 = load i32, i32* %17
%258 = icmp slt i32 %256, %257
br i1 %258, label %259, label %383
259: ; preds = %255
%260 = load i32, i32* %15
%261 = srem i32 %260, 2
%262 = icmp eq i32 %261, 1
br i1 %262, label %263, label %286
263: ; preds = %259
%264 = load double, double* %10
%265 = call i32 (...) @gaus()
%266 = mul nsw i32 %265, 3
%267 = sitofp i32 %266 to double
%268 = load double, double* %6
%269 = call double @llvm.fmuladd.f64(double %267, double %268, double 1.000000e+00)
%270 = fmul double %264, %269
store double %270, double* %8
%271 = load i32*, i32** %19
%272 = load i32, i32* %15
%273 = load i32, i32* %15
%274 = load double, double* %8
%275 = call i32 (i32*, i8*, ...) @fprintf(i32* %271, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.20, i64 0, i64 0), i32 %272, i32 %273, double %274)
%276 = load i32*, i32** %19
%277 = load i32, i32* %15
%278 = load i32, i32* %15
%279 = call i32 (i32*, i8*, ...) @fprintf(i32* %276, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0), i32 %277, i32 %278)
%280 = load i32*, i32** %21
%281 = load i32, i32* %15
%282 = load double, double* %8
%283 = load i32, i32* %15
%284 = load double, double* %8
%285 = call i32 (i32*, i8*, ...) @fprintf(i32* %280, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0), i32 %281, double %282, i32 %283, double %284)
br label %305
286: ; preds = %259
%287 = load double, double* %11
%288 = call i32 (...) @gaus()
%289 = mul nsw i32 %288, 3
%290 = sitofp i32 %289 to double
%291 = load double, double* %7
%292 = call double @llvm.fmuladd.f64(double %290, double %291, double 1.000000e+00)
%293 = fmul double %287, %292
store double %293, double* %9
%294 = load i32*, i32** %19
%295 = load i32, i32* %15
%296 = load i32, i32* %15
%297 = load double, double* %9
%298 = call i32 (i32*, i8*, ...) @fprintf(i32* %294, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0), i32 %295, i32 %296, double %297)
%299 = load i32*, i32** %22
%300 = load i32, i32* %15
%301 = load double, double* %9
%302 = load i32, i32* %15
%303 = load double, double* %9
%304 = call i32 (i32*, i8*, ...) @fprintf(i32* %299, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0), i32 %300, double %301, i32 %302, double %303)
br label %305
305: ; preds = %286, %263
%306 = load i32*, i32** %21
%307 = call i32 (i32*, i8*, ...) @fprintf(i32* %306, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%308 = load i32*, i32** %22
%309 = call i32 (i32*, i8*, ...) @fprintf(i32* %308, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%310 = load i32, i32* %15
%311 = load i32, i32* %17
%312 = add nsw i32 %310, %311
%313 = srem i32 %312, 2
%314 = icmp eq i32 %313, 0
br i1 %314, label %315, label %349
315: ; preds = %305
%316 = load double, double* %10
%317 = call i32 (...) @gaus()
%318 = mul nsw i32 %317, 3
%319 = sitofp i32 %318 to double
%320 = load double, double* %6
%321 = call double @llvm.fmuladd.f64(double %319, double %320, double 1.000000e+00)
%322 = fmul double %316, %321
store double %322, double* %8
%323 = load i32*, i32** %19
%324 = load i32, i32* %17
%325 = sub nsw i32 %324, 1
%326 = load i32, i32* %15
%327 = load i32, i32* %17
%328 = sub nsw i32 %327, 1
%329 = load i32, i32* %15
%330 = load double, double* %8
%331 = call i32 (i32*, i8*, ...) @fprintf(i32* %323, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.24, i64 0, i64 0), i32 %325, i32 %326, i32 %328, i32 %329, double %330)
%332 = load i32*, i32** %19
%333 = load i32, i32* %17
%334 = sub nsw i32 %333, 1
%335 = load i32, i32* %15
%336 = load i32, i32* %17
%337 = sub nsw i32 %336, 1
%338 = load i32, i32* %15
%339 = call i32 (i32*, i8*, ...) @fprintf(i32* %332, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.25, i64 0, i64 0), i32 %334, i32 %335, i32 %337, i32 %338)
%340 = load i32*, i32** %21
%341 = load i32, i32* %17
%342 = sub nsw i32 %341, 1
%343 = load i32, i32* %15
%344 = load double, double* %8
%345 = load i32, i32* %17
%346 = load i32, i32* %15
%347 = load double, double* %8
%348 = call i32 (i32*, i8*, ...) @fprintf(i32* %340, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %342, i32 %343, double %344, i32 %345, i32 %346, double %347)
br label %375
349: ; preds = %305
%350 = load double, double* %11
%351 = call i32 (...) @gaus()
%352 = mul nsw i32 %351, 3
%353 = sitofp i32 %352 to double
%354 = load double, double* %7
%355 = call double @llvm.fmuladd.f64(double %353, double %354, double 1.000000e+00)
%356 = fmul double %350, %355
store double %356, double* %9
%357 = load i32*, i32** %19
%358 = load i32, i32* %17
%359 = sub nsw i32 %358, 1
%360 = load i32, i32* %15
%361 = load i32, i32* %17
%362 = sub nsw i32 %361, 1
%363 = load i32, i32* %15
%364 = load double, double* %9
%365 = call i32 (i32*, i8*, ...) @fprintf(i32* %357, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.26, i64 0, i64 0), i32 %359, i32 %360, i32 %362, i32 %363, double %364)
%366 = load i32*, i32** %22
%367 = load i32, i32* %17
%368 = sub nsw i32 %367, 1
%369 = load i32, i32* %15
%370 = load double, double* %9
%371 = load i32, i32* %17
%372 = load i32, i32* %15
%373 = load double, double* %9
%374 = call i32 (i32*, i8*, ...) @fprintf(i32* %366, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %368, i32 %369, double %370, i32 %371, i32 %372, double %373)
br label %375
375: ; preds = %349, %315
%376 = load i32*, i32** %21
%377 = call i32 (i32*, i8*, ...) @fprintf(i32* %376, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%378 = load i32*, i32** %22
%379 = call i32 (i32*, i8*, ...) @fprintf(i32* %378, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
br label %380
380: ; preds = %375
%381 = load i32, i32* %15
%382 = add nsw i32 %381, 1
store i32 %382, i32* %15
br label %255
383: ; preds = %255
%384 = load i32*, i32** %19
%385 = call i32 (i32*, i8*, ...) @fprintf(i32* %384, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.27, i64 0, i64 0))
%386 = load i32*, i32** %19
%387 = call i32 @fclose(i32* %386)
%388 = load i32*, i32** %21
%389 = call i32 @fclose(i32* %388)
%390 = load i32*, i32** %22
%391 = call i32 @fclose(i32* %390)
store i32 0, i32* %1
br label %392
392: ; preds = %383, %28
%393 = load i32, i32* %1
ret i32 %393
}

LLVM IR (-O2):
@.str = [15 x i8] c"parameters.ini\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [23 x i8] c"%d %lf %lf %lf %lf %lf\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [98 x i8] c"50 0.4 1 0.333 1 0.333\0AN_vert_comps ratio_C C0 sigma_C(fraction of C0) R0 sigma_R(fraction of R0)\00"
@.str.5 = [43 x i8] c"Edit Values in \22parameters.ini\22 then rerun\00"
@RAND_MAX = global double 0.000000e+00
@.str.6 = [5 x i8] c"seed\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [12 x i8] c"circuit.cir\00"
@.str.9 = [15 x i8] c"capacitors.txt\00"
@.str.10 = [14 x i8] c"resistors.txt\00"
@.str.11 = [19 x i8] c"Random RC Network\0A\00"
@.str.12 = [28 x i8] c"Cx%dy%dX x%dy%d x%dy%d %en\0A\00"
@.str.13 = [27 x i8] c"Rx%dy%dX x%dy%d x%dy%d 1G\0A\00"
@.str.14 = [20 x i8] c"%d %d %e\0A%d %d %e\0A\0A\00"
@.str.15 = [28 x i8] c"Rx%dy%dX x%dy%d x%dy%d %ek\0A\00"
@.str.17 = [28 x i8] c"Cx%dy%dY x%dy%d x%dy%d %en\0A\00"
@.str.18 = [27 x i8] c"Rx%dy%dY x%dy%d x%dy%d 1G\0A\00"
@.str.19 = [28 x i8] c"Rx%dy%dY x%dy%d x%dy%d %ek\0A\00"
@.str.20 = [21 x i8] c"Cx0y%dX 0 x1y%d %en\0A\00"
@.str.21 = [20 x i8] c"Rx0y%dX 0 x1y%d 1G\0A\00"
@.str.22 = [18 x i8] c"0 %d %e\0A1 %d %e\0A\0A\00"
@.str.23 = [21 x i8] c"Rx0y%dX 0 x1y%d %ek\0A\00"
@.str.24 = [26 x i8] c"Cx%dy%dX x%dy%d VOUT %en\0A\00"
@.str.25 = [25 x i8] c"Rx%dy%dX x%dy%d VOUT 1G\0A\00"
@.str.26 = [26 x i8] c"Rx%dy%dX x%dy%d VOUT %ek\0A\00"
@.str.27 = [37 x i8] c"V1 R1_N 0 AC 50\0AR1 VOUT R1_N 100Meg\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = bitcast double* %1 to i8*
%9 = bitcast double* %2 to i8*
%10 = bitcast double* %3 to i8*
%11 = bitcast double* %4 to i8*
%12 = bitcast double* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %23, label %17
17: ; preds = %0
%18 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %15, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32* %6, double* %1, double* %4, double* %2, double* %5, double* %3)
%19 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %15, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32* %6, double* %1, double* %4, double* %2, double* %5, double* %3)
%20 = call i32 @fclose(i32* %15)
%21 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %32, label %27
23: ; preds = %0
%24 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%25 = tail call i64 @fwrite(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.4, i64 0, i64 0), i64 97, i64 1, i32* %24)
%26 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
br label %214
27: ; preds = %17
%28 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %7)
%29 = load i32, i32* %7
%30 = call i32 @srand(i32 %29)
%31 = call i32 @fclose(i32* %21)
br label %35
32: ; preds = %17
%33 = call i32 @time(i32* null)
%34 = call i32 @srand(i32 %33)
br label %35
35: ; preds = %32, %27
%36 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%37 = call i32 (...) @rand()
%38 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %37)
%39 = call i32 @fclose(i32* %36)
%40 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%41 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%42 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%43 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i64 18, i64 1, i32* %40)
%44 = load i32, i32* %6
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %89
46: ; preds = %35, %85
%47 = phi i32 [ %86, %85 ], [ %44, %35 ]
%48 = phi i32 [ %87, %85 ], [ 0, %35 ]
%49 = icmp sgt i32 %47, 2
br i1 %49, label %50, label %85
50: ; preds = %46, %78
%51 = phi i32 [ %79, %78 ], [ 1, %46 ]
%52 = add nuw nsw i32 %51, %48
%53 = and i32 %52, 1
%54 = icmp eq i32 %53, 0
br i1 %54, label %67, label %55
55: ; preds = %50
%56 = load double, double* %4
%57 = call i32 (...) @gaus()
%58 = mul nsw i32 %57, 3
%59 = sitofp i32 %58 to double
%60 = load double, double* %2
%61 = call double @llvm.fmuladd.f64(double %59, double %60, double 1.000000e+00)
%62 = fmul double %56, %61
%63 = add nuw nsw i32 %51, 1
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), i32 %51, i32 %48, i32 %51, i32 %48, i32 %63, i32 %48, double %62)
%65 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i32 %51, i32 %48, i32 %51, i32 %48, i32 %63, i32 %48)
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %51, i32 %48, double %62, i32 %63, i32 %48, double %62)
br label %78
67: ; preds = %50
%68 = load double, double* %5
%69 = call i32 (...) @gaus()
%70 = mul nsw i32 %69, 3
%71 = sitofp i32 %70 to double
%72 = load double, double* %3
%73 = call double @llvm.fmuladd.f64(double %71, double %72, double 1.000000e+00)
%74 = fmul double %68, %73
%75 = add nuw nsw i32 %51, 1
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 %51, i32 %48, i32 %51, i32 %48, i32 %75, i32 %48, double %74)
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %51, i32 %48, double %74, i32 %75, i32 %48, double %74)
br label %78
78: ; preds = %67, %55
%79 = phi i32 [ %75, %67 ], [ %63, %55 ]
%80 = call i32 @fputc(i32 10, i32* %41)
%81 = call i32 @fputc(i32 10, i32* %42)
%82 = load i32, i32* %6
%83 = add nsw i32 %82, -1
%84 = icmp slt i32 %79, %83
br i1 %84, label %50, label %85
85: ; preds = %78, %46
%86 = phi i32 [ %47, %46 ], [ %82, %78 ]
%87 = add nuw nsw i32 %48, 1
%88 = icmp slt i32 %87, %86
br i1 %88, label %46, label %89
89: ; preds = %85, %35
%90 = call i32 @fputc(i32 10, i32* %41)
%91 = call i32 @fputc(i32 10, i32* %42)
%92 = load i32, i32* %6
%93 = icmp sgt i32 %92, 1
br i1 %93, label %94, label %135
94: ; preds = %89, %131
%95 = phi i32 [ %132, %131 ], [ %92, %89 ]
%96 = phi i32 [ %98, %131 ], [ 0, %89 ]
%97 = icmp sgt i32 %95, 1
%98 = add nuw nsw i32 %96, 1
br i1 %97, label %99, label %131
99: ; preds = %94, %125
%100 = phi i32 [ %128, %125 ], [ 1, %94 ]
%101 = add nuw nsw i32 %100, %96
%102 = and i32 %101, 1
%103 = icmp eq i32 %102, 0
br i1 %103, label %104, label %115
104: ; preds = %99
%105 = load double, double* %4
%106 = call i32 (...) @gaus()
%107 = mul nsw i32 %106, 3
%108 = sitofp i32 %107 to double
%109 = load double, double* %2
%110 = call double @llvm.fmuladd.f64(double %108, double %109, double 1.000000e+00)
%111 = fmul double %105, %110
%112 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0), i32 %100, i32 %96, i32 %100, i32 %96, i32 %100, i32 %98, double %111)
%113 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0), i32 %100, i32 %96, i32 %100, i32 %96, i32 %100, i32 %98)
%114 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %100, i32 %96, double %111, i32 %100, i32 %98, double %111)
br label %125
115: ; preds = %99
%116 = load double, double* %5
%117 = call i32 (...) @gaus()
%118 = mul nsw i32 %117, 3
%119 = sitofp i32 %118 to double
%120 = load double, double* %3
%121 = call double @llvm.fmuladd.f64(double %119, double %120, double 1.000000e+00)
%122 = fmul double %116, %121
%123 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0), i32 %100, i32 %96, i32 %100, i32 %96, i32 %100, i32 %98, double %122)
%124 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %100, i32 %96, double %122, i32 %100, i32 %98, double %122)
br label %125
125: ; preds = %115, %104
%126 = call i32 @fputc(i32 10, i32* %41)
%127 = call i32 @fputc(i32 10, i32* %42)
%128 = add nuw nsw i32 %100, 1
%129 = load i32, i32* %6
%130 = icmp slt i32 %128, %129
br i1 %130, label %99, label %131
131: ; preds = %125, %94
%132 = phi i32 [ %95, %94 ], [ %129, %125 ]
%133 = add nsw i32 %132, -1
%134 = icmp slt i32 %98, %133
br i1 %134, label %94, label %135
135: ; preds = %131, %89
%136 = call i32 @fputc(i32 10, i32* %41)
%137 = call i32 @fputc(i32 10, i32* %42)
%138 = load i32, i32* %6
%139 = icmp sgt i32 %138, 0
br i1 %139, label %140, label %209
140: ; preds = %135, %203
%141 = phi i32 [ %206, %203 ], [ 0, %135 ]
%142 = and i32 %141, 1
%143 = icmp eq i32 %142, 0
br i1 %143, label %155, label %144
144: ; preds = %140
%145 = load double, double* %4
%146 = call i32 (...) @gaus()
%147 = mul nsw i32 %146, 3
%148 = sitofp i32 %147 to double
%149 = load double, double* %2
%150 = call double @llvm.fmuladd.f64(double %148, double %149, double 1.000000e+00)
%151 = fmul double %145, %150
%152 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.20, i64 0, i64 0), i32 %141, i32 %141, double %151)
%153 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0), i32 %141, i32 %141)
%154 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0), i32 %141, double %151, i32 %141, double %151)
br label %165
155: ; preds = %140
%156 = load double, double* %5
%157 = call i32 (...) @gaus()
%158 = mul nsw i32 %157, 3
%159 = sitofp i32 %158 to double
%160 = load double, double* %3
%161 = call double @llvm.fmuladd.f64(double %159, double %160, double 1.000000e+00)
%162 = fmul double %156, %161
%163 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0), i32 %141, i32 %141, double %162)
%164 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0), i32 %141, double %162, i32 %141, double %162)
br label %165
165: ; preds = %155, %144
%166 = call i32 @fputc(i32 10, i32* %41)
%167 = call i32 @fputc(i32 10, i32* %42)
%168 = load i32, i32* %6
%169 = add nsw i32 %168, %141
%170 = and i32 %169, 1
%171 = icmp eq i32 %170, 0
br i1 %171, label %172, label %189
172: ; preds = %165
%173 = load double, double* %4
%174 = call i32 (...) @gaus()
%175 = mul nsw i32 %174, 3
%176 = sitofp i32 %175 to double
%177 = load double, double* %2
%178 = call double @llvm.fmuladd.f64(double %176, double %177, double 1.000000e+00)
%179 = fmul double %173, %178
%180 = load i32, i32* %6
%181 = add nsw i32 %180, -1
%182 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.24, i64 0, i64 0), i32 %181, i32 %141, i32 %181, i32 %141, double %179)
%183 = load i32, i32* %6
%184 = add nsw i32 %183, -1
%185 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.25, i64 0, i64 0), i32 %184, i32 %141, i32 %184, i32 %141)
%186 = load i32, i32* %6
%187 = add nsw i32 %186, -1
%188 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %187, i32 %141, double %179, i32 %186, i32 %141, double %179)
br label %203
189: ; preds = %165
%190 = load double, double* %5
%191 = call i32 (...) @gaus()
%192 = mul nsw i32 %191, 3
%193 = sitofp i32 %192 to double
%194 = load double, double* %3
%195 = call double @llvm.fmuladd.f64(double %193, double %194, double 1.000000e+00)
%196 = fmul double %190, %195
%197 = load i32, i32* %6
%198 = add nsw i32 %197, -1
%199 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.26, i64 0, i64 0), i32 %198, i32 %141, i32 %198, i32 %141, double %196)
%200 = load i32, i32* %6
%201 = add nsw i32 %200, -1
%202 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %201, i32 %141, double %196, i32 %200, i32 %141, double %196)
br label %203
203: ; preds = %189, %172
%204 = call i32 @fputc(i32 10, i32* %41)
%205 = call i32 @fputc(i32 10, i32* %42)
%206 = add nuw nsw i32 %141, 1
%207 = load i32, i32* %6
%208 = icmp slt i32 %206, %207
br i1 %208, label %140, label %209
209: ; preds = %203, %135
%210 = call i64 @fwrite(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.27, i64 0, i64 0), i64 36, i64 1, i32* %40)
%211 = call i32 @fclose(i32* %40)
%212 = call i32 @fclose(i32* %41)
%213 = call i32 @fclose(i32* %42)
br label %214
214: ; preds = %209, %23
ret i32 0
}