#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*/ CRUSH(float *, int, float *);
int expf(int /*<<< orphan*/);
float powf(int, int);
float CHEW(float *GUT, float BONE[][1 << 16]) {
  int GRR;
  for (GRR = 0; GRR < 6; ++GRR) {
    GUT[GRR + 256 * 256] = powf(1 + expf(-CRUSH(BONE[GRR], 1 << 16, GUT)), -1);
    BONE[6][50 + GRR] = GUT[256 * 256 + GRR] * (1. - GUT[(8 << 13) + GRR]);
  }
  BONE[6][81] = 1 / (1 + expf(-CRUSH(GUT + (1 << 16), 6, BONE[6])));
  return BONE[6][82] = BONE[6][81] * (1. - BONE[6][81]), BONE[6][81];
}


x86 assembly (clang, -O0):
<CHEW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1205 <CHEW+0xd5>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x12,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rdx
mov    $0x10000,%esi
call   1050 <CRUSH@plt>
xor    %edi,%edi
sub    %eax,%edi
call   1040 <expf@plt>
mov    %eax,%edi
add    $0x1,%edi
mov    $0xffffffff,%esi
call   1030 <powf@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x10000,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x10000,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x10000,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe2b(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x32,%ecx
movslq %ecx,%rcx
movss  %xmm0,0x180000(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <CHEW+0x17>
mov    -0x8(%rbp),%rdi
add    $0x40000,%rdi
mov    -0x10(%rbp),%rdx
add    $0x180000,%rdx
mov    $0x6,%esi
call   1050 <CRUSH@plt>
xor    %edi,%edi
sub    %eax,%edi
call   1040 <expf@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x180144(%rax)
mov    -0x10(%rbp),%rax
movss  0x180144(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  0x180144(%rax),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xd8d(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x180148(%rax)
mov    -0x10(%rbp),%rax
movss  0x180144(%rax),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CHEW>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0x10000,%esi
mov    %rbx,%rdx
call   1050 <CRUSH@plt>
neg    %eax
mov    %eax,%edi
call   1040 <expf@plt>
lea    0x1(%rax),%edi
mov    $0xffffffff,%esi
call   1030 <powf@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xe90(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
lea    0x40000(%rbx),%r12
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
movss  %xmm0,0x40000(%rbx)
lea    0x180000(%r14),%r15
movss  %xmm1,0x1800c8(%r14)
lea    0x40000(%r14),%rdi
mov    $0x10000,%esi
mov    %rbx,%rdx
call   1050 <CRUSH@plt>
neg    %eax
mov    %eax,%edi
call   1040 <expf@plt>
lea    0x1(%rax),%edi
mov    $0xffffffff,%esi
call   1030 <powf@plt>
movss  %xmm0,0x40004(%rbx)
cvtss2sd %xmm0,%xmm0
movsd  0xe24(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x1800cc(%r14)
lea    0x80000(%r14),%rdi
mov    $0x10000,%esi
mov    %rbx,%rdx
call   1050 <CRUSH@plt>
neg    %eax
mov    %eax,%edi
call   1040 <expf@plt>
lea    0x1(%rax),%edi
mov    $0xffffffff,%esi
call   1030 <powf@plt>
movss  %xmm0,0x40008(%rbx)
cvtss2sd %xmm0,%xmm0
movsd  0xdce(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x1800d0(%r14)
lea    0xc0000(%r14),%rdi
mov    $0x10000,%esi
mov    %rbx,%rdx
call   1050 <CRUSH@plt>
neg    %eax
mov    %eax,%edi
call   1040 <expf@plt>
lea    0x1(%rax),%edi
mov    $0xffffffff,%esi
call   1030 <powf@plt>
movss  %xmm0,0x4000c(%rbx)
cvtss2sd %xmm0,%xmm0
movsd  0xd78(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x1800d4(%r14)
lea    0x100000(%r14),%rdi
mov    $0x10000,%esi
mov    %rbx,%rdx
call   1050 <CRUSH@plt>
neg    %eax
mov    %eax,%edi
call   1040 <expf@plt>
lea    0x1(%rax),%edi
mov    $0xffffffff,%esi
call   1030 <powf@plt>
movss  %xmm0,0x40010(%rbx)
cvtss2sd %xmm0,%xmm0
movsd  0xd22(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x1800d8(%r14)
lea    0x140000(%r14),%rdi
mov    $0x10000,%esi
mov    %rbx,%rdx
call   1050 <CRUSH@plt>
neg    %eax
mov    %eax,%edi
call   1040 <expf@plt>
lea    0x1(%rax),%edi
mov    $0xffffffff,%esi
call   1030 <powf@plt>
movss  %xmm0,0x40014(%rbx)
cvtss2sd %xmm0,%xmm0
movsd  0xccc(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x1800dc(%r14)
mov    %r12,%rdi
mov    $0x6,%esi
mov    %r15,%rdx
call   1050 <CRUSH@plt>
neg    %eax
mov    %eax,%edi
call   1040 <expf@plt>
lea    0x1(%rax),%ecx
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
movss  %xmm0,0x180144(%r14)
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xc6e(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
movss  %xmm1,0x180148(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float @CHEW(float* %0, [65536 x float]* %1) {
%3 = alloca float*
%4 = alloca [65536 x float]*
%5 = alloca i32
store float* %0, float** %3
store [65536 x float]* %1, [65536 x float]** %4
store i32 0, i32* %5
br label %6
6: ; preds = %49, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 6
br i1 %8, label %9, label %52
9: ; preds = %6
%10 = load [65536 x float]*, [65536 x float]** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [65536 x float], [65536 x float]* %10, i64 %12
%14 = getelementptr inbounds [65536 x float], [65536 x float]* %13, i64 0, i64 0
%15 = load float*, float** %3
%16 = call i32 @CRUSH(float* %14, i32 65536, float* %15)
%17 = sub nsw i32 0, %16
%18 = call i32 @expf(i32 %17)
%19 = add nsw i32 1, %18
%20 = call float @powf(i32 %19, i32 -1)
%21 = load float*, float** %3
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 65536
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds float, float* %21, i64 %24
store float %20, float* %25
%26 = load float*, float** %3
%27 = load i32, i32* %5
%28 = add nsw i32 65536, %27
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds float, float* %26, i64 %29
%31 = load float, float* %30
%32 = fpext float %31 to double
%33 = load float*, float** %3
%34 = load i32, i32* %5
%35 = add nsw i32 65536, %34
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %33, i64 %36
%38 = load float, float* %37
%39 = fpext float %38 to double
%40 = fsub double 1.000000e+00, %39
%41 = fmul double %32, %40
%42 = fptrunc double %41 to float
%43 = load [65536 x float]*, [65536 x float]** %4
%44 = getelementptr inbounds [65536 x float], [65536 x float]* %43, i64 6
%45 = load i32, i32* %5
%46 = add nsw i32 50, %45
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [65536 x float], [65536 x float]* %44, i64 0, i64 %47
store float %42, float* %48
br label %49
49: ; preds = %9
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %5
br label %6
52: ; preds = %6
%53 = load float*, float** %3
%54 = getelementptr inbounds float, float* %53, i64 65536
%55 = load [65536 x float]*, [65536 x float]** %4
%56 = getelementptr inbounds [65536 x float], [65536 x float]* %55, i64 6
%57 = getelementptr inbounds [65536 x float], [65536 x float]* %56, i64 0, i64 0
%58 = call i32 @CRUSH(float* %54, i32 6, float* %57)
%59 = sub nsw i32 0, %58
%60 = call i32 @expf(i32 %59)
%61 = add nsw i32 1, %60
%62 = sdiv i32 1, %61
%63 = sitofp i32 %62 to float
%64 = load [65536 x float]*, [65536 x float]** %4
%65 = getelementptr inbounds [65536 x float], [65536 x float]* %64, i64 6
%66 = getelementptr inbounds [65536 x float], [65536 x float]* %65, i64 0, i64 81
store float %63, float* %66
%67 = load [65536 x float]*, [65536 x float]** %4
%68 = getelementptr inbounds [65536 x float], [65536 x float]* %67, i64 6
%69 = getelementptr inbounds [65536 x float], [65536 x float]* %68, i64 0, i64 81
%70 = load float, float* %69
%71 = fpext float %70 to double
%72 = load [65536 x float]*, [65536 x float]** %4
%73 = getelementptr inbounds [65536 x float], [65536 x float]* %72, i64 6
%74 = getelementptr inbounds [65536 x float], [65536 x float]* %73, i64 0, i64 81
%75 = load float, float* %74
%76 = fpext float %75 to double
%77 = fsub double 1.000000e+00, %76
%78 = fmul double %71, %77
%79 = fptrunc double %78 to float
%80 = load [65536 x float]*, [65536 x float]** %4
%81 = getelementptr inbounds [65536 x float], [65536 x float]* %80, i64 6
%82 = getelementptr inbounds [65536 x float], [65536 x float]* %81, i64 0, i64 82
store float %79, float* %82
%83 = load [65536 x float]*, [65536 x float]** %4
%84 = getelementptr inbounds [65536 x float], [65536 x float]* %83, i64 6
%85 = getelementptr inbounds [65536 x float], [65536 x float]* %84, i64 0, i64 81
%86 = load float, float* %85
ret float %86
}

LLVM IR (-O2):
define float @CHEW(float* %0, [65536 x float]* %1) {
%3 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 0, i64 0
%4 = tail call i32 @CRUSH(float* %3, i32 65536, float* %0)
%5 = sub nsw i32 0, %4
%6 = tail call i32 @expf(i32 %5)
%7 = add nsw i32 %6, 1
%8 = tail call float @powf(i32 %7, i32 -1)
%9 = getelementptr inbounds float, float* %0, i64 65536
store float %8, float* %9
%10 = fpext float %8 to double
%11 = fsub double 1.000000e+00, %10
%12 = fmul double %11, %10
%13 = fptrunc double %12 to float
%14 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 6, i64 50
store float %13, float* %14
%15 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 1, i64 0
%16 = tail call i32 @CRUSH(float* %15, i32 65536, float* %0)
%17 = sub nsw i32 0, %16
%18 = tail call i32 @expf(i32 %17)
%19 = add nsw i32 %18, 1
%20 = tail call float @powf(i32 %19, i32 -1)
%21 = getelementptr inbounds float, float* %0, i64 65537
store float %20, float* %21
%22 = fpext float %20 to double
%23 = fsub double 1.000000e+00, %22
%24 = fmul double %23, %22
%25 = fptrunc double %24 to float
%26 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 6, i64 51
store float %25, float* %26
%27 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 2, i64 0
%28 = tail call i32 @CRUSH(float* %27, i32 65536, float* %0)
%29 = sub nsw i32 0, %28
%30 = tail call i32 @expf(i32 %29)
%31 = add nsw i32 %30, 1
%32 = tail call float @powf(i32 %31, i32 -1)
%33 = getelementptr inbounds float, float* %0, i64 65538
store float %32, float* %33
%34 = fpext float %32 to double
%35 = fsub double 1.000000e+00, %34
%36 = fmul double %35, %34
%37 = fptrunc double %36 to float
%38 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 6, i64 52
store float %37, float* %38
%39 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 3, i64 0
%40 = tail call i32 @CRUSH(float* %39, i32 65536, float* %0)
%41 = sub nsw i32 0, %40
%42 = tail call i32 @expf(i32 %41)
%43 = add nsw i32 %42, 1
%44 = tail call float @powf(i32 %43, i32 -1)
%45 = getelementptr inbounds float, float* %0, i64 65539
store float %44, float* %45
%46 = fpext float %44 to double
%47 = fsub double 1.000000e+00, %46
%48 = fmul double %47, %46
%49 = fptrunc double %48 to float
%50 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 6, i64 53
store float %49, float* %50
%51 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 4, i64 0
%52 = tail call i32 @CRUSH(float* %51, i32 65536, float* %0)
%53 = sub nsw i32 0, %52
%54 = tail call i32 @expf(i32 %53)
%55 = add nsw i32 %54, 1
%56 = tail call float @powf(i32 %55, i32 -1)
%57 = getelementptr inbounds float, float* %0, i64 65540
store float %56, float* %57
%58 = fpext float %56 to double
%59 = fsub double 1.000000e+00, %58
%60 = fmul double %59, %58
%61 = fptrunc double %60 to float
%62 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 6, i64 54
store float %61, float* %62
%63 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 5, i64 0
%64 = tail call i32 @CRUSH(float* %63, i32 65536, float* %0)
%65 = sub nsw i32 0, %64
%66 = tail call i32 @expf(i32 %65)
%67 = add nsw i32 %66, 1
%68 = tail call float @powf(i32 %67, i32 -1)
%69 = getelementptr inbounds float, float* %0, i64 65541
store float %68, float* %69
%70 = fpext float %68 to double
%71 = fsub double 1.000000e+00, %70
%72 = fmul double %71, %70
%73 = fptrunc double %72 to float
%74 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 6, i64 55
store float %73, float* %74
%75 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 6, i64 0
%76 = tail call i32 @CRUSH(float* %9, i32 6, float* %75)
%77 = sub nsw i32 0, %76
%78 = tail call i32 @expf(i32 %77)
%79 = add nsw i32 %78, 1
%80 = add i32 %78, 2
%81 = icmp ult i32 %80, 3
%82 = select i1 %81, i32 %79, i32 0
%83 = sitofp i32 %82 to float
%84 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 6, i64 81
store float %83, float* %84
%85 = fpext float %83 to double
%86 = fsub double 1.000000e+00, %85
%87 = fmul double %86, %85
%88 = fptrunc double %87 to float
%89 = getelementptr inbounds [65536 x float], [65536 x float]* %1, i64 6, i64 82
store float %88, float* %89
ret float %83
}