#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 */
typedef int time_t;
struct tm {
  int tm_isdst;
};

/* Variables and functions */
scalar_t__ Decode_date_input_format(struct tm *, char *, int /*<<< orphan*/);
scalar_t__ Decode_date_output_format(struct tm *, char *, int /*<<< orphan*/);
int Decode_ecma119_format(struct tm *, char *, int /*<<< orphan*/);
scalar_t__ Decode_xorriso_timestamp(struct tm *, char *, int /*<<< orphan*/);
scalar_t__ Sfile_decode_datestr(struct tm *, char *, int /*<<< orphan*/);
scalar_t__ isalpha(char);
int /*<<< orphan*/ isdigit(char);
double mktime(struct tm *);
int /*<<< orphan*/ sscanf(char *, char *, double *);
int strlen(char *);
double time(int /*<<< orphan*/ *);
int timezone;
char tolower(char);
time_t Decode_timestring(char *code, time_t *date, int flag) {
  char scale_chr;
  double value, seconds;
  struct tm result_tm;
  int seconds_valid = 0, ret;
  *date = 0;
  if (code[0] == '-' || code[0] == '+' || code[0] == '=' || code[0] == '@') {
    if (code[1] == 0)
      return (0);
    if (!isdigit(code[1]))
      return (0);
    value = -1;
    if (code[0] == '=' || code[0] == '@') {
      seconds = 0;
      sscanf(code + 1, "%lf", &value);
    } else {
      seconds = time(NULL);
      sscanf(code, "%lf", &value);
    }
    scale_chr = code[strlen(code) - 1];
    if (isalpha(scale_chr))
      scale_chr = tolower(scale_chr);
    if (scale_chr == 's')
      seconds += 1.0 * value;
    else if (scale_chr == 'h')
      seconds += 3600.0 * value;
    else if (scale_chr == 'd')
      seconds += 86400.0 * value;
    else if (scale_chr == 'w')
      seconds += 86400.0 * 7.0 * value;
    else if (scale_chr == 'm')
      seconds += 86400.0 * 31.0 * value;
    else if (scale_chr == 'y')
      seconds += 86400.0 * (365.25 * value + 1.0);
    else
      seconds += 1.0 * value;
    seconds_valid = 1;
    goto completed;
  } else if (Sfile_decode_datestr(&result_tm, code, 0) > 0) {
    result_tm.tm_isdst = -1;
    seconds = mktime(&result_tm);
    seconds_valid = 1;
    goto completed;
  } else if (Decode_date_input_format(&result_tm, code, 0) > 0) {
    result_tm.tm_isdst = -1;
    seconds = mktime(&result_tm);
    seconds_valid = 1;
    goto completed;
  } else if (Decode_xorriso_timestamp(&result_tm, code, 0) > 0) {
    seconds = mktime(&result_tm);
    seconds_valid = 1;
    goto completed;
  } else if (Decode_date_output_format(&result_tm, code, 0) > 0) {
    ;
    ;
    ;
    seconds = mktime(&result_tm);
    seconds_valid = 1;
    goto completed;
  } else if ((ret = Decode_ecma119_format(&result_tm, code, 0)) > 0) {
    seconds = mktime(&result_tm);
    if (ret == 1) {
      if (result_tm.tm_isdst < 0)
        result_tm.tm_isdst = 0;
      seconds -= timezone - result_tm.tm_isdst * 3600;
    }
    seconds_valid = 1;
    goto completed;
  }
  return (0);
completed:;
  if (!seconds_valid)
    return (0);
  *date = seconds;
  return (1);
}


