#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 */
int /*<<< orphan*/ lob_bnd_ext(double *, double const *, double const *,
                               double const *, double const *, unsigned int,
                               unsigned int, double *, unsigned int, double *);
int /*<<< orphan*/ lob_bnd_fst(double *, double const *, double const *,
                               double const *, double const *, unsigned int,
                               unsigned int, double const *);
void lob_bnd_lin_2(double *restrict b, const double *lob_bnd_data_r,
                   unsigned nr, unsigned mr, const double *lob_bnd_data_s,
                   unsigned ns, unsigned ms, const double *restrict u,
                   unsigned int un, double *restrict work) {
  unsigned mrs = mr * ms;
  const double *zr = lob_bnd_data_r, *Qr = zr + nr, *hr = Qr + 2 * nr,
               *lb_r = hr + mr;
  const double *zs = lob_bnd_data_s, *Qs = zs + ns, *hs = Qs + 2 * ns,
               *lbnp_s = hs + ms + 2 * ns * ms;
  double *a = work, *br = a + 2 * mr;
  for (; un; --un, b += 2 * mrs) {
    double *br_;
    unsigned i;
    for (i = 0, br_ = br; i < ns; ++i, br_ += 2 * mr, u += nr)
      lob_bnd_fst(br_, zr, Qr, hr, lb_r, nr, mr, u);
    lob_bnd_ext(b, zs, Qs, hs, lbnp_s, ns, ms, br, mr, a);
  }
}


