#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 */
scalar_t__ hitta_E12_component(float, float *);
int e_resistance(float orig_resistance, float *res_array) {
  int i, count = 0;
  float log = 0.001;
  for (i = 3; i > 0; i--) {
    if (orig_resistance < 56)
      log = 0.1;
    count += hitta_E12_component(orig_resistance * (1 + log), res_array);
    orig_resistance -= *res_array++;
    log *= 10;
  }
  return count;
}


x86 assembly (clang, -O0):
<e_resistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x3,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11d2 <e_resistance+0xc2>
movss  0xeb6(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1165 <e_resistance+0x55>
movss  0xea8(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xe9e(%rip),%xmm1
addss  -0x1c(%rbp),%xmm1
mulss  %xmm1,%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <hitta_E12_component@plt>
mov    %rax,%rcx
movslq -0x18(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movss  (%rax),%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xe52(%rip),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <e_resistance+0x2c>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_resistance>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movss  0xedf(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
movaps %xmm0,%xmm1
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
seta   %al
lea    0xed8(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
movaps %xmm0,0x10(%rsp)
addss  0xeb6(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <hitta_E12_component@plt>
mov    %rax,%r15
lea    0x4(%rbx),%rdi
movss  0xc(%rsp),%xmm1
subss  (%rbx),%xmm1
movaps 0x10(%rsp),%xmm2
mulss  0xe93(%rip),%xmm2
movaps %xmm1,%xmm0
movaps %xmm1,%xmm3
movss  %xmm1,0xc(%rsp)
cmpltss 0xe76(%rip),%xmm0
movss  0xe7a(%rip),%xmm1
andps  %xmm0,%xmm1
andnps %xmm2,%xmm0
orps   %xmm0,%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm1,%xmm0
addss  0xe59(%rip),%xmm0
mulss  %xmm3,%xmm0
call   1030 <hitta_E12_component@plt>
mov    %rax,%r14
add    %r15d,%r14d
movss  0xc(%rsp),%xmm0
subss  0x4(%rbx),%xmm0
add    $0x8,%rbx
movaps 0x10(%rsp),%xmm1
mulss  0xe32(%rip),%xmm1
addss  0xe26(%rip),%xmm1
movaps %xmm1,%xmm3
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
cmpltss 0xe10(%rip),%xmm1
movss  0xe18(%rip),%xmm0
andps  %xmm1,%xmm0
andnps %xmm3,%xmm1
orps   %xmm1,%xmm0
mulss  %xmm2,%xmm0
mov    %rbx,%rdi
call   1030 <hitta_E12_component@plt>
add    %r14d,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @e_resistance(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store float %0, float* %3
store float* %1, float** %4
store i32 0, i32* %6
store float 0x3F50624DE0000000, float* %7
store i32 3, i32* %5
br label %8
8: ; preds = %33, %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %36
11: ; preds = %8
%12 = load float, float* %3
%13 = fcmp olt float %12, 5.600000e+01
br i1 %13, label %14, label %15
14: ; preds = %11
store float 0x3FB99999A0000000, float* %7
br label %15
15: ; preds = %14, %11
%16 = load float, float* %3
%17 = load float, float* %7
%18 = fadd float 1.000000e+00, %17
%19 = fmul float %16, %18
%20 = load float*, float** %4
%21 = call i64 @hitta_E12_component(float %19, float* %20)
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = add nsw i64 %23, %21
%25 = trunc i64 %24 to i32
store i32 %25, i32* %6
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i32 1
store float* %27, float** %4
%28 = load float, float* %26
%29 = load float, float* %3
%30 = fsub float %29, %28
store float %30, float* %3
%31 = load float, float* %7
%32 = fmul float %31, 1.000000e+01
store float %32, float* %7
br label %33
33: ; preds = %15
%34 = load i32, i32* %5
%35 = add nsw i32 %34, -1
store i32 %35, i32* %5
br label %8
36: ; preds = %8
%37 = load i32, i32* %6
ret i32 %37
}

LLVM IR (-O2):
define i32 @e_resistance(float %0, float* %1) {
%3 = fcmp olt float %0, 5.600000e+01
%4 = select i1 %3, float 0x3FB99999A0000000, float 0x3F50624DE0000000
%5 = fadd float %4, 1.000000e+00
%6 = fmul float %5, %0
%7 = tail call i64 @hitta_E12_component(float %6, float* %1)
%8 = trunc i64 %7 to i32
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %1
%11 = fsub float %0, %10
%12 = fmul float %4, 1.000000e+01
%13 = fcmp olt float %11, 5.600000e+01
%14 = select i1 %13, float 0x3FB99999A0000000, float %12
%15 = fadd float %14, 1.000000e+00
%16 = fmul float %11, %15
%17 = tail call i64 @hitta_E12_component(float %16, float* %9)
%18 = trunc i64 %17 to i32
%19 = add i32 %8, %18
%20 = getelementptr inbounds float, float* %1, i64 2
%21 = load float, float* %9
%22 = fsub float %11, %21
%23 = fmul float %14, 1.000000e+01
%24 = fcmp olt float %22, 5.600000e+01
%25 = fadd float %23, 1.000000e+00
%26 = select i1 %24, float 0x3FF19999A0000000, float %25
%27 = fmul float %22, %26
%28 = tail call i64 @hitta_E12_component(float %27, float* %20)
%29 = trunc i64 %28 to i32
%30 = add i32 %19, %29
ret i32 %30
}