#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);
      break;
    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     139b <main+0x1bb>
movsbl -0x81(%rbp),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x98(%rbp)
sub    $0x2f,%eax
ja     1385 <main+0x1a5>
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    1396 <main+0x1b6>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
call   1050 <atof@plt>
movsd  %xmm0,-0x50(%rbp)
jmp    1396 <main+0x1b6>
mov    0x2cfe(%rip),%rax
mov    (%rax),%edi
call   1050 <atof@plt>
movsd  %xmm0,-0x58(%rbp)
jmp    1396 <main+0x1b6>
mov    0x2ce6(%rip),%rax
mov    (%rax),%edi
call   1050 <atof@plt>
movsd  %xmm0,-0x60(%rbp)
jmp    1396 <main+0x1b6>
mov    0x2cce(%rip),%rax
mov    (%rax),%edi
call   1050 <atof@plt>
movsd  %xmm0,-0x68(%rbp)
jmp    1396 <main+0x1b6>
mov    0x2cb6(%rip),%rax
mov    (%rax),%edi
call   10c0 <atol@plt>
mov    %rax,-0x40(%rbp)
jmp    1396 <main+0x1b6>
mov    0x2c9f(%rip),%rax
mov    (%rax),%edi
call   1050 <atof@plt>
movsd  %xmm0,-0x70(%rbp)
jmp    1396 <main+0x1b6>
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
call   10e0 <atoi@plt>
mov    %eax,-0x48(%rbp)
jmp    1396 <main+0x1b6>
jmp    1385 <main+0x1a5>
mov    $0x0,%al
call   1090 <show_help@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
jmp    126d <main+0x8d>
cmpl   $0x0,-0x20(%rbp)
jg     13b6 <main+0x1d6>
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     13f4 <main+0x214>
movsd  0xc48(%rip),%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    13f4 <main+0x214>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  %xmm0,-0x50(%rbp)
movsd  %xmm0,-0x58(%rbp)
jmp    14f8 <main+0x318>
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    14c6 <main+0x2e6>
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    14c6 <main+0x2e6>
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    14c6 <main+0x2e6>
cvtsi2sdl -0x20(%rbp),%xmm1
movsd  0xbed(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
ja     1459 <main+0x279>
movsd  -0x58(%rbp),%xmm0
movsd  0xbc9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1463 <main+0x283>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
ja     1488 <main+0x2a8>
movsd  -0x50(%rbp),%xmm0
movsd  0xb9a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1492 <main+0x2b2>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
ja     14b7 <main+0x2d7>
movsd  -0x60(%rbp),%xmm0
movsd  0xb6b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14c1 <main+0x2e1>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    14f3 <main+0x313>
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    14f8 <main+0x318>
movsd  -0x50(%rbp),%xmm0
movsd  0xb13(%rip),%xmm1
subsd  -0x90(%rbp),%xmm1
ff
ucomisd %xmm1,%xmm0
jb     154b <main+0x36b>
mov    0x2ab2(%rip),%rax
mov    (%rax),%edi
lea    0xbcb(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2a9d(%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    156b <main+0x38b>
movl   $0x1,-0x48(%rbp)
cmpq   $0x0,-0x40(%rbp)
jl     157f <main+0x39f>
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    179c <main+0x5bc>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    15ea <main+0x40a>
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    15bc <main+0x3dc>
mov    -0x78(%rbp),%rsi
lea    0xb20(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1780 <main+0x5a0>
mov    $0x0,%al
call   1100 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0x9f5(%rip),%xmm1
mov    0x29b6(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1670 <main+0x490>
mov    $0x0,%al
call   1040 <rc@plt>
mov    %eax,%esi
lea    0xabe(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1772 <main+0x592>
mov    $0x0,%al
call   1100 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0x994(%rip),%xmm1
mov    0x2955(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    16b1 <main+0x4d1>
jmp    1772 <main+0x592>
mov    $0x0,%al
call   1100 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0x953(%rip),%xmm1
mov    0x2914(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1709 <main+0x529>
mov    $0x0,%al
call   1040 <rc@plt>
mov    %eax,%esi
lea    0xa1c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1772 <main+0x592>
mov    $0x0,%al
call   1100 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0x8fb(%rip),%xmm1
mov    0x28bc(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1758 <main+0x578>
lea    0x9d0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1772 <main+0x592>
mov    -0x78(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0x9ae(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1603 <main+0x423>
lea    0x98c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    15a9 <main+0x3c9>
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     15f0 <main+0x400>
movl   $0x1,0x1c(%rsp)
movsd  0xdd9(%rip),%xmm2
mov    $0xffffffffffffffff,%r15
mov    $0xffffffff,%r13d
lea    0xddd(%rip),%r14
lea    0xe96(%rip),%rbx
movsd  %xmm2,0x20(%rsp)
movsd  %xmm2,0x28(%rsp)
movsd  %xmm2,0x40(%rsp)
movsd  %xmm2,0x10(%rsp)
jmp    129b <main+0xab>
movsd  %xmm2,0x8(%rsp)
mov    0x2d8f(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
mov    %r12,%rsi
mov    %rbx,%rdx
call   10e0 <getopt@plt>
cmp    $0xff,%al
movsd  0x8(%rsp),%xmm2
je     137b <main+0x18b>
movsbl %al,%eax
add    $0xffffffbc,%eax
cmp    $0x2f,%eax
ja     15f0 <main+0x400>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
movsd  %xmm2,0x8(%rsp)
mov    0x2d38(%rip),%rax
mov    (%rax),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x40(%rsp)
jmp    1280 <main+0x90>
movsd  %xmm2,0x8(%rsp)
mov    0x2d1c(%rip),%rax
mov    (%rax),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x20(%rsp)
jmp    1280 <main+0x90>
movsd  %xmm2,0x8(%rsp)
mov    0x2d00(%rip),%rax
mov    (%rax),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x28(%rsp)
jmp    1280 <main+0x90>
movsd  %xmm2,0x8(%rsp)
mov    0x2ce1(%rip),%rax
mov    (%rax),%edi
call   10d0 <atol@plt>
mov    %rax,%r15
jmp    1280 <main+0x90>
movsd  %xmm2,0x8(%rsp)
mov    0x2cc5(%rip),%rax
mov    (%rax),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x10(%rsp)
jmp    1280 <main+0x90>
movsd  %xmm2,0x8(%rsp)
mov    0x2ca6(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,0x1c(%rsp)
jmp    1280 <main+0x90>
mov    0x2c8f(%rip),%rax
mov    (%rax),%edi
call   1070 <atof@plt>
movsd  %xmm0,0x8(%rsp)
jmp    1280 <main+0x90>
test   %r13d,%r13d
jle    15f0 <main+0x400>
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jb     13a8 <main+0x1b8>
movsd  0xc72(%rip),%xmm1
ucomisd %xmm2,%xmm1
movsd  %xmm2,0x38(%rsp)
movsd  %xmm2,0x30(%rsp)
ja     141d <main+0x22d>
movsd  0x40(%rsp),%xmm0
ucomisd %xmm0,%xmm3
jbe    13ea <main+0x1fa>
xorpd  %xmm1,%xmm1
ucomisd 0x10(%rsp),%xmm1
jbe    13ea <main+0x1fa>
ucomisd 0x28(%rsp),%xmm1
jbe    13ea <main+0x1fa>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  0xc30(%rip),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,0x38(%rsp)
movsd  %xmm2,0x30(%rsp)
jmp    141d <main+0x22d>
call   1040 <fclamp@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <fclamp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x28(%rsp),%xmm0
call   1040 <fclamp@plt>
movsd  0x8(%rsp),%xmm2
movsd  %xmm0,0x30(%rsp)
movsd  %xmm2,0x8(%rsp)
ucomisd 0xbe5(%rip),%xmm2
jae    15d4 <main+0x3e4>
movsd  0x20(%rsp),%xmm0
call   1040 <fclamp@plt>
movsd  %xmm0,0x20(%rsp)
test   %r15,%r15
js     144f <main+0x25f>
mov    %r15,%rdi
call   1080 <srand@plt>
lea    0x1(%r13),%edi
call   10b0 <malloc@plt>
mov    %rax,%rbp
mov    %r13d,%r12d
movb   $0x0,(%rax,%r12,1)
mov    0x2b76(%rip),%r14
xor    %eax,%eax
jmp    148b <main+0x29b>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%eax
add    $0x1,%eax
cmp    0x1c(%rsp),%eax
jge    15c3 <main+0x3d3>
mov    %eax,0x10(%rsp)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rc@plt>
mov    %al,0x0(%rbp,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    14a0 <main+0x2b0>
mov    %rbp,%rdi
call   1060 <puts@plt>
xor    %r15d,%r15d
jmp    14e9 <main+0x2f9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1050 <rc@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r15d
add    $0x1,%r15d
cmp    %r13d,%r15d
jge    1470 <main+0x280>
xor    %eax,%eax
call   1110 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%r14),%xmm1
movsd  0xb03(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
ja     14d0 <main+0x2e0>
call   1110 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%r14),%xmm1
addsd  0xad3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x38(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     14e0 <main+0x2f0>
xor    %eax,%eax
call   1110 <rand@plt>
movsd  0xab4(%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    1580 <main+0x390>
call   1050 <rc@plt>
mov    %eax,%edi
jmp    15b9 <main+0x3c9>
call   1110 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%r14),%xmm1
addsd  0xa6e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x20(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    15b1 <main+0x3c1>
mov    $0x6e,%edi
jmp    15b9 <main+0x3c9>
movslq %r15d,%rax
movsbl 0x0(%rbp,%rax,1),%edi
call   1030 <putchar@plt>
jmp    14e0 <main+0x2f0>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x29f5(%rip),%rbx
mov    (%rbx),%edi
lea    0xb06(%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 %62
49: ; preds = %31
%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, %46, %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 %56, label %5
5: ; preds = %2, %43
%6 = phi i8 [ %52, %43 ], [ %3, %2 ]
%7 = phi i32 [ %51, %43 ], [ -1, %2 ]
%8 = phi i64 [ %50, %43 ], [ -1, %2 ]
%9 = phi double [ %49, %43 ], [ -1.000000e+00, %2 ]
%10 = phi double [ %48, %43 ], [ -1.000000e+00, %2 ]
%11 = phi double [ %47, %43 ], [ -1.000000e+00, %2 ]
%12 = phi double [ %46, %43 ], [ -1.000000e+00, %2 ]
%13 = phi double [ %45, %43 ], [ -1.000000e+00, %2 ]
%14 = phi i32 [ %44, %43 ], [ 1, %2 ]
%15 = sext i8 %6 to i32
switch i32 %15, label %40 [
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 %34
i32 80, label %37
]
16: ; preds = %5
%17 = load i32, i32* @optarg
%18 = tail call i32 @atoi(i32 %17)
br label %43
19: ; preds = %5
%20 = load i32, i32* @optarg
%21 = tail call double @atof(i32 %20)
br label %43
22: ; preds = %5
%23 = load i32, i32* @optarg
%24 = tail call double @atof(i32 %23)
br label %43
25: ; preds = %5
%26 = load i32, i32* @optarg
%27 = tail call double @atof(i32 %26)
br label %43
28: ; preds = %5
%29 = load i32, i32* @optarg
%30 = tail call double @atof(i32 %29)
br label %43
31: ; preds = %5
%32 = load i32, i32* @optarg
%33 = tail call i64 @atol(i32 %32)
br label %43
34: ; preds = %5
%35 = load i32, i32* @optarg
%36 = tail call double @atof(i32 %35)
br label %43
37: ; preds = %5
%38 = load i32, i32* @optarg
%39 = tail call i32 @atoi(i32 %38)
br label %43
40: ; preds = %5
%41 = tail call i32 (...) @show_help()
%42 = tail call i32 @exit(i32 1)
unreachable
43: ; preds = %37, %34, %31, %28, %25, %22, %19, %16
%44 = phi i32 [ %39, %37 ], [ %14, %34 ], [ %14, %31 ], [ %14, %28 ], [ %14, %25 ], [ %14, %22 ], [ %14, %19 ], [ %14, %16 ]
%45 = phi double [ %13, %37 ], [ %13, %34 ], [ %13, %31 ], [ %13, %28 ], [ %13, %25 ], [ %13, %22 ], [ %21, %19 ], [ %13, %16 ]
%46 = phi double [ %12, %37 ], [ %12, %34 ], [ %12, %31 ], [ %12, %28 ], [ %12, %25 ], [ %24, %22 ], [ %12, %19 ], [ %12, %16 ]
%47 = phi double [ %11, %37 ], [ %11, %34 ], [ %11, %31 ], [ %11, %28 ], [ %27, %25 ], [ %11, %22 ], [ %11, %19 ], [ %11, %16 ]
%48 = phi double [ %10, %37 ], [ %10, %34 ], [ %10, %31 ], [ %30, %28 ], [ %10, %25 ], [ %10, %22 ], [ %10, %19 ], [ %10, %16 ]
%49 = phi double [ %9, %37 ], [ %36, %34 ], [ %9, %31 ], [ %9, %28 ], [ %9, %25 ], [ %9, %22 ], [ %9, %19 ], [ %9, %16 ]
%50 = phi i64 [ %8, %37 ], [ %8, %34 ], [ %33, %31 ], [ %8, %28 ], [ %8, %25 ], [ %8, %22 ], [ %8, %19 ], [ %8, %16 ]
%51 = phi i32 [ %7, %37 ], [ %7, %34 ], [ %7, %31 ], [ %7, %28 ], [ %7, %25 ], [ %7, %22 ], [ %7, %19 ], [ %18, %16 ]
%52 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%53 = icmp eq i8 %52, -1
br i1 %53, label %54, label %5
54: ; preds = %43
%55 = icmp slt i32 %51, 1
br i1 %55, label %56, label %59
56: ; preds = %2, %54
%57 = tail call i32 (...) @show_help()
%58 = tail call i32 @exit(i32 1)
unreachable
59: ; preds = %54
%60 = fcmp oge double %49, 0.000000e+00
%61 = fcmp olt double %49, 1.000000e+00
%62 = and i1 %60, %61
br i1 %62, label %76, label %63
63: ; preds = %59
%64 = fcmp olt double %46, 0.000000e+00
%65 = fcmp olt double %45, 0.000000e+00
%66 = select i1 %64, i1 %65, i1 false
%67 = fcmp olt double %47, 0.000000e+00
%68 = select i1 %66, i1 %67, i1 false
br i1 %68, label %69, label %72
69: ; preds = %63
%70 = sitofp i32 %51 to double
%71 = fdiv double 1.000000e+00, %70
br label %76
72: ; preds = %63
%73 = tail call double @fclamp(double %46)
%74 = tail call double @fclamp(double %45)
%75 = tail call double @fclamp(double %47)
br label %76
76: ; preds = %59, %72, %69
%77 = phi double [ %71, %69 ], [ %74, %72 ], [ %49, %59 ]
%78 = phi double [ %71, %69 ], [ %73, %72 ], [ %49, %59 ]
%79 = phi double [ %71, %69 ], [ %75, %72 ], [ %49, %59 ]
%80 = fcmp ult double %77, 0x3FEFF80000000000
br i1 %80, label %88, label %81
81: ; preds = %76
%82 = load i32, i32* @stderr
%83 = tail call i32 @fprintf(i32 %82, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%84 = load i32, i32* @stderr
%85 = tail call i32 @fflush(i32 %84)
%86 = tail call i32 (...) @show_help()
%87 = tail call i32 @exit(i32 1)
unreachable
88: ; preds = %76
%89 = tail call double @fclamp(double %48)
%90 = icmp sgt i32 %44, 1
%91 = select i1 %90, i32 %44, i32 1
%92 = icmp sgt i64 %50, -1
br i1 %92, label %93, label %95
93: ; preds = %88
%94 = tail call i32 @srand(i64 %50)
br label %95
95: ; preds = %93, %88
%96 = add nuw nsw i32 %51, 1
%97 = tail call i64 @malloc(i32 %96)
%98 = inttoptr i64 %97 to i8*
%99 = zext i32 %51 to i64
%100 = getelementptr inbounds i8, i8* %98, i64 %99
store i8 0, i8* %100
br label %101
101: ; preds = %95, %160
%102 = phi i32 [ 0, %95 ], [ %162, %160 ]
br label %103
103: ; preds = %101, %103
%104 = phi i64 [ 0, %101 ], [ %108, %103 ]
%105 = tail call i32 (...) @rc()
%106 = trunc i32 %105 to i8
%107 = getelementptr inbounds i8, i8* %98, i64 %104
store i8 %106, i8* %107
%108 = add nuw nsw i64 %104, 1
%109 = icmp eq i64 %108, %99
br i1 %109, label %110, label %103
110: ; preds = %103
%111 = tail call i32 @puts(i8* dereferenceable(1) %98)
br label %112
112: ; preds = %110, %156
%113 = phi i32 [ %158, %156 ], [ 0, %110 ]
%114 = tail call i64 (...) @rand()
%115 = sitofp i64 %114 to double
%116 = load double, double* @RAND_MAX
%117 = fadd double %116, 1.000000e+00
%118 = fdiv double %115, %117
%119 = fcmp olt double %118, %77
br i1 %119, label %120, label %124
120: ; preds = %112
%121 = tail call i32 (...) @rc()
%122 = tail call i32 @putchar(i32 %121)
%123 = add nsw i32 %113, -1
br label %156
124: ; preds = %112
%125 = tail call i64 (...) @rand()
%126 = sitofp i64 %125 to double
%127 = load double, double* @RAND_MAX
%128 = fadd double %127, 1.000000e+00
%129 = fdiv double %126, %128
%130 = fcmp olt double %129, %78
br i1 %130, label %156, label %131
131: ; preds = %124
%132 = tail call i64 (...) @rand()
%133 = sitofp i64 %132 to double
%134 = load double, double* @RAND_MAX
%135 = fadd double %134, 1.000000e+00
%136 = fdiv double %133, %135
%137 = fcmp olt double %136, %79
br i1 %137, label %138, label %141
138: ; preds = %131
%139 = tail call i32 (...) @rc()
%140 = tail call i32 @putchar(i32 %139)
br label %156
141: ; preds = %131
%142 = tail call i64 (...) @rand()
%143 = sitofp i64 %142 to double
%144 = load double, double* @RAND_MAX
%145 = fadd double %144, 1.000000e+00
%146 = fdiv double %143, %145
%147 = fcmp olt double %146, %89
br i1 %147, label %148, label %150
148: ; preds = %141
%149 = tail call i32 @putchar(i32 110)
br label %156
150: ; preds = %141
%151 = sext i32 %113 to i64
%152 = getelementptr inbounds i8, i8* %98, i64 %151
%153 = load i8, i8* %152
%154 = sext i8 %153 to i32
%155 = tail call i32 @putchar(i32 %154)
br label %156
156: ; preds = %124, %150, %148, %138, %120
%157 = phi i32 [ %123, %120 ], [ %113, %124 ], [ %113, %138 ], [ %113, %148 ], [ %113, %150 ]
%158 = add nsw i32 %157, 1
%159 = icmp slt i32 %158, %51
br i1 %159, label %112, label %160
160: ; preds = %156
%161 = tail call i32 @putchar(i32 10)
%162 = add nuw nsw i32 %102, 1
%163 = icmp eq i32 %162, %91
br i1 %163, label %164, label %101
164: ; preds = %160
ret i32 0
}