x86 assembly (clang, -O0):
<lob_bnd_lin_2>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xa8,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
imul   0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
mov    %ecx,%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x20(%rbp),%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shl    $0x1,%ecx
mov    %ecx,%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    0x10(%rbp),%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    -0x2c(%rbp),%ecx
shl    $0x1,%ecx
imul   0x10(%rbp),%ecx
mov    %ecx,%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    0x28(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    %ecx,%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
cmpl   $0x0,0x20(%rbp)
je     1319 <lob_bnd_lin_2+0x1f9>
movl   $0x0,-0x8c(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jae    12b6 <lob_bnd_lin_2+0x196>
mov    -0x88(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%r10d
mov    0x18(%rbp),%rax
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <lob_bnd_fst@plt>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x88(%rbp),%rax
mov    %ecx,%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
mov    -0x1c(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,0x18(%rbp)
jmp    1231 <lob_bnd_lin_2+0x111>
mov    -0x10(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x68(%rbp),%rcx
mov    -0x70(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    0x10(%rbp),%ebx
mov    -0x80(%rbp),%r11
mov    -0x20(%rbp),%r10d
mov    -0x78(%rbp),%rax
mov    %ebx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1040 <lob_bnd_ext@plt>
mov    0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,0x20(%rbp)
mov    -0x30(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1212 <lob_bnd_lin_2+0xf2>
add    $0xa8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<lob_bnd_lin_2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r8,0x10(%rsp)
mov    %rdi,%r12
mov    0xc0(%rsp),%edi
test   %edi,%edi
je     129a <lob_bnd_lin_2+0x17a>
mov    %ecx,%r8d
mov    %r9,%r15
mov    0xb0(%rsp),%r14d
mov    0xb8(%rsp),%r13
mov    %edx,%r11d
lea    (%rsi,%r11,8),%r9
lea    (%rdx,%rdx,1),%eax
lea    (%r9,%rax,8),%r10
mov    %ecx,%eax
lea    (%r10,%rax,8),%rbx
mov    %r15d,%eax
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
lea    (%r15,%r15,1),%eax
mov    %rcx,0x40(%rsp)
lea    (%rcx,%rax,8),%rcx
mov    %rcx,0x38(%rsp)
lea    (%rcx,%r14,8),%rcx
imul   %r14d,%eax
lea    (%rcx,%rax,8),%rax
mov    %rax,0x30(%rsp)
lea    (%r8,%r8,1),%ebp
mov    0xc8(%rsp),%rax
lea    (%rax,%rbp,8),%rax
mov    %rax,0x18(%rsp)
mov    %ebp,%eax
imul   %r14d,%eax
mov    %r15,%r14
mov    %rax,0x28(%rsp)
shl    $0x3,%rbp
shl    $0x3,%r11
mov    %r15,0x20(%rsp)
mov    %rdx,0x70(%rsp)
mov    %rsi,0x68(%rsp)
mov    %r11,0x60(%rsp)
mov    %r9,0x58(%rsp)
mov    %r10,0x50(%rsp)
jmp    1249 <lob_bnd_lin_2+0x129>
nopl   0x0(%rax)
mov    0x48(%rsp),%r12
mov    %r12,%rdi
mov    0x10(%rsp),%rsi
mov    0x40(%rsp),%rdx
mov    0x38(%rsp),%rcx
mov    0x30(%rsp),%r8
mov    0x20(%rsp),%r9
push   0xc8(%rsp)
push   %r15
push   0x28(%rsp)
mov    0xc8(%rsp),%eax
push   %rax
call   1040 <lob_bnd_ext@plt>
add    $0x20,%rsp
mov    0x28(%rsp),%rax
lea    (%r12,%rax,8),%r12
mov    0xc(%rsp),%edi
add    $0xffffffff,%edi
mov    %r15,%r8
mov    0x20(%rsp),%r14
je     129a <lob_bnd_lin_2+0x17a>
test   %r14d,%r14d
mov    %r12,0x48(%rsp)
mov    %edi,0xc(%rsp)
mov    %r8,%r15
je     11f0 <lob_bnd_lin_2+0xd0>
mov    0x18(%rsp),%r12
nop
mov    %r12,%rdi
mov    0x68(%rsp),%rsi
mov    0x58(%rsp),%rdx
mov    0x50(%rsp),%rcx
mov    %rbx,%r8
mov    0x70(%rsp),%r9
push   %r13
push   %r15
call   1030 <lob_bnd_fst@plt>
add    $0x10,%rsp
add    %rbp,%r12
add    0x60(%rsp),%r13
add    $0xffffffff,%r14d
jne    1260 <lob_bnd_lin_2+0x140>
jmp    11f0 <lob_bnd_lin_2+0xd0>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @lob_bnd_lin_2(double* noalias %0, double* %1, i32 %2, i32 %3, double* %4, i32 %5, i32 %6, double* noalias %7, i32 %8, double* noalias %9) {
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca double*
%16 = alloca i32
%17 = alloca i32
%18 = alloca double*
%19 = alloca i32
%20 = alloca double*
%21 = alloca i32
%22 = alloca double*
%23 = alloca double*
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca double*
%31 = alloca double*
%32 = alloca double*
%33 = alloca i32
store double* %0, double** %11
store double* %1, double** %12
store i32 %2, i32* %13
store i32 %3, i32* %14
store double* %4, double** %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store double* %7, double** %18
store i32 %8, i32* %19
store double* %9, double** %20
%34 = load i32, i32* %14
%35 = load i32, i32* %17
%36 = mul i32 %34, %35
store i32 %36, i32* %21
%37 = load double*, double** %12
store double* %37, double** %22
%38 = load double*, double** %22
%39 = load i32, i32* %13
%40 = zext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
store double* %41, double** %23
%42 = load double*, double** %23
%43 = load i32, i32* %13
%44 = mul i32 2, %43
%45 = zext i32 %44 to i64
%46 = getelementptr inbounds double, double* %42, i64 %45
store double* %46, double** %24
%47 = load double*, double** %24
%48 = load i32, i32* %14
%49 = zext i32 %48 to i64
%50 = getelementptr inbounds double, double* %47, i64 %49
store double* %50, double** %25
%51 = load double*, double** %15
store double* %51, double** %26
%52 = load double*, double** %26
%53 = load i32, i32* %16
%54 = zext i32 %53 to i64
%55 = getelementptr inbounds double, double* %52, i64 %54
store double* %55, double** %27
%56 = load double*, double** %27
%57 = load i32, i32* %16
%58 = mul i32 2, %57
%59 = zext i32 %58 to i64
%60 = getelementptr inbounds double, double* %56, i64 %59
store double* %60, double** %28
%61 = load double*, double** %28
%62 = load i32, i32* %17
%63 = zext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
%65 = load i32, i32* %16
%66 = mul i32 2, %65
%67 = load i32, i32* %17
%68 = mul i32 %66, %67
%69 = zext i32 %68 to i64
%70 = getelementptr inbounds double, double* %64, i64 %69
store double* %70, double** %29
%71 = load double*, double** %20
store double* %71, double** %30
%72 = load double*, double** %30
%73 = load i32, i32* %14
%74 = mul i32 2, %73
%75 = zext i32 %74 to i64
%76 = getelementptr inbounds double, double* %72, i64 %75
store double* %76, double** %31
br label %77
77: ; preds = %120, %10
%78 = load i32, i32* %19
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %128
80: ; preds = %77
store i32 0, i32* %33
%81 = load double*, double** %31
store double* %81, double** %32
br label %82
82: ; preds = %96, %80
%83 = load i32, i32* %33
%84 = load i32, i32* %16
%85 = icmp ult i32 %83, %84
br i1 %85, label %86, label %108
86: ; preds = %82
%87 = load double*, double** %32
%88 = load double*, double** %22
%89 = load double*, double** %23
%90 = load double*, double** %24
%91 = load double*, double** %25
%92 = load i32, i32* %13
%93 = load i32, i32* %14
%94 = load double*, double** %18
%95 = call i32 @lob_bnd_fst(double* %87, double* %88, double* %89, double* %90, double* %91, i32 %92, i32 %93, double* %94)
br label %96
96: ; preds = %86
%97 = load i32, i32* %33
%98 = add i32 %97, 1
store i32 %98, i32* %33
%99 = load i32, i32* %14
%100 = mul i32 2, %99
%101 = load double*, double** %32
%102 = zext i32 %100 to i64
%103 = getelementptr inbounds double, double* %101, i64 %102
store double* %103, double** %32
%104 = load i32, i32* %13
%105 = load double*, double** %18
%106 = zext i32 %104 to i64
%107 = getelementptr inbounds double, double* %105, i64 %106
store double* %107, double** %18
br label %82
108: ; preds = %82
%109 = load double*, double** %11
%110 = load double*, double** %26
%111 = load double*, double** %27
%112 = load double*, double** %28
%113 = load double*, double** %29
%114 = load i32, i32* %16
%115 = load i32, i32* %17
%116 = load double*, double** %31
%117 = load i32, i32* %14
%118 = load double*, double** %30
%119 = call i32 @lob_bnd_ext(double* %109, double* %110, double* %111, double* %112, double* %113, i32 %114, i32 %115, double* %116, i32 %117, double* %118)
br label %120
120: ; preds = %108
%121 = load i32, i32* %19
%122 = add i32 %121, -1
store i32 %122, i32* %19
%123 = load i32, i32* %21
%124 = mul i32 2, %123
%125 = load double*, double** %11
%126 = zext i32 %124 to i64
%127 = getelementptr inbounds double, double* %125, i64 %126
store double* %127, double** %11
br label %77
128: ; preds = %77
ret void
}

LLVM IR (-O2):
define void @lob_bnd_lin_2(double* noalias %0, double* %1, i32 %2, i32 %3, double* %4, i32 %5, i32 %6, double* noalias %7, i32 %8, double* noalias %9) {
%11 = zext i32 %2 to i64
%12 = getelementptr inbounds double, double* %1, i64 %11
%13 = shl i32 %2, 1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = zext i32 %3 to i64
%17 = getelementptr inbounds double, double* %15, i64 %16
%18 = zext i32 %5 to i64
%19 = getelementptr inbounds double, double* %4, i64 %18
%20 = shl i32 %5, 1
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = zext i32 %6 to i64
%24 = getelementptr inbounds double, double* %22, i64 %23
%25 = mul i32 %20, %6
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = shl i32 %3, 1
%29 = zext i32 %28 to i64
%30 = getelementptr inbounds double, double* %9, i64 %29
%31 = icmp eq i32 %8, 0
br i1 %31, label %55, label %32
32: ; preds = %10
%33 = icmp eq i32 %5, 0
%34 = mul i32 %28, %6
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %32, %49
%37 = phi double* [ %0, %32 ], [ %53, %49 ]
%38 = phi double* [ %7, %32 ], [ %50, %49 ]
%39 = phi i32 [ %8, %32 ], [ %52, %49 ]
br i1 %33, label %49, label %40
40: ; preds = %36, %40
%41 = phi i32 [ %45, %40 ], [ 0, %36 ]
%42 = phi double* [ %46, %40 ], [ %30, %36 ]
%43 = phi double* [ %47, %40 ], [ %38, %36 ]
%44 = tail call i32 @lob_bnd_fst(double* %42, double* %1, double* %12, double* %15, double* %17, i32 %2, i32 %3, double* %43)
%45 = add nuw i32 %41, 1
%46 = getelementptr inbounds double, double* %42, i64 %29
%47 = getelementptr inbounds double, double* %43, i64 %11
%48 = icmp eq i32 %45, %5
br i1 %48, label %49, label %40
49: ; preds = %40, %36
%50 = phi double* [ %38, %36 ], [ %47, %40 ]
%51 = tail call i32 @lob_bnd_ext(double* %37, double* %4, double* %19, double* %22, double* %27, i32 %5, i32 %6, double* %30, i32 %3, double* %9)
%52 = add i32 %39, -1
%53 = getelementptr inbounds double, double* %37, i64 %35
%54 = icmp eq i32 %52, 0
br i1 %54, label %55, label %36
55: ; preds = %49, %10
ret void
}