double wcsceq(wcstring)
char *wcstring;
{
  if (wcstring[0] == 'J' || wcstring[0] == 'j' || wcstring[0] == 'B' ||
      wcstring[0] == 'b')
    return (atof(wcstring + 1));
  else if (!strncmp(wcstring, "FK4", 3) || !strncmp(wcstring, "fk4", 3))
    return (1950.0);
  else if (!strncmp(wcstring, "FK5", 3) || !strncmp(wcstring, "fk5", 3))
    return (2000.0);
  else if (!strncmp(wcstring, "ICRS", 4) || !strncmp(wcstring, "icrs", 4))
    return (2000.0);
  else if (wcstring[0] == '1' || wcstring[0] == '2')
    return (atof(wcstring));
  else
    return (0.0);
}


x86 assembly (clang, -O0):
<wcsceq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x4a,%eax
je     116c <wcsceq+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6a,%eax
je     116c <wcsceq+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x42,%eax
je     116c <wcsceq+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x62,%eax
jne    1189 <wcsceq+0x69>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1040 <atof@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12b4 <wcsceq+0x194>
mov    -0x10(%rbp),%rdi
lea    0xe7c(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     11c5 <wcsceq+0xa5>
mov    -0x10(%rbp),%rdi
lea    0xe62(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11d7 <wcsceq+0xb7>
movsd  0xe33(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12b4 <wcsceq+0x194>
mov    -0x10(%rbp),%rdi
lea    0xe36(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1213 <wcsceq+0xf3>
mov    -0x10(%rbp),%rdi
lea    0xe1c(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1225 <wcsceq+0x105>
movsd  0xded(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12b4 <wcsceq+0x194>
mov    -0x10(%rbp),%rdi
lea    0xdf0(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1261 <wcsceq+0x141>
mov    -0x10(%rbp),%rdi
lea    0xdd7(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1273 <wcsceq+0x153>
movsd  0xd9f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12b4 <wcsceq+0x194>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
je     1293 <wcsceq+0x173>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x32,%eax
jne    12ac <wcsceq+0x18c>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <atof@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12b4 <wcsceq+0x194>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsceq>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%r14b
lea    -0x42(%r14),%eax
rol    $0x5,%al
cmp    $0x5,%al
ja     115f <wcsceq+0x3f>
movzbl %al,%eax
mov    $0x33,%ecx
bt     %eax,%ecx
jae    115f <wcsceq+0x3f>
add    $0x1,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <atof@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xeaa(%rip),%rsi
mov    $0x3,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
movsd  0xe85(%rip),%xmm0
test   %eax,%eax
je     1157 <wcsceq+0x37>
lea    0xe8e(%rip),%rsi
mov    $0x3,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
movsd  0xe65(%rip),%xmm0
test   %eax,%eax
je     1157 <wcsceq+0x37>
lea    0xe72(%rip),%rsi
mov    $0x3,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
movsd  0xe4d(%rip),%xmm0
test   %eax,%eax
je     1157 <wcsceq+0x37>
lea    0xe56(%rip),%rsi
mov    $0x3,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
test   %eax,%eax
je     122a <wcsceq+0x10a>
lea    0xe42(%rip),%rsi
mov    $0x4,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
test   %eax,%eax
je     122a <wcsceq+0x10a>
lea    0xe2f(%rip),%rsi
mov    $0x4,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
test   %eax,%eax
movsd  0xdfb(%rip),%xmm0
je     1157 <wcsceq+0x37>
add    $0xcf,%r14b
xorpd  %xmm0,%xmm0
cmp    $0x1,%r14b
jbe    1146 <wcsceq+0x26>
jmp    1157 <wcsceq+0x37>
movsd  0xdd6(%rip),%xmm0
jmp    1157 <wcsceq+0x37>

LLVM IR (-O0):
@.str = [4 x i8] c"FK4\00"
@.str.1 = [4 x i8] c"fk4\00"
@.str.2 = [4 x i8] c"FK5\00"
@.str.3 = [4 x i8] c"fk5\00"
@.str.4 = [5 x i8] c"ICRS\00"
@.str.5 = [5 x i8] c"icrs\00"
define double @wcsceq(i8* %0) {
%2 = alloca double
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 74
br i1 %8, label %27, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 106
br i1 %14, label %27, label %15
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 66
br i1 %20, label %27, label %21
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 98
br i1 %26, label %27, label %32
27: ; preds = %21, %15, %9, %1
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 1
%30 = call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* %29)
%31 = sitofp i32 %30 to double
store double %31, double* %2
br label %76
32: ; preds = %21
%33 = load i8*, i8** %3
%34 = call i32 @strncmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3)
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %32
%37 = load i8*, i8** %3
%38 = call i32 @strncmp(i8* %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 3)
%39 = icmp ne i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %36, %32
store double 1.950000e+03, double* %2
br label %76
41: ; preds = %36
%42 = load i8*, i8** %3
%43 = call i32 @strncmp(i8* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 3)
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = load i8*, i8** %3
%47 = call i32 @strncmp(i8* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 3)
%48 = icmp ne i32 %47, 0
br i1 %48, label %50, label %49
49: ; preds = %45, %41
store double 2.000000e+03, double* %2
br label %76
50: ; preds = %45
%51 = load i8*, i8** %3
%52 = call i32 @strncmp(i8* %51, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 4)
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %50
%55 = load i8*, i8** %3
%56 = call i32 @strncmp(i8* %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64 4)
%57 = icmp ne i32 %56, 0
br i1 %57, label %59, label %58
58: ; preds = %54, %50
store double 2.000000e+03, double* %2
br label %76
59: ; preds = %54
%60 = load i8*, i8** %3
%61 = getelementptr inbounds i8, i8* %60, i64 0
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 49
br i1 %64, label %71, label %65
65: ; preds = %59
%66 = load i8*, i8** %3
%67 = getelementptr inbounds i8, i8* %66, i64 0
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 50
br i1 %70, label %71, label %75
71: ; preds = %65, %59
%72 = load i8*, i8** %3
%73 = call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* %72)
%74 = sitofp i32 %73 to double
store double %74, double* %2
br label %76
75: ; preds = %65
store double 0.000000e+00, double* %2
br label %76
76: ; preds = %75, %71, %58, %49, %40, %27
%77 = load double, double* %2
ret double %77
}

LLVM IR (-O2):
@.str = [4 x i8] c"FK4\00"
@.str.1 = [4 x i8] c"fk4\00"
@.str.2 = [4 x i8] c"FK5\00"
@.str.3 = [4 x i8] c"fk5\00"
@.str.4 = [5 x i8] c"ICRS\00"
@.str.5 = [5 x i8] c"icrs\00"
define double @wcsceq(i8* %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -66
%4 = tail call i8 @llvm.fshl.i8(i8 %3, i8 %3, i8 5)
switch i8 %4, label %7 [
i8 1, label %5
i8 5, label %5
i8 0, label %5
i8 4, label %5
]
5: ; preds = %1, %1, %1, %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
br label %28
7: ; preds = %1
%8 = tail call i32 @strncmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3)
%9 = icmp eq i32 %8, 0
br i1 %9, label %32, label %10
10: ; preds = %7
%11 = tail call i32 @strncmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 3)
%12 = icmp eq i32 %11, 0
br i1 %12, label %32, label %13
13: ; preds = %10
%14 = tail call i32 @strncmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 3)
%15 = icmp eq i32 %14, 0
br i1 %15, label %32, label %16
16: ; preds = %13
%17 = tail call i32 @strncmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 3)
%18 = icmp eq i32 %17, 0
br i1 %18, label %32, label %19
19: ; preds = %16
%20 = tail call i32 @strncmp(i8* %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 4)
%21 = icmp eq i32 %20, 0
br i1 %21, label %32, label %22
22: ; preds = %19
%23 = tail call i32 @strncmp(i8* %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64 4)
%24 = icmp eq i32 %23, 0
br i1 %24, label %32, label %25
25: ; preds = %22
%26 = add i8 %2, -49
%27 = icmp ult i8 %26, 2
br i1 %27, label %28, label %32
28: ; preds = %25, %5
%29 = phi i8* [ %6, %5 ], [ %0, %25 ]
%30 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* %29)
%31 = sitofp i32 %30 to double
br label %32
32: ; preds = %28, %25, %19, %22, %13, %16, %7, %10
%33 = phi double [ 1.950000e+03, %10 ], [ 1.950000e+03, %7 ], [ 2.000000e+03, %16 ], [ 2.000000e+03, %13 ], [ 2.000000e+03, %22 ], [ 2.000000e+03, %19 ], [ 0.000000e+00, %25 ], [ %31, %28 ]
ret double %33
}