float date_decode_(char *strdate) {
  int id, im, iy, ok;
  char str3[4], str1[2];
  char months[13][4] = {"jan", "feb", "mar", "apr", "may", "jun",
                        "jul", "aug", "sep", "oct", "nov", "dec"};
  double days_1900 = 59958230400.0 / (60. * 60. * 24.);
  if (sscanf(strdate, "%d/%d/%d%1s", &im, &id, &iy, str1) == 3) {
    ok = 1;
  } else if (sscanf(strdate, "%d-%d-%d%1s", &iy, &im, &id, str1) == 3) {
    ok = 1;
  } else if (sscanf(strdate, "%d-%3s-%d%1s", &id, str3, &iy, str1) == 3) {
    if (iy < 30)
      iy += 2000;
    else if (iy < 100)
      iy += 1900;
    ok = 0;
    for (im = 0; im < 12; im++) {
      if (strcasecmp(str3, months[im]) == 0) {
        im++;
        ok = 1;
        break;
      }
    }
  } else {
    ok = 0;
  }
  if (ok)
    return days_from_day0_(&days_1900, &iy, &im, &id);
  else
    return -1.e34;
}


x86 assembly (clang, -O0):
<date_decode_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x34,%edx
call   1040 <memcpy@plt>
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x26(%rbp),%r9
lea    0xec7(%rip),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x1c(%rbp),%r8
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x3,%eax
jne    11a5 <date_decode_+0x65>
movl   $0x1,-0x20(%rbp)
jmp    12b2 <date_decode_+0x172>
mov    -0x10(%rbp),%rdi
lea    -0x26(%rbp),%r9
lea    0xe9c(%rip),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x14(%rbp),%r8
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x3,%eax
jne    11dc <date_decode_+0x9c>
movl   $0x1,-0x20(%rbp)
jmp    12ad <date_decode_+0x16d>
mov    -0x10(%rbp),%rdi
lea    -0x24(%rbp),%rcx
lea    -0x26(%rbp),%r9
lea    0xe6d(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x1c(%rbp),%r8
mov    $0x0,%al
call   1060 <sscanf@plt>
cmp    $0x3,%eax
jne    12a1 <date_decode_+0x161>
cmpl   $0x1e,-0x1c(%rbp)
jge    1221 <date_decode_+0xe1>
mov    -0x1c(%rbp),%eax
add    $0x7d0,%eax
mov    %eax,-0x1c(%rbp)
jmp    123b <date_decode_+0xfb>
cmpl   $0x64,-0x1c(%rbp)
jge    1236 <date_decode_+0xf6>
mov    -0x1c(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x1c(%rbp)
jmp    123b <date_decode_+0xfb>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xc,-0x18(%rbp)
jge    129c <date_decode_+0x15c>
lea    -0x24(%rbp),%rdi
movslq -0x18(%rbp),%rax
lea    -0x60(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1289 <date_decode_+0x149>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
jmp    129c <date_decode_+0x15c>
jmp    128e <date_decode_+0x14e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1249 <date_decode_+0x109>
jmp    12a8 <date_decode_+0x168>
movl   $0x0,-0x20(%rbp)
jmp    12ad <date_decode_+0x16d>
jmp    12b2 <date_decode_+0x172>
cmpl   $0x0,-0x20(%rbp)
je     12e1 <date_decode_+0x1a1>
lea    -0x68(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x14(%rbp),%rcx
mov    $0x0,%al
call   1050 <days_from_day0_@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    12ee <date_decode_+0x1ae>
movss  0xd1f(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_decode_>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
movabs $0x41252d9200000000,%rax
2d 25 41
mov    %rax,0x18(%rsp)
lea    0xef6(%rip),%rsi
lea    0x4(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0x12(%rsp),%r9
xor    %eax,%eax
call   1050 <sscanf@plt>
cmp    $0x3,%eax
je     13d6 <date_decode_+0x2a6>
lea    0xed7(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x4(%rsp),%rcx
lea    0x14(%rsp),%r8
lea    0x12(%rsp),%r9
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <sscanf@plt>
cmp    $0x3,%eax
je     13d6 <date_decode_+0x2a6>
lea    0xeb5(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0x12(%rsp),%r9
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <sscanf@plt>
movss  0xe33(%rip),%xmm0
cmp    $0x3,%eax
jne    13f8 <date_decode_+0x2c8>
mov    0xc(%rsp),%eax
cmp    $0x1d,%eax
jg     11e6 <date_decode_+0xb6>
add    $0x7d0,%eax
jmp    11f0 <date_decode_+0xc0>
cmp    $0x63,%eax
ja     11f4 <date_decode_+0xc4>
add    $0x76c,%eax
mov    %eax,0xc(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xe0d(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1387 <date_decode_+0x257>
movl   $0x1,0x4(%rsp)
lea    0xdf0(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     138e <date_decode_+0x25e>
movl   $0x2,0x4(%rsp)
lea    0xdd3(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1395 <date_decode_+0x265>
movl   $0x3,0x4(%rsp)
lea    0xdb6(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     139c <date_decode_+0x26c>
movl   $0x4,0x4(%rsp)
lea    0xd99(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     13a3 <date_decode_+0x273>
movl   $0x5,0x4(%rsp)
lea    0xd7c(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     13aa <date_decode_+0x27a>
movl   $0x6,0x4(%rsp)
lea    0xd5f(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     13b1 <date_decode_+0x281>
movl   $0x7,0x4(%rsp)
lea    0xd42(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     13b8 <date_decode_+0x288>
movl   $0x8,0x4(%rsp)
lea    0xd25(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     13bf <date_decode_+0x28f>
movl   $0x9,0x4(%rsp)
lea    0xd08(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     13c6 <date_decode_+0x296>
movl   $0xa,0x4(%rsp)
lea    0xceb(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     13cd <date_decode_+0x29d>
movl   $0xb,0x4(%rsp)
lea    0xcd2(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
movss  0xc82(%rip),%xmm0
jne    13f8 <date_decode_+0x2c8>
mov    $0xc,%eax
jmp    13d2 <date_decode_+0x2a2>
mov    $0x1,%eax
jmp    13d2 <date_decode_+0x2a2>
mov    $0x2,%eax
jmp    13d2 <date_decode_+0x2a2>
mov    $0x3,%eax
jmp    13d2 <date_decode_+0x2a2>
mov    $0x4,%eax
jmp    13d2 <date_decode_+0x2a2>
mov    $0x5,%eax
jmp    13d2 <date_decode_+0x2a2>
mov    $0x6,%eax
jmp    13d2 <date_decode_+0x2a2>
mov    $0x7,%eax
jmp    13d2 <date_decode_+0x2a2>
mov    $0x8,%eax
jmp    13d2 <date_decode_+0x2a2>
mov    $0x9,%eax
jmp    13d2 <date_decode_+0x2a2>
mov    $0xa,%eax
jmp    13d2 <date_decode_+0x2a2>
mov    $0xb,%eax
mov    %eax,0x4(%rsp)
lea    0x18(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0x14(%rsp),%rcx
xor    %eax,%eax
call   1040 <days_from_day0_@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.date_decode_.months = [13 x [4 x i8]] [[4 x i8] c"jan\00", [4 x i8] c"feb\00", [4 x i8] c"mar\00", [4 x i8] c"apr\00", [4 x i8] c"may\00", [4 x i8] c"jun\00", [4 x i8] c"jul\00", [4 x i8] c"aug\00", [4 x i8] c"sep\00", [4 x i8] c"oct\00", [4 x i8] c"nov\00", [4 x i8] c"dec\00", [4 x i8] zeroinitializer]
@.str = [12 x i8] c"%d/%d/%d%1s\00"
@.str.1 = [12 x i8] c"%d-%d-%d%1s\00"
@.str.2 = [13 x i8] c"%d-%3s-%d%1s\00"
define float @date_decode_(i8* %0) {
%2 = alloca float
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [4 x i8]
%9 = alloca [2 x i8]
%10 = alloca [13 x [4 x i8]]
%11 = alloca double
store i8* %0, i8** %3
%12 = bitcast [13 x [4 x i8]]* %10 to i8*
store double 6.939610e+05, double* %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%15 = call i32 (i8*, i8*, ...) @sscanf(i8* %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %4, i32* %6, i8* %14)
%16 = icmp eq i32 %15, 3
br i1 %16, label %17, label %18
17: ; preds = %1
store i32 1, i32* %7
br label %66
18: ; preds = %1
%19 = load i8*, i8** %3
%20 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%21 = call i32 (i8*, i8*, ...) @sscanf(i8* %19, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %5, i32* %4, i8* %20)
%22 = icmp eq i32 %21, 3
br i1 %22, label %23, label %24
23: ; preds = %18
store i32 1, i32* %7
br label %65
24: ; preds = %18
%25 = load i8*, i8** %3
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%27 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%28 = call i32 (i8*, i8*, ...) @sscanf(i8* %25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %4, i8* %26, i32* %6, i8* %27)
%29 = icmp eq i32 %28, 3
br i1 %29, label %30, label %63
30: ; preds = %24
%31 = load i32, i32* %6
%32 = icmp slt i32 %31, 30
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 2000
store i32 %35, i32* %6
br label %43
36: ; preds = %30
%37 = load i32, i32* %6
%38 = icmp slt i32 %37, 100
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1900
store i32 %41, i32* %6
br label %42
42: ; preds = %39, %36
br label %43
43: ; preds = %42, %33
store i32 0, i32* %7
store i32 0, i32* %5
br label %44
44: ; preds = %59, %43
%45 = load i32, i32* %5
%46 = icmp slt i32 %45, 12
br i1 %46, label %47, label %62
47: ; preds = %44
%48 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%49 = load i32, i32* %5
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [13 x [4 x i8]], [13 x [4 x i8]]* %10, i64 0, i64 %50
%52 = getelementptr inbounds [4 x i8], [4 x i8]* %51, i64 0, i64 0
%53 = call i32 @strcasecmp(i8* %48, i8* %52)
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %47
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
store i32 1, i32* %7
br label %62
58: ; preds = %47
br label %59
59: ; preds = %58
%60 = load i32, i32* %5
%61 = add nsw i32 %60, 1
store i32 %61, i32* %5
br label %44
62: ; preds = %55, %44
br label %64
63: ; preds = %24
store i32 0, i32* %7
br label %64
64: ; preds = %63, %62
br label %65
65: ; preds = %64, %23
br label %66
66: ; preds = %65, %17
%67 = load i32, i32* %7
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %72
69: ; preds = %66
%70 = call i32 (double*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @days_from_day0_ to i32 (double*, i32*, i32*, i32*, ...)*)(double* %11, i32* %6, i32* %5, i32* %4)
%71 = sitofp i32 %70 to float
store float %71, float* %2
br label %73
72: ; preds = %66
store float 0xC6FED09BE0000000, float* %2
br label %73
73: ; preds = %72, %69
%74 = load float, float* %2
ret float %74
}

LLVM IR (-O2):
@__const.date_decode_.months = [13 x [4 x i8]] [[4 x i8] c"jan\00", [4 x i8] c"feb\00", [4 x i8] c"mar\00", [4 x i8] c"apr\00", [4 x i8] c"may\00", [4 x i8] c"jun\00", [4 x i8] c"jul\00", [4 x i8] c"aug\00", [4 x i8] c"sep\00", [4 x i8] c"oct\00", [4 x i8] c"nov\00", [4 x i8] c"dec\00", [4 x i8] zeroinitializer]
@.str = [12 x i8] c"%d/%d/%d%1s\00"
@.str.1 = [12 x i8] c"%d-%d-%d%1s\00"
@.str.2 = [13 x i8] c"%d-%3s-%d%1s\00"
define float @date_decode_(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i8]
%6 = alloca [2 x i8]
%7 = alloca double
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%13 = bitcast double* %7 to i8*
store double 6.939610e+05, double* %7
%14 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %2, i32* %4, i8* %12)
%15 = icmp eq i32 %14, 3
br i1 %15, label %69, label %16
16: ; preds = %1
%17 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %3, i32* %2, i8* %12)
%18 = icmp eq i32 %17, 3
br i1 %18, label %69, label %19
19: ; preds = %16
%20 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %2, i8* %11, i32* %4, i8* %12)
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %72
22: ; preds = %19
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 30
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = add nsw i32 %23, 2000
store i32 %26, i32* %4
br label %31
27: ; preds = %22
%28 = icmp ult i32 %23, 100
br i1 %28, label %29, label %31
29: ; preds = %27
%30 = add nuw nsw i32 %23, 1900
store i32 %30, i32* %4
br label %31
31: ; preds = %27, %29, %25
store i32 0, i32* %3
%32 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 0, i64 0))
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %66, %63, %60, %57, %54, %51, %48, %45, %42, %39, %36, %31
%35 = phi i32 [ 1, %31 ], [ 2, %36 ], [ 3, %39 ], [ 4, %42 ], [ 5, %45 ], [ 6, %48 ], [ 7, %51 ], [ 8, %54 ], [ 9, %57 ], [ 10, %60 ], [ 11, %63 ], [ 12, %66 ]
store i32 %35, i32* %3
br label %69
36: ; preds = %31
store i32 1, i32* %3
%37 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 1, i64 0))
%38 = icmp eq i32 %37, 0
br i1 %38, label %34, label %39
39: ; preds = %36
store i32 2, i32* %3
%40 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 2, i64 0))
%41 = icmp eq i32 %40, 0
br i1 %41, label %34, label %42
42: ; preds = %39
store i32 3, i32* %3
%43 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 3, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %34, label %45
45: ; preds = %42
store i32 4, i32* %3
%46 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 4, i64 0))
%47 = icmp eq i32 %46, 0
br i1 %47, label %34, label %48
48: ; preds = %45
store i32 5, i32* %3
%49 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 5, i64 0))
%50 = icmp eq i32 %49, 0
br i1 %50, label %34, label %51
51: ; preds = %48
store i32 6, i32* %3
%52 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 6, i64 0))
%53 = icmp eq i32 %52, 0
br i1 %53, label %34, label %54
54: ; preds = %51
store i32 7, i32* %3
%55 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 7, i64 0))
%56 = icmp eq i32 %55, 0
br i1 %56, label %34, label %57
57: ; preds = %54
store i32 8, i32* %3
%58 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 8, i64 0))
%59 = icmp eq i32 %58, 0
br i1 %59, label %34, label %60
60: ; preds = %57
store i32 9, i32* %3
%61 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 9, i64 0))
%62 = icmp eq i32 %61, 0
br i1 %62, label %34, label %63
63: ; preds = %60
store i32 10, i32* %3
%64 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 10, i64 0))
%65 = icmp eq i32 %64, 0
br i1 %65, label %34, label %66
66: ; preds = %63
store i32 11, i32* %3
%67 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([13 x [4 x i8]], [13 x [4 x i8]]* @__const.date_decode_.months, i64 0, i64 11, i64 0))
%68 = icmp eq i32 %67, 0
br i1 %68, label %34, label %72
69: ; preds = %16, %1, %34
%70 = call i32 (double*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @days_from_day0_ to i32 (double*, i32*, i32*, i32*, ...)*)(double* %7, i32* %4, i32* %3, i32* %2)
%71 = sitofp i32 %70 to float
br label %72
72: ; preds = %66, %19, %69
%73 = phi float [ %71, %69 ], [ 0xC6FED09BE0000000, %19 ], [ 0xC6FED09BE0000000, %66 ]
ret float %73
}