clipt(p, q, t0, t1) double p, q, *t0, *t1;
{
  double r;
  int accept = !0;
  if (p < 0.0) {
    r = q / p;
    if (r > *t1)
      accept = 0;
    else if (r > *t0)
      *t0 = r;
  } else if (p > 0.0) {
    r = q / p;
    if (r < *t0)
      accept = 0;
    else if (r < *t1)
      *t1 = r;
  } else if (q < 0.0)
    accept = 0;
  return (accept);
}


x86 assembly (clang, -O0):
<clipt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movl   $0x1,-0x2c(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1183 <clipt+0x83>
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1159 <clipt+0x59>
movl   $0x0,-0x2c(%rbp)
jmp    117e <clipt+0x7e>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1179 <clipt+0x79>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    117e <clipt+0x7e>
jmp    1214 <clipt+0x114>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11f5 <clipt+0xf5>
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    11c7 <clipt+0xc7>
movl   $0x0,-0x2c(%rbp)
jmp    11f0 <clipt+0xf0>
movsd  -0x28(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    11eb <clipt+0xeb>
movsd  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    11f0 <clipt+0xf0>
jmp    120f <clipt+0x10f>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    120a <clipt+0x10a>
movl   $0x0,-0x2c(%rbp)
jmp    120f <clipt+0x10f>
jmp    1214 <clipt+0x114>
mov    -0x2c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clipt>:
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jbe    1126 <clipt+0x26>
divsd  %xmm0,%xmm1
xor    %eax,%eax
ucomisd (%rsi),%xmm1
ja     1161 <clipt+0x61>
mov    $0x1,%eax
ucomisd (%rdi),%xmm1
jbe    1161 <clipt+0x61>
movsd  %xmm1,(%rdi)
ret
ucomisd %xmm2,%xmm0
jbe    1150 <clipt+0x50>
divsd  %xmm0,%xmm1
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
ja     1161 <clipt+0x61>
movsd  (%rsi),%xmm0
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
jbe    1161 <clipt+0x61>
movsd  %xmm1,(%rsi)
ret
mov    $0x1,%eax
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1161 <clipt+0x61>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @clipt(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca i32
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
store i32 1, i32* %10
%11 = load double, double* %5
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %32
13: ; preds = %4
%14 = load double, double* %6
%15 = load double, double* %5
%16 = fdiv double %14, %15
store double %16, double* %9
%17 = load double, double* %9
%18 = load double*, double** %8
%19 = load double, double* %18
%20 = fcmp ogt double %17, %19
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 0, i32* %10
br label %31
22: ; preds = %13
%23 = load double, double* %9
%24 = load double*, double** %7
%25 = load double, double* %24
%26 = fcmp ogt double %23, %25
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = load double, double* %9
%29 = load double*, double** %7
store double %28, double* %29
br label %30
30: ; preds = %27, %22
br label %31
31: ; preds = %30, %21
br label %60
32: ; preds = %4
%33 = load double, double* %5
%34 = fcmp ogt double %33, 0.000000e+00
br i1 %34, label %35, label %54
35: ; preds = %32
%36 = load double, double* %6
%37 = load double, double* %5
%38 = fdiv double %36, %37
store double %38, double* %9
%39 = load double, double* %9
%40 = load double*, double** %7
%41 = load double, double* %40
%42 = fcmp olt double %39, %41
br i1 %42, label %43, label %44
43: ; preds = %35
store i32 0, i32* %10
br label %53
44: ; preds = %35
%45 = load double, double* %9
%46 = load double*, double** %8
%47 = load double, double* %46
%48 = fcmp olt double %45, %47
br i1 %48, label %49, label %52
49: ; preds = %44
%50 = load double, double* %9
%51 = load double*, double** %8
store double %50, double* %51
br label %52
52: ; preds = %49, %44
br label %53
53: ; preds = %52, %43
br label %59
54: ; preds = %32
%55 = load double, double* %6
%56 = fcmp olt double %55, 0.000000e+00
br i1 %56, label %57, label %58
57: ; preds = %54
store i32 0, i32* %10
br label %58
58: ; preds = %57, %54
br label %59
59: ; preds = %58, %53
br label %60
60: ; preds = %59, %31
%61 = load i32, i32* %10
ret i32 %61
}

LLVM IR (-O2):
define i32 @clipt(double %0, double %1, double* nocapture %2, double* nocapture %3) {
%5 = fcmp olt double %0, 0.000000e+00
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = fdiv double %1, %0
%8 = load double, double* %3
%9 = fcmp ogt double %7, %8
br i1 %9, label %27, label %10
10: ; preds = %6
%11 = load double, double* %2
%12 = fcmp ogt double %7, %11
br i1 %12, label %13, label %27
13: ; preds = %10
store double %7, double* %2
br label %27
14: ; preds = %4
%15 = fcmp ogt double %0, 0.000000e+00
br i1 %15, label %16, label %24
16: ; preds = %14
%17 = fdiv double %1, %0
%18 = load double, double* %2
%19 = fcmp olt double %17, %18
br i1 %19, label %27, label %20
20: ; preds = %16
%21 = load double, double* %3
%22 = fcmp olt double %17, %21
br i1 %22, label %23, label %27
23: ; preds = %20
store double %17, double* %3
br label %27
24: ; preds = %14
%25 = fcmp olt double %1, 0.000000e+00
br i1 %25, label %26, label %27
26: ; preds = %24
br label %27
27: ; preds = %16, %6, %20, %23, %26, %24, %13, %10
%28 = phi i32 [ 1, %13 ], [ 1, %10 ], [ 1, %23 ], [ 1, %20 ], [ 0, %26 ], [ 1, %24 ], [ 0, %6 ], [ 0, %16 ]
ret i32 %28
}