void get_owen_t0_icof(double tjd, double *t0, int *icof) {
  int i, j = 0;
  double t0s[5] = {
      -3392455.5, -470455.5, 2451544.5, 5373544.5, 8295544.5,
  };
  *t0 = t0s[0];
  for (i = 1; i < 5; i++) {
    if (tjd < (t0s[i - 1] + t0s[i]) / 2) {
      ;
    } else {
      *t0 = t0s[i];
      j++;
    }
  }
  *icof = j;
}


x86 assembly (clang, -O0):
<get_owen_t0_icof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xec7(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe9d(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe88(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x5,-0x1c(%rbp)
jge    1201 <get_owen_t0_icof+0xf1>
movsd  -0x8(%rbp),%xmm1
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x50(%rbp,%rax,8),%xmm0
movslq -0x1c(%rbp),%rax
addsd  -0x50(%rbp,%rax,8),%xmm0
movsd  0xe68(%rip),%xmm2
divsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    11d3 <get_owen_t0_icof+0xc3>
jmp    11ee <get_owen_t0_icof+0xde>
movslq -0x1c(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11f3 <get_owen_t0_icof+0xe3>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1191 <get_owen_t0_icof+0x81>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_owen_t0_icof>:
push   %rbx
movsd  0xef7(%rip),%xmm1
xor    %r10d,%r10d
xor    %edx,%edx
ucomisd %xmm0,%xmm1
setbe  %r8b
seta   %dl
movsd  0xee7(%rip),%xmm2
xor    %eax,%eax
ucomisd %xmm0,%xmm2
seta   %al
movsd  0xede(%rip),%xmm3
xor    %ecx,%ecx
ucomisd %xmm0,%xmm3
setbe  %r9b
lea    0xef5(%rip),%rbx
movsd  (%rbx,%rax,8),%xmm4
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm4
movsd  0xebb(%rip),%xmm3
andnpd %xmm3,%xmm1
orpd   %xmm4,%xmm1
ja     116d <get_owen_t0_icof+0x6d>
movapd %xmm1,%xmm3
jmp    1179 <get_owen_t0_icof+0x79>
lea    0xeb4(%rip),%rax
movsd  (%rax,%rdx,8),%xmm3
xor    %eax,%eax
ucomisd %xmm0,%xmm2
setbe  %r11b
ja     1189 <get_owen_t0_icof+0x89>
movapd %xmm1,%xmm3
mov    $0x2,%ebx
sub    %edx,%ebx
movsd  0xe88(%rip),%xmm2
ucomisd %xmm0,%xmm2
ja     11a2 <get_owen_t0_icof+0xa2>
movapd %xmm1,%xmm3
mov    %r8b,%r10b
cmova  %r10d,%ebx
movsd  %xmm3,(%rdi)
mov    %r11b,%al
add    %ebx,%eax
mov    %r9b,%cl
add    %eax,%ecx
mov    %ecx,(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define void @get_owen_t0_icof(double %0, double* %1, i32* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [5 x double]
store double %0, double* %4
store double* %1, double** %5
store i32* %2, i32** %6
store i32 0, i32* %8
%10 = bitcast [5 x double]* %9 to i8*
%11 = bitcast i8* %10 to [5 x double]*
%12 = getelementptr inbounds [5 x double], [5 x double]* %11, i32 0, i32 0
store double 0xC149E1E3C0000000, double* %12
%13 = getelementptr inbounds [5 x double], [5 x double]* %11, i32 0, i32 1
store double 0xC11CB6DE00000000, double* %13
%14 = getelementptr inbounds [5 x double], [5 x double]* %11, i32 0, i32 2
store double 0x4142B42C40000000, double* %14
%15 = getelementptr inbounds [5 x double], [5 x double]* %11, i32 0, i32 3
store double 0x41547F9A20000000, double* %15
%16 = getelementptr inbounds [5 x double], [5 x double]* %11, i32 0, i32 4
store double 0x415FA51E20000000, double* %16
%17 = getelementptr inbounds [5 x double], [5 x double]* %9, i64 0, i64 0
%18 = load double, double* %17
%19 = load double*, double** %5
store double %18, double* %19
store i32 1, i32* %7
br label %20
20: ; preds = %47, %3
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 5
br i1 %22, label %23, label %50
23: ; preds = %20
%24 = load double, double* %4
%25 = load i32, i32* %7
%26 = sub nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [5 x double], [5 x double]* %9, i64 0, i64 %27
%29 = load double, double* %28
%30 = load i32, i32* %7
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [5 x double], [5 x double]* %9, i64 0, i64 %31
%33 = load double, double* %32
%34 = fadd double %29, %33
%35 = fdiv double %34, 2.000000e+00
%36 = fcmp olt double %24, %35
br i1 %36, label %37, label %38
37: ; preds = %23
br label %46
38: ; preds = %23
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [5 x double], [5 x double]* %9, i64 0, i64 %40
%42 = load double, double* %41
%43 = load double*, double** %5
store double %42, double* %43
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %46
46: ; preds = %38, %37
br label %47
47: ; preds = %46
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
store i32 %49, i32* %7
br label %20
50: ; preds = %20
%51 = load i32, i32* %8
%52 = load i32*, i32** %6
store i32 %51, i32* %52
ret void
}

LLVM IR (-O2):
define void @get_owen_t0_icof(double %0, double* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = fcmp olt double %0, 0xC13D78BF80000000
%5 = select i1 %4, double 0xC149E1E3C0000000, double 0xC11CB6DE00000000
%6 = fcmp olt double %0, 0x412E3AA100000000
%7 = fcmp olt double %0, 0x414DD9B040000000
%8 = and i1 %6, %7
%9 = fcmp olt double %0, 0x415A125C20000000
%10 = and i1 %8, %9
%11 = select i1 %7, double 0x4142B42C40000000, double 0x41547F9A20000000
%12 = select i1 %9, double %11, double 0x415FA51E20000000
%13 = select i1 %10, double %5, double %12
store double %13, double* %1
%14 = xor i1 %4, true
%15 = zext i1 %14 to i32
%16 = select i1 %4, i32 1, i32 2
%17 = select i1 %6, i32 %15, i32 %16
%18 = xor i1 %7, true
%19 = zext i1 %18 to i32
%20 = add nuw nsw i32 %17, %19
%21 = xor i1 %9, true
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %20, %22
store i32 %23, i32* %2
ret void
}