int find_num_strobogrammatic_numbers_of_size_n(int n) {
  int total, index;
  if (n <= 0) {
    return (0);
  }
  if ((n % 2) == 1) {
    if (n == 1) {
      return (3);
    }
    total = 1;
    for (index = 0; index <= (n / 2); ++index) {
      if (index == 0) {
        total *= 4;
      } else if (total == (n / 2)) {
        total *= 3;
      } else {
        total *= 5;
      }
    }
  } else {
    for (index = 0; index < (n / 2); ++index) {
      if (index == 0) {
        total *= 4;
      } else {
        total *= 5;
      }
    }
  }
  return (total);
}


x86 assembly (clang, -O0):
<find_num_strobogrammatic_numbers_of_size_n>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <find_num_strobogrammatic_numbers_of_size_n+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    123b <find_num_strobogrammatic_numbers_of_size_n+0x13b>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11d9 <find_num_strobogrammatic_numbers_of_size_n+0xd9>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <find_num_strobogrammatic_numbers_of_size_n+0x47>
movl   $0x3,-0x4(%rbp)
jmp    123b <find_num_strobogrammatic_numbers_of_size_n+0x13b>
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jg     11d4 <find_num_strobogrammatic_numbers_of_size_n+0xd4>
cmpl   $0x0,-0x10(%rbp)
jne    118b <find_num_strobogrammatic_numbers_of_size_n+0x8b>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    11c1 <find_num_strobogrammatic_numbers_of_size_n+0xc1>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jne    11b5 <find_num_strobogrammatic_numbers_of_size_n+0xb5>
imul   $0x3,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11bc <find_num_strobogrammatic_numbers_of_size_n+0xbc>
imul   $0x5,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11c1 <find_num_strobogrammatic_numbers_of_size_n+0xc1>
jmp    11c6 <find_num_strobogrammatic_numbers_of_size_n+0xc6>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <find_num_strobogrammatic_numbers_of_size_n+0x55>
jmp    1235 <find_num_strobogrammatic_numbers_of_size_n+0x135>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    1230 <find_num_strobogrammatic_numbers_of_size_n+0x130>
cmpl   $0x0,-0x10(%rbp)
jne    1216 <find_num_strobogrammatic_numbers_of_size_n+0x116>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    121d <find_num_strobogrammatic_numbers_of_size_n+0x11d>
imul   $0x5,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1222 <find_num_strobogrammatic_numbers_of_size_n+0x122>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e0 <find_num_strobogrammatic_numbers_of_size_n+0xe0>
jmp    1235 <find_num_strobogrammatic_numbers_of_size_n+0x135>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_num_strobogrammatic_numbers_of_size_n>:
test   %edi,%edi
jle    1126 <find_num_strobogrammatic_numbers_of_size_n+0x26>
test   $0x1,%dil
jne    1129 <find_num_strobogrammatic_numbers_of_size_n+0x29>
cmp    $0x2,%edi
jb     11c6 <find_num_strobogrammatic_numbers_of_size_n+0xc6>
shr    %edi
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x3,%ecx
cmp    $0x3,%eax
jae    1170 <find_num_strobogrammatic_numbers_of_size_n+0x70>
xor    %edx,%edx
jmp    1199 <find_num_strobogrammatic_numbers_of_size_n+0x99>
xor    %eax,%eax
ret
mov    $0x3,%eax
cmp    $0x1,%edi
je     11c6 <find_num_strobogrammatic_numbers_of_size_n+0xc6>
shr    %edi
lea    (%rdi,%rdi,2),%r8d
lea    -0x1(%rdi),%eax
mov    %edi,%edx
and    $0x3,%edx
cmp    $0x3,%eax
jae    11c7 <find_num_strobogrammatic_numbers_of_size_n+0xc7>
mov    $0x4,%eax
test   %edx,%edx
je     11c6 <find_num_strobogrammatic_numbers_of_size_n+0xc6>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %edi,%eax
lea    (%rax,%rax,4),%eax
cmove  %r8d,%eax
add    $0xffffffff,%edx
jne    1160 <find_num_strobogrammatic_numbers_of_size_n+0x60>
jmp    11c6 <find_num_strobogrammatic_numbers_of_size_n+0xc6>
and    $0xfffffffc,%edi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x0(,%rax,4),%esi
test   %edx,%edx
lea    (%rax,%rax,4),%eax
cmove  %esi,%eax
imul   $0x7d,%eax,%eax
add    $0x4,%edx
cmp    %edx,%edi
jne    1180 <find_num_strobogrammatic_numbers_of_size_n+0x80>
test   %ecx,%ecx
je     11c6 <find_num_strobogrammatic_numbers_of_size_n+0xc6>
neg    %ecx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x0(,%rax,4),%edi
cmp    %esi,%edx
lea    (%rax,%rax,4),%eax
cmove  %edi,%eax
add    $0xffffffff,%esi
cmp    %esi,%ecx
jne    11b0 <find_num_strobogrammatic_numbers_of_size_n+0xb0>
ret
mov    %edi,%esi
and    $0xfffffffc,%esi
mov    $0x4,%eax
jmp    11e9 <find_num_strobogrammatic_numbers_of_size_n+0xe9>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xfffffffc,%esi
je     114f <find_num_strobogrammatic_numbers_of_size_n+0x4f>
cmp    %edi,%eax
lea    (%rax,%rax,4),%ecx
cmove  %r8d,%ecx
mov    %r8d,%eax
cmp    %edi,%ecx
je     11fc <find_num_strobogrammatic_numbers_of_size_n+0xfc>
lea    (%rcx,%rcx,4),%eax
mov    %r8d,%ecx
cmp    %edi,%eax
je     1206 <find_num_strobogrammatic_numbers_of_size_n+0x106>
lea    (%rax,%rax,4),%ecx
mov    %r8d,%eax
cmp    %edi,%ecx
je     11e0 <find_num_strobogrammatic_numbers_of_size_n+0xe0>
lea    (%rcx,%rcx,4),%eax
jmp    11e0 <find_num_strobogrammatic_numbers_of_size_n+0xe0>

