void splitTimevalue(double timevalue, int timeunit, int *date, int *time) {
  int vdate = 0, vtime = 0;
  int hour, minute, second;
  int year, month, day;
  static int lwarn = 1;
  if (timeunit == 1) {
    timevalue /= 86400;
    conv_timeval(timevalue, &vdate, &vtime);
  } else if (timeunit == 5) {
    timevalue /= 24;
    conv_timeval(timevalue, &vdate, &vtime);
  } else if (timeunit == 9) {
    conv_timeval(timevalue, &vdate, &vtime);
  } else if (timeunit == 10) {
    vdate = (int)timevalue * 100;
    vdate += 1;
    vtime = 0;
  } else if (timeunit == 11) {
    if (timevalue < -214700) {
      Warning_(__func__, "Year %g out of range, set to -214700", timevalue);
      timevalue = -214700;
    } else if (timevalue > 214700) {
      Warning_(__func__, "Year %g out of range, set to 214700", timevalue);
      timevalue = 214700;
    }
    vdate = (int)timevalue * 10000;
    vdate += 101;
    vtime = 0;
  } else {
    if (lwarn) {
      Warning_(__func__, "timeunit %s unsupported!", tunitNamePtr(timeunit));
      lwarn = 0;
    }
  }
  cdiDecodeDate(vdate, &year, &month, &day);
  cdiDecodeTime(vtime, &hour, &minute, &second);
  if (month > 17 || day > 31 || hour > 23 || minute > 59 || second > 59) {
    if ((month > 17 || day > 31) && (year < -9999 || year > 9999))
      year = 1;
    if (month > 17)
      month = 1;
    if (day > 31)
      day = 1;
    if (hour > 23)
      hour = 0;
    if (minute > 59)
      minute = 0;
    if (second > 59)
      second = 0;
    vdate = cdiEncodeDate(year, month, day);
    vtime = cdiEncodeTime(hour, minute, second);
    if (lwarn) {
      lwarn = 0;
      Warning_(__func__,
               "Reset wrong date/time to %4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d!",
               year, month, day, hour, minute, second);
    }
  }
  *date = vdate;
  *time = vtime;
}


