int BSIM4NumFingerDiff(nf, minSD, nuIntD, nuEndD, nuIntS, nuEndS)
int minSD;
double nf, *nuIntD, *nuEndD, *nuIntS, *nuEndS;
{
  int NF;
  NF = (int)nf;
  if ((NF % 2) != 0) {
    *nuEndD = *nuEndS = 1.0;
    *nuIntD = *nuIntS =
        2.0 * (((nf - 1.0) / 2.0) > (0.0) ? ((nf - 1.0) / 2.0) : (0.0));
  } else {
    if (minSD == 1) {
      *nuEndD = 2.0;
      *nuIntD = 2.0 * (((nf / 2.0 - 1.0)) > (0.0) ? ((nf / 2.0 - 1.0)) : (0.0));
      *nuEndS = 0.0;
      *nuIntS = nf;
    } else {
      *nuEndD = 0.0;
      *nuIntD = nf;
      *nuEndS = 2.0;
      *nuIntS = 2.0 * (((nf / 2.0 - 1.0)) > (0.0) ? ((nf / 2.0 - 1.0)) : (0.0));
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<BSIM4NumFingerDiff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11dc <BSIM4NumFingerDiff+0xdc>
mov    -0x30(%rbp),%rax
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11a9 <BSIM4NumFingerDiff+0xa9>
movsd  -0x8(%rbp),%xmm0
movsd  0xe71(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe6d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    11b6 <BSIM4NumFingerDiff+0xb6>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    11b6 <BSIM4NumFingerDiff+0xb6>
movsd  -0x40(%rbp),%xmm1
movsd  0xe45(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    132e <BSIM4NumFingerDiff+0x22e>
cmpl   $0x1,-0xc(%rbp)
jne    128a <BSIM4NumFingerDiff+0x18a>
mov    -0x20(%rbp),%rax
movsd  0xe16(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  0xe05(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdf1(%rip),%xmm1
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1247 <BSIM4NumFingerDiff+0x147>
movsd  -0x8(%rbp),%xmm0
movsd  0xddb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdc7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1254 <BSIM4NumFingerDiff+0x154>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1254 <BSIM4NumFingerDiff+0x154>
movsd  -0x48(%rbp),%xmm1
movsd  0xda7(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1329 <BSIM4NumFingerDiff+0x229>
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  0xd5a(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  0xd49(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd35(%rip),%xmm1
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1303 <BSIM4NumFingerDiff+0x203>
movsd  -0x8(%rbp),%xmm0
movsd  0xd1f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd0b(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1310 <BSIM4NumFingerDiff+0x210>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1310 <BSIM4NumFingerDiff+0x210>
movsd  -0x50(%rbp),%xmm1
movsd  0xceb(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    132e <BSIM4NumFingerDiff+0x22e>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSIM4NumFingerDiff>:
cvttsd2si %xmm0,%eax
test   $0x1,%al
jne    1155 <BSIM4NumFingerDiff+0x55>
cmp    $0x1,%edi
jne    1191 <BSIM4NumFingerDiff+0x91>
movabs $0x4000000000000000,%rax
movsd  0xee5(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xed1(%rip),%xmm1
mov    %rax,(%rdx)
xorpd  %xmm2,%xmm2
cmpltsd %xmm1,%xmm2
addsd  %xmm1,%xmm1
andpd  %xmm2,%xmm1
movlpd %xmm1,(%rsi)
movq   $0x0,(%r8)
movsd  %xmm0,(%rcx)
xor    %eax,%eax
ret
movabs $0x3ff0000000000000,%rax
mov    %rax,(%r8)
mov    %rax,(%rdx)
addsd  0xe93(%rip),%xmm0
mulsd  0xe93(%rip),%xmm0
xorpd  %xmm1,%xmm1
cmpltsd %xmm0,%xmm1
addsd  %xmm0,%xmm0
andpd  %xmm1,%xmm0
movlpd %xmm0,(%rcx)
movlpd %xmm0,(%rsi)
xor    %eax,%eax
ret
movq   $0x0,(%rdx)
movsd  %xmm0,(%rsi)
movabs $0x4000000000000000,%rax
mulsd  0xe5a(%rip),%xmm0
mov    %rax,(%r8)
addsd  0xe47(%rip),%xmm0
xorpd  %xmm1,%xmm1
cmpltsd %xmm0,%xmm1
addsd  %xmm0,%xmm0
andpd  %xmm1,%xmm0
movlpd %xmm0,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @BSIM4NumFingerDiff(double %0, i32 %1, double* %2, double* %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
store double %0, double* %7
store i32 %1, i32* %8
store double* %2, double** %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
%14 = load double, double* %7
%15 = fptosi double %14 to i32
store i32 %15, i32* %13
%16 = load i32, i32* %13
%17 = srem i32 %16, 2
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %36
19: ; preds = %6
%20 = load double*, double** %12
store double 1.000000e+00, double* %20
%21 = load double*, double** %10
store double 1.000000e+00, double* %21
%22 = load double, double* %7
%23 = fsub double %22, 1.000000e+00
%24 = fdiv double %23, 2.000000e+00
%25 = fcmp ogt double %24, 0.000000e+00
br i1 %25, label %26, label %30
26: ; preds = %19
%27 = load double, double* %7
%28 = fsub double %27, 1.000000e+00
%29 = fdiv double %28, 2.000000e+00
br label %31
30: ; preds = %19
br label %31
31: ; preds = %30, %26
%32 = phi double [ %29, %26 ], [ 0.000000e+00, %30 ]
%33 = fmul double 2.000000e+00, %32
%34 = load double*, double** %11
store double %33, double* %34
%35 = load double*, double** %9
store double %33, double* %35
br label %76
36: ; preds = %6
%37 = load i32, i32* %8
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %57
39: ; preds = %36
%40 = load double*, double** %10
store double 2.000000e+00, double* %40
%41 = load double, double* %7
%42 = fdiv double %41, 2.000000e+00
%43 = fsub double %42, 1.000000e+00
%44 = fcmp ogt double %43, 0.000000e+00
br i1 %44, label %45, label %49
45: ; preds = %39
%46 = load double, double* %7
%47 = fdiv double %46, 2.000000e+00
%48 = fsub double %47, 1.000000e+00
br label %50
49: ; preds = %39
br label %50
50: ; preds = %49, %45
%51 = phi double [ %48, %45 ], [ 0.000000e+00, %49 ]
%52 = fmul double 2.000000e+00, %51
%53 = load double*, double** %9
store double %52, double* %53
%54 = load double*, double** %12
store double 0.000000e+00, double* %54
%55 = load double, double* %7
%56 = load double*, double** %11
store double %55, double* %56
br label %75
57: ; preds = %36
%58 = load double*, double** %10
store double 0.000000e+00, double* %58
%59 = load double, double* %7
%60 = load double*, double** %9
store double %59, double* %60
%61 = load double*, double** %12
store double 2.000000e+00, double* %61
%62 = load double, double* %7
%63 = fdiv double %62, 2.000000e+00
%64 = fsub double %63, 1.000000e+00
%65 = fcmp ogt double %64, 0.000000e+00
br i1 %65, label %66, label %70
66: ; preds = %57
%67 = load double, double* %7
%68 = fdiv double %67, 2.000000e+00
%69 = fsub double %68, 1.000000e+00
br label %71
70: ; preds = %57
br label %71
71: ; preds = %70, %66
%72 = phi double [ %69, %66 ], [ 0.000000e+00, %70 ]
%73 = fmul double 2.000000e+00, %72
%74 = load double*, double** %11
store double %73, double* %74
br label %75
75: ; preds = %71, %50
br label %76
76: ; preds = %75, %31
ret i32 0
}

LLVM IR (-O2):
define i32 @BSIM4NumFingerDiff(double %0, i32 %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fptosi double %0 to i32
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %6
store double 1.000000e+00, double* %5
store double 1.000000e+00, double* %3
%11 = fadd double %0, -1.000000e+00
%12 = fmul double %11, 5.000000e-01
%13 = fcmp ogt double %12, 0.000000e+00
%14 = fmul double %12, 2.000000e+00
%15 = select i1 %13, double %14, double 0.000000e+00
store double %15, double* %4
store double %15, double* %2
br label %30
16: ; preds = %6
%17 = icmp eq i32 %1, 1
br i1 %17, label %18, label %24
18: ; preds = %16
store double 2.000000e+00, double* %3
%19 = fmul double %0, 5.000000e-01
%20 = fadd double %19, -1.000000e+00
%21 = fcmp ogt double %20, 0.000000e+00
%22 = fmul double %20, 2.000000e+00
%23 = select i1 %21, double %22, double 0.000000e+00
store double %23, double* %2
store double 0.000000e+00, double* %5
store double %0, double* %4
br label %30
24: ; preds = %16
store double 0.000000e+00, double* %3
store double %0, double* %2
store double 2.000000e+00, double* %5
%25 = fmul double %0, 5.000000e-01
%26 = fadd double %25, -1.000000e+00
%27 = fcmp ogt double %26, 0.000000e+00
%28 = fmul double %26, 2.000000e+00
%29 = select i1 %27, double %28, double 0.000000e+00
store double %29, double* %4
br label %30
30: ; preds = %18, %24, %10
ret i32 0
}