void separation_point_U(double *x_loc, double dx, double dy, int imax,
                        double **U, double **V) {
  int i;
  for (i = imax - 1; i > 1; i--) {
    if (U[i][1] < 0) {
      *x_loc = (i)*dx;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<separation_point_U>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
jle    1174 <separation_point_U+0x74>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
xorps  %xmm0,%xmm0
ucomisd 0x8(%rax),%xmm0
jbe    1161 <separation_point_U+0x61>
cvtsi2sdl -0x34(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1174 <separation_point_U+0x74>
jmp    1166 <separation_point_U+0x66>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    1126 <separation_point_U+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<separation_point_U>:
lea    -0x1(%rsi),%eax
lea    (%rdx,%rax,8),%rax
xorpd  %xmm1,%xmm1
nopl   0x0(%rax,%rax,1)
cmp    $0x3,%esi
jl     1135 <separation_point_U+0x35>
mov    (%rax),%rcx
add    $0xffffffff,%esi
add    $0xfffffffffffffff8,%rax
ucomisd 0x8(%rcx),%xmm1
jbe    1110 <separation_point_U+0x10>
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
ret

LLVM IR (-O0):
define void @separation_point_U(double* %0, double %1, double %2, i32 %3, double** %4, double** %5) {
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca double**
%12 = alloca double**
%13 = alloca i32
store double* %0, double** %7
store double %1, double* %8
store double %2, double* %9
store i32 %3, i32* %10
store double** %4, double*** %11
store double** %5, double*** %12
%14 = load i32, i32* %10
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %13
br label %16
16: ; preds = %35, %6
%17 = load i32, i32* %13
%18 = icmp sgt i32 %17, 1
br i1 %18, label %19, label %38
19: ; preds = %16
%20 = load double**, double*** %11
%21 = load i32, i32* %13
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double*, double** %20, i64 %22
%24 = load double*, double** %23
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = fcmp olt double %26, 0.000000e+00
br i1 %27, label %28, label %34
28: ; preds = %19
%29 = load i32, i32* %13
%30 = sitofp i32 %29 to double
%31 = load double, double* %8
%32 = fmul double %30, %31
%33 = load double*, double** %7
store double %32, double* %33
br label %38
34: ; preds = %19
br label %35
35: ; preds = %34
%36 = load i32, i32* %13
%37 = add nsw i32 %36, -1
store i32 %37, i32* %13
br label %16
38: ; preds = %28, %16
ret void
}

LLVM IR (-O2):
define void @separation_point_U(double* nocapture writeonly %0, double %1, double %2, i32 %3, double** nocapture %4, double** nocapture readnone %5) {
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %13, %6
%9 = phi i64 [ %10, %13 ], [ %7, %6 ]
%10 = add nsw i64 %9, -1
%11 = trunc i64 %9 to i32
%12 = icmp sgt i32 %11, 2
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = and i64 %10, 4294967295
%15 = getelementptr inbounds double*, double** %4, i64 %14
%16 = load double*, double** %15
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = fcmp olt double %18, 0.000000e+00
br i1 %19, label %20, label %8
20: ; preds = %13
%21 = trunc i64 %10 to i32
%22 = sitofp i32 %21 to double
%23 = fmul double %22, %1
store double %23, double* %0
br label %24
24: ; preds = %8, %20
ret void
}