#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
double wcsceq(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    1183 <wcsceq+0x63>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    12a8 <wcsceq+0x188>
mov    -0x10(%rbp),%rdi
lea    0xe82(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     11bf <wcsceq+0x9f>
mov    -0x10(%rbp),%rdi
lea    0xe68(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11d1 <wcsceq+0xb1>
movsd  0xe39(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12a8 <wcsceq+0x188>
mov    -0x10(%rbp),%rdi
lea    0xe3c(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     120d <wcsceq+0xed>
mov    -0x10(%rbp),%rdi
lea    0xe22(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    121f <wcsceq+0xff>
movsd  0xdf3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12a8 <wcsceq+0x188>
mov    -0x10(%rbp),%rdi
lea    0xdf6(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     125b <wcsceq+0x13b>
mov    -0x10(%rbp),%rdi
lea    0xddd(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    126d <wcsceq+0x14d>
movsd  0xda5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12a8 <wcsceq+0x188>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
je     128d <wcsceq+0x16d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x32,%eax
jne    12a0 <wcsceq+0x180>
mov    -0x10(%rbp),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    12a8 <wcsceq+0x188>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsceq>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
add    $0xbe,%al
rol    $0x5,%al
cmp    $0x5,%al
ja     1149 <wcsceq+0x29>
movzbl %al,%eax
mov    $0x33,%ecx
bt     %eax,%ecx
jae    1149 <wcsceq+0x29>
add    $0x1,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <atof@plt>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
movsd  0xe9b(%rip),%xmm0
test   %eax,%eax
je     120c <wcsceq+0xec>
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
movsd  0xe77(%rip),%xmm0
test   %eax,%eax
je     120c <wcsceq+0xec>
lea    0xe84(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
movsd  0xe5f(%rip),%xmm0
test   %eax,%eax
je     120c <wcsceq+0xec>
lea    0xe68(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     120e <wcsceq+0xee>
lea    0xe54(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     120e <wcsceq+0xee>
lea    0xe41(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
movsd  0xe0d(%rip),%xmm0
je     120c <wcsceq+0xec>
mov    (%rbx),%al
add    $0xcf,%al
xorps  %xmm0,%xmm0
cmp    $0x1,%al
jbe    1140 <wcsceq+0x20>
pop    %rbx
ret
movsd  0xdf2(%rip),%xmm0
pop    %rbx
ret

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 %31
27: ; preds = %21, %15, %9, %1
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 1
%30 = call double @atof(i8* %29)
store double %30, double* %2
br label %74
31: ; preds = %21
%32 = load i8*, i8** %3
%33 = call i32 @strncmp(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load i8*, i8** %3
%37 = call i32 @strncmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%38 = icmp ne i32 %37, 0
br i1 %38, label %40, label %39
39: ; preds = %35, %31
store double 1.950000e+03, double* %2
br label %74
40: ; preds = %35
%41 = load i8*, i8** %3
%42 = call i32 @strncmp(i8* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %40
%45 = load i8*, i8** %3
%46 = call i32 @strncmp(i8* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%47 = icmp ne i32 %46, 0
br i1 %47, label %49, label %48
48: ; preds = %44, %40
store double 2.000000e+03, double* %2
br label %74
49: ; preds = %44
%50 = load i8*, i8** %3
%51 = call i32 @strncmp(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = load i8*, i8** %3
%55 = call i32 @strncmp(i8* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%56 = icmp ne i32 %55, 0
br i1 %56, label %58, label %57
57: ; preds = %53, %49
store double 2.000000e+03, double* %2
br label %74
58: ; preds = %53
%59 = load i8*, i8** %3
%60 = getelementptr inbounds i8, i8* %59, i64 0
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 49
br i1 %63, label %70, label %64
64: ; preds = %58
%65 = load i8*, i8** %3
%66 = getelementptr inbounds i8, i8* %65, i64 0
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 50
br i1 %69, label %70, label %73
70: ; preds = %64, %58
%71 = load i8*, i8** %3
%72 = call double @atof(i8* %71)
store double %72, double* %2
br label %74
73: ; preds = %64
store double 0.000000e+00, double* %2
br label %74
74: ; preds = %73, %70, %57, %48, %39, %27
%75 = load double, double* %2
ret double %75
}

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 %29
7: ; preds = %1
%8 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 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* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 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* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 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* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 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* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 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* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%24 = icmp eq i32 %23, 0
br i1 %24, label %32, label %25
25: ; preds = %22
%26 = load i8, i8* %0
%27 = add i8 %26, -49
%28 = icmp ult i8 %27, 2
br i1 %28, label %29, label %32
29: ; preds = %25, %5
%30 = phi i8* [ %6, %5 ], [ %0, %25 ]
%31 = tail call double @atof(i8* %30)
br label %32
32: ; preds = %29, %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, %29 ]
ret double %33
}