#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 Range(int, double, int *, double *, double *, int, int, double);
double fabs(double);
double ELossCL(int ZP, double MP, int ZT[], double MT[], double CT[],
               int NTarEl, int IsGas, double TT, double E) {
  double EIn = 0.0, ELow = 0.0, EUp = 0.0, TTStep = 0.0, R = 0.0, DR = 0.0,
         FFF1 = 0.681;
  if (TT < 0)
    return 0;
  if (E <= 0)
    return E;
  if ((DR = Range(ZP, MP, ZT, MT, CT, NTarEl, IsGas, E) - TT) <= 0)
    return E;
  EIn = EUp = E;
  E = E - E * FFF1;
  TTStep = TT / 100;
  R = Range(ZP, MP, ZT, MT, CT, NTarEl, IsGas, E);
  while (fabs(R - DR) >= TTStep) {
    R = Range(ZP, MP, ZT, MT, CT, NTarEl, IsGas, E);
    if (R > DR) {
      EUp = E;
      E = EUp - (EUp - ELow) * FFF1;
    } else if (R < DR) {
      ELow = E;
      E = ELow + (EUp - ELow) * FFF1;
    } else
      return (EIn - E);
  };
  return (EIn - E);
}


x86 assembly (clang, -O0):
<ELossCL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8d,-0x34(%rbp)
mov    %r9d,-0x38(%rbp)
movsd  %xmm1,-0x40(%rbp)
movsd  %xmm2,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe87(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    1199 <ELossCL+0x89>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    139b <ELossCL+0x28b>
xorps  %xmm0,%xmm0
ucomisd -0x48(%rbp),%xmm0
jb     11b6 <ELossCL+0xa6>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    139b <ELossCL+0x28b>
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x34(%rbp),%r8d
mov    -0x38(%rbp),%r9d
movsd  -0x48(%rbp),%xmm1
call   1030 <Range@plt>
movaps %xmm0,%xmm1
subsd  -0x40(%rbp),%xmm1
movsd  %xmm1,-0x78(%rbp)
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1205 <ELossCL+0xf5>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    139b <ELossCL+0x28b>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xdb4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x34(%rbp),%r8d
mov    -0x38(%rbp),%r9d
movsd  -0x48(%rbp),%xmm1
call   1030 <Range@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
movaps 0xd77(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x68(%rbp),%xmm0
jb     138c <ELossCL+0x27c>
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x34(%rbp),%r8d
mov    -0x38(%rbp),%r9d
movsd  -0x48(%rbp),%xmm1
call   1030 <Range@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    132a <ELossCL+0x21a>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1387 <ELossCL+0x277>
movsd  -0x70(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    136e <ELossCL+0x25e>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1382 <ELossCL+0x272>
movsd  -0x50(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    139b <ELossCL+0x28b>
jmp    1387 <ELossCL+0x277>
jmp    1288 <ELossCL+0x178>
movsd  -0x50(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ELossCL>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1202 <ELossCL+0xf2>
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
jae    11f7 <ELossCL+0xe7>
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %edi,%ebp
movapd %xmm3,%xmm0
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,(%rsp)
movapd %xmm2,%xmm1
movsd  %xmm3,0x18(%rsp)
call   1030 <Range@plt>
movsd  0x10(%rsp),%xmm2
movapd %xmm0,%xmm3
subsd  %xmm2,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm3,%xmm0
jae    11fd <ELossCL+0xed>
movsd  0xe73(%rip),%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  0xe66(%rip),%xmm2
movsd  %xmm2,0x10(%rsp)
mov    %ebp,%edi
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15d,%r8d
mov    %r14d,%r9d
movsd  %xmm1,0x8(%rsp)
movsd  %xmm3,0x30(%rsp)
call   1030 <Range@plt>
subsd  0x30(%rsp),%xmm0
andpd  0xe42(%rip),%xmm0
ucomisd 0x10(%rsp),%xmm0
jae    1211 <ELossCL+0x101>
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
jmp    1202 <ELossCL+0xf2>
movapd %xmm2,%xmm0
jmp    1202 <ELossCL+0xf2>
movsd  (%rsp),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  (%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
jmp    1288 <ELossCL+0x178>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm2
subsd  0x28(%rsp),%xmm2
xorpd  0xdd8(%rip),%xmm2
movsd  %xmm1,0x20(%rsp)
mulsd  0xdaa(%rip),%xmm2
addsd  %xmm2,%xmm1
subsd  %xmm3,%xmm0
andpd  0xdaa(%rip),%xmm0
ucomisd 0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm0
jb     11ec <ELossCL+0xdc>
movsd  %xmm1,0x8(%rsp)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <Range@plt>
movsd  0x30(%rsp),%xmm3
ucomisd %xmm3,%xmm0
ja     1240 <ELossCL+0x130>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm3
jbe    11ec <ELossCL+0xdc>
movsd  0x20(%rsp),%xmm2
subsd  %xmm1,%xmm2
movsd  %xmm1,0x28(%rsp)
jmp    125e <ELossCL+0x14e>

LLVM IR (-O0):
define double @ELossCL(i32 %0, double %1, i32* %2, double* %3, double* %4, i32 %5, i32 %6, double %7, double %8) {
%10 = alloca double
%11 = alloca i32
%12 = alloca double
%13 = alloca i32*
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
store i32 %0, i32* %11
store double %1, double* %12
store i32* %2, i32** %13
store double* %3, double** %14
store double* %4, double** %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store double %7, double* %18
store double %8, double* %19
store double 0.000000e+00, double* %20
store double 0.000000e+00, double* %21
store double 0.000000e+00, double* %22
store double 0.000000e+00, double* %23
store double 0.000000e+00, double* %24
store double 0.000000e+00, double* %25
store double 6.810000e-01, double* %26
%27 = load double, double* %18
%28 = fcmp olt double %27, 0.000000e+00
br i1 %28, label %29, label %30
29: ; preds = %9
store double 0.000000e+00, double* %10
br label %119
30: ; preds = %9
%31 = load double, double* %19
%32 = fcmp ole double %31, 0.000000e+00
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = load double, double* %19
store double %34, double* %10
br label %119
35: ; preds = %30
%36 = load i32, i32* %11
%37 = load double, double* %12
%38 = load i32*, i32** %13
%39 = load double*, double** %14
%40 = load double*, double** %15
%41 = load i32, i32* %16
%42 = load i32, i32* %17
%43 = load double, double* %19
%44 = call double @Range(i32 %36, double %37, i32* %38, double* %39, double* %40, i32 %41, i32 %42, double %43)
%45 = load double, double* %18
%46 = fsub double %44, %45
store double %46, double* %25
%47 = fcmp ole double %46, 0.000000e+00
br i1 %47, label %48, label %50
48: ; preds = %35
%49 = load double, double* %19
store double %49, double* %10
br label %119
50: ; preds = %35
%51 = load double, double* %19
store double %51, double* %22
store double %51, double* %20
%52 = load double, double* %19
%53 = load double, double* %19
%54 = load double, double* %26
%55 = fneg double %53
%56 = call double @llvm.fmuladd.f64(double %55, double %54, double %52)
store double %56, double* %19
%57 = load double, double* %18
%58 = fdiv double %57, 1.000000e+02
store double %58, double* %23
%59 = load i32, i32* %11
%60 = load double, double* %12
%61 = load i32*, i32** %13
%62 = load double*, double** %14
%63 = load double*, double** %15
%64 = load i32, i32* %16
%65 = load i32, i32* %17
%66 = load double, double* %19
%67 = call double @Range(i32 %59, double %60, i32* %61, double* %62, double* %63, i32 %64, i32 %65, double %66)
store double %67, double* %24
br label %68
68: ; preds = %114, %50
%69 = load double, double* %24
%70 = load double, double* %25
%71 = fsub double %69, %70
%72 = call double @llvm.fabs.f64(double %71)
%73 = load double, double* %23
%74 = fcmp oge double %72, %73
br i1 %74, label %75, label %115
75: ; preds = %68
%76 = load i32, i32* %11
%77 = load double, double* %12
%78 = load i32*, i32** %13
%79 = load double*, double** %14
%80 = load double*, double** %15
%81 = load i32, i32* %16
%82 = load i32, i32* %17
%83 = load double, double* %19
%84 = call double @Range(i32 %76, double %77, i32* %78, double* %79, double* %80, i32 %81, i32 %82, double %83)
store double %84, double* %24
%85 = load double, double* %24
%86 = load double, double* %25
%87 = fcmp ogt double %85, %86
br i1 %87, label %88, label %97
88: ; preds = %75
%89 = load double, double* %19
store double %89, double* %22
%90 = load double, double* %22
%91 = load double, double* %22
%92 = load double, double* %21
%93 = fsub double %91, %92
%94 = load double, double* %26
%95 = fneg double %93
%96 = call double @llvm.fmuladd.f64(double %95, double %94, double %90)
store double %96, double* %19
br label %114
97: ; preds = %75
%98 = load double, double* %24
%99 = load double, double* %25
%100 = fcmp olt double %98, %99
br i1 %100, label %101, label %109
101: ; preds = %97
%102 = load double, double* %19
store double %102, double* %21
%103 = load double, double* %21
%104 = load double, double* %22
%105 = load double, double* %21
%106 = fsub double %104, %105
%107 = load double, double* %26
%108 = call double @llvm.fmuladd.f64(double %106, double %107, double %103)
store double %108, double* %19
br label %113
109: ; preds = %97
%110 = load double, double* %20
%111 = load double, double* %19
%112 = fsub double %110, %111
store double %112, double* %10
br label %119
113: ; preds = %101
br label %114
114: ; preds = %113, %88
br label %68
115: ; preds = %68
%116 = load double, double* %20
%117 = load double, double* %19
%118 = fsub double %116, %117
store double %118, double* %10
br label %119
119: ; preds = %115, %109, %48, %33, %29
%120 = load double, double* %10
ret double %120
}

LLVM IR (-O2):
define double @ELossCL(i32 %0, double %1, i32* %2, double* %3, double* %4, i32 %5, i32 %6, double %7, double %8) {
%10 = fcmp olt double %7, 0.000000e+00
br i1 %10, label %51, label %11
11: ; preds = %9
%12 = fcmp ugt double %8, 0.000000e+00
br i1 %12, label %13, label %51
13: ; preds = %11
%14 = tail call double @Range(i32 %0, double %1, i32* %2, double* %3, double* %4, i32 %5, i32 %6, double %8)
%15 = fsub double %14, %7
%16 = fcmp ugt double %15, 0.000000e+00
br i1 %16, label %17, label %51
17: ; preds = %13
%18 = fneg double %8
%19 = tail call double @llvm.fmuladd.f64(double %18, double 6.810000e-01, double %8)
%20 = fdiv double %7, 1.000000e+02
%21 = tail call double @Range(i32 %0, double %1, i32* %2, double* %3, double* %4, i32 %5, i32 %6, double %19)
%22 = fsub double %21, %15
%23 = tail call double @llvm.fabs.f64(double %22)
%24 = fcmp ult double %23, %20
br i1 %24, label %48, label %25
25: ; preds = %17, %40
%26 = phi double [ %43, %40 ], [ %8, %17 ]
%27 = phi double [ %42, %40 ], [ 0.000000e+00, %17 ]
%28 = phi double [ %44, %40 ], [ %19, %17 ]
%29 = tail call double @Range(i32 %0, double %1, i32* %2, double* %3, double* %4, i32 %5, i32 %6, double %28)
%30 = fcmp ogt double %29, %15
br i1 %30, label %31, label %34
31: ; preds = %25
%32 = fsub double %28, %27
%33 = fneg double %32
br label %40
34: ; preds = %25
%35 = fcmp olt double %29, %15
br i1 %35, label %36, label %38
36: ; preds = %34
%37 = fsub double %26, %28
br label %40
38: ; preds = %34
%39 = fsub double %8, %28
br label %51
40: ; preds = %36, %31
%41 = phi double [ %37, %36 ], [ %33, %31 ]
%42 = phi double [ %28, %36 ], [ %27, %31 ]
%43 = phi double [ %26, %36 ], [ %28, %31 ]
%44 = tail call double @llvm.fmuladd.f64(double %41, double 6.810000e-01, double %28)
%45 = fsub double %29, %15
%46 = tail call double @llvm.fabs.f64(double %45)
%47 = fcmp ult double %46, %20
br i1 %47, label %48, label %25
48: ; preds = %40, %17
%49 = phi double [ %19, %17 ], [ %44, %40 ]
%50 = fsub double %8, %49
br label %51
51: ; preds = %13, %11, %9, %48, %38
%52 = phi double [ %39, %38 ], [ %50, %48 ], [ 0.000000e+00, %9 ], [ %8, %11 ], [ %8, %13 ]
ret double %52
}