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)
        *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)
        *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    1283 <BSIM4RdsEndIso+0x173>
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    126d <BSIM4RdsEndIso+0x15d>
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    127e <BSIM4RdsEndIso+0x16e>
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    1237 <BSIM4RdsEndIso+0x127>
jp     1237 <BSIM4RdsEndIso+0x127>
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1268 <BSIM4RdsEndIso+0x158>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xdb7(%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    127e <BSIM4RdsEndIso+0x16e>
mov    -0x34(%rbp),%esi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13d8 <BSIM4RdsEndIso+0x2c8>
mov    -0x34(%rbp),%eax
mov    %eax,-0x48(%rbp)
sub    $0x1,%eax
je     12ec <BSIM4RdsEndIso+0x1dc>
jmp    1297 <BSIM4RdsEndIso+0x187>
mov    -0x48(%rbp),%eax
sub    $0x2,%eax
je     1339 <BSIM4RdsEndIso+0x229>
jmp    12a8 <BSIM4RdsEndIso+0x198>
mov    -0x48(%rbp),%eax
sub    $0x3,%eax
je     12ec <BSIM4RdsEndIso+0x1dc>
jmp    12b9 <BSIM4RdsEndIso+0x1a9>
mov    -0x48(%rbp),%eax
sub    $0x4,%eax
je     1339 <BSIM4RdsEndIso+0x229>
jmp    12ca <BSIM4RdsEndIso+0x1ba>
mov    -0x48(%rbp),%eax
sub    $0x7,%eax
je     12ec <BSIM4RdsEndIso+0x1dc>
jmp    12db <BSIM4RdsEndIso+0x1cb>
mov    -0x48(%rbp),%eax
sub    $0x8,%eax
je     1339 <BSIM4RdsEndIso+0x229>
jmp    13c2 <BSIM4RdsEndIso+0x2b2>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1314 <BSIM4RdsEndIso+0x204>
jp     1314 <BSIM4RdsEndIso+0x204>
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1334 <BSIM4RdsEndIso+0x224>
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    13d3 <BSIM4RdsEndIso+0x2c3>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1364 <BSIM4RdsEndIso+0x254>
jp     1364 <BSIM4RdsEndIso+0x254>
lea    0xcab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    138c <BSIM4RdsEndIso+0x27c>
jp     138c <BSIM4RdsEndIso+0x27c>
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    13bd <BSIM4RdsEndIso+0x2ad>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xc62(%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    13d3 <BSIM4RdsEndIso+0x2c3>
mov    -0x34(%rbp),%esi
lea    0xc64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13d8 <BSIM4RdsEndIso+0x2c8>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSIM4RdsEndIso>:
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%rbx
mov    %edi,%eax
cmp    $0x1,%esi
jne    1155 <BSIM4RdsEndIso+0x35>
cmp    $0x6,%eax
ja     120d <BSIM4RdsEndIso+0xed>
mov    $0x26,%ecx
bt     %eax,%ecx
jb     11e6 <BSIM4RdsEndIso+0xc6>
mov    $0x58,%ecx
bt     %eax,%ecx
jb     1176 <BSIM4RdsEndIso+0x56>
jmp    120d <BSIM4RdsEndIso+0xed>
cmp    $0x8,%eax
ja     120d <BSIM4RdsEndIso+0xed>
mov    $0x8a,%ecx
bt     %eax,%ecx
jb     11e6 <BSIM4RdsEndIso+0xc6>
mov    $0x114,%ecx
bt     %eax,%ecx
jae    120d <BSIM4RdsEndIso+0xed>
addsd  %xmm3,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jne    11c4 <BSIM4RdsEndIso+0xa4>
jp     11c4 <BSIM4RdsEndIso+0xa4>
lea    0xea5(%rip),%rdi
movsd  %xmm0,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm5,0x8(%rsp)
movsd  %xmm2,(%rsp)
call   1030 <puts@plt>
xorpd  %xmm3,%xmm3
movsd  (%rsp),%xmm2
movsd  0x8(%rsp),%xmm5
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm0
ucomisd %xmm3,%xmm5
jne    11cc <BSIM4RdsEndIso+0xac>
jnp    11f2 <BSIM4RdsEndIso+0xd2>
mulsd  0xe2c(%rip),%xmm5
mulsd  %xmm1,%xmm0
mulsd  %xmm5,%xmm2
divsd  %xmm2,%xmm0
movsd  %xmm0,(%rbx)
jmp    121d <BSIM4RdsEndIso+0xfd>
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm5
jne    11fb <BSIM4RdsEndIso+0xdb>
jp     11fb <BSIM4RdsEndIso+0xdb>
movq   $0x0,(%rbx)
jmp    121d <BSIM4RdsEndIso+0xfd>
mulsd  %xmm2,%xmm1
mulsd  %xmm5,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
jmp    121d <BSIM4RdsEndIso+0xfd>
lea    0xdf4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
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 %67
21: ; preds = %9
%22 = load i32, i32* %16
switch i32 %22, label %63 [
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 %66
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 %48, label %50
48: ; preds = %45
%49 = load double*, double** %18
store double 0.000000e+00, double* %49
br label %62
50: ; preds = %45
%51 = load double, double* %11
%52 = load double, double* %10
%53 = fmul double %51, %52
%54 = load double, double* %15
%55 = fmul double 3.000000e+00, %54
%56 = load double, double* %12
%57 = load double, double* %13
%58 = fadd double %56, %57
%59 = fmul double %55, %58
%60 = fdiv double %53, %59
%61 = load double*, double** %18
store double %60, double* %61
br label %62
62: ; preds = %50, %48
br label %66
63: ; preds = %21
%64 = load i32, i32* %16
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %64)
br label %66
66: ; preds = %63, %62, %37
br label %113
67: ; preds = %9
%68 = load i32, i32* %16
switch i32 %68, label %109 [
i32 1, label %69
i32 3, label %69
i32 7, label %69
i32 2, label %84
i32 4, label %84
i32 8, label %84
]
69: ; preds = %67, %67, %67
%70 = load double, double* %15
%71 = fcmp oeq double %70, 0.000000e+00
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = load double*, double** %18
store double 0.000000e+00, double* %73
br label %83
74: ; preds = %69
%75 = load double, double* %11
%76 = load double, double* %12
%77 = fmul double %75, %76
%78 = load double, double* %10
%79 = load double, double* %15
%80 = fmul double %78, %79
%81 = fdiv double %77, %80
%82 = load double*, double** %18
store double %81, double* %82
br label %83
83: ; preds = %74, %72
br label %112
84: ; preds = %67, %67, %67
%85 = load double, double* %12
%86 = load double, double* %13
%87 = fadd double %85, %86
%88 = fcmp oeq double %87, 0.000000e+00
br i1 %88, label %89, label %91
89: ; preds = %84
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %91
91: ; preds = %89, %84
%92 = load double, double* %15
%93 = fcmp oeq double %92, 0.000000e+00
br i1 %93, label %94, label %96
94: ; preds = %91
%95 = load double*, double** %18
store double 0.000000e+00, double* %95
br label %108
96: ; preds = %91
%97 = load double, double* %11
%98 = load double, double* %10
%99 = fmul double %97, %98
%100 = load double, double* %15
%101 = fmul double 3.000000e+00, %100
%102 = load double, double* %12
%103 = load double, double* %13
%104 = fadd double %102, %103
%105 = fmul double %101, %104
%106 = fdiv double %99, %105
%107 = load double*, double** %18
store double %106, double* %107
br label %108
108: ; preds = %96, %94
br label %112
109: ; preds = %67
%110 = load i32, i32* %16
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %110)
br label %112
112: ; preds = %109, %108, %83
br label %113
113: ; preds = %112, %66
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 %24
24: ; preds = %22, %19
%25 = fcmp oeq double %5, 0.000000e+00
br i1 %25, label %26, label %27
26: ; preds = %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 %47
47: ; preds = %45, %42
%48 = fcmp oeq double %5, 0.000000e+00
br i1 %48, label %49, label %50
49: ; preds = %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
}