x86 assembly (clang, -O0):
<splitTimevalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11cf <splitTimevalue+0x5f>
movsd  -0x8(%rbp),%xmm0
movsd  0xe6b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x24(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x1,%al
call   1030 <conv_timeval@plt>
jmp    1355 <splitTimevalue+0x1e5>
cmpl   $0x5,-0xc(%rbp)
jne    1208 <splitTimevalue+0x98>
movsd  -0x8(%rbp),%xmm0
movsd  0xe2a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x24(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x1,%al
call   1030 <conv_timeval@plt>
jmp    1350 <splitTimevalue+0x1e0>
cmpl   $0x9,-0xc(%rbp)
jne    122b <splitTimevalue+0xbb>
movsd  -0x8(%rbp),%xmm0
lea    -0x24(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x1,%al
call   1030 <conv_timeval@plt>
jmp    134b <splitTimevalue+0x1db>
cmpl   $0xa,-0xc(%rbp)
jne    1255 <splitTimevalue+0xe5>
cvttsd2si -0x8(%rbp),%eax
imul   $0x64,%eax,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
jmp    1346 <splitTimevalue+0x1d6>
cmpl   $0xb,-0xc(%rbp)
jne    1304 <splitTimevalue+0x194>
movsd  0xd99(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    129e <splitTimevalue+0x12e>
movsd  -0x8(%rbp),%xmm0
lea    0xda2(%rip),%rdi
lea    0xdaa(%rip),%rsi
mov    $0x1,%al
call   1040 <Warning_@plt>
movsd  0xd6c(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12e1 <splitTimevalue+0x171>
movsd  -0x8(%rbp),%xmm0
movsd  0xd5d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12dc <splitTimevalue+0x16c>
movsd  -0x8(%rbp),%xmm0
lea    0xd5f(%rip),%rdi
lea    0xd8c(%rip),%rsi
mov    $0x1,%al
call   1040 <Warning_@plt>
movsd  0xd31(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12e1 <splitTimevalue+0x171>
cvttsd2si -0x8(%rbp),%eax
imul   $0x2710,%eax,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x65,%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
jmp    1341 <splitTimevalue+0x1d1>
cmpl   $0x0,0x2d4d(%rip)
je     133c <splitTimevalue+0x1cc>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1080 <tunitNamePtr@plt>
mov    %eax,%edx
lea    0xcfc(%rip),%rdi
lea    0xd4d(%rip),%rsi
mov    $0x0,%al
call   1040 <Warning_@plt>
movl   $0x0,0x2d1c(%rip)
jmp    1341 <splitTimevalue+0x1d1>
jmp    1346 <splitTimevalue+0x1d6>
jmp    134b <splitTimevalue+0x1db>
jmp    1350 <splitTimevalue+0x1e0>
jmp    1355 <splitTimevalue+0x1e5>
mov    -0x24(%rbp),%edi
lea    -0x38(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0x0,%al
call   1070 <cdiDecodeDate@plt>
mov    -0x28(%rbp),%edi
lea    -0x2c(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
mov    $0x0,%al
call   1090 <cdiDecodeTime@plt>
cmpl   $0x11,-0x3c(%rbp)
jg     13b3 <splitTimevalue+0x243>
cmpl   $0x1f,-0x40(%rbp)
jg     13b3 <splitTimevalue+0x243>
cmpl   $0x17,-0x2c(%rbp)
jg     13b3 <splitTimevalue+0x243>
cmpl   $0x3b,-0x30(%rbp)
jg     13b3 <splitTimevalue+0x243>
cmpl   $0x3b,-0x34(%rbp)
jle    14b1 <splitTimevalue+0x341>
cmpl   $0x11,-0x3c(%rbp)
jg     13c7 <splitTimevalue+0x257>
cmpl   $0x1f,-0x40(%rbp)
jle    13e8 <splitTimevalue+0x278>
cmpl   $0xffffd8f1,-0x38(%rbp)
jl     13e1 <splitTimevalue+0x271>
cmpl   $0x270f,-0x38(%rbp)
jle    13e8 <splitTimevalue+0x278>
movl   $0x1,-0x38(%rbp)
cmpl   $0x11,-0x3c(%rbp)
jle    13f9 <splitTimevalue+0x289>
movl   $0x1,-0x3c(%rbp)
cmpl   $0x1f,-0x40(%rbp)
jle    140a <splitTimevalue+0x29a>
movl   $0x1,-0x40(%rbp)
cmpl   $0x17,-0x2c(%rbp)
jle    141b <splitTimevalue+0x2ab>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x3b,-0x30(%rbp)
jle    142c <splitTimevalue+0x2bc>
movl   $0x0,-0x30(%rbp)
cmpl   $0x3b,-0x34(%rbp)
jle    143d <splitTimevalue+0x2cd>
movl   $0x0,-0x34(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    $0x0,%al
call   1060 <cdiEncodeDate@plt>
mov    %eax,-0x24(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    $0x0,%al
call   1050 <cdiEncodeTime@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,0x2bee(%rip)
je     14ac <splitTimevalue+0x33c>
movl   $0x0,0x2bde(%rip)
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
mov    -0x30(%rbp),%r10d
mov    -0x34(%rbp),%eax
lea    0xb8a(%rip),%rdi
lea    0xbf4(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1040 <Warning_@plt>
jmp    14b1 <splitTimevalue+0x341>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitTimevalue>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    -0x1(%rdi),%eax
cmp    $0xa,%eax
ja     11b1 <splitTimevalue+0x41>
lea    0xe82(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
divsd  0xe69(%rip),%xmm0
jmp    11f0 <splitTimevalue+0x80>
cmpb   $0x0,0x2ea4(%rip)
jne    1274 <splitTimevalue+0x104>
xor    %eax,%eax
call   1080 <tunitNamePtr@plt>
lea    0xe80(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <Warning_@plt>
movb   $0x1,0x2e79(%rip)
jmp    1274 <splitTimevalue+0x104>
divsd  0xe20(%rip),%xmm0
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x1,%al
call   1030 <conv_timeval@plt>
jmp    1274 <splitTimevalue+0x104>
cvttsd2si %xmm0,%eax
imul   $0x64,%eax,%eax
or     $0x1,%eax
jmp    1268 <splitTimevalue+0xf8>
movsd  0xde9(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    122c <splitTimevalue+0xbc>
movsd  %xmm1,0x28(%rsp)
lea    0xe31(%rip),%rsi
jmp    1247 <splitTimevalue+0xd7>
movsd  0xdd4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    125b <splitTimevalue+0xeb>
movsd  %xmm1,0x28(%rsp)
lea    0xe39(%rip),%rsi
lea    0xdfe(%rip),%rdi
mov    $0x1,%al
call   1040 <Warning_@plt>
movsd  0x28(%rsp),%xmm0
cvttsd2si %xmm0,%eax
imul   $0x2710,%eax,%eax
add    $0x65,%eax
mov    %eax,0xc(%rsp)
movl   $0x0,0x8(%rsp)
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rsi
lea    0x24(%rsp),%rdx
lea    0x20(%rsp),%rcx
xor    %eax,%eax
call   1070 <cdiDecodeDate@plt>
mov    0x8(%rsp),%edi
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
xor    %eax,%eax
call   1090 <cdiDecodeTime@plt>
mov    0x24(%rsp),%esi
cmp    $0x12,%esi
setge  %al
mov    0x20(%rsp),%edx
cmp    $0x20,%edx
setge  %bl
or     %al,%bl
mov    0x1c(%rsp),%edi
mov    0x18(%rsp),%ecx
mov    0x14(%rsp),%eax
jne    12df <splitTimevalue+0x16f>
cmp    $0x17,%edi
jg     12df <splitTimevalue+0x16f>
cmp    $0x3b,%ecx
jg     12df <splitTimevalue+0x16f>
cmp    $0x3c,%eax
jl     139a <splitTimevalue+0x22a>
test   %bl,%bl
je     12fc <splitTimevalue+0x18c>
mov    $0xffffd8f0,%ebx
add    0x10(%rsp),%ebx
cmp    $0xffffb1e0,%ebx
ja     12fc <splitTimevalue+0x18c>
movl   $0x1,0x10(%rsp)
cmp    $0x12,%esi
jge    13b2 <splitTimevalue+0x242>
cmp    $0x20,%edx
jge    13c8 <splitTimevalue+0x258>
cmp    $0x18,%edi
jge    13de <splitTimevalue+0x26e>
cmp    $0x3c,%ecx
jge    13ef <splitTimevalue+0x27f>
cmp    $0x3c,%eax
jl     132d <splitTimevalue+0x1bd>
movl   $0x0,0x14(%rsp)
mov    0x10(%rsp),%edi
xor    %eax,%eax
call   1060 <cdiEncodeDate@plt>
mov    %eax,0xc(%rsp)
mov    0x1c(%rsp),%edi
mov    0x18(%rsp),%esi
mov    0x14(%rsp),%edx
xor    %eax,%eax
call   1050 <cdiEncodeTime@plt>
mov    %eax,0x8(%rsp)
cmpb   $0x0,0x2d02(%rip)
jne    139a <splitTimevalue+0x22a>
movb   $0x1,0x2cf9(%rip)
mov    0x10(%rsp),%edx
mov    0x24(%rsp),%ecx
mov    0x20(%rsp),%r8d
mov    0x1c(%rsp),%r9d
mov    0x18(%rsp),%r10d
mov    0x14(%rsp),%ebx
lea    0xcc7(%rip),%rdi
lea    0xd31(%rip),%rsi
xor    %eax,%eax
push   %rbx
push   %r10
call   1040 <Warning_@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%eax
mov    %eax,(%r15)
mov    0x8(%rsp),%eax
mov    %eax,(%r14)
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
movl   $0x1,0x24(%rsp)
mov    $0x1,%esi
cmp    $0x20,%edx
jl     130e <splitTimevalue+0x19e>
movl   $0x1,0x20(%rsp)
mov    $0x1,%edx
cmp    $0x18,%edi
jl     1317 <splitTimevalue+0x1a7>
movl   $0x0,0x1c(%rsp)
cmp    $0x3c,%ecx
jl     1320 <splitTimevalue+0x1b0>
movl   $0x0,0x18(%rsp)
cmp    $0x3c,%eax
jge    1325 <splitTimevalue+0x1b5>
jmp    132d <splitTimevalue+0x1bd>

LLVM IR (-O0):
@splitTimevalue.lwarn = internal global i32 1
@__func__.splitTimevalue = [15 x i8] c"splitTimevalue\00"
@.str = [37 x i8] c"Year %g out of range, set to -214700\00"
@.str.1 = [36 x i8] c"Year %g out of range, set to 214700\00"
@.str.2 = [25 x i8] c"timeunit %s unsupported!\00"
@.str.3 = [62 x i8] c"Reset wrong date/time to %4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d!\00"
define void @splitTimevalue(double %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store double %0, double* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
store i32 0, i32* %9
store i32 0, i32* %10
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %24
19: ; preds = %4
%20 = load double, double* %5
%21 = fdiv double %20, 8.640000e+04
store double %21, double* %5
%22 = load double, double* %5
%23 = call i32 (double, i32*, i32*, ...) bitcast (i32 (...)* @conv_timeval to i32 (double, i32*, i32*, ...)*)(double %22, i32* %9, i32* %10)
br label %81
24: ; preds = %4
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, 5
br i1 %26, label %27, label %32
27: ; preds = %24
%28 = load double, double* %5
%29 = fdiv double %28, 2.400000e+01
store double %29, double* %5
%30 = load double, double* %5
%31 = call i32 (double, i32*, i32*, ...) bitcast (i32 (...)* @conv_timeval to i32 (double, i32*, i32*, ...)*)(double %30, i32* %9, i32* %10)
br label %80
32: ; preds = %24
%33 = load i32, i32* %6
%34 = icmp eq i32 %33, 9
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = load double, double* %5
%37 = call i32 (double, i32*, i32*, ...) bitcast (i32 (...)* @conv_timeval to i32 (double, i32*, i32*, ...)*)(double %36, i32* %9, i32* %10)
br label %79
38: ; preds = %32
%39 = load i32, i32* %6
%40 = icmp eq i32 %39, 10
br i1 %40, label %41, label %47
41: ; preds = %38
%42 = load double, double* %5
%43 = fptosi double %42 to i32
%44 = mul nsw i32 %43, 100
store i32 %44, i32* %9
%45 = load i32, i32* %9
%46 = add nsw i32 %45, 1
store i32 %46, i32* %9
store i32 0, i32* %10
br label %78
47: ; preds = %38
%48 = load i32, i32* %6
%49 = icmp eq i32 %48, 11
br i1 %49, label %50, label %69
50: ; preds = %47
%51 = load double, double* %5
%52 = fcmp olt double %51, -2.147000e+05
br i1 %52, label %53, label %56
53: ; preds = %50
%54 = load double, double* %5
%55 = call i32 (i8*, i8*, double, ...) bitcast (i32 (...)* @Warning_ to i32 (i8*, i8*, double, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.splitTimevalue, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double %54)
store double -2.147000e+05, double* %5
br label %63
56: ; preds = %50
%57 = load double, double* %5
%58 = fcmp ogt double %57, 2.147000e+05
br i1 %58, label %59, label %62
59: ; preds = %56
%60 = load double, double* %5
%61 = call i32 (i8*, i8*, double, ...) bitcast (i32 (...)* @Warning_ to i32 (i8*, i8*, double, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.splitTimevalue, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), double %60)
store double 2.147000e+05, double* %5
br label %62
62: ; preds = %59, %56
br label %63
63: ; preds = %62, %53
%64 = load double, double* %5
%65 = fptosi double %64 to i32
%66 = mul nsw i32 %65, 10000
store i32 %66, i32* %9
%67 = load i32, i32* %9
%68 = add nsw i32 %67, 101
store i32 %68, i32* %9
store i32 0, i32* %10
br label %77
69: ; preds = %47
%70 = load i32, i32* @splitTimevalue.lwarn
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %76
72: ; preds = %69
%73 = load i32, i32* %6
%74 = call i32 (i32, ...) bitcast (i32 (...)* @tunitNamePtr to i32 (i32, ...)*)(i32 %73)
%75 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @Warning_ to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.splitTimevalue, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %74)
store i32 0, i32* @splitTimevalue.lwarn
br label %76
76: ; preds = %72, %69
br label %77
77: ; preds = %76, %63
br label %78
78: ; preds = %77, %41
br label %79
79: ; preds = %78, %35
br label %80
80: ; preds = %79, %27
br label %81
81: ; preds = %80, %19
%82 = load i32, i32* %9
%83 = call i32 (i32, i32*, i32*, i32*, ...) bitcast (i32 (...)* @cdiDecodeDate to i32 (i32, i32*, i32*, i32*, ...)*)(i32 %82, i32* %14, i32* %15, i32* %16)
%84 = load i32, i32* %10
%85 = call i32 (i32, i32*, i32*, i32*, ...) bitcast (i32 (...)* @cdiDecodeTime to i32 (i32, i32*, i32*, i32*, ...)*)(i32 %84, i32* %11, i32* %12, i32* %13)
%86 = load i32, i32* %15
%87 = icmp sgt i32 %86, 17
br i1 %87, label %100, label %88
88: ; preds = %81
%89 = load i32, i32* %16
%90 = icmp sgt i32 %89, 31
br i1 %90, label %100, label %91
91: ; preds = %88
%92 = load i32, i32* %11
%93 = icmp sgt i32 %92, 23
br i1 %93, label %100, label %94
94: ; preds = %91
%95 = load i32, i32* %12
%96 = icmp sgt i32 %95, 59
br i1 %96, label %100, label %97
97: ; preds = %94
%98 = load i32, i32* %13
%99 = icmp sgt i32 %98, 59
br i1 %99, label %100, label %153
100: ; preds = %97, %94, %91, %88, %81
%101 = load i32, i32* %15
%102 = icmp sgt i32 %101, 17
br i1 %102, label %106, label %103
103: ; preds = %100
%104 = load i32, i32* %16
%105 = icmp sgt i32 %104, 31
br i1 %105, label %106, label %113
106: ; preds = %103, %100
%107 = load i32, i32* %14
%108 = icmp slt i32 %107, -9999
br i1 %108, label %112, label %109
109: ; preds = %106
%110 = load i32, i32* %14
%111 = icmp sgt i32 %110, 9999
br i1 %111, label %112, label %113
112: ; preds = %109, %106
store i32 1, i32* %14
br label %113
113: ; preds = %112, %109, %103
%114 = load i32, i32* %15
%115 = icmp sgt i32 %114, 17
br i1 %115, label %116, label %117
116: ; preds = %113
store i32 1, i32* %15
br label %117
117: ; preds = %116, %113
%118 = load i32, i32* %16
%119 = icmp sgt i32 %118, 31
br i1 %119, label %120, label %121
120: ; preds = %117
store i32 1, i32* %16
br label %121
121: ; preds = %120, %117
%122 = load i32, i32* %11
%123 = icmp sgt i32 %122, 23
br i1 %123, label %124, label %125
124: ; preds = %121
store i32 0, i32* %11
br label %125
125: ; preds = %124, %121
%126 = load i32, i32* %12
%127 = icmp sgt i32 %126, 59
br i1 %127, label %128, label %129
128: ; preds = %125
store i32 0, i32* %12
br label %129
129: ; preds = %128, %125
%130 = load i32, i32* %13
%131 = icmp sgt i32 %130, 59
br i1 %131, label %132, label %133
132: ; preds = %129
store i32 0, i32* %13
br label %133
133: ; preds = %132, %129
%134 = load i32, i32* %14
%135 = load i32, i32* %15
%136 = load i32, i32* %16
%137 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cdiEncodeDate to i32 (i32, i32, i32, ...)*)(i32 %134, i32 %135, i32 %136)
store i32 %137, i32* %9
%138 = load i32, i32* %11
%139 = load i32, i32* %12
%140 = load i32, i32* %13
%141 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cdiEncodeTime to i32 (i32, i32, i32, ...)*)(i32 %138, i32 %139, i32 %140)
store i32 %141, i32* %10
%142 = load i32, i32* @splitTimevalue.lwarn
%143 = icmp ne i32 %142, 0
br i1 %143, label %144, label %152
144: ; preds = %133
store i32 0, i32* @splitTimevalue.lwarn
%145 = load i32, i32* %14
%146 = load i32, i32* %15
%147 = load i32, i32* %16
%148 = load i32, i32* %11
%149 = load i32, i32* %12
%150 = load i32, i32* %13
%151 = call i32 (i8*, i8*, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @Warning_ to i32 (i8*, i8*, i32, i32, i32, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.splitTimevalue, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0), i32 %145, i32 %146, i32 %147, i32 %148, i32 %149, i32 %150)
br label %152
152: ; preds = %144, %133
br label %153
153: ; preds = %152, %97
%154 = load i32, i32* %9
%155 = load i32*, i32** %7
store i32 %154, i32* %155
%156 = load i32, i32* %10
%157 = load i32*, i32** %8
store i32 %156, i32* %157
ret void
}

LLVM IR (-O2):
@splitTimevalue.lwarn = internal unnamed_addr global i1 false
@__func__.splitTimevalue = [15 x i8] c"splitTimevalue\00"
@.str = [37 x i8] c"Year %g out of range, set to -214700\00"
@.str.1 = [36 x i8] c"Year %g out of range, set to 214700\00"
@.str.2 = [25 x i8] c"timeunit %s unsupported!\00"
@.str.3 = [62 x i8] c"Reset wrong date/time to %4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d!\00"
define void @splitTimevalue(double %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%14 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%15 = bitcast i32* %7 to i8*
%16 = bitcast i32* %8 to i8*
%17 = bitcast i32* %9 to i8*
%18 = bitcast i32* %10 to i8*
%19 = bitcast i32* %11 to i8*
%20 = bitcast i32* %12 to i8*
switch i32 %1, label %46 [
i32 1, label %21
i32 5, label %24
i32 9, label %27
i32 10, label %29
i32 11, label %33
]
21: ; preds = %4
%22 = fdiv double %0, 8.640000e+04
%23 = call i32 (double, i32*, i32*, ...) bitcast (i32 (...)* @conv_timeval to i32 (double, i32*, i32*, ...)*)(double %22, i32* %5, i32* %6)
br label %51
24: ; preds = %4
%25 = fdiv double %0, 2.400000e+01
%26 = call i32 (double, i32*, i32*, ...) bitcast (i32 (...)* @conv_timeval to i32 (double, i32*, i32*, ...)*)(double %25, i32* %5, i32* %6)
br label %51
27: ; preds = %4
%28 = call i32 (double, i32*, i32*, ...) bitcast (i32 (...)* @conv_timeval to i32 (double, i32*, i32*, ...)*)(double %0, i32* %5, i32* %6)
br label %51
29: ; preds = %4
%30 = fptosi double %0 to i32
%31 = mul nsw i32 %30, 100
%32 = or i32 %31, 1
store i32 %32, i32* %5
store i32 0, i32* %6
br label %51
33: ; preds = %4
%34 = fcmp olt double %0, -2.147000e+05
br i1 %34, label %37, label %35
35: ; preds = %33
%36 = fcmp ogt double %0, 2.147000e+05
br i1 %36, label %37, label %41
37: ; preds = %35, %33
%38 = phi i8* [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), %33 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), %35 ]
%39 = phi double [ -2.147000e+05, %33 ], [ 2.147000e+05, %35 ]
%40 = tail call i32 (i8*, i8*, double, ...) bitcast (i32 (...)* @Warning_ to i32 (i8*, i8*, double, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.splitTimevalue, i64 0, i64 0), i8* %38, double %0)
br label %41
41: ; preds = %37, %35
%42 = phi double [ %0, %35 ], [ %39, %37 ]
%43 = fptosi double %42 to i32
%44 = mul nsw i32 %43, 10000
%45 = add nsw i32 %44, 101
store i32 %45, i32* %5
store i32 0, i32* %6
br label %51
46: ; preds = %4
%47 = load i1, i1* @splitTimevalue.lwarn
br i1 %47, label %51, label %48
48: ; preds = %46
%49 = tail call i32 (i32, ...) bitcast (i32 (...)* @tunitNamePtr to i32 (i32, ...)*)(i32 %1)
%50 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @Warning_ to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.splitTimevalue, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %49)
store i1 true, i1* @splitTimevalue.lwarn
br label %51
51: ; preds = %24, %29, %46, %48, %41, %27, %21
%52 = load i32, i32* %5
%53 = call i32 (i32, i32*, i32*, i32*, ...) bitcast (i32 (...)* @cdiDecodeDate to i32 (i32, i32*, i32*, i32*, ...)*)(i32 %52, i32* %10, i32* %11, i32* %12)
%54 = load i32, i32* %6
%55 = call i32 (i32, i32*, i32*, i32*, ...) bitcast (i32 (...)* @cdiDecodeTime to i32 (i32, i32*, i32*, i32*, ...)*)(i32 %54, i32* %7, i32* %8, i32* %9)
%56 = load i32, i32* %11
%57 = icmp sgt i32 %56, 17
%58 = load i32, i32* %12
%59 = icmp sgt i32 %58, 31
%60 = select i1 %57, i1 true, i1 %59
%61 = load i32, i32* %7
%62 = icmp sgt i32 %61, 23
%63 = select i1 %60, i1 true, i1 %62
%64 = load i32, i32* %8
%65 = icmp sgt i32 %64, 59
%66 = select i1 %63, i1 true, i1 %65
%67 = load i32, i32* %9
%68 = icmp sgt i32 %67, 59
%69 = select i1 %66, i1 true, i1 %68
br i1 %69, label %70, label %104
70: ; preds = %51
br i1 %60, label %71, label %76
71: ; preds = %70
%72 = load i32, i32* %10
%73 = add i32 %72, -10000
%74 = icmp ult i32 %73, -19999
br i1 %74, label %75, label %76
75: ; preds = %71
store i32 1, i32* %10
br label %76
76: ; preds = %71, %70, %75
br i1 %57, label %77, label %78
77: ; preds = %76
store i32 1, i32* %11
br label %78
78: ; preds = %77, %76
%79 = phi i32 [ 1, %77 ], [ %56, %76 ]
br i1 %59, label %80, label %81
80: ; preds = %78
store i32 1, i32* %12
br label %81
81: ; preds = %80, %78
%82 = phi i32 [ 1, %80 ], [ %58, %78 ]
br i1 %62, label %83, label %84
83: ; preds = %81
store i32 0, i32* %7
br label %84
84: ; preds = %83, %81
br i1 %65, label %85, label %86
85: ; preds = %84
store i32 0, i32* %8
br label %86
86: ; preds = %85, %84
br i1 %68, label %87, label %88
87: ; preds = %86
store i32 0, i32* %9
br label %88
88: ; preds = %87, %86
%89 = load i32, i32* %10
%90 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cdiEncodeDate to i32 (i32, i32, i32, ...)*)(i32 %89, i32 %79, i32 %82)
store i32 %90, i32* %5
%91 = load i32, i32* %7
%92 = load i32, i32* %8
%93 = load i32, i32* %9
%94 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cdiEncodeTime to i32 (i32, i32, i32, ...)*)(i32 %91, i32 %92, i32 %93)
store i32 %94, i32* %6
%95 = load i1, i1* @splitTimevalue.lwarn
br i1 %95, label %104, label %96
96: ; preds = %88
store i1 true, i1* @splitTimevalue.lwarn
%97 = load i32, i32* %10
%98 = load i32, i32* %11
%99 = load i32, i32* %12
%100 = load i32, i32* %7
%101 = load i32, i32* %8
%102 = load i32, i32* %9
%103 = call i32 (i8*, i8*, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @Warning_ to i32 (i8*, i8*, i32, i32, i32, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.splitTimevalue, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0), i32 %97, i32 %98, i32 %99, i32 %100, i32 %101, i32 %102)
br label %104
104: ; preds = %88, %96, %51
%105 = load i32, i32* %5
store i32 %105, i32* %2
%106 = load i32, i32* %6
store i32 %106, i32* %3
ret void
}