#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double intlin(double, double, double, double, double);
void intlinarr(long nxm, double *ym, double *xm, int nx, double *y, double *x) {
  long j, jj;
  for (jj = 1; jj < nxm; jj++)
    for (j = 0; j < nx; j++)
      if (x[j] >= xm[jj - 1] && x[j] <= xm[jj])
        y[j] = intlin(x[j], ym[jj - 1], xm[jj - 1], ym[jj], xm[jj]);
}


x86 assembly (clang, -O0):
<intlinarr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    122d <intlinarr+0x11d>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmp    %rcx,%rax
jge    1217 <intlinarr+0x107>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    $0x1,%rcx
ucomisd (%rax,%rcx,8),%xmm0
jb     1201 <intlinarr+0xf1>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     1201 <intlinarr+0xf1>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    $0x1,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    $0x1,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
call   1030 <intlin@plt>
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1206 <intlinarr+0xf6>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    114d <intlinarr+0x3d>
jmp    121c <intlinarr+0x10c>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1137 <intlinarr+0x27>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlinarr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,0x10(%rsp)
mov    %ecx,0x4(%rsp)
mov    %rdi,0x8(%rsp)
cmp    $0x2,%rdi
jl     11b8 <intlinarr+0xa8>
mov    %r9,%rbx
mov    %rdx,%rbp
mov    %rsi,%r12
movslq 0x4(%rsp),%r15
mov    $0x1,%r13d
jmp    115b <intlinarr+0x4b>
nopl   0x0(%rax)
add    $0x1,%r13
cmp    0x8(%rsp),%r13
je     11b8 <intlinarr+0xa8>
cmpl   $0x0,0x4(%rsp)
jle    1150 <intlinarr+0x40>
xor    %r14d,%r14d
jmp    1179 <intlinarr+0x69>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14
cmp    %r14,%r15
je     1150 <intlinarr+0x40>
movsd  (%rbx,%r14,8),%xmm0
movsd  -0x8(%rbp,%r13,8),%xmm2
ucomisd %xmm2,%xmm0
jb     1170 <intlinarr+0x60>
movsd  0x0(%rbp,%r13,8),%xmm4
ucomisd %xmm0,%xmm4
jb     1170 <intlinarr+0x60>
movsd  -0x8(%r12,%r13,8),%xmm1
movsd  (%r12,%r13,8),%xmm3
call   1030 <intlin@plt>
mov    0x10(%rsp),%rax
movsd  %xmm0,(%rax,%r14,8)
jmp    1170 <intlinarr+0x60>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @intlinarr(i64 %0, double* %1, double* %2, i32 %3, double* %4, double* %5) {
%7 = alloca i64
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca double*
%12 = alloca double*
%13 = alloca i64
%14 = alloca i64
store i64 %0, i64* %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
store i64 1, i64* %14
br label %15
15: ; preds = %78, %6
%16 = load i64, i64* %14
%17 = load i64, i64* %7
%18 = icmp slt i64 %16, %17
br i1 %18, label %19, label %81
19: ; preds = %15
store i64 0, i64* %13
br label %20
20: ; preds = %74, %19
%21 = load i64, i64* %13
%22 = load i32, i32* %10
%23 = sext i32 %22 to i64
%24 = icmp slt i64 %21, %23
br i1 %24, label %25, label %77
25: ; preds = %20
%26 = load double*, double** %12
%27 = load i64, i64* %13
%28 = getelementptr inbounds double, double* %26, i64 %27
%29 = load double, double* %28
%30 = load double*, double** %9
%31 = load i64, i64* %14
%32 = sub nsw i64 %31, 1
%33 = getelementptr inbounds double, double* %30, i64 %32
%34 = load double, double* %33
%35 = fcmp oge double %29, %34
br i1 %35, label %36, label %73
36: ; preds = %25
%37 = load double*, double** %12
%38 = load i64, i64* %13
%39 = getelementptr inbounds double, double* %37, i64 %38
%40 = load double, double* %39
%41 = load double*, double** %9
%42 = load i64, i64* %14
%43 = getelementptr inbounds double, double* %41, i64 %42
%44 = load double, double* %43
%45 = fcmp ole double %40, %44
br i1 %45, label %46, label %73
46: ; preds = %36
%47 = load double*, double** %12
%48 = load i64, i64* %13
%49 = getelementptr inbounds double, double* %47, i64 %48
%50 = load double, double* %49
%51 = load double*, double** %8
%52 = load i64, i64* %14
%53 = sub nsw i64 %52, 1
%54 = getelementptr inbounds double, double* %51, i64 %53
%55 = load double, double* %54
%56 = load double*, double** %9
%57 = load i64, i64* %14
%58 = sub nsw i64 %57, 1
%59 = getelementptr inbounds double, double* %56, i64 %58
%60 = load double, double* %59
%61 = load double*, double** %8
%62 = load i64, i64* %14
%63 = getelementptr inbounds double, double* %61, i64 %62
%64 = load double, double* %63
%65 = load double*, double** %9
%66 = load i64, i64* %14
%67 = getelementptr inbounds double, double* %65, i64 %66
%68 = load double, double* %67
%69 = call double @intlin(double %50, double %55, double %60, double %64, double %68)
%70 = load double*, double** %11
%71 = load i64, i64* %13
%72 = getelementptr inbounds double, double* %70, i64 %71
store double %69, double* %72
br label %73
73: ; preds = %46, %36, %25
br label %74
74: ; preds = %73
%75 = load i64, i64* %13
%76 = add nsw i64 %75, 1
store i64 %76, i64* %13
br label %20
77: ; preds = %20
br label %78
78: ; preds = %77
%79 = load i64, i64* %14
%80 = add nsw i64 %79, 1
store i64 %80, i64* %14
br label %15
81: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @intlinarr(i64 %0, double* nocapture %1, double* nocapture %2, i32 %3, double* nocapture writeonly %4, double* nocapture %5) {
%7 = icmp sgt i64 %0, 1
br i1 %7, label %8, label %39
8: ; preds = %6
%9 = sext i32 %3 to i64
%10 = icmp sgt i32 %3, 0
br label %11
11: ; preds = %8, %36
%12 = phi i64 [ 1, %8 ], [ %37, %36 ]
br i1 %10, label %13, label %36
13: ; preds = %11
%14 = add nsw i64 %12, -1
%15 = getelementptr inbounds double, double* %2, i64 %14
%16 = getelementptr inbounds double, double* %2, i64 %12
%17 = getelementptr inbounds double, double* %1, i64 %14
%18 = getelementptr inbounds double, double* %1, i64 %12
br label %19
19: ; preds = %13, %33
%20 = phi i64 [ 0, %13 ], [ %34, %33 ]
%21 = getelementptr inbounds double, double* %5, i64 %20
%22 = load double, double* %21
%23 = load double, double* %15
%24 = fcmp ult double %22, %23
br i1 %24, label %33, label %25
25: ; preds = %19
%26 = load double, double* %16
%27 = fcmp ugt double %22, %26
br i1 %27, label %33, label %28
28: ; preds = %25
%29 = load double, double* %17
%30 = load double, double* %18
%31 = tail call double @intlin(double %22, double %29, double %23, double %30, double %26)
%32 = getelementptr inbounds double, double* %4, i64 %20
store double %31, double* %32
br label %33
33: ; preds = %19, %25, %28
%34 = add nuw nsw i64 %20, 1
%35 = icmp eq i64 %34, %9
br i1 %35, label %36, label %19
36: ; preds = %33, %11
%37 = add nuw nsw i64 %12, 1
%38 = icmp eq i64 %37, %0
br i1 %38, label %39, label %11
39: ; preds = %36, %6
ret void
}