#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*/ abyx(int, double *, int);
int /*<<< orphan*/ error2(char *);
double sum(double *, int);
int /*<<< orphan*/ zero(double *, int);
double Fcodon_3x4(double fcodon[], double fb3x4[]) {
  int b[3], k, j, nc = 64;
  double t;
  zero(fb3x4, 12);
  for (k = 0; k < nc; k++) {
    b[0] = k / 16;
    b[1] = (k % 16) / 4;
    b[2] = k % 4;
    for (j = 0; j < 3; j++)
      fb3x4[j * 4 + b[j]] += fcodon[k];
  }
  for (j = 0; j < 3; j++) {
    t = sum(fb3x4 + j * 4, 4);
    if (t < 1e-15)
      error2("Fcodon_3x4: empty sequence?");
    abyx(1 / t, fb3x4 + j * 4, 4);
  }
  return (0);
}


x86 assembly (clang, -O0):
<Fcodon_3x4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x40,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xc,%esi
call   1050 <zero@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    120a <Fcodon_3x4+0xca>
mov    -0x20(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    11f7 <Fcodon_3x4+0xb7>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x2,%ecx
movslq -0x24(%rbp),%rdx
add    -0x1c(%rbp,%rdx,4),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b3 <Fcodon_3x4+0x73>
jmp    11fc <Fcodon_3x4+0xbc>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    116c <Fcodon_3x4+0x2c>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    1298 <Fcodon_3x4+0x158>
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%eax
shl    $0x2,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    $0x4,%esi
call   1040 <sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xdbb(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    125c <Fcodon_3x4+0x11c>
lea    0xdb9(%rip),%rdi
call   1030 <error2@plt>
movsd  0xda4(%rip),%xmm0
divsd  -0x30(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    -0x10(%rbp),%rsi
mov    -0x24(%rbp),%eax
shl    $0x2,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    $0x4,%edx
call   1060 <abyx@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1211 <Fcodon_3x4+0xd1>
xorps  %xmm0,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fcodon_3x4>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0xc,%esi
call   1050 <zero@plt>
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%ecx
and    $0x3,%ecx
movsd  (%rbx,%rax,8),%xmm0
mov    %rax,%rdx
shr    %rdx
and    $0x7ffffff8,%edx
addsd  (%r14,%rdx,1),%xmm0
movsd  %xmm0,(%r14,%rdx,1)
movsd  (%rbx,%rax,8),%xmm0
mov    %eax,%edx
and    $0xc,%edx
addsd  0x20(%r14,%rdx,2),%xmm0
movsd  %xmm0,0x20(%r14,%rdx,2)
movsd  (%rbx,%rax,8),%xmm0
addsd  0x40(%r14,%rcx,8),%xmm0
movsd  %xmm0,0x40(%r14,%rcx,8)
add    $0x1,%rax
cmp    $0x40,%rax
jne    1160 <Fcodon_3x4+0x20>
mov    %r14,%rdi
mov    $0x4,%esi
call   1040 <sum@plt>
movapd %xmm0,%xmm1
movsd  0xe30(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ec <Fcodon_3x4+0xac>
lea    0xe33(%rip),%rdi
movsd  %xmm1,(%rsp)
call   1030 <error2@plt>
movsd  (%rsp),%xmm1
movsd  0xe14(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1060 <abyx@plt>
lea    0x20(%r14),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <sum@plt>
movapd %xmm0,%xmm1
movsd  0xdda(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1242 <Fcodon_3x4+0x102>
lea    0xddd(%rip),%rdi
movsd  %xmm1,(%rsp)
call   1030 <error2@plt>
movsd  (%rsp),%xmm1
movsd  0xdbe(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1060 <abyx@plt>
add    $0x40,%r14
mov    %r14,%rdi
mov    $0x4,%esi
call   1040 <sum@plt>
movapd %xmm0,%xmm1
movsd  0xd84(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1298 <Fcodon_3x4+0x158>
lea    0xd87(%rip),%rdi
movsd  %xmm1,(%rsp)
call   1030 <error2@plt>
movsd  (%rsp),%xmm1
movsd  0xd68(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1060 <abyx@plt>
xorpd  %xmm0,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Fcodon_3x4: empty sequence?\00"
define double @Fcodon_3x4(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [3 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
store double* %0, double** %3
store double* %1, double** %4
store i32 64, i32* %8
%10 = load double*, double** %4
%11 = call i32 @zero(double* %10, i32 12)
store i32 0, i32* %6
br label %12
12: ; preds = %52, %2
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %55
16: ; preds = %12
%17 = load i32, i32* %6
%18 = sdiv i32 %17, 16
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 %18, i32* %19
%20 = load i32, i32* %6
%21 = srem i32 %20, 16
%22 = sdiv i32 %21, 4
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %22, i32* %23
%24 = load i32, i32* %6
%25 = srem i32 %24, 4
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %25, i32* %26
store i32 0, i32* %7
br label %27
27: ; preds = %48, %16
%28 = load i32, i32* %7
%29 = icmp slt i32 %28, 3
br i1 %29, label %30, label %51
30: ; preds = %27
%31 = load double*, double** %3
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = load double*, double** %4
%37 = load i32, i32* %7
%38 = mul nsw i32 %37, 4
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = add nsw i32 %38, %42
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %36, i64 %44
%46 = load double, double* %45
%47 = fadd double %46, %35
store double %47, double* %45
br label %48
48: ; preds = %30
%49 = load i32, i32* %7
%50 = add nsw i32 %49, 1
store i32 %50, i32* %7
br label %27
51: ; preds = %27
br label %52
52: ; preds = %51
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
br label %12
55: ; preds = %12
store i32 0, i32* %7
br label %56
56: ; preds = %80, %55
%57 = load i32, i32* %7
%58 = icmp slt i32 %57, 3
br i1 %58, label %59, label %83
59: ; preds = %56
%60 = load double*, double** %4
%61 = load i32, i32* %7
%62 = mul nsw i32 %61, 4
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %60, i64 %63
%65 = call double @sum(double* %64, i32 4)
store double %65, double* %9
%66 = load double, double* %9
%67 = fcmp olt double %66, 1.000000e-15
br i1 %67, label %68, label %70
68: ; preds = %59
%69 = call i32 @error2(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %70
70: ; preds = %68, %59
%71 = load double, double* %9
%72 = fdiv double 1.000000e+00, %71
%73 = fptosi double %72 to i32
%74 = load double*, double** %4
%75 = load i32, i32* %7
%76 = mul nsw i32 %75, 4
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %74, i64 %77
%79 = call i32 @abyx(i32 %73, double* %78, i32 4)
br label %80
80: ; preds = %70
%81 = load i32, i32* %7
%82 = add nsw i32 %81, 1
store i32 %82, i32* %7
br label %56
83: ; preds = %56
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [28 x i8] c"Fcodon_3x4: empty sequence?\00"
define double @Fcodon_3x4(double* nocapture %0, double* %1) {
%3 = tail call i32 @zero(double* %1, i32 12)
br label %4
4: ; preds = %2, %4
%5 = phi i64 [ 0, %2 ], [ %26, %4 ]
%6 = lshr i64 %5, 4
%7 = lshr i64 %5, 2
%8 = and i64 %7, 3
%9 = and i64 %5, 3
%10 = getelementptr inbounds double, double* %0, i64 %5
%11 = load double, double* %10
%12 = and i64 %6, 268435455
%13 = getelementptr inbounds double, double* %1, i64 %12
%14 = load double, double* %13
%15 = fadd double %11, %14
store double %15, double* %13
%16 = load double, double* %10
%17 = or i64 %8, 4
%18 = getelementptr inbounds double, double* %1, i64 %17
%19 = load double, double* %18
%20 = fadd double %16, %19
store double %20, double* %18
%21 = load double, double* %10
%22 = or i64 %9, 8
%23 = getelementptr inbounds double, double* %1, i64 %22
%24 = load double, double* %23
%25 = fadd double %21, %24
store double %25, double* %23
%26 = add nuw nsw i64 %5, 1
%27 = icmp eq i64 %26, 64
br i1 %27, label %28, label %4
28: ; preds = %4
%29 = tail call double @sum(double* %1, i32 4)
%30 = fcmp olt double %29, 1.000000e-15
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = tail call i32 @error2(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
%34 = fdiv double 1.000000e+00, %29
%35 = fptosi double %34 to i32
%36 = tail call i32 @abyx(i32 %35, double* %1, i32 4)
%37 = getelementptr inbounds double, double* %1, i64 4
%38 = tail call double @sum(double* %37, i32 4)
%39 = fcmp olt double %38, 1.000000e-15
br i1 %39, label %40, label %42
40: ; preds = %33
%41 = tail call i32 @error2(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %42
42: ; preds = %40, %33
%43 = fdiv double 1.000000e+00, %38
%44 = fptosi double %43 to i32
%45 = tail call i32 @abyx(i32 %44, double* %37, i32 4)
%46 = getelementptr inbounds double, double* %1, i64 8
%47 = tail call double @sum(double* %46, i32 4)
%48 = fcmp olt double %47, 1.000000e-15
br i1 %48, label %49, label %51
49: ; preds = %42
%50 = tail call i32 @error2(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %51
51: ; preds = %49, %42
%52 = fdiv double 1.000000e+00, %47
%53 = fptosi double %52 to i32
%54 = tail call i32 @abyx(i32 %53, double* %46, i32 4)
ret double 0.000000e+00
}