int BSIM4RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, nuEnd, rgeo, Type, Rend)
double Weffcj, Rsh, DMCG, DMCI, DMDG;
int rgeo, Type;
double nuEnd, *Rend;
{
  if (Type == 1) {
    switch (rgeo) {
    case 1:
    case 2:
    case 5:
      if (nuEnd == 0.0)
        *Rend = 0.0;
      else
        *Rend = Rsh * DMCG / (Weffcj * nuEnd);
      break;
    case 3:
    case 4:
    case 6:
      if ((DMCG + DMCI) == 0.0)
        printf("(DMCG + DMCI) can not be equal to zero\n");
      if ((nuEnd == 0.0) || ((DMCG + DMCI) == 0.0))
        *Rend = 0.0;
      else
        *Rend = Rsh * Weffcj / (3.0 * nuEnd * (DMCG + DMCI));
      break;
    default:
      printf("Warning: Specified RGEO = %d not matched\n", rgeo);
    }
  } else {
    switch (rgeo) {
    case 1:
    case 3:
    case 7:
      if (nuEnd == 0.0)
        *Rend = 0.0;
      else
        *Rend = Rsh * DMCG / (Weffcj * nuEnd);
      break;
    case 2:
    case 4:
    case 8:
      if ((DMCG + DMCI) == 0.0)
        printf("(DMCG + DMCI) can not be equal to zero\n");
      if ((nuEnd == 0.0) || ((DMCG + DMCI) == 0.0))
        *Rend = 0.0;
      else
        *Rend = Rsh * Weffcj / (3.0 * nuEnd * (DMCG + DMCI));
      break;
    default:
      printf("Warning: Specified RGEO = %d not matched\n", rgeo);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<BSIM4RdsEndIso>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
mov    %edi,-0x34(%rbp)
mov    %esi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
cmpl   $0x1,-0x38(%rbp)
jne    12a5 <BSIM4RdsEndIso+0x195>
mov    -0x34(%rbp),%eax
mov    %eax,-0x44(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     1197 <BSIM4RdsEndIso+0x87>
jmp    1161 <BSIM4RdsEndIso+0x51>
mov    -0x44(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x2,%eax
jb     11e4 <BSIM4RdsEndIso+0xd4>
jmp    1175 <BSIM4RdsEndIso+0x65>
mov    -0x44(%rbp),%eax
sub    $0x5,%eax
je     1197 <BSIM4RdsEndIso+0x87>
jmp    1186 <BSIM4RdsEndIso+0x76>
mov    -0x44(%rbp),%eax
sub    $0x6,%eax
je     11e4 <BSIM4RdsEndIso+0xd4>
jmp    128f <BSIM4RdsEndIso+0x17f>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11bf <BSIM4RdsEndIso+0xaf>
jp     11bf <BSIM4RdsEndIso+0xaf>
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    11df <BSIM4RdsEndIso+0xcf>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    12a0 <BSIM4RdsEndIso+0x190>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    120f <BSIM4RdsEndIso+0xff>
jp     120f <BSIM4RdsEndIso+0xff>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    122c <BSIM4RdsEndIso+0x11c>
jp     122c <BSIM4RdsEndIso+0x11c>
jmp    1249 <BSIM4RdsEndIso+0x139>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1259 <BSIM4RdsEndIso+0x149>
jp     1259 <BSIM4RdsEndIso+0x149>
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    128a <BSIM4RdsEndIso+0x17a>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xd95(%rip),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
addsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    12a0 <BSIM4RdsEndIso+0x190>
mov    -0x34(%rbp),%esi
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    141c <BSIM4RdsEndIso+0x30c>
mov    -0x34(%rbp),%eax
mov    %eax,-0x48(%rbp)
sub    $0x1,%eax
je     130e <BSIM4RdsEndIso+0x1fe>
jmp    12b9 <BSIM4RdsEndIso+0x1a9>
mov    -0x48(%rbp),%eax
sub    $0x2,%eax
je     135b <BSIM4RdsEndIso+0x24b>
jmp    12ca <BSIM4RdsEndIso+0x1ba>
mov    -0x48(%rbp),%eax
sub    $0x3,%eax
je     130e <BSIM4RdsEndIso+0x1fe>
jmp    12db <BSIM4RdsEndIso+0x1cb>
mov    -0x48(%rbp),%eax
sub    $0x4,%eax
je     135b <BSIM4RdsEndIso+0x24b>
jmp    12ec <BSIM4RdsEndIso+0x1dc>
mov    -0x48(%rbp),%eax
sub    $0x7,%eax
je     130e <BSIM4RdsEndIso+0x1fe>
jmp    12fd <BSIM4RdsEndIso+0x1ed>
mov    -0x48(%rbp),%eax
sub    $0x8,%eax
je     135b <BSIM4RdsEndIso+0x24b>
jmp    1406 <BSIM4RdsEndIso+0x2f6>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1336 <BSIM4RdsEndIso+0x226>
jp     1336 <BSIM4RdsEndIso+0x226>
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1356 <BSIM4RdsEndIso+0x246>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1417 <BSIM4RdsEndIso+0x307>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1386 <BSIM4RdsEndIso+0x276>
jp     1386 <BSIM4RdsEndIso+0x276>
lea    0xc89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13a3 <BSIM4RdsEndIso+0x293>
jp     13a3 <BSIM4RdsEndIso+0x293>
jmp    13c0 <BSIM4RdsEndIso+0x2b0>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13d0 <BSIM4RdsEndIso+0x2c0>
jp     13d0 <BSIM4RdsEndIso+0x2c0>
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1401 <BSIM4RdsEndIso+0x2f1>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xc1e(%rip),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
addsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1417 <BSIM4RdsEndIso+0x307>
mov    -0x34(%rbp),%esi
lea    0xc20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    141c <BSIM4RdsEndIso+0x30c>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSIM4RdsEndIso>:
push   %rbx
mov    %rdx,%rbx
mov    %edi,%eax
cmp    $0x1,%esi
jne    114a <BSIM4RdsEndIso+0x2a>
cmp    $0x6,%eax
ja     11b7 <BSIM4RdsEndIso+0x97>
mov    $0x26,%ecx
bt     %eax,%ecx
jb     1188 <BSIM4RdsEndIso+0x68>
mov    $0x58,%ecx
bt     %eax,%ecx
jb     1163 <BSIM4RdsEndIso+0x43>
jmp    11b7 <BSIM4RdsEndIso+0x97>
cmp    $0x8,%eax
ja     11b7 <BSIM4RdsEndIso+0x97>
mov    $0x8a,%ecx
bt     %eax,%ecx
jb     1188 <BSIM4RdsEndIso+0x68>
mov    $0x114,%ecx
bt     %eax,%ecx
jae    11b7 <BSIM4RdsEndIso+0x97>
addsd  %xmm3,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jne    11a6 <BSIM4RdsEndIso+0x86>
jp     11a6 <BSIM4RdsEndIso+0x86>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
movq   $0x0,(%rbx)
jmp    11e1 <BSIM4RdsEndIso+0xc1>
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm5
jne    1194 <BSIM4RdsEndIso+0x74>
jnp    11ae <BSIM4RdsEndIso+0x8e>
mulsd  %xmm2,%xmm1
mulsd  %xmm5,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
jmp    11e1 <BSIM4RdsEndIso+0xc1>
ucomisd %xmm3,%xmm5
jne    11c9 <BSIM4RdsEndIso+0xa9>
jp     11c9 <BSIM4RdsEndIso+0xa9>
movq   $0x0,(%rbx)
jmp    11e1 <BSIM4RdsEndIso+0xc1>
lea    0xe4a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11e1 <BSIM4RdsEndIso+0xc1>
mulsd  0xe2f(%rip),%xmm5
mulsd  %xmm1,%xmm0
mulsd  %xmm5,%xmm2
divsd  %xmm2,%xmm0
movsd  %xmm0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"(DMCG + DMCI) can not be equal to zero\0A\00"
@.str.1 = [42 x i8] c"Warning: Specified RGEO = %d not matched\0A\00"
define i32 @BSIM4RdsEndIso(double %0, double %1, double %2, double %3, double %4, double %5, i32 %6, i32 %7, double* %8) {
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca i32
%17 = alloca i32
%18 = alloca double*
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store double* %8, double** %18
%19 = load i32, i32* %17
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %72
21: ; preds = %9
%22 = load i32, i32* %16
switch i32 %22, label %68 [
i32 1, label %23
i32 2, label %23
i32 5, label %23
i32 3, label %38
i32 4, label %38
i32 6, label %38
]
23: ; preds = %21, %21, %21
%24 = load double, double* %15
%25 = fcmp oeq double %24, 0.000000e+00
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load double*, double** %18
store double 0.000000e+00, double* %27
br label %37
28: ; preds = %23
%29 = load double, double* %11
%30 = load double, double* %12
%31 = fmul double %29, %30
%32 = load double, double* %10
%33 = load double, double* %15
%34 = fmul double %32, %33
%35 = fdiv double %31, %34
%36 = load double*, double** %18
store double %35, double* %36
br label %37
37: ; preds = %28, %26
br label %71
38: ; preds = %21, %21, %21
%39 = load double, double* %12
%40 = load double, double* %13
%41 = fadd double %39, %40
%42 = fcmp oeq double %41, 0.000000e+00
br i1 %42, label %43, label %45
43: ; preds = %38
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %45
45: ; preds = %43, %38
%46 = load double, double* %15
%47 = fcmp oeq double %46, 0.000000e+00
br i1 %47, label %53, label %48
48: ; preds = %45
%49 = load double, double* %12
%50 = load double, double* %13
%51 = fadd double %49, %50
%52 = fcmp oeq double %51, 0.000000e+00
br i1 %52, label %53, label %55
53: ; preds = %48, %45
%54 = load double*, double** %18
store double 0.000000e+00, double* %54
br label %67
55: ; preds = %48
%56 = load double, double* %11
%57 = load double, double* %10
%58 = fmul double %56, %57
%59 = load double, double* %15
%60 = fmul double 3.000000e+00, %59
%61 = load double, double* %12
%62 = load double, double* %13
%63 = fadd double %61, %62
%64 = fmul double %60, %63
%65 = fdiv double %58, %64
%66 = load double*, double** %18
store double %65, double* %66
br label %67
67: ; preds = %55, %53
br label %71
68: ; preds = %21
%69 = load i32, i32* %16
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %68, %67, %37
br label %123
72: ; preds = %9
%73 = load i32, i32* %16
switch i32 %73, label %119 [
i32 1, label %74
i32 3, label %74
i32 7, label %74
i32 2, label %89
i32 4, label %89
i32 8, label %89
]
74: ; preds = %72, %72, %72
%75 = load double, double* %15
%76 = fcmp oeq double %75, 0.000000e+00
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = load double*, double** %18
store double 0.000000e+00, double* %78
br label %88
79: ; preds = %74
%80 = load double, double* %11
%81 = load double, double* %12
%82 = fmul double %80, %81
%83 = load double, double* %10
%84 = load double, double* %15
%85 = fmul double %83, %84
%86 = fdiv double %82, %85
%87 = load double*, double** %18
store double %86, double* %87
br label %88
88: ; preds = %79, %77
br label %122
89: ; preds = %72, %72, %72
%90 = load double, double* %12
%91 = load double, double* %13
%92 = fadd double %90, %91
%93 = fcmp oeq double %92, 0.000000e+00
br i1 %93, label %94, label %96
94: ; preds = %89
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %96
96: ; preds = %94, %89
%97 = load double, double* %15
%98 = fcmp oeq double %97, 0.000000e+00
br i1 %98, label %104, label %99
99: ; preds = %96
%100 = load double, double* %12
%101 = load double, double* %13
%102 = fadd double %100, %101
%103 = fcmp oeq double %102, 0.000000e+00
br i1 %103, label %104, label %106
104: ; preds = %99, %96
%105 = load double*, double** %18
store double 0.000000e+00, double* %105
br label %118
106: ; preds = %99
%107 = load double, double* %11
%108 = load double, double* %10
%109 = fmul double %107, %108
%110 = load double, double* %15
%111 = fmul double 3.000000e+00, %110
%112 = load double, double* %12
%113 = load double, double* %13
%114 = fadd double %112, %113
%115 = fmul double %111, %114
%116 = fdiv double %109, %115
%117 = load double*, double** %18
store double %116, double* %117
br label %118
118: ; preds = %106, %104
br label %122
119: ; preds = %72
%120 = load i32, i32* %16
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %120)
br label %122
122: ; preds = %119, %118, %88
br label %123
123: ; preds = %122, %71
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [42 x i8] c"Warning: Specified RGEO = %d not matched\0A\00"
@str.2 = [39 x i8] c"(DMCG + DMCI) can not be equal to zero\00"
define i32 @BSIM4RdsEndIso(double %0, double %1, double %2, double %3, double %4, double %5, i32 %6, i32 %7, double* nocapture writeonly %8) {
%10 = icmp eq i32 %7, 1
br i1 %10, label %11, label %34
11: ; preds = %9
switch i32 %6, label %32 [
i32 1, label %12
i32 2, label %12
i32 5, label %12
i32 3, label %19
i32 4, label %19
i32 6, label %19
]
12: ; preds = %11, %11, %11
%13 = fcmp oeq double %5, 0.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %12
store double 0.000000e+00, double* %8
br label %57
15: ; preds = %12
%16 = fmul double %1, %2
%17 = fmul double %0, %5
%18 = fdiv double %16, %17
store double %18, double* %8
br label %57
19: ; preds = %11, %11, %11
%20 = fadd double %2, %3
%21 = fcmp oeq double %20, 0.000000e+00
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
br label %26
24: ; preds = %19
%25 = fcmp oeq double %5, 0.000000e+00
br i1 %25, label %26, label %27
26: ; preds = %22, %24
store double 0.000000e+00, double* %8
br label %57
27: ; preds = %24
%28 = fmul double %0, %1
%29 = fmul double %5, 3.000000e+00
%30 = fmul double %20, %29
%31 = fdiv double %28, %30
store double %31, double* %8
br label %57
32: ; preds = %11
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %57
34: ; preds = %9
switch i32 %6, label %55 [
i32 1, label %35
i32 3, label %35
i32 7, label %35
i32 2, label %42
i32 4, label %42
i32 8, label %42
]
35: ; preds = %34, %34, %34
%36 = fcmp oeq double %5, 0.000000e+00
br i1 %36, label %37, label %38
37: ; preds = %35
store double 0.000000e+00, double* %8
br label %57
38: ; preds = %35
%39 = fmul double %1, %2
%40 = fmul double %0, %5
%41 = fdiv double %39, %40
store double %41, double* %8
br label %57
42: ; preds = %34, %34, %34
%43 = fadd double %2, %3
%44 = fcmp oeq double %43, 0.000000e+00
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
br label %49
47: ; preds = %42
%48 = fcmp oeq double %5, 0.000000e+00
br i1 %48, label %49, label %50
49: ; preds = %45, %47
store double 0.000000e+00, double* %8
br label %57
50: ; preds = %47
%51 = fmul double %0, %1
%52 = fmul double %5, 3.000000e+00
%53 = fmul double %43, %52
%54 = fdiv double %51, %53
store double %54, double* %8
br label %57
55: ; preds = %34
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %57
57: ; preds = %55, %38, %37, %50, %49, %32, %15, %14, %27, %26
ret i32 0
}