LLVM IR (-O0):
define i32 @find_num_strobogrammatic_numbers_of_size_n(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %68
9: ; preds = %1
%10 = load i32, i32* %3
%11 = srem i32 %10, 2
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %46
13: ; preds = %9
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 3, i32* %2
br label %68
17: ; preds = %13
store i32 1, i32* %4
store i32 0, i32* %5
br label %18
18: ; preds = %42, %17
%19 = load i32, i32* %5
%20 = load i32, i32* %3
%21 = sdiv i32 %20, 2
%22 = icmp sle i32 %19, %21
br i1 %22, label %23, label %45
23: ; preds = %18
%24 = load i32, i32* %5
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* %4
%28 = mul nsw i32 %27, 4
store i32 %28, i32* %4
br label %41
29: ; preds = %23
%30 = load i32, i32* %4
%31 = load i32, i32* %3
%32 = sdiv i32 %31, 2
%33 = icmp eq i32 %30, %32
br i1 %33, label %34, label %37
34: ; preds = %29
%35 = load i32, i32* %4
%36 = mul nsw i32 %35, 3
store i32 %36, i32* %4
br label %40
37: ; preds = %29
%38 = load i32, i32* %4
%39 = mul nsw i32 %38, 5
store i32 %39, i32* %4
br label %40
40: ; preds = %37, %34
br label %41
41: ; preds = %40, %26
br label %42
42: ; preds = %41
%43 = load i32, i32* %5
%44 = add nsw i32 %43, 1
store i32 %44, i32* %5
br label %18
45: ; preds = %18
br label %66
46: ; preds = %9
store i32 0, i32* %5
br label %47
47: ; preds = %62, %46
%48 = load i32, i32* %5
%49 = load i32, i32* %3
%50 = sdiv i32 %49, 2
%51 = icmp slt i32 %48, %50
br i1 %51, label %52, label %65
52: ; preds = %47
%53 = load i32, i32* %5
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = load i32, i32* %4
%57 = mul nsw i32 %56, 4
store i32 %57, i32* %4
br label %61
58: ; preds = %52
%59 = load i32, i32* %4
%60 = mul nsw i32 %59, 5
store i32 %60, i32* %4
br label %61
61: ; preds = %58, %55
br label %62
62: ; preds = %61
%63 = load i32, i32* %5
%64 = add nsw i32 %63, 1
store i32 %64, i32* %5
br label %47
65: ; preds = %47
br label %66
66: ; preds = %65, %45
%67 = load i32, i32* %4
store i32 %67, i32* %2
br label %68
68: ; preds = %66, %16, %8
%69 = load i32, i32* %2
ret i32 %69
}

