#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double RAND_MAX;
double atof(int /*<<< orphan*/);
int atoi(int /*<<< orphan*/);
long atol(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
double fclamp(double);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(int *);
int getopt(int, char **, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ rand();
int ri(int);
int /*<<< orphan*/ show_help();
int /*<<< orphan*/ srand(unsigned long);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int i, j, k;
  int n = -1, z;
  double p, P = 1.0 / 100.0;
  long int seed = -1;
  int pair, n_pair = 1;
  int rand_range = 100;
  double ins_prob = -1.0, del_prob = -1.0, sub_prob = -1.0, glo_prob = -1.0;
  int *a, *b;
  int ch;
  double feps = 1.0 / 1024.0;
  while ((ch = getopt(argc, argv, "n:I:D:U:s:p:P:hR:")) != -1)
    switch (ch) {
    case 'n':
      n = atoi(optarg);
      break;
    case 'I':
      ins_prob = atof(optarg);
      break;
    case 'D':
      del_prob = atof(optarg);
      break;
    case 'U':
      sub_prob = atof(optarg);
      break;
    case 's':
      seed = atol(optarg);
      break;
    case 'p':
      glo_prob = atof(optarg);
      break;
    case 'P':
      n_pair = atoi(optarg);
      break;
    case 'R':
      rand_range = atoi(optarg);
      break;
    case 'h':
    default:
      show_help();
      exit(1);
      break;
    }
  if (n <= 0) {
    show_help();
    exit(1);
  }
  if ((glo_prob >= 0.0) && (glo_prob < 1.0)) {
    del_prob = ins_prob = sub_prob = glo_prob;
  } else {
    if ((del_prob < 0) && (ins_prob < 0) && (sub_prob < 0)) {
      glo_prob = 1.0 / (double)n;
      if ((del_prob < 0) || (del_prob > 1)) {
        del_prob = glo_prob;
      }
      if ((ins_prob < 0) || (ins_prob > 1)) {
        ins_prob = glo_prob;
      }
      if ((sub_prob < 0) || (sub_prob > 1)) {
        sub_prob = glo_prob;
      }
    } else {
      del_prob = fclamp(del_prob);
      ins_prob = fclamp(ins_prob);
      sub_prob = fclamp(sub_prob);
    }
  }
  if (ins_prob >= (1.0 - feps)) {
    fprintf(stderr, "insertion probability cannot be 1\n");
    fflush(stderr);
    show_help();
    exit(1);
  }
  if (n_pair < 1) {
    n_pair = 1;
  }
  if (seed >= 0) {
    srand((unsigned long int)seed);
  }
  a = (int *)malloc(sizeof(int) * (n + 1));
  for (pair = 0; pair < n_pair; pair++) {
    for (i = 0; i < n; i++) {
      a[i] = ri(rand_range);
    }
    for (i = 0; i < n; i++) {
      printf(" %i", a[i]);
    }
    printf("\n");
    for (i = 0; i < n; i++) {
      p = ((double)rand()) / (RAND_MAX + 1.0);
      if (p < ins_prob) {
        printf(" %i", ri(rand_range));
        i--;
        continue;
      }
      p = ((double)rand()) / (RAND_MAX + 1.0);
      if (p < del_prob) {
        continue;
      }
      p = ((double)rand()) / (RAND_MAX + 1.0);
      if (p < sub_prob) {
        printf(" %i", ri(rand_range));
        continue;
      }
      printf(" %i", a[i]);
    }
    printf("\n");
  }
  free(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x20(%rbp)
movsd  0xdf8(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
movl   $0x1,-0x48(%rbp)
movl   $0x64,-0x4c(%rbp)
movsd  0xdcd(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xdc0(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xdb3(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xda6(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xd91(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe5b(%rip),%rdx
call   10e0 <getopt@plt>
mov    %eax,-0x84(%rbp)
cmp    $0xffffffff,%eax
je     139f <main+0x1af>
mov    -0x84(%rbp),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x98(%rbp)
sub    $0x2f,%eax
ja     1389 <main+0x199>
mov    -0x98(%rbp),%rax
lea    0xd5e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,-0x20(%rbp)
jmp    139a <main+0x1aa>
mov    0x2d10(%rip),%rax
mov    (%rax),%edi
call   1060 <atof@plt>
movsd  %xmm0,-0x58(%rbp)
jmp    139a <main+0x1aa>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
call   1060 <atof@plt>
movsd  %xmm0,-0x60(%rbp)
jmp    139a <main+0x1aa>
mov    0x2ce0(%rip),%rax
mov    (%rax),%edi
call   1060 <atof@plt>
movsd  %xmm0,-0x68(%rbp)
jmp    139a <main+0x1aa>
mov    0x2cc8(%rip),%rax
mov    (%rax),%edi
call   10d0 <atol@plt>
mov    %rax,-0x40(%rbp)
jmp    139a <main+0x1aa>
mov    0x2cb1(%rip),%rax
mov    (%rax),%edi
call   1060 <atof@plt>
movsd  %xmm0,-0x70(%rbp)
jmp    139a <main+0x1aa>
mov    0x2c99(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,-0x48(%rbp)
jmp    139a <main+0x1aa>
mov    0x2c83(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,-0x4c(%rbp)
jmp    139a <main+0x1aa>
jmp    1389 <main+0x199>
mov    $0x0,%al
call   10a0 <show_help@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    1277 <main+0x87>
cmpl   $0x0,-0x20(%rbp)
jg     13ba <main+0x1ca>
mov    $0x0,%al
call   10a0 <show_help@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
movsd  -0x70(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     13f8 <main+0x208>
movsd  0xc44(%rip),%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    13f8 <main+0x208>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  %xmm0,-0x58(%rbp)
movsd  %xmm0,-0x60(%rbp)
jmp    14fc <main+0x30c>
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    14ca <main+0x2da>
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    14ca <main+0x2da>
xorps  %xmm0,%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    14ca <main+0x2da>
cvtsi2sdl -0x20(%rbp),%xmm1
movsd  0xbe9(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
ja     145d <main+0x26d>
movsd  -0x60(%rbp),%xmm0
movsd  0xbc5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1467 <main+0x277>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
ja     148c <main+0x29c>
movsd  -0x58(%rbp),%xmm0
movsd  0xb96(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1496 <main+0x2a6>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x68(%rbp),%xmm0
ja     14bb <main+0x2cb>
movsd  -0x68(%rbp),%xmm0
movsd  0xb67(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14c5 <main+0x2d5>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    14f7 <main+0x307>
movsd  -0x60(%rbp),%xmm0
call   1040 <fclamp@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1040 <fclamp@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1040 <fclamp@plt>
movsd  %xmm0,-0x68(%rbp)
jmp    14fc <main+0x30c>
movsd  -0x58(%rbp),%xmm0
movsd  0xb0f(%rip),%xmm1
subsd  -0x90(%rbp),%xmm1
ff
ucomisd %xmm1,%xmm0
jb     154f <main+0x35f>
mov    0x2aae(%rip),%rax
mov    (%rax),%edi
lea    0xbc7(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x2a99(%rip),%rax
mov    (%rax),%edi
call   10c0 <fflush@plt>
mov    $0x0,%al
call   10a0 <show_help@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
cmpl   $0x1,-0x48(%rbp)
jge    1560 <main+0x370>
movl   $0x1,-0x48(%rbp)
cmpq   $0x0,-0x40(%rbp)
jl     1574 <main+0x384>
mov    -0x40(%rbp),%rdi
call   1080 <srand@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x78(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    176e <main+0x57e>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    15d4 <main+0x3e4>
mov    -0x4c(%rbp),%edi
call   1050 <ri@plt>
mov    %eax,%edx
mov    -0x78(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    15a5 <main+0x3b5>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    160e <main+0x41e>
mov    -0x78(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xb1c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    15db <main+0x3eb>
lea    0xafe(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1752 <main+0x562>
mov    $0x0,%al
call   1110 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0x9d5(%rip),%xmm1
mov    0x2996(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1691 <main+0x4a1>
mov    -0x4c(%rbp),%edi
call   1050 <ri@plt>
mov    %eax,%esi
lea    0xa99(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1744 <main+0x554>
mov    $0x0,%al
call   1110 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0x973(%rip),%xmm1
mov    0x2934(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    16d2 <main+0x4e2>
jmp    1744 <main+0x554>
mov    $0x0,%al
call   1110 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0x932(%rip),%xmm1
mov    0x28f3(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    172b <main+0x53b>
mov    -0x4c(%rbp),%edi
call   1050 <ri@plt>
mov    %eax,%esi
lea    0x9f6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1744 <main+0x554>
mov    -0x78(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0x9d8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1623 <main+0x433>
lea    0x9ba(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1592 <main+0x3a2>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r12
mov    %edi,%r13d
mov    $0xffffffff,%eax
mov    %rax,0x28(%rsp)
mov    $0xffffffffffffffff,%r15
movsd  0xdd3(%rip),%xmm0
mov    $0x64,%r14d
movl   $0x1,0x1c(%rsp)
lea    0xe96(%rip),%rbx
lea    0xdcf(%rip),%rbp
movsd  %xmm0,0x40(%rsp)
movsd  %xmm0,0x20(%rsp)
movsd  %xmm0,0x10(%rsp)
jmp    126e <main+0x6e>
nopl   (%rax)
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13d,%edi
mov    %r12,%rsi
mov    %rbx,%rdx
call   10f0 <getopt@plt>
lea    -0x44(%rax),%ecx
cmp    $0x2f,%ecx
ja     133e <main+0x13e>
movslq 0x0(%rbp,%rcx,4),%rax
add    %rbp,%rax
jmp    *%rax
mov    0x2d4d(%rip),%rax
mov    (%rax),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x40(%rsp)
jmp    1280 <main+0x80>
mov    0x2d37(%rip),%rax
mov    (%rax),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x10(%rsp)
jmp    1280 <main+0x80>
mov    0x2d21(%rip),%rax
mov    (%rax),%edi
call   1100 <atoi@plt>
mov    %eax,0x1c(%rsp)
jmp    1280 <main+0x80>
mov    0x2d0d(%rip),%rax
mov    (%rax),%edi
call   1100 <atoi@plt>
mov    %eax,%r14d
jmp    1280 <main+0x80>
mov    0x2cfa(%rip),%rax
mov    (%rax),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x20(%rsp)
jmp    1280 <main+0x80>
mov    0x2ce1(%rip),%rax
mov    (%rax),%edi
call   1100 <atoi@plt>
mov    %rax,0x28(%rsp)
jmp    1280 <main+0x80>
mov    0x2cc9(%rip),%rax
mov    (%rax),%edi
call   10e0 <atol@plt>
mov    %rax,%r15
jmp    1280 <main+0x80>
cmp    $0xffffffff,%eax
jne    15cf <main+0x3cf>
mov    0x28(%rsp),%rbp
test   %ebp,%ebp
jle    15cf <main+0x3cf>
xorpd  %xmm3,%xmm3
movsd  0x8(%rsp),%xmm2
ucomisd %xmm3,%xmm2
jb     137e <main+0x17e>
movsd  0xc9c(%rip),%xmm1
ucomisd %xmm2,%xmm1
movsd  %xmm2,0x38(%rsp)
movsd  %xmm2,0x30(%rsp)
ja     13f2 <main+0x1f2>
movsd  0x40(%rsp),%xmm0
ucomisd %xmm0,%xmm3
jbe    13bf <main+0x1bf>
xorpd  %xmm1,%xmm1
ucomisd 0x10(%rsp),%xmm1
jbe    13bf <main+0x1bf>
ucomisd 0x20(%rsp),%xmm1
jbe    13bf <main+0x1bf>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  0xc5b(%rip),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,0x38(%rsp)
movsd  %xmm2,0x30(%rsp)
jmp    13f2 <main+0x1f2>
call   1050 <fclamp@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <fclamp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
call   1050 <fclamp@plt>
movsd  0x8(%rsp),%xmm2
movsd  %xmm0,0x30(%rsp)
movsd  %xmm2,0x8(%rsp)
ucomisd 0xc10(%rip),%xmm2
jae    15b3 <main+0x3b3>
test   %r15,%r15
js     1413 <main+0x213>
mov    %r15,%rdi
call   1090 <srand@plt>
lea    0x4(,%rbp,4),%edi
call   10c0 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%r15d
lea    0xce1(%rip),%r12
mov    0x2bad(%rip),%r13
xor    %eax,%eax
mov    %r14d,0x4(%rsp)
jmp    1460 <main+0x260>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x10(%rsp),%eax
add    $0x1,%eax
cmp    0x1c(%rsp),%eax
mov    0x4(%rsp),%r14d
jge    159a <main+0x39a>
mov    %eax,0x10(%rsp)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r14d,%edi
call   1060 <ri@plt>
mov    %eax,(%rbx,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1470 <main+0x270>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx,%rbp,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1490 <main+0x290>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %r14d,%r14d
mov    0x28(%rsp),%rbp
jmp    14e6 <main+0x2e6>
nopw   0x0(%rax,%rax,1)
mov    0x4(%rsp),%edi
call   1060 <ri@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0xffffffff,%r14d
add    $0x1,%r14d
cmp    %ebp,%r14d
jge    1440 <main+0x240>
xor    %eax,%eax
call   1120 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x0(%r13),%xmm1
movsd  0xb05(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     14c0 <main+0x2c0>
xor    %eax,%eax
call   1120 <rand@plt>
movsd  0xae2(%rip),%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x0(%r13),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0x38(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     14d9 <main+0x2d9>
xor    %eax,%eax
call   1120 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x0(%r13),%xmm1
addsd  0xaa3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x30(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    1585 <main+0x385>
mov    0x4(%rsp),%edi
call   1060 <ri@plt>
mov    %r12,%rdi
mov    %eax,%esi
jmp    158e <main+0x38e>
movslq %r14d,%rax
mov    (%rbx,%rax,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    14d9 <main+0x2d9>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2a16(%rip),%rbx
mov    (%rbx),%edi
lea    0xb27(%rip),%rsi
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
call   10d0 <fflush@plt>
xor    %eax,%eax
call   10b0 <show_help@plt>
mov    $0x1,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"n:I:D:U:s:p:P:hR:\00"
@optarg = global i32 0
@stderr = global i32 0
@.str.1 = [35 x i8] c"insertion probability cannot be 1\0A\00"
@.str.2 = [4 x i8] c" %i\00"
@.str.3 = [2 x i8] c"\0A\00"
@RAND_MAX = global double 0.000000e+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 double
%12 = alloca double
%13 = alloca i64
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca i32
%24 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %9
store double 1.000000e-02, double* %12
store i64 -1, i64* %13
store i32 1, i32* %15
store i32 100, i32* %16
store double -1.000000e+00, double* %17
store double -1.000000e+00, double* %18
store double -1.000000e+00, double* %19
store double -1.000000e+00, double* %20
store double 0x3F50000000000000, double* %24
br label %25
25: ; preds = %60, %2
%26 = load i32, i32* %4
%27 = load i8**, i8*** %5
%28 = call i32 @getopt(i32 %26, i8** %27, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 %28, i32* %23
%29 = icmp ne i32 %28, -1
br i1 %29, label %30, label %61
30: ; preds = %25
%31 = load i32, i32* %23
switch i32 %31, label %57 [
i32 110, label %32
i32 73, label %35
i32 68, label %38
i32 85, label %41
i32 115, label %44
i32 112, label %47
i32 80, label %50
i32 82, label %53
i32 104, label %56
]
32: ; preds = %30
%33 = load i32, i32* @optarg
%34 = call i32 @atoi(i32 %33)
store i32 %34, i32* %9
br label %60
35: ; preds = %30
%36 = load i32, i32* @optarg
%37 = call double @atof(i32 %36)
store double %37, double* %17
br label %60
38: ; preds = %30
%39 = load i32, i32* @optarg
%40 = call double @atof(i32 %39)
store double %40, double* %18
br label %60
41: ; preds = %30
%42 = load i32, i32* @optarg
%43 = call double @atof(i32 %42)
store double %43, double* %19
br label %60
44: ; preds = %30
%45 = load i32, i32* @optarg
%46 = call i64 @atol(i32 %45)
store i64 %46, i64* %13
br label %60
47: ; preds = %30
%48 = load i32, i32* @optarg
%49 = call double @atof(i32 %48)
store double %49, double* %20
br label %60
50: ; preds = %30
%51 = load i32, i32* @optarg
%52 = call i32 @atoi(i32 %51)
store i32 %52, i32* %15
br label %60
53: ; preds = %30
%54 = load i32, i32* @optarg
%55 = call i32 @atoi(i32 %54)
store i32 %55, i32* %16
br label %60
56: ; preds = %30
br label %57
57: ; preds = %30, %56
%58 = call i32 (...) @show_help()
%59 = call i32 @exit(i32 1)
unreachable
60: ; preds = %53, %50, %47, %44, %41, %38, %35, %32
br label %25
61: ; preds = %25
%62 = load i32, i32* %9
%63 = icmp sle i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = call i32 (...) @show_help()
%66 = call i32 @exit(i32 1)
unreachable
67: ; preds = %61
%68 = load double, double* %20
%69 = fcmp oge double %68, 0.000000e+00
br i1 %69, label %70, label %75
70: ; preds = %67
%71 = load double, double* %20
%72 = fcmp olt double %71, 1.000000e+00
br i1 %72, label %73, label %75
73: ; preds = %70
%74 = load double, double* %20
store double %74, double* %19
store double %74, double* %17
store double %74, double* %18
br label %120
75: ; preds = %70, %67
%76 = load double, double* %18
%77 = fcmp olt double %76, 0.000000e+00
br i1 %77, label %78, label %112
78: ; preds = %75
%79 = load double, double* %17
%80 = fcmp olt double %79, 0.000000e+00
br i1 %80, label %81, label %112
81: ; preds = %78
%82 = load double, double* %19
%83 = fcmp olt double %82, 0.000000e+00
br i1 %83, label %84, label %112
84: ; preds = %81
%85 = load i32, i32* %9
%86 = sitofp i32 %85 to double
%87 = fdiv double 1.000000e+00, %86
store double %87, double* %20
%88 = load double, double* %18
%89 = fcmp olt double %88, 0.000000e+00
br i1 %89, label %93, label %90
90: ; preds = %84
%91 = load double, double* %18
%92 = fcmp ogt double %91, 1.000000e+00
br i1 %92, label %93, label %95
93: ; preds = %90, %84
%94 = load double, double* %20
store double %94, double* %18
br label %95
95: ; preds = %93, %90
%96 = load double, double* %17
%97 = fcmp olt double %96, 0.000000e+00
br i1 %97, label %101, label %98
98: ; preds = %95
%99 = load double, double* %17
%100 = fcmp ogt double %99, 1.000000e+00
br i1 %100, label %101, label %103
101: ; preds = %98, %95
%102 = load double, double* %20
store double %102, double* %17
br label %103
103: ; preds = %101, %98
%104 = load double, double* %19
%105 = fcmp olt double %104, 0.000000e+00
br i1 %105, label %109, label %106
106: ; preds = %103
%107 = load double, double* %19
%108 = fcmp ogt double %107, 1.000000e+00
br i1 %108, label %109, label %111
109: ; preds = %106, %103
%110 = load double, double* %20
store double %110, double* %19
br label %111
111: ; preds = %109, %106
br label %119
112: ; preds = %81, %78, %75
%113 = load double, double* %18
%114 = call double @fclamp(double %113)
store double %114, double* %18
%115 = load double, double* %17
%116 = call double @fclamp(double %115)
store double %116, double* %17
%117 = load double, double* %19
%118 = call double @fclamp(double %117)
store double %118, double* %19
br label %119
119: ; preds = %112, %111
br label %120
120: ; preds = %119, %73
%121 = load double, double* %17
%122 = load double, double* %24
%123 = fsub double 1.000000e+00, %122
%124 = fcmp oge double %121, %123
br i1 %124, label %125, label %132
125: ; preds = %120
%126 = load i32, i32* @stderr
%127 = call i32 @fprintf(i32 %126, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%128 = load i32, i32* @stderr
%129 = call i32 @fflush(i32 %128)
%130 = call i32 (...) @show_help()
%131 = call i32 @exit(i32 1)
unreachable
132: ; preds = %120
%133 = load i32, i32* %15
%134 = icmp slt i32 %133, 1
br i1 %134, label %135, label %136
135: ; preds = %132
store i32 1, i32* %15
br label %136
136: ; preds = %135, %132
%137 = load i64, i64* %13
%138 = icmp sge i64 %137, 0
br i1 %138, label %139, label %142
139: ; preds = %136
%140 = load i64, i64* %13
%141 = call i32 @srand(i64 %140)
br label %142
142: ; preds = %139, %136
%143 = load i32, i32* %9
%144 = add nsw i32 %143, 1
%145 = sext i32 %144 to i64
%146 = mul i64 4, %145
%147 = trunc i64 %146 to i32
%148 = call i64 @malloc(i32 %147)
%149 = inttoptr i64 %148 to i32*
store i32* %149, i32** %21
store i32 0, i32* %14
br label %150
150: ; preds = %240, %142
%151 = load i32, i32* %14
%152 = load i32, i32* %15
%153 = icmp slt i32 %151, %152
br i1 %153, label %154, label %243
154: ; preds = %150
store i32 0, i32* %6
br label %155
155: ; preds = %166, %154
%156 = load i32, i32* %6
%157 = load i32, i32* %9
%158 = icmp slt i32 %156, %157
br i1 %158, label %159, label %169
159: ; preds = %155
%160 = load i32, i32* %16
%161 = call i32 @ri(i32 %160)
%162 = load i32*, i32** %21
%163 = load i32, i32* %6
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds i32, i32* %162, i64 %164
store i32 %161, i32* %165
br label %166
166: ; preds = %159
%167 = load i32, i32* %6
%168 = add nsw i32 %167, 1
store i32 %168, i32* %6
br label %155
169: ; preds = %155
store i32 0, i32* %6
br label %170
170: ; preds = %181, %169
%171 = load i32, i32* %6
%172 = load i32, i32* %9
%173 = icmp slt i32 %171, %172
br i1 %173, label %174, label %184
174: ; preds = %170
%175 = load i32*, i32** %21
%176 = load i32, i32* %6
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds i32, i32* %175, i64 %177
%179 = load i32, i32* %178
%180 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %179)
br label %181
181: ; preds = %174
%182 = load i32, i32* %6
%183 = add nsw i32 %182, 1
store i32 %183, i32* %6
br label %170
184: ; preds = %170
%185 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %6
br label %186
186: ; preds = %235, %184
%187 = load i32, i32* %6
%188 = load i32, i32* %9
%189 = icmp slt i32 %187, %188
br i1 %189, label %190, label %238
190: ; preds = %186
%191 = call i64 (...) @rand()
%192 = sitofp i64 %191 to double
%193 = load double, double* @RAND_MAX
%194 = fadd double %193, 1.000000e+00
%195 = fdiv double %192, %194
store double %195, double* %11
%196 = load double, double* %11
%197 = load double, double* %17
%198 = fcmp olt double %196, %197
br i1 %198, label %199, label %205
199: ; preds = %190
%200 = load i32, i32* %16
%201 = call i32 @ri(i32 %200)
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %201)
%203 = load i32, i32* %6
%204 = add nsw i32 %203, -1
store i32 %204, i32* %6
br label %235
205: ; preds = %190
%206 = call i64 (...) @rand()
%207 = sitofp i64 %206 to double
%208 = load double, double* @RAND_MAX
%209 = fadd double %208, 1.000000e+00
%210 = fdiv double %207, %209
store double %210, double* %11
%211 = load double, double* %11
%212 = load double, double* %18
%213 = fcmp olt double %211, %212
br i1 %213, label %214, label %215
214: ; preds = %205
br label %235
215: ; preds = %205
%216 = call i64 (...) @rand()
%217 = sitofp i64 %216 to double
%218 = load double, double* @RAND_MAX
%219 = fadd double %218, 1.000000e+00
%220 = fdiv double %217, %219
store double %220, double* %11
%221 = load double, double* %11
%222 = load double, double* %19
%223 = fcmp olt double %221, %222
br i1 %223, label %224, label %228
224: ; preds = %215
%225 = load i32, i32* %16
%226 = call i32 @ri(i32 %225)
%227 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %226)
br label %235
228: ; preds = %215
%229 = load i32*, i32** %21
%230 = load i32, i32* %6
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds i32, i32* %229, i64 %231
%233 = load i32, i32* %232
%234 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %233)
br label %235
235: ; preds = %228, %224, %214, %199
%236 = load i32, i32* %6
%237 = add nsw i32 %236, 1
store i32 %237, i32* %6
br label %186
238: ; preds = %186
%239 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %240
240: ; preds = %238
%241 = load i32, i32* %14
%242 = add nsw i32 %241, 1
store i32 %242, i32* %14
br label %150
243: ; preds = %150
%244 = load i32*, i32** %21
%245 = call i32 @free(i32* %244)
%246 = load i32, i32* %3
ret i32 %246
}

LLVM IR (-O2):
@.str = [18 x i8] c"n:I:D:U:s:p:P:hR:\00"
@optarg = global i32 0
@stderr = global i32 0
@.str.1 = [35 x i8] c"insertion probability cannot be 1\0A\00"
@.str.2 = [4 x i8] c" %i\00"
@RAND_MAX = global double 0.000000e+00
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %37, %2
%4 = phi i32 [ 1, %2 ], [ %38, %37 ]
%5 = phi i32 [ 100, %2 ], [ %39, %37 ]
%6 = phi double [ -1.000000e+00, %2 ], [ %40, %37 ]
%7 = phi double [ -1.000000e+00, %2 ], [ %41, %37 ]
%8 = phi double [ -1.000000e+00, %2 ], [ %42, %37 ]
%9 = phi double [ -1.000000e+00, %2 ], [ %43, %37 ]
%10 = phi i64 [ -1, %2 ], [ %44, %37 ]
%11 = phi i32 [ -1, %2 ], [ %45, %37 ]
%12 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
switch i32 %12, label %46 [
i32 -1, label %49
i32 110, label %13
i32 73, label %16
i32 68, label %19
i32 85, label %22
i32 115, label %25
i32 112, label %28
i32 80, label %31
i32 82, label %34
]
13: ; preds = %3
%14 = load i32, i32* @optarg
%15 = tail call i32 @atoi(i32 %14)
br label %37
16: ; preds = %3
%17 = load i32, i32* @optarg
%18 = tail call double @atof(i32 %17)
br label %37
19: ; preds = %3
%20 = load i32, i32* @optarg
%21 = tail call double @atof(i32 %20)
br label %37
22: ; preds = %3
%23 = load i32, i32* @optarg
%24 = tail call double @atof(i32 %23)
br label %37
25: ; preds = %3
%26 = load i32, i32* @optarg
%27 = tail call i64 @atol(i32 %26)
br label %37
28: ; preds = %3
%29 = load i32, i32* @optarg
%30 = tail call double @atof(i32 %29)
br label %37
31: ; preds = %3
%32 = load i32, i32* @optarg
%33 = tail call i32 @atoi(i32 %32)
br label %37
34: ; preds = %3
%35 = load i32, i32* @optarg
%36 = tail call i32 @atoi(i32 %35)
br label %37
37: ; preds = %34, %31, %28, %25, %22, %19, %16, %13
%38 = phi i32 [ %4, %34 ], [ %33, %31 ], [ %4, %28 ], [ %4, %25 ], [ %4, %22 ], [ %4, %19 ], [ %4, %16 ], [ %4, %13 ]
%39 = phi i32 [ %36, %34 ], [ %5, %31 ], [ %5, %28 ], [ %5, %25 ], [ %5, %22 ], [ %5, %19 ], [ %5, %16 ], [ %5, %13 ]
%40 = phi double [ %6, %34 ], [ %6, %31 ], [ %6, %28 ], [ %6, %25 ], [ %6, %22 ], [ %6, %19 ], [ %18, %16 ], [ %6, %13 ]
%41 = phi double [ %7, %34 ], [ %7, %31 ], [ %7, %28 ], [ %7, %25 ], [ %7, %22 ], [ %21, %19 ], [ %7, %16 ], [ %7, %13 ]
%42 = phi double [ %8, %34 ], [ %8, %31 ], [ %8, %28 ], [ %8, %25 ], [ %24, %22 ], [ %8, %19 ], [ %8, %16 ], [ %8, %13 ]
%43 = phi double [ %9, %34 ], [ %9, %31 ], [ %30, %28 ], [ %9, %25 ], [ %9, %22 ], [ %9, %19 ], [ %9, %16 ], [ %9, %13 ]
%44 = phi i64 [ %10, %34 ], [ %10, %31 ], [ %10, %28 ], [ %27, %25 ], [ %10, %22 ], [ %10, %19 ], [ %10, %16 ], [ %10, %13 ]
%45 = phi i32 [ %11, %34 ], [ %11, %31 ], [ %11, %28 ], [ %11, %25 ], [ %11, %22 ], [ %11, %19 ], [ %11, %16 ], [ %15, %13 ]
br label %3
46: ; preds = %3
%47 = tail call i32 (...) @show_help()
%48 = tail call i32 @exit(i32 1)
unreachable
49: ; preds = %3
%50 = icmp slt i32 %11, 1
br i1 %50, label %51, label %54
51: ; preds = %49
%52 = tail call i32 (...) @show_help()
%53 = tail call i32 @exit(i32 1)
unreachable
54: ; preds = %49
%55 = fcmp oge double %9, 0.000000e+00
%56 = fcmp olt double %9, 1.000000e+00
%57 = and i1 %55, %56
br i1 %57, label %71, label %58
58: ; preds = %54
%59 = fcmp olt double %7, 0.000000e+00
%60 = fcmp olt double %6, 0.000000e+00
%61 = select i1 %59, i1 %60, i1 false
%62 = fcmp olt double %8, 0.000000e+00
%63 = select i1 %61, i1 %62, i1 false
br i1 %63, label %64, label %67
64: ; preds = %58
%65 = sitofp i32 %11 to double
%66 = fdiv double 1.000000e+00, %65
br label %71
67: ; preds = %58
%68 = tail call double @fclamp(double %7)
%69 = tail call double @fclamp(double %6)
%70 = tail call double @fclamp(double %8)
br label %71
71: ; preds = %54, %67, %64
%72 = phi double [ %66, %64 ], [ %69, %67 ], [ %9, %54 ]
%73 = phi double [ %66, %64 ], [ %68, %67 ], [ %9, %54 ]
%74 = phi double [ %66, %64 ], [ %70, %67 ], [ %9, %54 ]
%75 = fcmp ult double %72, 0x3FEFF80000000000
br i1 %75, label %83, label %76
76: ; preds = %71
%77 = load i32, i32* @stderr
%78 = tail call i32 @fprintf(i32 %77, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%79 = load i32, i32* @stderr
%80 = tail call i32 @fflush(i32 %79)
%81 = tail call i32 (...) @show_help()
%82 = tail call i32 @exit(i32 1)
unreachable
83: ; preds = %71
%84 = icmp sgt i32 %4, 1
%85 = select i1 %84, i32 %4, i32 1
%86 = icmp sgt i64 %10, -1
br i1 %86, label %87, label %89
87: ; preds = %83
%88 = tail call i32 @srand(i64 %10)
br label %89
89: ; preds = %87, %83
%90 = shl i32 %11, 2
%91 = add i32 %90, 4
%92 = tail call i64 @malloc(i32 %91)
%93 = inttoptr i64 %92 to i32*
%94 = zext i32 %11 to i64
%95 = zext i32 %11 to i64
br label %96
96: ; preds = %89, %151
%97 = phi i32 [ 0, %89 ], [ %153, %151 ]
br label %98
98: ; preds = %96, %98
%99 = phi i64 [ 0, %96 ], [ %102, %98 ]
%100 = tail call i32 @ri(i32 %5)
%101 = getelementptr inbounds i32, i32* %93, i64 %99
store i32 %100, i32* %101
%102 = add nuw nsw i64 %99, 1
%103 = icmp eq i64 %102, %94
br i1 %103, label %104, label %98
104: ; preds = %98, %104
%105 = phi i64 [ %109, %104 ], [ 0, %98 ]
%106 = getelementptr inbounds i32, i32* %93, i64 %105
%107 = load i32, i32* %106
%108 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %107)
%109 = add nuw nsw i64 %105, 1
%110 = icmp eq i64 %109, %95
br i1 %110, label %111, label %104
111: ; preds = %104
%112 = tail call i32 @putchar(i32 10)
br label %113
113: ; preds = %111, %147
%114 = phi i32 [ %149, %147 ], [ 0, %111 ]
%115 = tail call i64 (...) @rand()
%116 = sitofp i64 %115 to double
%117 = load double, double* @RAND_MAX
%118 = fadd double %117, 1.000000e+00
%119 = fdiv double %116, %118
%120 = fcmp olt double %119, %72
br i1 %120, label %121, label %125
121: ; preds = %113
%122 = tail call i32 @ri(i32 %5)
%123 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %122)
%124 = add nsw i32 %114, -1
br label %147
125: ; preds = %113
%126 = tail call i64 (...) @rand()
%127 = sitofp i64 %126 to double
%128 = load double, double* @RAND_MAX
%129 = fadd double %128, 1.000000e+00
%130 = fdiv double %127, %129
%131 = fcmp olt double %130, %73
br i1 %131, label %147, label %132
132: ; preds = %125
%133 = tail call i64 (...) @rand()
%134 = sitofp i64 %133 to double
%135 = load double, double* @RAND_MAX
%136 = fadd double %135, 1.000000e+00
%137 = fdiv double %134, %136
%138 = fcmp olt double %137, %74
br i1 %138, label %139, label %142
139: ; preds = %132
%140 = tail call i32 @ri(i32 %5)
%141 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %140)
br label %147
142: ; preds = %132
%143 = sext i32 %114 to i64
%144 = getelementptr inbounds i32, i32* %93, i64 %143
%145 = load i32, i32* %144
%146 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %145)
br label %147
147: ; preds = %125, %142, %139, %121
%148 = phi i32 [ %124, %121 ], [ %114, %125 ], [ %114, %139 ], [ %114, %142 ]
%149 = add nsw i32 %148, 1
%150 = icmp slt i32 %149, %11
br i1 %150, label %113, label %151
151: ; preds = %147
%152 = tail call i32 @putchar(i32 10)
%153 = add nuw nsw i32 %97, 1
%154 = icmp eq i32 %153, %85
br i1 %154, label %155, label %96
155: ; preds = %151
%156 = tail call i32 @free(i32* %93)
ret i32 0
}