#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 */
scalar_t__ atof(char *);
int atoi(char *);
double betai(double, double, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  double temp;
  double thisproba, thisproba2;
  int x;
  int y;
  int thisy;
  int n1 = 1, n2 = 1;
  double ratio;
  double t1, t2, t3, t4;
  double sum;
  int ymin, ymax;
  int argcount = 1;
  int noup;
  double sig;
  int show = 0;
  double p;
  if (argc < 4) {
    usage();
    exit(0);
  }
  x = -1;
  y = -1;
  while (argcount < argc) {
    if (!strcmp(argv[argcount], "-xvalue")) {
      x = atoi(argv[argcount + 1]);
      argcount += 2;
    } else if (!strcmp(argv[argcount], "-yvalue")) {
      y = atoi(argv[argcount + 1]);
      argcount += 2;
    } else if (!strcmp(argv[argcount], "-diff")) {
      n1 = atoi(argv[argcount + 1]);
      n2 = atoi(argv[argcount + 2]);
      argcount += 3;
    } else if (!strcmp(argv[argcount], "-sig")) {
      sig = (double)atof(argv[argcount + 1]);
      argcount += 2;
    } else {
      usage();
      exit(0);
    }
  }
  if (x > -1 && y > -1) {
    ymin = -1;
    ymax = 10000;
    sum = 0;
    noup = 1;
    ratio = (double)n1 / (double)n2;
    p = (double)(n1) / (double)(n1 + n2);
    thisproba = betai((double)(x + 1), (double)(y + 1), p);
    thisproba2 = betai((double)(y + 1), (double)(x + 1), 1 - p);
    fprintf(stdout, "P( y <= %d | x = %d ) = %g \n", y, x, thisproba);
    fprintf(stdout, "P( y >= %d | x = %d ) = %g \n", y, x, thisproba2);
  } else if (x > -1 && y == -1) {
    y = 0;
    ymin = -1;
    ymax = 10000;
    sum = 0;
    noup = 1;
    ratio = (double)n1 / (double)n2;
    p = (double)(n1) / (double)(n1 + n2);
    y = 0;
    while (1) {
      thisproba = betai((double)(x + 1), (double)(y + 1), p);
      thisproba2 = betai((double)(y + 1), (double)(x + 1), 1 - p);
      if (thisproba < sig / 2.0) {
        ymin = y;
      }
      if (ymax == 10000 && thisproba2 < sig / 2.0) {
        ymax = y;
        break;
      }
      y++;
    }
    thisproba = betai((double)(x + 1), (double)(ymin + 1), p);
    thisproba2 = betai((double)(ymax + 1), (double)(x + 1), 1 - p);
    fprintf(stderr, "P( y <= %d | x = %d ) = %g \n", ymin, x, thisproba);
    fprintf(stderr, "P( y >= %d | x = %d ) = %g \n", ymax, x, thisproba2);
    if (ymin == -1) {
      fprintf(stdout, "%d *--%d\n", x, ymax);
    } else {
      fprintf(stdout, "%d %d--%d\n", x, ymin, ymax);
    }
  } else if (show == 1) {
    fprintf(stdout, "%d %d C(%d | %d ) = %g    %g\n", x, y, y, x, thisproba,
            thisproba2);
    y++;
    if (thisproba > 0.9999999999) {
    }
  }
}


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   $0x1,-0x38(%rbp)
movl   $0x1,-0x3c(%rbp)
movl   $0x1,-0x7c(%rbp)
movl   $0x0,-0x8c(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    11c0 <main+0x50>
mov    $0x0,%al
call   1070 <usage@plt>
xor    %edi,%edi
call   1090 <exit@plt>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0xffffffff,-0x30(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    133f <main+0x1cf>
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe2b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1222 <main+0xb2>
mov    -0x10(%rbp),%rax
mov    -0x7c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x7c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x7c(%rbp)
jmp    133a <main+0x1ca>
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdeb(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    126a <main+0xfa>
mov    -0x10(%rbp),%rax
mov    -0x7c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x30(%rbp)
mov    -0x7c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x7c(%rbp)
jmp    1335 <main+0x1c5>
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdab(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12cb <main+0x15b>
mov    -0x10(%rbp),%rax
mov    -0x7c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x7c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x7c(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x7c(%rbp)
jmp    1330 <main+0x1c0>
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd50(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    131d <main+0x1ad>
mov    -0x10(%rbp),%rax
mov    -0x7c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atof@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x7c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x7c(%rbp)
jmp    132b <main+0x1bb>
mov    $0x0,%al
call   1070 <usage@plt>
xor    %edi,%edi
call   1090 <exit@plt>
jmp    1330 <main+0x1c0>
jmp    1335 <main+0x1c5>
jmp    133a <main+0x1ca>
jmp    11ce <main+0x5e>
cmpl   $0xffffffff,-0x2c(%rbp)
jle    143f <main+0x2cf>
cmpl   $0xffffffff,-0x30(%rbp)
jle    143f <main+0x2cf>
movl   $0xffffffff,-0x74(%rbp)
movl   $0x2710,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x1,-0x80(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm0
mov    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x30(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
cvttsd2si -0x98(%rbp),%edi
ff
call   1060 <betai@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xc30(%rip),%xmm2
subsd  -0x98(%rbp),%xmm2
ff
cvttsd2si %xmm2,%edi
call   1060 <betai@plt>
movsd  %xmm0,-0x28(%rbp)
mov    0x2bdb(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%edx
mov    -0x2c(%rbp),%ecx
movsd  -0x20(%rbp),%xmm0
lea    0xc22(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    0x2bb9(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%edx
mov    -0x2c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
lea    0xc1d(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    16d4 <main+0x564>
cmpl   $0xffffffff,-0x2c(%rbp)
jle    1664 <main+0x4f4>
cmpl   $0xffffffff,-0x30(%rbp)
jne    1664 <main+0x4f4>
movl   $0x0,-0x30(%rbp)
movl   $0xffffffff,-0x74(%rbp)
movl   $0x2710,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x1,-0x80(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm0
mov    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movl   $0x0,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x30(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
cvttsd2si -0x98(%rbp),%edi
ff
call   1060 <betai@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xb22(%rip),%xmm2
subsd  -0x98(%rbp),%xmm2
ff
cvttsd2si %xmm2,%edi
call   1060 <betai@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xaef(%rip),%xmm2
divsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    152d <main+0x3bd>
mov    -0x30(%rbp),%eax
mov    %eax,-0x74(%rbp)
cmpl   $0x2710,-0x78(%rbp)
jne    1568 <main+0x3f8>
movsd  -0x28(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xab9(%rip),%xmm2
divsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1568 <main+0x3f8>
mov    -0x30(%rbp),%eax
mov    %eax,-0x78(%rbp)
jmp    1576 <main+0x406>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    14ac <main+0x33c>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x74(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
cvttsd2si -0x98(%rbp),%edi
ff
call   1060 <betai@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xa58(%rip),%xmm2
subsd  -0x98(%rbp),%xmm2
ff
cvttsd2si %xmm2,%edi
call   1060 <betai@plt>
movsd  %xmm0,-0x28(%rbp)
mov    0x2a0b(%rip),%rax
mov    (%rax),%edi
mov    -0x74(%rbp),%edx
mov    -0x2c(%rbp),%ecx
movsd  -0x20(%rbp),%xmm0
lea    0xa4a(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    0x29e9(%rip),%rax
mov    (%rax),%edi
mov    -0x78(%rbp),%edx
mov    -0x2c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
lea    0xa45(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
cmpl   $0xffffffff,-0x74(%rbp)
jne    163e <main+0x4ce>
mov    0x29b5(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%edx
mov    -0x78(%rbp),%ecx
lea    0xa3b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    165f <main+0x4ef>
mov    0x2993(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%edx
mov    -0x74(%rbp),%ecx
mov    -0x78(%rbp),%r8d
lea    0xa1f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    16cf <main+0x55f>
cmpl   $0x1,-0x8c(%rbp)
jne    16ca <main+0x55a>
mov    0x2960(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0x9e9(%rip),%rsi
mov    $0x2,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0x94a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    16c5 <main+0x555>
jmp    16c5 <main+0x555>
jmp    16ca <main+0x55a>
jmp    16cf <main+0x55f>
jmp    16d4 <main+0x564>
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    $0x38,%rsp
cmp    $0x4,%edi
jl     14f0 <main+0x380>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xffffffff,%eax
mov    %rax,0x28(%rsp)
mov    $0x1,%r15d
lea    0xe6d(%rip),%r12
mov    $0xffffffff,%eax
mov    %rax,0x20(%rsp)
movl   $0x1,0x8(%rsp)
movl   $0x1,0x10(%rsp)
jmp    11e6 <main+0x76>
nop
mov    0x8(%rbx,%r13,8),%rdi
call   1080 <atoi@plt>
mov    %rax,0x28(%rsp)
mov    $0x2,%eax
movsd  0x18(%rsp),%xmm2
add    %eax,%r15d
cmp    %ebp,%r15d
jge    129a <main+0x12a>
movsd  %xmm2,0x18(%rsp)
mov    %r15d,%r13d
mov    (%rbx,%r13,8),%r14
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11c0 <main+0x50>
mov    %r14,%rdi
lea    0xe0c(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1260 <main+0xf0>
mov    %r14,%rdi
lea    0xe01(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1274 <main+0x104>
mov    %r14,%rdi
lea    0xdf4(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    14f0 <main+0x380>
mov    0x8(%rbx,%r13,8),%rdi
call   1030 <atof@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %rax,%xmm2
mov    $0x2,%eax
jmp    11da <main+0x6a>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rbx,%r13,8),%rdi
call   1080 <atoi@plt>
mov    %rax,0x20(%rsp)
jmp    11cf <main+0x5f>
mov    0x8(%rbx,%r13,8),%rdi
call   1080 <atoi@plt>
mov    %eax,0x8(%rsp)
mov    0x10(%rbx,%r13,8),%rdi
call   1080 <atoi@plt>
mov    %eax,0x10(%rsp)
mov    $0x3,%eax
jmp    11d4 <main+0x64>
mov    0x28(%rsp),%rbp
test   %ebp,%ebp
mov    0x20(%rsp),%rbx
js     1376 <main+0x206>
test   %ebx,%ebx
js     1376 <main+0x206>
mov    0x8(%rsp),%eax
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
mov    0x10(%rsp),%ecx
add    %eax,%ecx
cvtsi2sd %ecx,%xmm0
divsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rsp)
lea    0x1(%rbp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x1(%rbx),%eax
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0x30(%rsp)
cvttsd2si %xmm2,%edi
call   1060 <betai@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0xcf9(%rip),%xmm0
subsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movsd  0x30(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1060 <betai@plt>
movsd  %xmm0,0x8(%rsp)
mov    0x2ca9(%rip),%r14
mov    (%r14),%edi
lea    0xcf2(%rip),%rsi
mov    %ebx,%edx
mov    %ebp,%ecx
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0xcf4(%rip),%rsi
mov    %ebx,%edx
mov    %ebp,%ecx
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %ebp,%ebp
js     1365 <main+0x1f5>
cmp    $0xffffffff,%ebx
jne    1365 <main+0x1f5>
mov    0x8(%rsp),%eax
cvtsi2sd %eax,%xmm0
mov    0x10(%rsp),%ecx
add    %eax,%ecx
cvtsi2sd %ecx,%xmm1
divsd  %xmm1,%xmm0
lea    0x1(%rbp),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0x20(%rsp)
cvttsd2si %xmm0,%r12d
movsd  0xc4e(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%r15d
mulsd  0xc45(%rip),%xmm2
mov    $0xffffffff,%ebx
mov    $0xffffffff,%ebp
movsd  %xmm2,0x18(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%eax
lea    0x1(%rax),%ebx
add    $0x2,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
mov    %r12d,%edi
call   1060 <betai@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mov    %r15d,%edi
call   1060 <betai@plt>
movsd  0x18(%rsp),%xmm2
ucomisd 0x10(%rsp),%xmm2
cmova  %ebx,%ebp
ucomisd %xmm0,%xmm2
jbe    13e0 <main+0x270>
lea    0x1(%rbp),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x20(%rsp),%xmm0
mov    %r12d,%edi
call   1060 <betai@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mov    %r15d,%edi
call   1060 <betai@plt>
movsd  %xmm0,0x18(%rsp)
mov    0x2b6f(%rip),%r14
mov    (%r14),%edi
lea    0xbb0(%rip),%rsi
mov    %ebp,%edx
mov    0x28(%rsp),%r15
mov    %r15d,%ecx
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0xbac(%rip),%rsi
mov    %ebx,%edx
mov    %r15d,%ecx
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    %ebp,%eax
mov    0x2b21(%rip),%rcx
mov    (%rcx),%edi
inc    %eax
jne    14d5 <main+0x365>
lea    0xba1(%rip),%rsi
mov    %r15d,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1365 <main+0x1f5>
lea    0xb93(%rip),%rsi
mov    %r15d,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1365 <main+0x1f5>
xor    %eax,%eax
call   1070 <usage@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"-xvalue\00"
@.str.1 = [8 x i8] c"-yvalue\00"
@.str.2 = [6 x i8] c"-diff\00"
@.str.3 = [5 x i8] c"-sig\00"
@stdout = global i32 0
@.str.4 = [29 x i8] c"P( y <= %d | x = %d ) = %g \0A\00"
@.str.5 = [29 x i8] c"P( y >= %d | x = %d ) = %g \0A\00"
@stderr = global i32 0
@.str.6 = [10 x i8] c"%d *--%d\0A\00"
@.str.7 = [11 x i8] c"%d %d--%d\0A\00"
@.str.8 = [30 x i8] c"%d %d C(%d | %d ) = %g %g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca double
%25 = alloca i32
%26 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %12
store i32 1, i32* %13
store i32 1, i32* %22
store i32 0, i32* %25
%27 = load i32, i32* %4
%28 = icmp slt i32 %27, 4
br i1 %28, label %29, label %32
29: ; preds = %2
%30 = call i32 (...) @usage()
%31 = call i32 @exit(i32 0)
unreachable
32: ; preds = %2
store i32 -1, i32* %9
store i32 -1, i32* %10
br label %33
33: ; preds = %123, %32
%34 = load i32, i32* %22
%35 = load i32, i32* %4
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %124
37: ; preds = %33
%38 = load i8**, i8*** %5
%39 = load i32, i32* %22
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %38, i64 %40
%42 = load i8*, i8** %41
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %55, label %45
45: ; preds = %37
%46 = load i8**, i8*** %5
%47 = load i32, i32* %22
%48 = add nsw i32 %47, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %46, i64 %49
%51 = load i8*, i8** %50
%52 = call i32 @atoi(i8* %51)
store i32 %52, i32* %9
%53 = load i32, i32* %22
%54 = add nsw i32 %53, 2
store i32 %54, i32* %22
br label %123
55: ; preds = %37
%56 = load i8**, i8*** %5
%57 = load i32, i32* %22
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8*, i8** %56, i64 %58
%60 = load i8*, i8** %59
%61 = call i32 @strcmp(i8* %60, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%62 = icmp ne i32 %61, 0
br i1 %62, label %73, label %63
63: ; preds = %55
%64 = load i8**, i8*** %5
%65 = load i32, i32* %22
%66 = add nsw i32 %65, 1
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8*, i8** %64, i64 %67
%69 = load i8*, i8** %68
%70 = call i32 @atoi(i8* %69)
store i32 %70, i32* %10
%71 = load i32, i32* %22
%72 = add nsw i32 %71, 2
store i32 %72, i32* %22
br label %122
73: ; preds = %55
%74 = load i8**, i8*** %5
%75 = load i32, i32* %22
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8*, i8** %74, i64 %76
%78 = load i8*, i8** %77
%79 = call i32 @strcmp(i8* %78, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%80 = icmp ne i32 %79, 0
br i1 %80, label %98, label %81
81: ; preds = %73
%82 = load i8**, i8*** %5
%83 = load i32, i32* %22
%84 = add nsw i32 %83, 1
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i8*, i8** %82, i64 %85
%87 = load i8*, i8** %86
%88 = call i32 @atoi(i8* %87)
store i32 %88, i32* %12
%89 = load i8**, i8*** %5
%90 = load i32, i32* %22
%91 = add nsw i32 %90, 2
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8*, i8** %89, i64 %92
%94 = load i8*, i8** %93
%95 = call i32 @atoi(i8* %94)
store i32 %95, i32* %13
%96 = load i32, i32* %22
%97 = add nsw i32 %96, 3
store i32 %97, i32* %22
br label %121
98: ; preds = %73
%99 = load i8**, i8*** %5
%100 = load i32, i32* %22
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i8*, i8** %99, i64 %101
%103 = load i8*, i8** %102
%104 = call i32 @strcmp(i8* %103, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%105 = icmp ne i32 %104, 0
br i1 %105, label %117, label %106
106: ; preds = %98
%107 = load i8**, i8*** %5
%108 = load i32, i32* %22
%109 = add nsw i32 %108, 1
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds i8*, i8** %107, i64 %110
%112 = load i8*, i8** %111
%113 = call i64 @atof(i8* %112)
%114 = sitofp i64 %113 to double
store double %114, double* %24
%115 = load i32, i32* %22
%116 = add nsw i32 %115, 2
store i32 %116, i32* %22
br label %120
117: ; preds = %98
%118 = call i32 (...) @usage()
%119 = call i32 @exit(i32 0)
unreachable
120: ; preds = %106
br label %121
121: ; preds = %120, %81
br label %122
122: ; preds = %121, %63
br label %123
123: ; preds = %122, %45
br label %33
124: ; preds = %33
%125 = load i32, i32* %9
%126 = icmp sgt i32 %125, -1
br i1 %126, label %127, label %172
127: ; preds = %124
%128 = load i32, i32* %10
%129 = icmp sgt i32 %128, -1
br i1 %129, label %130, label %172
130: ; preds = %127
store i32 -1, i32* %20
store i32 10000, i32* %21
store double 0.000000e+00, double* %19
store i32 1, i32* %23
%131 = load i32, i32* %12
%132 = sitofp i32 %131 to double
%133 = load i32, i32* %13
%134 = sitofp i32 %133 to double
%135 = fdiv double %132, %134
store double %135, double* %14
%136 = load i32, i32* %12
%137 = sitofp i32 %136 to double
%138 = load i32, i32* %12
%139 = load i32, i32* %13
%140 = add nsw i32 %138, %139
%141 = sitofp i32 %140 to double
%142 = fdiv double %137, %141
store double %142, double* %26
%143 = load i32, i32* %9
%144 = add nsw i32 %143, 1
%145 = sitofp i32 %144 to double
%146 = load i32, i32* %10
%147 = add nsw i32 %146, 1
%148 = sitofp i32 %147 to double
%149 = load double, double* %26
%150 = fptosi double %149 to i32
%151 = call double @betai(double %145, double %148, i32 %150)
store double %151, double* %7
%152 = load i32, i32* %10
%153 = add nsw i32 %152, 1
%154 = sitofp i32 %153 to double
%155 = load i32, i32* %9
%156 = add nsw i32 %155, 1
%157 = sitofp i32 %156 to double
%158 = load double, double* %26
%159 = fsub double 1.000000e+00, %158
%160 = fptosi double %159 to i32
%161 = call double @betai(double %154, double %157, i32 %160)
store double %161, double* %8
%162 = load i32, i32* @stdout
%163 = load i32, i32* %10
%164 = load i32, i32* %9
%165 = load double, double* %7
%166 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %162, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %163, i32 %164, double %165)
%167 = load i32, i32* @stdout
%168 = load i32, i32* %10
%169 = load i32, i32* %9
%170 = load double, double* %8
%171 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %167, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %168, i32 %169, double %170)
br label %294
172: ; preds = %127, %124
%173 = load i32, i32* %9
%174 = icmp sgt i32 %173, -1
br i1 %174, label %175, label %274
175: ; preds = %172
%176 = load i32, i32* %10
%177 = icmp eq i32 %176, -1
br i1 %177, label %178, label %274
178: ; preds = %175
store i32 0, i32* %10
store i32 -1, i32* %20
store i32 10000, i32* %21
store double 0.000000e+00, double* %19
store i32 1, i32* %23
%179 = load i32, i32* %12
%180 = sitofp i32 %179 to double
%181 = load i32, i32* %13
%182 = sitofp i32 %181 to double
%183 = fdiv double %180, %182
store double %183, double* %14
%184 = load i32, i32* %12
%185 = sitofp i32 %184 to double
%186 = load i32, i32* %12
%187 = load i32, i32* %13
%188 = add nsw i32 %186, %187
%189 = sitofp i32 %188 to double
%190 = fdiv double %185, %189
store double %190, double* %26
store i32 0, i32* %10
br label %191
191: ; preds = %178, %227
%192 = load i32, i32* %9
%193 = add nsw i32 %192, 1
%194 = sitofp i32 %193 to double
%195 = load i32, i32* %10
%196 = add nsw i32 %195, 1
%197 = sitofp i32 %196 to double
%198 = load double, double* %26
%199 = fptosi double %198 to i32
%200 = call double @betai(double %194, double %197, i32 %199)
store double %200, double* %7
%201 = load i32, i32* %10
%202 = add nsw i32 %201, 1
%203 = sitofp i32 %202 to double
%204 = load i32, i32* %9
%205 = add nsw i32 %204, 1
%206 = sitofp i32 %205 to double
%207 = load double, double* %26
%208 = fsub double 1.000000e+00, %207
%209 = fptosi double %208 to i32
%210 = call double @betai(double %203, double %206, i32 %209)
store double %210, double* %8
%211 = load double, double* %7
%212 = load double, double* %24
%213 = fdiv double %212, 2.000000e+00
%214 = fcmp olt double %211, %213
br i1 %214, label %215, label %217
215: ; preds = %191
%216 = load i32, i32* %10
store i32 %216, i32* %20
br label %217
217: ; preds = %215, %191
%218 = load i32, i32* %21
%219 = icmp eq i32 %218, 10000
br i1 %219, label %220, label %227
220: ; preds = %217
%221 = load double, double* %8
%222 = load double, double* %24
%223 = fdiv double %222, 2.000000e+00
%224 = fcmp olt double %221, %223
br i1 %224, label %225, label %227
225: ; preds = %220
%226 = load i32, i32* %10
store i32 %226, i32* %21
br label %230
227: ; preds = %220, %217
%228 = load i32, i32* %10
%229 = add nsw i32 %228, 1
store i32 %229, i32* %10
br label %191
230: ; preds = %225
%231 = load i32, i32* %9
%232 = add nsw i32 %231, 1
%233 = sitofp i32 %232 to double
%234 = load i32, i32* %20
%235 = add nsw i32 %234, 1
%236 = sitofp i32 %235 to double
%237 = load double, double* %26
%238 = fptosi double %237 to i32
%239 = call double @betai(double %233, double %236, i32 %238)
store double %239, double* %7
%240 = load i32, i32* %21
%241 = add nsw i32 %240, 1
%242 = sitofp i32 %241 to double
%243 = load i32, i32* %9
%244 = add nsw i32 %243, 1
%245 = sitofp i32 %244 to double
%246 = load double, double* %26
%247 = fsub double 1.000000e+00, %246
%248 = fptosi double %247 to i32
%249 = call double @betai(double %242, double %245, i32 %248)
store double %249, double* %8
%250 = load i32, i32* @stderr
%251 = load i32, i32* %20
%252 = load i32, i32* %9
%253 = load double, double* %7
%254 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %250, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %251, i32 %252, double %253)
%255 = load i32, i32* @stderr
%256 = load i32, i32* %21
%257 = load i32, i32* %9
%258 = load double, double* %8
%259 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %255, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %256, i32 %257, double %258)
%260 = load i32, i32* %20
%261 = icmp eq i32 %260, -1
br i1 %261, label %262, label %267
262: ; preds = %230
%263 = load i32, i32* @stdout
%264 = load i32, i32* %9
%265 = load i32, i32* %21
%266 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %263, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %264, i32 %265)
br label %273
267: ; preds = %230
%268 = load i32, i32* @stdout
%269 = load i32, i32* %9
%270 = load i32, i32* %20
%271 = load i32, i32* %21
%272 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %268, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %269, i32 %270, i32 %271)
br label %273
273: ; preds = %267, %262
br label %293
274: ; preds = %175, %172
%275 = load i32, i32* %25
%276 = icmp eq i32 %275, 1
br i1 %276, label %277, label %292
277: ; preds = %274
%278 = load i32, i32* @stdout
%279 = load i32, i32* %9
%280 = load i32, i32* %10
%281 = load i32, i32* %10
%282 = load i32, i32* %9
%283 = load double, double* %7
%284 = load double, double* %8
%285 = call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %278, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i32 %279, i32 %280, i32 %281, i32 %282, double %283, double %284)
%286 = load i32, i32* %10
%287 = add nsw i32 %286, 1
store i32 %287, i32* %10
%288 = load double, double* %7
%289 = fcmp ogt double %288, 0x3FEFFFFFFFF24190
br i1 %289, label %290, label %291
290: ; preds = %277
br label %291
291: ; preds = %290, %277
br label %292
292: ; preds = %291, %274
br label %293
293: ; preds = %292, %273
br label %294
294: ; preds = %293, %130
%295 = load i32, i32* %3
ret i32 %295
}

LLVM IR (-O2):
@.str = [8 x i8] c"-xvalue\00"
@.str.1 = [8 x i8] c"-yvalue\00"
@.str.2 = [6 x i8] c"-diff\00"
@.str.3 = [5 x i8] c"-sig\00"
@stdout = global i32 0
@.str.4 = [29 x i8] c"P( y <= %d | x = %d ) = %g \0A\00"
@.str.5 = [29 x i8] c"P( y >= %d | x = %d ) = %g \0A\00"
@stderr = global i32 0
@.str.6 = [10 x i8] c"%d *--%d\0A\00"
@.str.7 = [11 x i8] c"%d %d--%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 4
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 (...) @usage()
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2, %61
%8 = phi double [ %67, %61 ], [ undef, %2 ]
%9 = phi i32 [ %68, %61 ], [ 1, %2 ]
%10 = phi i32 [ %66, %61 ], [ -1, %2 ]
%11 = phi i32 [ %65, %61 ], [ -1, %2 ]
%12 = phi i32 [ %64, %61 ], [ 1, %2 ]
%13 = phi i32 [ %63, %61 ], [ 1, %2 ]
%14 = zext i32 %9 to i64
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %7
%20 = add nuw nsw i32 %9, 1
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %1, i64 %21
%23 = load i8*, i8** %22
%24 = tail call i32 @atoi(i8* %23)
br label %61
25: ; preds = %7
%26 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %25
%29 = add nuw nsw i32 %9, 1
%30 = zext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %1, i64 %30
%32 = load i8*, i8** %31
%33 = tail call i32 @atoi(i8* %32)
br label %61
34: ; preds = %25
%35 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %48
37: ; preds = %34
%38 = add nuw nsw i32 %9, 1
%39 = zext i32 %38 to i64
%40 = getelementptr inbounds i8*, i8** %1, i64 %39
%41 = load i8*, i8** %40
%42 = tail call i32 @atoi(i8* %41)
%43 = add nuw nsw i32 %9, 2
%44 = zext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %1, i64 %44
%46 = load i8*, i8** %45
%47 = tail call i32 @atoi(i8* %46)
br label %61
48: ; preds = %34
%49 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %58
51: ; preds = %48
%52 = add nuw nsw i32 %9, 1
%53 = zext i32 %52 to i64
%54 = getelementptr inbounds i8*, i8** %1, i64 %53
%55 = load i8*, i8** %54
%56 = tail call i64 @atof(i8* %55)
%57 = sitofp i64 %56 to double
br label %61
58: ; preds = %48
%59 = tail call i32 (...) @usage()
%60 = tail call i32 @exit(i32 0)
unreachable
61: ; preds = %28, %51, %37, %19
%62 = phi i32 [ 2, %28 ], [ 2, %51 ], [ 3, %37 ], [ 2, %19 ]
%63 = phi i32 [ %13, %28 ], [ %13, %51 ], [ %47, %37 ], [ %13, %19 ]
%64 = phi i32 [ %12, %28 ], [ %12, %51 ], [ %42, %37 ], [ %12, %19 ]
%65 = phi i32 [ %33, %28 ], [ %11, %51 ], [ %11, %37 ], [ %11, %19 ]
%66 = phi i32 [ %10, %28 ], [ %10, %51 ], [ %10, %37 ], [ %24, %19 ]
%67 = phi double [ %8, %28 ], [ %57, %51 ], [ %8, %37 ], [ %8, %19 ]
%68 = add nuw nsw i32 %9, %62
%69 = icmp slt i32 %68, %0
br i1 %69, label %7, label %70
70: ; preds = %61
%71 = icmp sgt i32 %66, -1
%72 = icmp sgt i32 %65, -1
%73 = select i1 %71, i1 %72, i1 false
br i1 %73, label %74, label %92
74: ; preds = %70
%75 = sitofp i32 %64 to double
%76 = add nsw i32 %64, %63
%77 = sitofp i32 %76 to double
%78 = fdiv double %75, %77
%79 = add nuw nsw i32 %66, 1
%80 = sitofp i32 %79 to double
%81 = add nuw nsw i32 %65, 1
%82 = sitofp i32 %81 to double
%83 = fptosi double %78 to i32
%84 = tail call double @betai(double %80, double %82, i32 %83)
%85 = fsub double 1.000000e+00, %78
%86 = fptosi double %85 to i32
%87 = tail call double @betai(double %82, double %80, i32 %86)
%88 = load i32, i32* @stdout
%89 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %65, i32 %66, double %84)
%90 = load i32, i32* @stdout
%91 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %65, i32 %66, double %87)
br label %131
92: ; preds = %70
%93 = icmp eq i32 %65, -1
%94 = select i1 %71, i1 %93, i1 false
br i1 %94, label %95, label %131
95: ; preds = %92
%96 = sitofp i32 %64 to double
%97 = add nsw i32 %64, %63
%98 = sitofp i32 %97 to double
%99 = fdiv double %96, %98
%100 = add nuw nsw i32 %66, 1
%101 = sitofp i32 %100 to double
%102 = fptosi double %99 to i32
%103 = fsub double 1.000000e+00, %99
%104 = fptosi double %103 to i32
%105 = fmul double %67, 5.000000e-01
br label %106
106: ; preds = %106, %95
%107 = phi i32 [ 0, %95 ], [ %109, %106 ]
%108 = phi i32 [ -1, %95 ], [ %114, %106 ]
%109 = add nuw nsw i32 %107, 1
%110 = sitofp i32 %109 to double
%111 = tail call double @betai(double %101, double %110, i32 %102)
%112 = tail call double @betai(double %110, double %101, i32 %104)
%113 = fcmp olt double %111, %105
%114 = select i1 %113, i32 %107, i32 %108
%115 = fcmp olt double %112, %105
br i1 %115, label %116, label %106
116: ; preds = %106
%117 = add nsw i32 %114, 1
%118 = sitofp i32 %117 to double
%119 = tail call double @betai(double %101, double %118, i32 %102)
%120 = tail call double @betai(double %110, double %101, i32 %104)
%121 = load i32, i32* @stderr
%122 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %114, i32 %66, double %119)
%123 = load i32, i32* @stderr
%124 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %123, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %107, i32 %66, double %120)
%125 = icmp eq i32 %114, -1
%126 = load i32, i32* @stdout
br i1 %125, label %127, label %129
127: ; preds = %116
%128 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %126, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %66, i32 %107)
br label %131
129: ; preds = %116
%130 = tail call i32 (i32, i8*, i32, i32, ...) @fprintf(i32 %126, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %66, i32 %114, i32 %107)
br label %131
131: ; preds = %92, %129, %127, %74
ret i32 0
}