#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 */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ stderr;
double *normalize_population_ACGT_allele_frequency(
    double *population_ACGT_allele_frequency, double minus_1_AF,
    double minus_2_AF) {
  int bi;
  for (bi = 0; bi < 4; bi++) {
    if (population_ACGT_allele_frequency[bi] >= 0) {
    } else if (population_ACGT_allele_frequency[bi] == -1) {
      population_ACGT_allele_frequency[bi] = minus_1_AF;
    } else if (population_ACGT_allele_frequency[bi] == -2) {
      population_ACGT_allele_frequency[bi] = minus_2_AF;
    } else {
      fprintf(stderr,
              "Warning: unknown ref population allele frequency code '%f', I "
              "use '-2' instead\n",
              population_ACGT_allele_frequency[bi]);
      population_ACGT_allele_frequency[bi] = minus_2_AF;
    }
  }
  return population_ACGT_allele_frequency;
}


x86 assembly (clang, -O0):
<normalize_population_ACGT_allele_frequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    121f <normalize_population_ACGT_allele_frequency+0x10f>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1156 <normalize_population_ACGT_allele_frequency+0x46>
jmp    120c <normalize_population_ACGT_allele_frequency+0xfc>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xe95(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1192 <normalize_population_ACGT_allele_frequency+0x82>
jp     1192 <normalize_population_ACGT_allele_frequency+0x82>
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1207 <normalize_population_ACGT_allele_frequency+0xf7>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xe61(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ce <normalize_population_ACGT_allele_frequency+0xbe>
jp     11ce <normalize_population_ACGT_allele_frequency+0xbe>
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1202 <normalize_population_ACGT_allele_frequency+0xf2>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe25(%rip),%rsi
call   1030 <fprintf@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1207 <normalize_population_ACGT_allele_frequency+0xf7>
jmp    120c <normalize_population_ACGT_allele_frequency+0xfc>
jmp    1211 <normalize_population_ACGT_allele_frequency+0x101>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <normalize_population_ACGT_allele_frequency+0x1d>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_population_ACGT_allele_frequency>:
push   %rbx
sub    $0x10,%rsp
movaps %xmm0,%xmm3
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm0
jae    117d <normalize_population_ACGT_allele_frequency+0x6d>
ucomisd 0xecf(%rip),%xmm0
movaps %xmm3,%xmm2
jne    1138 <normalize_population_ACGT_allele_frequency+0x28>
jnp    1179 <normalize_population_ACGT_allele_frequency+0x69>
ucomisd 0xec8(%rip),%xmm0
movaps %xmm1,%xmm2
jne    1147 <normalize_population_ACGT_allele_frequency+0x37>
jnp    1179 <normalize_population_ACGT_allele_frequency+0x69>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
movsd  %xmm1,(%rsp)
movsd  %xmm3,0x8(%rsp)
call   1030 <fprintf@plt>
xorpd  %xmm4,%xmm4
movsd  0x8(%rsp),%xmm3
movsd  (%rsp),%xmm1
movaps %xmm1,%xmm2
movsd  %xmm2,(%rbx)
movsd  0x8(%rbx),%xmm0
ucomisd %xmm4,%xmm0
jae    11d9 <normalize_population_ACGT_allele_frequency+0xc9>
ucomisd 0xe70(%rip),%xmm0
movaps %xmm3,%xmm2
jne    1197 <normalize_population_ACGT_allele_frequency+0x87>
jnp    11d4 <normalize_population_ACGT_allele_frequency+0xc4>
ucomisd 0xe69(%rip),%xmm0
movaps %xmm1,%xmm2
jne    11a6 <normalize_population_ACGT_allele_frequency+0x96>
jnp    11d4 <normalize_population_ACGT_allele_frequency+0xc4>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%rip),%rsi
movsd  %xmm1,(%rsp)
movsd  %xmm3,0x8(%rsp)
call   1030 <fprintf@plt>
movsd  0x8(%rsp),%xmm3
movsd  (%rsp),%xmm1
movaps %xmm1,%xmm2
movsd  %xmm2,0x8(%rbx)
movsd  0x10(%rbx),%xmm0
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm0
jae    123d <normalize_population_ACGT_allele_frequency+0x12d>
ucomisd 0xe10(%rip),%xmm0
movaps %xmm3,%xmm2
jne    11f7 <normalize_population_ACGT_allele_frequency+0xe7>
jnp    1238 <normalize_population_ACGT_allele_frequency+0x128>
ucomisd 0xe09(%rip),%xmm0
movaps %xmm1,%xmm2
jne    1206 <normalize_population_ACGT_allele_frequency+0xf6>
jnp    1238 <normalize_population_ACGT_allele_frequency+0x128>
mov    0x2dd3(%rip),%rax
mov    (%rax),%edi
lea    0xdfa(%rip),%rsi
movsd  %xmm1,(%rsp)
movsd  %xmm3,0x8(%rsp)
call   1030 <fprintf@plt>
xorpd  %xmm4,%xmm4
movsd  0x8(%rsp),%xmm3
movsd  (%rsp),%xmm1
movaps %xmm1,%xmm2
movsd  %xmm2,0x10(%rbx)
movsd  0x18(%rbx),%xmm0
ucomisd %xmm4,%xmm0
jae    1289 <normalize_population_ACGT_allele_frequency+0x179>
ucomisd 0xdb0(%rip),%xmm0
jne    1254 <normalize_population_ACGT_allele_frequency+0x144>
jnp    1284 <normalize_population_ACGT_allele_frequency+0x174>
ucomisd 0xdac(%rip),%xmm0
jne    1265 <normalize_population_ACGT_allele_frequency+0x155>
jp     1265 <normalize_population_ACGT_allele_frequency+0x155>
movaps %xmm1,%xmm3
jmp    1284 <normalize_population_ACGT_allele_frequency+0x174>
mov    0x2d74(%rip),%rax
mov    (%rax),%edi
lea    0xd9b(%rip),%rsi
movsd  %xmm1,(%rsp)
call   1030 <fprintf@plt>
movsd  (%rsp),%xmm3
movsd  %xmm3,0x18(%rbx)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [80 x i8] c"Warning: unknown ref population allele frequency code '%f', I use '-2' instead\0A\00"
define double* @normalize_population_ACGT_allele_frequency(double* %0, double %1, double %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store double* %0, double** %4
store double %1, double* %5
store double %2, double* %6
store i32 0, i32* %7
br label %8
8: ; preds = %61, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 4
br i1 %10, label %11, label %64
11: ; preds = %8
%12 = load double*, double** %4
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = load double, double* %15
%17 = fcmp oge double %16, 0.000000e+00
br i1 %17, label %18, label %19
18: ; preds = %11
br label %60
19: ; preds = %11
%20 = load double*, double** %4
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
%24 = load double, double* %23
%25 = fcmp oeq double %24, -1.000000e+00
br i1 %25, label %26, label %32
26: ; preds = %19
%27 = load double, double* %5
%28 = load double*, double** %4
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %28, i64 %30
store double %27, double* %31
br label %59
32: ; preds = %19
%33 = load double*, double** %4
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %33, i64 %35
%37 = load double, double* %36
%38 = fcmp oeq double %37, -2.000000e+00
br i1 %38, label %39, label %45
39: ; preds = %32
%40 = load double, double* %6
%41 = load double*, double** %4
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
store double %40, double* %44
br label %58
45: ; preds = %32
%46 = load i32, i32* @stderr
%47 = load double*, double** %4
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %47, i64 %49
%51 = load double, double* %50
%52 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), double %51)
%53 = load double, double* %6
%54 = load double*, double** %4
%55 = load i32, i32* %7
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
store double %53, double* %57
br label %58
58: ; preds = %45, %39
br label %59
59: ; preds = %58, %26
br label %60
60: ; preds = %59, %18
br label %61
61: ; preds = %60
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
br label %8
64: ; preds = %8
%65 = load double*, double** %4
ret double* %65
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [80 x i8] c"Warning: unknown ref population allele frequency code '%f', I use '-2' instead\0A\00"
define double* @normalize_population_ACGT_allele_frequency(double* returned %0, double %1, double %2) {
%4 = load double, double* %0
%5 = fcmp ult double %4, 0.000000e+00
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = fcmp oeq double %4, -1.000000e+00
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = fcmp oeq double %4, -2.000000e+00
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), double %4)
br label %13
13: ; preds = %8, %6, %10
%14 = phi double [ %2, %10 ], [ %1, %6 ], [ %2, %8 ]
store double %14, double* %0
br label %15
15: ; preds = %13, %3
%16 = getelementptr inbounds double, double* %0, i64 1
%17 = load double, double* %16
%18 = fcmp ult double %17, 0.000000e+00
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = fcmp oeq double %17, -1.000000e+00
br i1 %20, label %26, label %21
21: ; preds = %19
%22 = fcmp oeq double %17, -2.000000e+00
br i1 %22, label %26, label %23
23: ; preds = %21
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), double %17)
br label %26
26: ; preds = %19, %21, %23
%27 = phi double [ %2, %23 ], [ %2, %21 ], [ %1, %19 ]
store double %27, double* %16
br label %28
28: ; preds = %26, %15
%29 = getelementptr inbounds double, double* %0, i64 2
%30 = load double, double* %29
%31 = fcmp ult double %30, 0.000000e+00
br i1 %31, label %32, label %41
32: ; preds = %28
%33 = fcmp oeq double %30, -1.000000e+00
br i1 %33, label %39, label %34
34: ; preds = %32
%35 = fcmp oeq double %30, -2.000000e+00
br i1 %35, label %39, label %36
36: ; preds = %34
%37 = load i32, i32* @stderr
%38 = tail call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), double %30)
br label %39
39: ; preds = %32, %34, %36
%40 = phi double [ %2, %36 ], [ %2, %34 ], [ %1, %32 ]
store double %40, double* %29
br label %41
41: ; preds = %39, %28
%42 = getelementptr inbounds double, double* %0, i64 3
%43 = load double, double* %42
%44 = fcmp ult double %43, 0.000000e+00
br i1 %44, label %45, label %54
45: ; preds = %41
%46 = fcmp oeq double %43, -1.000000e+00
br i1 %46, label %52, label %47
47: ; preds = %45
%48 = fcmp oeq double %43, -2.000000e+00
br i1 %48, label %52, label %49
49: ; preds = %47
%50 = load i32, i32* @stderr
%51 = tail call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), double %43)
br label %52
52: ; preds = %45, %47, %49
%53 = phi double [ %2, %49 ], [ %2, %47 ], [ %1, %45 ]
store double %53, double* %42
br label %54
54: ; preds = %52, %41
ret double* %0
}