#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 *);
char getopt(int, char **, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ rand();
int rc();
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;
  double ins_prob = -1.0, del_prob = -1.0, sub_prob = -1.0, noc_prob = -1.0,
         glo_prob = -1.0;
  char *a, *b;
  char ch;
  double feps = 1.0 / 1024.0;
  while ((ch = getopt(argc, argv, "n:I:D:U:s:p:N:P:h")) != -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 'N':
      noc_prob = atof(optarg);
    case 's':
      seed = atol(optarg);
      break;
    case 'p':
      glo_prob = atof(optarg);
      break;
    case 'P':
      n_pair = 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);
  }
  noc_prob = fclamp(noc_prob);
  if (n_pair < 1) {
    n_pair = 1;
  }
  if (seed >= 0) {
    srand((unsigned long int)seed);
  }
  a = (char *)malloc(sizeof(char) * (n + 1));
  a[n] = '\0';
  for (pair = 0; pair < n_pair; pair++) {
    for (i = 0; i < n; i++) {
      a[i] = rc();
    }
    printf("%s\n", a);
    for (i = 0; i < n; i++) {
      p = ((double)rand()) / (RAND_MAX + 1.0);
      if (p < ins_prob) {
        printf("%c", rc());
        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("%c", rc());
        continue;
      }
      p = ((double)rand()) / (RAND_MAX + 1.0);
      if (p < noc_prob) {
        printf("n");
        continue;
      }
      printf("%c", a[i]);
    }
    printf("\n");
  }
}


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  0xe08(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
movl   $0x1,-0x48(%rbp)
movsd  0xde4(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xdd7(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xdca(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xdbd(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xdb0(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xd9b(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe65(%rip),%rdx
call   10d0 <getopt@plt>
mov    %al,-0x81(%rbp)
movsbl %al,%eax
cmp    $0xffffffff,%eax
je     1396 <main+0x1b6>
movsbl -0x81(%rbp),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x98(%rbp)
sub    $0x2f,%eax
ja     1380 <main+0x1a0>
mov    -0x98(%rbp),%rax
lea    0xd64(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,-0x20(%rbp)
jmp    1391 <main+0x1b1>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
call   1050 <atof@plt>
movsd  %xmm0,-0x50(%rbp)
jmp    1391 <main+0x1b1>
mov    0x2cfe(%rip),%rax
mov    (%rax),%edi
call   1050 <atof@plt>
movsd  %xmm0,-0x58(%rbp)
jmp    1391 <main+0x1b1>
mov    0x2ce6(%rip),%rax
mov    (%rax),%edi
call   1050 <atof@plt>
movsd  %xmm0,-0x60(%rbp)
jmp    1391 <main+0x1b1>
mov    0x2cce(%rip),%rax
mov    (%rax),%edi
call   1050 <atof@plt>
movsd  %xmm0,-0x68(%rbp)
mov    0x2cbb(%rip),%rax
mov    (%rax),%edi
call   10c0 <atol@plt>
mov    %rax,-0x40(%rbp)
jmp    1391 <main+0x1b1>
mov    0x2ca4(%rip),%rax
mov    (%rax),%edi
call   1050 <atof@plt>
movsd  %xmm0,-0x70(%rbp)
jmp    1391 <main+0x1b1>
mov    0x2c8c(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,-0x48(%rbp)
jmp    1391 <main+0x1b1>
jmp    1380 <main+0x1a0>
mov    $0x0,%al
call   1090 <show_help@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
jmp    126d <main+0x8d>
cmpl   $0x0,-0x20(%rbp)
jg     13b1 <main+0x1d1>
mov    $0x0,%al
call   1090 <show_help@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
movsd  -0x70(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     13ef <main+0x20f>
movsd  0xc4d(%rip),%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    13ef <main+0x20f>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  %xmm0,-0x50(%rbp)
movsd  %xmm0,-0x58(%rbp)
jmp    14f3 <main+0x313>
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    14c1 <main+0x2e1>
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    14c1 <main+0x2e1>
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    14c1 <main+0x2e1>
cvtsi2sdl -0x20(%rbp),%xmm1
movsd  0xbf2(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
ja     1454 <main+0x274>
movsd  -0x58(%rbp),%xmm0
movsd  0xbce(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    145e <main+0x27e>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
ja     1483 <main+0x2a3>
movsd  -0x50(%rbp),%xmm0
movsd  0xb9f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    148d <main+0x2ad>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
ja     14b2 <main+0x2d2>
movsd  -0x60(%rbp),%xmm0
movsd  0xb70(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14bc <main+0x2dc>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    14ee <main+0x30e>
movsd  -0x58(%rbp),%xmm0
call   1030 <fclamp@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1030 <fclamp@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1030 <fclamp@plt>
movsd  %xmm0,-0x60(%rbp)
jmp    14f3 <main+0x313>
movsd  -0x50(%rbp),%xmm0
movsd  0xb18(%rip),%xmm1
subsd  -0x90(%rbp),%xmm1
ff
ucomisd %xmm1,%xmm0
jb     1546 <main+0x366>
mov    0x2ab7(%rip),%rax
mov    (%rax),%edi
lea    0xbd0(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2aa2(%rip),%rax
mov    (%rax),%edi
call   10b0 <fflush@plt>
mov    $0x0,%al
call   1090 <show_help@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
movsd  -0x68(%rbp),%xmm0
call   1030 <fclamp@plt>
movsd  %xmm0,-0x68(%rbp)
cmpl   $0x1,-0x48(%rbp)
jge    1566 <main+0x386>
movl   $0x1,-0x48(%rbp)
cmpq   $0x0,-0x40(%rbp)
jl     157a <main+0x39a>
mov    -0x40(%rbp),%rdi
call   1070 <srand@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
movslq -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    1797 <main+0x5b7>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    15e5 <main+0x405>
mov    $0x0,%al
call   1040 <rc@plt>
mov    %al,%dl
mov    -0x78(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    15b7 <main+0x3d7>
mov    -0x78(%rbp),%rsi
lea    0xb25(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    177b <main+0x59b>
mov    $0x0,%al
call   1100 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0x9fa(%rip),%xmm1
mov    0x29bb(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    166b <main+0x48b>
mov    $0x0,%al
call   1040 <rc@plt>
mov    %eax,%esi
lea    0xac3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    176d <main+0x58d>
mov    $0x0,%al
call   1100 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0x999(%rip),%xmm1
mov    0x295a(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    16ac <main+0x4cc>
jmp    176d <main+0x58d>
mov    $0x0,%al
call   1100 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0x958(%rip),%xmm1
mov    0x2919(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1704 <main+0x524>
mov    $0x0,%al
call   1040 <rc@plt>
mov    %eax,%esi
lea    0xa21(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    176d <main+0x58d>
mov    $0x0,%al
call   1100 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0x900(%rip),%xmm1
mov    0x28c1(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1753 <main+0x573>
lea    0x9d5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    176d <main+0x58d>
mov    -0x78(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0x9b3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    15fe <main+0x41e>
lea    0x991(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    15a4 <main+0x3c4>
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,%ebp
lea    0xece(%rip),%rdx
call   10e0 <getopt@plt>
cmp    $0xff,%al
je     156e <main+0x37e>
movl   $0x1,0x14(%rsp)
movsd  0xdd9(%rip),%xmm0
mov    $0xffffffffffffffff,%rbx
mov    $0xffffffff,%r15d
lea    0xddd(%rip),%r14
mov    0x2db6(%rip),%r13
movsd  %xmm0,0x18(%rsp)
movsd  %xmm0,0x20(%rsp)
movsd  %xmm0,0x40(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  %xmm0,0x28(%rsp)
jmp    1292 <main+0xa2>
mov    0x0(%r13),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x18(%rsp)
mov    0x0(%r13),%edi
call   10d0 <atol@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %r12,%rsi
lea    0xe4f(%rip),%rdx
call   10e0 <getopt@plt>
cmp    $0xff,%al
je     130e <main+0x11e>
movsbl %al,%eax
add    $0xffffffbc,%eax
cmp    $0x2f,%eax
ja     156e <main+0x37e>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
mov    0x0(%r13),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x40(%rsp)
jmp    127d <main+0x8d>
mov    0x0(%r13),%edi
call   10f0 <atoi@plt>
mov    %eax,0x14(%rsp)
jmp    127d <main+0x8d>
mov    0x0(%r13),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x20(%rsp)
jmp    127d <main+0x8d>
mov    0x0(%r13),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x8(%rsp)
jmp    127d <main+0x8d>
mov    0x0(%r13),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x28(%rsp)
jmp    127d <main+0x8d>
mov    0x0(%r13),%edi
call   10f0 <atoi@plt>
mov    %eax,%r15d
jmp    127d <main+0x8d>
test   %r15d,%r15d
jle    156e <main+0x37e>
xorpd  %xmm3,%xmm3
movsd  0x8(%rsp),%xmm2
ucomisd %xmm3,%xmm2
jb     1341 <main+0x151>
movsd  0xcd9(%rip),%xmm1
ucomisd %xmm2,%xmm1
movsd  %xmm2,0x38(%rsp)
movsd  %xmm2,0x30(%rsp)
ja     13b6 <main+0x1c6>
movsd  0x40(%rsp),%xmm0
ucomisd %xmm0,%xmm3
jbe    1383 <main+0x193>
xorpd  %xmm1,%xmm1
ucomisd 0x28(%rsp),%xmm1
jbe    1383 <main+0x193>
ucomisd 0x20(%rsp),%xmm1
jbe    1383 <main+0x193>
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
movsd  0xc97(%rip),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,0x38(%rsp)
movsd  %xmm2,0x30(%rsp)
jmp    13b6 <main+0x1c6>
call   1040 <fclamp@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0x28(%rsp),%xmm0
call   1040 <fclamp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
call   1040 <fclamp@plt>
movsd  0x8(%rsp),%xmm2
movsd  %xmm0,0x30(%rsp)
movsd  %xmm2,0x8(%rsp)
ucomisd 0xc4c(%rip),%xmm2
jae    1552 <main+0x362>
movsd  0x18(%rsp),%xmm0
call   1040 <fclamp@plt>
movsd  %xmm0,0x18(%rsp)
test   %rbx,%rbx
js     13e8 <main+0x1f8>
mov    %rbx,%rdi
call   1080 <srand@plt>
lea    0x1(%r15),%edi
call   10b0 <malloc@plt>
mov    %rax,%rbp
mov    %r15d,%r13d
movb   $0x0,(%rax,%r13,1)
mov    0x2bdd(%rip),%r14
xor    %r12d,%r12d
jmp    1429 <main+0x239>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
cmp    0x14(%rsp),%r12d
jge    1541 <main+0x351>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rc@plt>
mov    %al,0x0(%rbp,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1430 <main+0x240>
mov    %rbp,%rdi
call   1060 <puts@plt>
xor    %ebx,%ebx
jmp    1467 <main+0x277>
call   1050 <rc@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
add    $0x1,%ebx
cmp    %r15d,%ebx
jge    1410 <main+0x220>
xor    %eax,%eax
call   1110 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%r14),%xmm1
movsd  0xb85(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
ja     1450 <main+0x260>
call   1110 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%r14),%xmm1
addsd  0xb55(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x38(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     145f <main+0x26f>
xor    %eax,%eax
call   1110 <rand@plt>
movsd  0xb36(%rip),%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%r14),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0x30(%rsp),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
jbe    14fe <main+0x30e>
call   1050 <rc@plt>
mov    %eax,%edi
jmp    1537 <main+0x347>
call   1110 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%r14),%xmm1
addsd  0xaf0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    152f <main+0x33f>
mov    $0x6e,%edi
jmp    1537 <main+0x347>
movslq %ebx,%rax
movsbl 0x0(%rbp,%rax,1),%edi
call   1030 <putchar@plt>
jmp    145f <main+0x26f>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2a77(%rip),%rbx
mov    (%rbx),%edi
lea    0xb88(%rip),%rsi
call   1090 <fprintf@plt>
mov    (%rbx),%edi
call   10c0 <fflush@plt>
xor    %eax,%eax
call   10a0 <show_help@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

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

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