double hillcar_terminal_reinf(double *state) {
  double x = state[0];
  double y = state[1];
  if (x < 0)
    return 0;
  if (y < 0)
    y = -y;
  if (y - 0.1 <= 0) {
    return 1.0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<hillcar_terminal_reinf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    113e <hillcar_terminal_reinf+0x3e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a5 <hillcar_terminal_reinf+0xa5>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    116d <hillcar_terminal_reinf+0x6d>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  0xe86(%rip),%xmm0
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     119d <hillcar_terminal_reinf+0x9d>
movsd  0xe75(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a5 <hillcar_terminal_reinf+0xa5>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hillcar_terminal_reinf>:
xorpd  %xmm0,%xmm0
ucomisd (%rdi),%xmm0
ja     114a <hillcar_terminal_reinf+0x4a>
movsd  0x8(%rdi),%xmm1
movapd 0xee9(%rip),%xmm2
xorpd  %xmm1,%xmm2
xorpd  %xmm0,%xmm0
movapd %xmm1,%xmm3
cmpltsd %xmm0,%xmm3
andpd  %xmm3,%xmm2
andnpd %xmm1,%xmm3
orpd   %xmm2,%xmm3
addsd  0xed4(%rip),%xmm3
ucomisd %xmm3,%xmm0
jb     114a <hillcar_terminal_reinf+0x4a>
movsd  0xece(%rip),%xmm0
ret

LLVM IR (-O0):
define double @hillcar_terminal_reinf(double* %0) {
%2 = alloca double
%3 = alloca double*
%4 = alloca double
%5 = alloca double
store double* %0, double** %3
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
store double %8, double* %4
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
store double %11, double* %5
%12 = load double, double* %4
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %1
store double 0.000000e+00, double* %2
br label %27
15: ; preds = %1
%16 = load double, double* %5
%17 = fcmp olt double %16, 0.000000e+00
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load double, double* %5
%20 = fneg double %19
store double %20, double* %5
br label %21
21: ; preds = %18, %15
%22 = load double, double* %5
%23 = fsub double %22, 1.000000e-01
%24 = fcmp ole double %23, 0.000000e+00
br i1 %24, label %25, label %26
25: ; preds = %21
store double 1.000000e+00, double* %2
br label %27
26: ; preds = %21
store double 0.000000e+00, double* %2
br label %27
27: ; preds = %26, %25, %14
%28 = load double, double* %2
ret double %28
}

LLVM IR (-O2):
define double @hillcar_terminal_reinf(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fcmp olt double %2, 0.000000e+00
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = fcmp olt double %4, 0.000000e+00
%8 = fneg double %4
%9 = select i1 %7, double %8, double %4
%10 = fadd double %9, -1.000000e-01
%11 = fcmp ugt double %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %6
br label %13
13: ; preds = %6, %1, %12
%14 = phi double [ 0.000000e+00, %12 ], [ 0.000000e+00, %1 ], [ 1.000000e+00, %6 ]
ret double %14
}