LLVM IR (-O2):
define i32 @find_num_strobogrammatic_numbers_of_size_n(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %81, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = lshr i32 %0, 1
%8 = icmp ugt i32 %0, 1
br i1 %8, label %9, label %81
9: ; preds = %6
%10 = add nsw i32 %7, -1
%11 = and i32 %7, 3
%12 = icmp ult i32 %10, 3
br i1 %12, label %54, label %13
13: ; preds = %9
%14 = and i32 %7, 2147483644
br label %42
15: ; preds = %3
%16 = icmp eq i32 %0, 1
br i1 %16, label %81, label %17
17: ; preds = %15
%18 = lshr i32 %0, 1
%19 = mul nsw i32 %18, 3
%20 = add nsw i32 %18, -1
%21 = and i32 %18, 3
%22 = icmp ult i32 %20, 3
br i1 %22, label %69, label %23
23: ; preds = %17
%24 = and i32 %18, 2147483644
br label %25
25: ; preds = %25, %23
%26 = phi i32 [ 4, %23 ], [ %39, %25 ]
%27 = phi i32 [ 0, %23 ], [ %40, %25 ]
%28 = icmp eq i32 %26, %18
%29 = mul nsw i32 %26, 5
%30 = select i1 %28, i32 %19, i32 %29
%31 = icmp eq i32 %30, %18
%32 = mul nsw i32 %30, 5
%33 = select i1 %31, i32 %19, i32 %32
%34 = icmp eq i32 %33, %18
%35 = mul nsw i32 %33, 5
%36 = select i1 %34, i32 %19, i32 %35
%37 = icmp eq i32 %36, %18
%38 = mul nsw i32 %36, 5
%39 = select i1 %37, i32 %19, i32 %38
%40 = add i32 %27, 4
%41 = icmp eq i32 %40, %24
br i1 %41, label %69, label %25
42: ; preds = %42, %13
%43 = phi i32 [ 0, %13 ], [ %51, %42 ]
%44 = phi i32 [ undef, %13 ], [ %50, %42 ]
%45 = phi i32 [ 0, %13 ], [ %52, %42 ]
%46 = icmp eq i32 %43, 0
%47 = shl nsw i32 %44, 2
%48 = mul nsw i32 %44, 5
%49 = select i1 %46, i32 %47, i32 %48
%50 = mul i32 %49, 125
%51 = add nuw nsw i32 %43, 4
%52 = add i32 %45, 4
%53 = icmp eq i32 %52, %14
br i1 %53, label %54, label %42
54: ; preds = %42, %9
%55 = phi i32 [ 0, %9 ], [ %51, %42 ]
%56 = phi i32 [ undef, %9 ], [ %50, %42 ]
%57 = icmp eq i32 %11, 0
br i1 %57, label %81, label %58
58: ; preds = %54, %58
%59 = phi i32 [ %66, %58 ], [ %55, %54 ]
%60 = phi i32 [ %65, %58 ], [ %56, %54 ]
%61 = phi i32 [ %67, %58 ], [ 0, %54 ]
%62 = icmp eq i32 %59, 0
%63 = shl nsw i32 %60, 2
%64 = mul nsw i32 %60, 5
%65 = select i1 %62, i32 %63, i32 %64
%66 = add nuw nsw i32 %59, 1
%67 = add i32 %61, 1
%68 = icmp eq i32 %67, %11
br i1 %68, label %81, label %58
69: ; preds = %25, %17
%70 = phi i32 [ undef, %17 ], [ %39, %25 ]
%71 = phi i32 [ 4, %17 ], [ %39, %25 ]
%72 = icmp eq i32 %21, 0
br i1 %72, label %81, label %73
73: ; preds = %69, %73
%74 = phi i32 [ %78, %73 ], [ %71, %69 ]
%75 = phi i32 [ %79, %73 ], [ 0, %69 ]
%76 = icmp eq i32 %74, %18
%77 = mul nsw i32 %74, 5
%78 = select i1 %76, i32 %19, i32 %77
%79 = add i32 %75, 1
%80 = icmp eq i32 %79, %21
br i1 %80, label %81, label %73
81: ; preds = %69, %73, %54, %58, %6, %15, %1
%82 = phi i32 [ 0, %1 ], [ 3, %15 ], [ undef, %6 ], [ %56, %54 ], [ %65, %58 ], [ %70, %69 ], [ %78, %73 ]
ret i32 %82
}