x86 assembly (clang, -O0):
<Decode_timestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1224 <Decode_timestring+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
je     1224 <Decode_timestring+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
je     1224 <Decode_timestring+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    1483 <Decode_timestring+0x2c3>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1241 <Decode_timestring+0x81>
movl   $0x0,-0x4(%rbp)
jmp    161e <Decode_timestring+0x45e>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1263 <Decode_timestring+0xa3>
movl   $0x0,-0x4(%rbp)
jmp    161e <Decode_timestring+0x45e>
movsd  0xd95(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
je     1290 <Decode_timestring+0xd0>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    12b5 <Decode_timestring+0xf5>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
lea    0xd91(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1090 <sscanf@plt>
jmp    12d7 <Decode_timestring+0x117>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xd6a(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1090 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1d(%rbp)
movsbl -0x1d(%rbp),%edi
call   10b0 <isalpha@plt>
cmp    $0x0,%rax
je     1319 <Decode_timestring+0x159>
movsbl -0x1d(%rbp),%edi
call   1080 <tolower@plt>
mov    %al,-0x1d(%rbp)
movsbl -0x1d(%rbp),%eax
cmp    $0x73,%eax
jne    133e <Decode_timestring+0x17e>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1477 <Decode_timestring+0x2b7>
movsbl -0x1d(%rbp),%eax
cmp    $0x68,%eax
jne    136f <Decode_timestring+0x1af>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  0xcd3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1472 <Decode_timestring+0x2b2>
movsbl -0x1d(%rbp),%eax
cmp    $0x64,%eax
jne    13a0 <Decode_timestring+0x1e0>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  0xc7a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    146d <Decode_timestring+0x2ad>
movsbl -0x1d(%rbp),%eax
cmp    $0x77,%eax
jne    13d1 <Decode_timestring+0x211>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  0xc69(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1468 <Decode_timestring+0x2a8>
movsbl -0x1d(%rbp),%eax
cmp    $0x6d,%eax
jne    1402 <Decode_timestring+0x242>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  0xc30(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1463 <Decode_timestring+0x2a3>
movsbl -0x1d(%rbp),%eax
cmp    $0x79,%eax
jne    144b <Decode_timestring+0x28b>
movsd  -0x28(%rbp),%xmm0
movsd  0xbf4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbf0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  0xbcf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    145e <Decode_timestring+0x29e>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1463 <Decode_timestring+0x2a3>
jmp    1468 <Decode_timestring+0x2a8>
jmp    146d <Decode_timestring+0x2ad>
jmp    1472 <Decode_timestring+0x2b2>
jmp    1477 <Decode_timestring+0x2b7>
movl   $0x1,-0x3c(%rbp)
jmp    15f6 <Decode_timestring+0x436>
mov    -0x10(%rbp),%rsi
lea    -0x38(%rbp),%rdi
xor    %edx,%edx
call   1060 <Sfile_decode_datestr@plt>
cmp    $0x0,%rax
jle    14bd <Decode_timestring+0x2fd>
movl   $0xffffffff,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
call   10a0 <mktime@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    15f6 <Decode_timestring+0x436>
mov    -0x10(%rbp),%rsi
lea    -0x38(%rbp),%rdi
xor    %edx,%edx
call   10d0 <Decode_date_input_format@plt>
cmp    $0x0,%rax
jle    14f7 <Decode_timestring+0x337>
movl   $0xffffffff,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
call   10a0 <mktime@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    15f6 <Decode_timestring+0x436>
mov    -0x10(%rbp),%rsi
lea    -0x38(%rbp),%rdi
xor    %edx,%edx
call   10e0 <Decode_xorriso_timestamp@plt>
cmp    $0x0,%rax
jle    152a <Decode_timestring+0x36a>
lea    -0x38(%rbp),%rdi
call   10a0 <mktime@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    15f6 <Decode_timestring+0x436>
mov    -0x10(%rbp),%rsi
lea    -0x38(%rbp),%rdi
xor    %edx,%edx
call   10c0 <Decode_date_output_format@plt>
cmp    $0x0,%rax
jle    155d <Decode_timestring+0x39d>
lea    -0x38(%rbp),%rdi
call   10a0 <mktime@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    15f6 <Decode_timestring+0x436>
mov    -0x10(%rbp),%rsi
lea    -0x38(%rbp),%rdi
xor    %edx,%edx
call   1040 <Decode_ecma119_format@plt>
mov    %eax,-0x40(%rbp)
cmp    $0x0,%eax
jle    15d1 <Decode_timestring+0x411>
lea    -0x38(%rbp),%rdi
call   10a0 <mktime@plt>
movsd  %xmm0,-0x30(%rbp)
cmpl   $0x1,-0x40(%rbp)
jne    15c5 <Decode_timestring+0x405>
cmpl   $0x0,-0x38(%rbp)
jge    15a1 <Decode_timestring+0x3e1>
movl   $0x0,-0x38(%rbp)
mov    0x2a38(%rip),%rax
mov    (%rax),%eax
imul   $0xe10,-0x38(%rbp),%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    15f6 <Decode_timestring+0x436>
jmp    15d6 <Decode_timestring+0x416>
jmp    15db <Decode_timestring+0x41b>
jmp    15e0 <Decode_timestring+0x420>
jmp    15e5 <Decode_timestring+0x425>
jmp    15ea <Decode_timestring+0x42a>
movl   $0x0,-0x4(%rbp)
jmp    161e <Decode_timestring+0x45e>
cmpl   $0x0,-0x3c(%rbp)
jne    160c <Decode_timestring+0x44c>
movl   $0x0,-0x4(%rbp)
jmp    161e <Decode_timestring+0x45e>
cvttsd2si -0x30(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decode_timestring>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movl   $0x0,(%rsi)
mov    (%rdi),%al
add    $0xd5,%al
cmp    $0x15,%al
ja     12a2 <Decode_timestring+0xe2>
movzbl %al,%eax
mov    $0x240005,%ecx
bt     %rax,%rcx
jae    12a2 <Decode_timestring+0xe2>
mov    0x1(%rbx),%al
xor    %ebp,%ebp
test   %al,%al
je     1348 <Decode_timestring+0x188>
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1348 <Decode_timestring+0x188>
lea    0x1(%rbx),%rdi
movabs $0xbff0000000000000,%rax
mov    %rax,0x10(%rsp)
mov    (%rbx),%al
xorps  %xmm0,%xmm0
cmp    $0x3d,%al
je     1239 <Decode_timestring+0x79>
cmp    $0x40,%al
je     1239 <Decode_timestring+0x79>
xor    %edi,%edi
call   1070 <time@plt>
mov    %rbx,%rdi
movsd  %xmm0,0x18(%rsp)
lea    0xe42(%rip),%rsi
lea    0x10(%rsp),%rdx
call   1090 <sscanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
mov    -0x1(%rax,%rbx,1),%bl
movsbl %bl,%ebp
mov    %ebp,%edi
call   10b0 <isalpha@plt>
test   %rax,%rax
je     1276 <Decode_timestring+0xb6>
mov    %ebp,%edi
call   1080 <tolower@plt>
mov    %eax,%ebx
add    $0x9c,%bl
cmp    $0x15,%bl
movsd  0x18(%rsp),%xmm0
ja     1297 <Decode_timestring+0xd7>
movzbl %bl,%eax
lea    0xda2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
addsd  0x10(%rsp),%xmm0
jmp    133c <Decode_timestring+0x17c>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1060 <Sfile_decode_datestr@plt>
test   %rax,%rax
jg     12ce <Decode_timestring+0x10e>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   10d0 <Decode_date_input_format@plt>
test   %rax,%rax
jle    1353 <Decode_timestring+0x193>
movl   $0xffffffff,0x8(%rsp)
ff
lea    0x8(%rsp),%rdi
call   10a0 <mktime@plt>
jmp    133c <Decode_timestring+0x17c>
movsd  0x10(%rsp),%xmm1
jmp    1330 <Decode_timestring+0x170>
movsd  0x10(%rsp),%xmm1
mulsd  0xd30(%rip),%xmm1
jmp    1338 <Decode_timestring+0x178>
movsd  0x10(%rsp),%xmm1
mulsd  0xd10(%rip),%xmm1
jmp    1338 <Decode_timestring+0x178>
movsd  0x10(%rsp),%xmm1
mulsd  0xd08(%rip),%xmm1
jmp    1338 <Decode_timestring+0x178>
movsd  0x10(%rsp),%xmm1
mulsd  0xcd8(%rip),%xmm1
addsd  0xcd8(%rip),%xmm1
mulsd  0xcd8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%r14)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   10e0 <Decode_xorriso_timestamp@plt>
test   %rax,%rax
jg     12d6 <Decode_timestring+0x116>
lea    0x8(%rsp),%rdi
xor    %ebp,%ebp
mov    %rbx,%rsi
xor    %edx,%edx
call   10c0 <Decode_date_output_format@plt>
test   %rax,%rax
jg     12d6 <Decode_timestring+0x116>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1040 <Decode_ecma119_format@plt>
test   %eax,%eax
jle    1348 <Decode_timestring+0x188>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
call   10a0 <mktime@plt>
cmp    $0x1,%ebx
jne    133c <Decode_timestring+0x17c>
mov    0x8(%rsp),%eax
xor    %ecx,%ecx
test   %eax,%eax
cmovns %eax,%ecx
mov    0x2c25(%rip),%rax
imul   $0xfffff1f0,%ecx,%ecx
add    (%rax),%ecx
cvtsi2sd %ecx,%xmm1
subsd  %xmm1,%xmm0
jmp    133c <Decode_timestring+0x17c>

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [4 x i8] c"%lf\00"
@timezone = global i32 0
define i32 @Decode_timestring(i8* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8
%9 = alloca double
%10 = alloca double
%11 = alloca %struct.tm
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 0, i32* %12
%14 = load i32*, i32** %6
store i32 0, i32* %14
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 45
br i1 %19, label %38, label %20
20: ; preds = %3
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 43
br i1 %25, label %38, label %26
26: ; preds = %20
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 61
br i1 %31, label %38, label %32
32: ; preds = %26
%33 = load i8*, i8** %5
%34 = getelementptr inbounds i8, i8* %33, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 64
br i1 %37, label %38, label %145
38: ; preds = %32, %26, %20, %3
%39 = load i8*, i8** %5
%40 = getelementptr inbounds i8, i8* %39, i64 1
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %45
44: ; preds = %38
store i32 0, i32* %4
br label %209
45: ; preds = %38
%46 = load i8*, i8** %5
%47 = getelementptr inbounds i8, i8* %46, i64 1
%48 = load i8, i8* %47
%49 = call i32 @isdigit(i8 signext %48)
%50 = icmp ne i32 %49, 0
br i1 %50, label %52, label %51
51: ; preds = %45
store i32 0, i32* %4
br label %209
52: ; preds = %45
store double -1.000000e+00, double* %9
%53 = load i8*, i8** %5
%54 = getelementptr inbounds i8, i8* %53, i64 0
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 61
br i1 %57, label %64, label %58
58: ; preds = %52
%59 = load i8*, i8** %5
%60 = getelementptr inbounds i8, i8* %59, i64 0
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 64
br i1 %63, label %64, label %68
64: ; preds = %58, %52
store double 0.000000e+00, double* %10
%65 = load i8*, i8** %5
%66 = getelementptr inbounds i8, i8* %65, i64 1
%67 = call i32 @sscanf(i8* %66, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %9)
br label %72
68: ; preds = %58
%69 = call double @time(i32* null)
store double %69, double* %10
%70 = load i8*, i8** %5
%71 = call i32 @sscanf(i8* %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %9)
br label %72
72: ; preds = %68, %64
%73 = load i8*, i8** %5
%74 = load i8*, i8** %5
%75 = call i32 @strlen(i8* %74)
%76 = sub nsw i32 %75, 1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %73, i64 %77
%79 = load i8, i8* %78
store i8 %79, i8* %8
%80 = load i8, i8* %8
%81 = call i64 @isalpha(i8 signext %80)
%82 = icmp ne i64 %81, 0
br i1 %82, label %83, label %86
83: ; preds = %72
%84 = load i8, i8* %8
%85 = call signext i8 @tolower(i8 signext %84)
store i8 %85, i8* %8
br label %86
86: ; preds = %83, %72
%87 = load i8, i8* %8
%88 = sext i8 %87 to i32
%89 = icmp eq i32 %88, 115
br i1 %89, label %90, label %94
90: ; preds = %86
%91 = load double, double* %9
%92 = load double, double* %10
%93 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %91, double %92)
store double %93, double* %10
br label %144
94: ; preds = %86
%95 = load i8, i8* %8
%96 = sext i8 %95 to i32
%97 = icmp eq i32 %96, 104
br i1 %97, label %98, label %102
98: ; preds = %94
%99 = load double, double* %9
%100 = load double, double* %10
%101 = call double @llvm.fmuladd.f64(double 3.600000e+03, double %99, double %100)
store double %101, double* %10
br label %143
102: ; preds = %94
%103 = load i8, i8* %8
%104 = sext i8 %103 to i32
%105 = icmp eq i32 %104, 100
br i1 %105, label %106, label %110
106: ; preds = %102
%107 = load double, double* %9
%108 = load double, double* %10
%109 = call double @llvm.fmuladd.f64(double 8.640000e+04, double %107, double %108)
store double %109, double* %10
br label %142
110: ; preds = %102
%111 = load i8, i8* %8
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 119
br i1 %113, label %114, label %118
114: ; preds = %110
%115 = load double, double* %9
%116 = load double, double* %10
%117 = call double @llvm.fmuladd.f64(double 6.048000e+05, double %115, double %116)
store double %117, double* %10
br label %141
118: ; preds = %110
%119 = load i8, i8* %8
%120 = sext i8 %119 to i32
%121 = icmp eq i32 %120, 109
br i1 %121, label %122, label %126
122: ; preds = %118
%123 = load double, double* %9
%124 = load double, double* %10
%125 = call double @llvm.fmuladd.f64(double 2.678400e+06, double %123, double %124)
store double %125, double* %10
br label %140
126: ; preds = %118
%127 = load i8, i8* %8
%128 = sext i8 %127 to i32
%129 = icmp eq i32 %128, 121
br i1 %129, label %130, label %135
130: ; preds = %126
%131 = load double, double* %9
%132 = call double @llvm.fmuladd.f64(double 3.652500e+02, double %131, double 1.000000e+00)
%133 = load double, double* %10
%134 = call double @llvm.fmuladd.f64(double 8.640000e+04, double %132, double %133)
store double %134, double* %10
br label %139
135: ; preds = %126
%136 = load double, double* %9
%137 = load double, double* %10
%138 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %136, double %137)
store double %138, double* %10
br label %139
139: ; preds = %135, %130
br label %140
140: ; preds = %139, %122
br label %141
141: ; preds = %140, %114
br label %142
142: ; preds = %141, %106
br label %143
143: ; preds = %142, %98
br label %144
144: ; preds = %143, %90
store i32 1, i32* %12
br label %201
145: ; preds = %32
%146 = load i8*, i8** %5
%147 = call i64 @Sfile_decode_datestr(%struct.tm* %11, i8* %146, i32 0)
%148 = icmp sgt i64 %147, 0
br i1 %148, label %149, label %152
149: ; preds = %145
%150 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 0
store i32 -1, i32* %150
%151 = call double @mktime(%struct.tm* %11)
store double %151, double* %10
store i32 1, i32* %12
br label %201
152: ; preds = %145
%153 = load i8*, i8** %5
%154 = call i64 @Decode_date_input_format(%struct.tm* %11, i8* %153, i32 0)
%155 = icmp sgt i64 %154, 0
br i1 %155, label %156, label %159
156: ; preds = %152
%157 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 0
store i32 -1, i32* %157
%158 = call double @mktime(%struct.tm* %11)
store double %158, double* %10
store i32 1, i32* %12
br label %201
159: ; preds = %152
%160 = load i8*, i8** %5
%161 = call i64 @Decode_xorriso_timestamp(%struct.tm* %11, i8* %160, i32 0)
%162 = icmp sgt i64 %161, 0
br i1 %162, label %163, label %165
163: ; preds = %159
%164 = call double @mktime(%struct.tm* %11)
store double %164, double* %10
store i32 1, i32* %12
br label %201
165: ; preds = %159
%166 = load i8*, i8** %5
%167 = call i64 @Decode_date_output_format(%struct.tm* %11, i8* %166, i32 0)
%168 = icmp sgt i64 %167, 0
br i1 %168, label %169, label %171
169: ; preds = %165
%170 = call double @mktime(%struct.tm* %11)
store double %170, double* %10
store i32 1, i32* %12
br label %201
171: ; preds = %165
%172 = load i8*, i8** %5
%173 = call i32 @Decode_ecma119_format(%struct.tm* %11, i8* %172, i32 0)
store i32 %173, i32* %13
%174 = icmp sgt i32 %173, 0
br i1 %174, label %175, label %195
175: ; preds = %171
%176 = call double @mktime(%struct.tm* %11)
store double %176, double* %10
%177 = load i32, i32* %13
%178 = icmp eq i32 %177, 1
br i1 %178, label %179, label %194
179: ; preds = %175
%180 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 0
%181 = load i32, i32* %180
%182 = icmp slt i32 %181, 0
br i1 %182, label %183, label %185
183: ; preds = %179
%184 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 0
store i32 0, i32* %184
br label %185
185: ; preds = %183, %179
%186 = load i32, i32* @timezone
%187 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 0
%188 = load i32, i32* %187
%189 = mul nsw i32 %188, 3600
%190 = sub nsw i32 %186, %189
%191 = sitofp i32 %190 to double
%192 = load double, double* %10
%193 = fsub double %192, %191
store double %193, double* %10
br label %194
194: ; preds = %185, %175
store i32 1, i32* %12
br label %201
195: ; preds = %171
br label %196
196: ; preds = %195
br label %197
197: ; preds = %196
br label %198
198: ; preds = %197
br label %199
199: ; preds = %198
br label %200
200: ; preds = %199
store i32 0, i32* %4
br label %209
201: ; preds = %194, %169, %163, %156, %149, %144
%202 = load i32, i32* %12
%203 = icmp ne i32 %202, 0
br i1 %203, label %205, label %204
204: ; preds = %201
store i32 0, i32* %4
br label %209
205: ; preds = %201
%206 = load double, double* %10
%207 = fptosi double %206 to i32
%208 = load i32*, i32** %6
store i32 %207, i32* %208
store i32 1, i32* %4
br label %209
209: ; preds = %205, %204, %200, %51, %44
%210 = load i32, i32* %4
ret i32 %210
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [4 x i8] c"%lf\00"
@timezone = global i32 0
define i32 @Decode_timestring(i8* %0, i32* nocapture writeonly %1, i32 %2) {
%4 = alloca double
%5 = alloca %struct.tm
%6 = bitcast double* %4 to i8*
%7 = bitcast %struct.tm* %5 to i8*
store i32 0, i32* %1
%8 = load i8, i8* %0
switch i8 %8, label %57 [
i8 45, label %9
i8 43, label %9
i8 61, label %9
i8 64, label %9
]
9: ; preds = %3, %3, %3, %3
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %98, label %13
13: ; preds = %9
%14 = tail call i32 @isdigit(i8 signext %11)
%15 = icmp eq i32 %14, 0
br i1 %15, label %98, label %16
16: ; preds = %13
store double -1.000000e+00, double* %4
%17 = load i8, i8* %0
switch i8 %17, label %18 [
i8 61, label %20
i8 64, label %20
]
18: ; preds = %16
%19 = tail call double @time(i32* null)
br label %20
20: ; preds = %16, %16, %18
%21 = phi i8* [ %0, %18 ], [ %10, %16 ], [ %10, %16 ]
%22 = phi double [ %19, %18 ], [ 0.000000e+00, %16 ], [ 0.000000e+00, %16 ]
%23 = call i32 @sscanf(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%24 = call i32 @strlen(i8* %0)
%25 = add nsw i32 %24, -1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %0, i64 %26
%28 = load i8, i8* %27
%29 = call i64 @isalpha(i8 signext %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %20
%32 = call signext i8 @tolower(i8 signext %28)
br label %33
33: ; preds = %31, %20
%34 = phi i8 [ %32, %31 ], [ %28, %20 ]
switch i8 %34, label %54 [
i8 115, label %35
i8 104, label %38
i8 100, label %41
i8 119, label %44
i8 109, label %47
i8 121, label %50
]
35: ; preds = %33
%36 = load double, double* %4
%37 = fadd double %22, %36
br label %95
38: ; preds = %33
%39 = load double, double* %4
%40 = call double @llvm.fmuladd.f64(double %39, double 3.600000e+03, double %22)
br label %95
41: ; preds = %33
%42 = load double, double* %4
%43 = call double @llvm.fmuladd.f64(double %42, double 8.640000e+04, double %22)
br label %95
44: ; preds = %33
%45 = load double, double* %4
%46 = call double @llvm.fmuladd.f64(double %45, double 6.048000e+05, double %22)
br label %95
47: ; preds = %33
%48 = load double, double* %4
%49 = call double @llvm.fmuladd.f64(double %48, double 2.678400e+06, double %22)
br label %95
50: ; preds = %33
%51 = load double, double* %4
%52 = call double @llvm.fmuladd.f64(double %51, double 3.652500e+02, double 1.000000e+00)
%53 = call double @llvm.fmuladd.f64(double %52, double 8.640000e+04, double %22)
br label %95
54: ; preds = %33
%55 = load double, double* %4
%56 = fadd double %22, %55
br label %95
57: ; preds = %3
%58 = call i64 @Sfile_decode_datestr(%struct.tm* %5, i8* %0, i32 0)
%59 = icmp sgt i64 %58, 0
br i1 %59, label %60, label %63
60: ; preds = %57
%61 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
store i32 -1, i32* %61
%62 = call double @mktime(%struct.tm* %5)
br label %95
63: ; preds = %57
%64 = call i64 @Decode_date_input_format(%struct.tm* %5, i8* %0, i32 0)
%65 = icmp sgt i64 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %63
%67 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
store i32 -1, i32* %67
%68 = call double @mktime(%struct.tm* %5)
br label %95
69: ; preds = %63
%70 = call i64 @Decode_xorriso_timestamp(%struct.tm* %5, i8* %0, i32 0)
%71 = icmp sgt i64 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call double @mktime(%struct.tm* %5)
br label %95
74: ; preds = %69
%75 = call i64 @Decode_date_output_format(%struct.tm* %5, i8* %0, i32 0)
%76 = icmp sgt i64 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = call double @mktime(%struct.tm* %5)
br label %95
79: ; preds = %74
%80 = call i32 @Decode_ecma119_format(%struct.tm* %5, i8* %0, i32 0)
%81 = icmp sgt i32 %80, 0
br i1 %81, label %82, label %98
82: ; preds = %79
%83 = call double @mktime(%struct.tm* %5)
%84 = icmp eq i32 %80, 1
br i1 %84, label %85, label %95
85: ; preds = %82
%86 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
%87 = load i32, i32* %86
%88 = icmp sgt i32 %87, 0
%89 = select i1 %88, i32 %87, i32 0
%90 = load i32, i32* @timezone
%91 = mul i32 %89, -3600
%92 = add i32 %91, %90
%93 = sitofp i32 %92 to double
%94 = fsub double %83, %93
br label %95
95: ; preds = %60, %66, %72, %77, %38, %44, %50, %54, %47, %41, %35, %85, %82
%96 = phi double [ %62, %60 ], [ %68, %66 ], [ %73, %72 ], [ %78, %77 ], [ %37, %35 ], [ %40, %38 ], [ %43, %41 ], [ %46, %44 ], [ %49, %47 ], [ %53, %50 ], [ %56, %54 ], [ %94, %85 ], [ %83, %82 ]
%97 = fptosi double %96 to i32
store i32 %97, i32* %1
br label %98
98: ; preds = %79, %13, %9, %95
%99 = phi i32 [ 1, %95 ], [ 0, %9 ], [ 0, %13 ], [ 0, %79 ]
ret i32 %99
}