#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 SNPHWE_pValue(int, int, int, int);
int /*<<< orphan*/ printf(char *, int, double);
int old_main(int argc, char **argv) {
  int ohets;
  int ohom1;
  int ohom2;
  double pval;
  for (ohets = 5; ohets <= 21; ohets += 2) {
    ohom1 = (21 - ohets) / 2;
    ohom2 = 100 - (ohets + ohom1);
    pval = SNPHWE_pValue(ohets, ohom1, ohom2, 1);
    printf("%d\t%f\n", ohets, pval);
  }
  return 0;
}


x86 assembly (clang, -O0):
<old_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
cmpl   $0x15,-0x14(%rbp)
jg     119d <old_main+0x7d>
mov    $0x15,%eax
sub    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
mov    $0x64,%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    $0x1,%ecx
call   1040 <SNPHWE_pValue@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x14(%rbp),%esi
movsd  -0x28(%rbp),%xmm0
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <old_main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<old_main>:
push   %rbx
mov    $0x5,%edi
mov    $0x8,%esi
mov    $0x57,%edx
mov    $0x1,%ecx
call   1040 <SNPHWE_pValue@plt>
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    $0x7,%edi
mov    $0x7,%esi
mov    $0x56,%edx
mov    $0x1,%ecx
call   1040 <SNPHWE_pValue@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    $0x9,%edi
mov    $0x6,%esi
mov    $0x55,%edx
mov    $0x1,%ecx
call   1040 <SNPHWE_pValue@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    $0xb,%edi
mov    $0x5,%esi
mov    $0x54,%edx
mov    $0x1,%ecx
call   1040 <SNPHWE_pValue@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <printf@plt>
mov    $0xd,%edi
mov    $0x4,%esi
mov    $0x53,%edx
mov    $0x1,%ecx
call   1040 <SNPHWE_pValue@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <printf@plt>
mov    $0xf,%edi
mov    $0x3,%esi
mov    $0x52,%edx
mov    $0x1,%ecx
call   1040 <SNPHWE_pValue@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <printf@plt>
mov    $0x11,%edi
mov    $0x2,%esi
mov    $0x51,%edx
mov    $0x1,%ecx
call   1040 <SNPHWE_pValue@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1030 <printf@plt>
mov    $0x13,%edi
mov    $0x1,%esi
mov    $0x50,%edx
mov    $0x1,%ecx
call   1040 <SNPHWE_pValue@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
call   1030 <printf@plt>
mov    $0x15,%edi
xor    %esi,%esi
mov    $0x4f,%edx
mov    $0x1,%ecx
call   1040 <SNPHWE_pValue@plt>
mov    %rbx,%rdi
mov    $0x15,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d\09%f\0A\00"
define i32 @old_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 5, i32* %5
br label %9
9: ; preds = %27, %2
%10 = load i32, i32* %5
%11 = icmp sle i32 %10, 21
br i1 %11, label %12, label %30
12: ; preds = %9
%13 = load i32, i32* %5
%14 = sub nsw i32 21, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = add nsw i32 %16, %17
%19 = sub nsw i32 100, %18
store i32 %19, i32* %7
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call double @SNPHWE_pValue(i32 %20, i32 %21, i32 %22, i32 1)
store double %23, double* %8
%24 = load i32, i32* %5
%25 = load double, double* %8
%26 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %24, double %25)
br label %27
27: ; preds = %12
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 2
store i32 %29, i32* %5
br label %9
30: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d\09%f\0A\00"
define i32 @old_main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @SNPHWE_pValue(i32 5, i32 8, i32 87, i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5, double %3)
%5 = tail call double @SNPHWE_pValue(i32 7, i32 7, i32 86, i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 7, double %5)
%7 = tail call double @SNPHWE_pValue(i32 9, i32 6, i32 85, i32 1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 9, double %7)
%9 = tail call double @SNPHWE_pValue(i32 11, i32 5, i32 84, i32 1)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 11, double %9)
%11 = tail call double @SNPHWE_pValue(i32 13, i32 4, i32 83, i32 1)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 13, double %11)
%13 = tail call double @SNPHWE_pValue(i32 15, i32 3, i32 82, i32 1)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 15, double %13)
%15 = tail call double @SNPHWE_pValue(i32 17, i32 2, i32 81, i32 1)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 17, double %15)
%17 = tail call double @SNPHWE_pValue(i32 19, i32 1, i32 80, i32 1)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 19, double %17)
%19 = tail call double @SNPHWE_pValue(i32 21, i32 0, i32 79, i32 1)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 21, double %19)
ret i32 0
}