#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 cos(double);
void bubble_elt(double *x, double *y, double *z, const double *zr, unsigned nr,
                const double *zs, unsigned ns, const double *zt, unsigned nt,
                int type) {
  unsigned i, j, k;
  for (k = 0; k < nt; ++k)
    for (j = 0; j < ns; ++j)
      for (i = 0; i < nr; ++i) {
        double dx = 0, dy = 0, dz = 0;
        switch (type) {
        case 0:
          dx =
              cos(3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zs[j] / 2) *
              cos(3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zt[k] / 2);
          break;
        case 1:
          dx =
              -cos(
                  3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zs[j] / 2) *
              cos(3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zt[k] / 2);
          break;
        case 2:
          dy =
              cos(3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zt[k] / 2) *
              cos(3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zr[i] / 2);
          break;
        case 3:
          dy =
              -cos(
                  3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zt[k] / 2) *
              cos(3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zr[i] / 2);
          break;
        case 4:
          dz =
              cos(3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zr[i] / 2) *
              cos(3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zs[j] / 2);
          break;
        case 5:
          dz =
              -cos(
                  3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zr[i] / 2) *
              cos(3.1415926535897932384626433832795028841971693993751058209749445923 *
                  zs[j] / 2);
          break;
        }
        x[(k * ns + j) * nr + i] = zr[i] + dx;
        y[(k * ns + j) * nr + i] = zs[j] + dy;
        z[(k * ns + j) * nr + i] = zt[k] + dz;
      }
}


x86 assembly (clang, -O0):
<bubble_elt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    0x20(%rbp),%eax
jae    151b <bubble_elt+0x40b>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    0x10(%rbp),%eax
jae    1508 <bubble_elt+0x3f8>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jae    14f5 <bubble_elt+0x3e5>
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
mov    0x28(%rbp),%eax
mov    %rax,-0x60(%rbp)
sub    $0x5,%rax
ja     1460 <bubble_elt+0x350>
mov    -0x60(%rbp),%rax
lea    0xe63(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
movsd  0xe43(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xe2e(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movsd  %xmm0,-0x68(%rbp)
mov    0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
movsd  0xe19(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xe04(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1460 <bubble_elt+0x350>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
movsd  0xdde(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xdc9(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
movsd  0xd9d(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xd88(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1460 <bubble_elt+0x350>
mov    0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
movsd  0xd62(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xd4d(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movsd  %xmm0,-0x78(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
movsd  0xd38(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xd23(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1460 <bubble_elt+0x350>
mov    0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
movsd  0xcfd(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xce8(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
movsd  0xcbc(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xca7(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1460 <bubble_elt+0x350>
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
movsd  0xc81(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xc6c(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
movsd  0xc54(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xc3f(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1460 <bubble_elt+0x350>
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
movsd  0xc16(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xc01(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
movsd  0xbd2(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xbbd(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   0x10(%rbp),%ecx
add    -0x38(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x34(%rbp),%ecx
mov    %ecx,%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   0x10(%rbp),%ecx
add    -0x38(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x34(%rbp),%ecx
mov    %ecx,%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x58(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   0x10(%rbp),%ecx
add    -0x38(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x34(%rbp),%ecx
mov    %ecx,%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    116d <bubble_elt+0x5d>
jmp    14fa <bubble_elt+0x3ea>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    115a <bubble_elt+0x4a>
jmp    150d <bubble_elt+0x3fd>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1147 <bubble_elt+0x37>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bubble_elt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r8d,0x14(%rsp)
mov    %rdx,0x50(%rsp)
mov    %rsi,0x48(%rsp)
mov    %rdi,0x40(%rsp)
mov    0xa0(%rsp),%eax
test   %eax,%eax
je     1421 <bubble_elt+0x311>
mov    %r9,%rbx
mov    %rcx,%rbp
mov    0xa8(%rsp),%edx
mov    0x98(%rsp),%rsi
mov    0x90(%rsp),%ecx
mov    %eax,%eax
mov    %rax,0x30(%rsp)
mov    %ecx,%eax
mov    %rax,0x38(%rsp)
mov    0x14(%rsp),%eax
mov    %eax,%edi
mov    %rdi,0x20(%rsp)
imul   %eax,%ecx
mov    %rcx,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %r15d,%r15d
jmp    11ae <bubble_elt+0x9e>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15
mov    0x18(%rsp),%rax
add    0x28(%rsp),%rax
mov    %rax,0x18(%rsp)
cmp    0x30(%rsp),%r15
je     1421 <bubble_elt+0x311>
cmpl   $0x0,0x90(%rsp)
je     1190 <bubble_elt+0x80>
mov    0x18(%rsp),%r12
xor    %r13d,%r13d
jmp    11e0 <bubble_elt+0xd0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r13
add    0x20(%rsp),%r12
cmp    0x38(%rsp),%r13
je     1190 <bubble_elt+0x80>
cmpl   $0x0,0x14(%rsp)
je     11d0 <bubble_elt+0xc0>
xor    %r14d,%r14d
jmp    129a <bubble_elt+0x18a>
movsd  (%rbx,%r13,8),%xmm0
movsd  0xe03(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdff(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <cos@plt>
movsd  %xmm0,(%rsp)
mov    0x98(%rsp),%rax
movsd  (%rax,%r15,8),%xmm0
mulsd  0xdd3(%rip),%xmm0
mulsd  0xdd3(%rip),%xmm0
call   1030 <cos@plt>
xorpd  %xmm2,%xmm2
mov    0x98(%rsp),%rsi
mov    0xa8(%rsp),%edx
mulsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
addsd  0x0(%rbp,%r14,8),%xmm0
lea    (%r12,%r14,1),%eax
mov    0x40(%rsp),%rcx
movsd  %xmm0,(%rcx,%rax,8)
addsd  (%rbx,%r13,8),%xmm1
mov    0x48(%rsp),%rcx
movsd  %xmm1,(%rcx,%rax,8)
addsd  (%rsi,%r15,8),%xmm2
mov    0x50(%rsp),%rcx
movsd  %xmm2,(%rcx,%rax,8)
add    $0x1,%r14
cmp    %r14,0x20(%rsp)
je     11d0 <bubble_elt+0xc0>
xorpd  %xmm2,%xmm2
cmp    $0x5,%edx
ja     1418 <bubble_elt+0x308>
mov    %edx,%eax
lea    0xd70(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  (%rbx,%r13,8),%xmm0
movsd  0xd39(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd35(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <cos@plt>
xorpd  0xd2c(%rip),%xmm0
movapd %xmm0,(%rsp)
jmp    1217 <bubble_elt+0x107>
movsd  (%rsi,%r15,8),%xmm0
movsd  0xd04(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd00(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <cos@plt>
movsd  %xmm0,(%rsp)
jmp    1348 <bubble_elt+0x238>
movsd  (%rsi,%r15,8),%xmm0
movsd  0xcda(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcd6(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <cos@plt>
xorpd  0xccd(%rip),%xmm0
movapd %xmm0,(%rsp)
movsd  0x0(%rbp,%r14,8),%xmm0
mulsd  0xca9(%rip),%xmm0
mulsd  0xca9(%rip),%xmm0
call   1030 <cos@plt>
xorpd  %xmm2,%xmm2
mov    0x98(%rsp),%rsi
mov    0xa8(%rsp),%edx
movapd %xmm0,%xmm1
mulsd  (%rsp),%xmm1
xorpd  %xmm0,%xmm0
jmp    1256 <bubble_elt+0x146>
movsd  0x0(%rbp,%r14,8),%xmm0
movsd  0xc68(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc64(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <cos@plt>
movsd  %xmm0,(%rsp)
jmp    13e5 <bubble_elt+0x2d5>
movsd  0x0(%rbp,%r14,8),%xmm0
movsd  0xc3d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc39(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <cos@plt>
xorpd  0xc30(%rip),%xmm0
movapd %xmm0,(%rsp)
movsd  (%rbx,%r13,8),%xmm0
mulsd  0xc0d(%rip),%xmm0
mulsd  0xc0d(%rip),%xmm0
call   1030 <cos@plt>
mov    0x98(%rsp),%rsi
mov    0xa8(%rsp),%edx
movapd %xmm0,%xmm2
mulsd  (%rsp),%xmm2
xorpd  %xmm0,%xmm0
jmp    1252 <bubble_elt+0x142>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @bubble_elt(double* %0, double* %1, double* %2, double* %3, i32 %4, double* %5, i32 %6, double* %7, i32 %8, i32 %9) {
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
%16 = alloca double*
%17 = alloca i32
%18 = alloca double*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca double
%25 = alloca double
%26 = alloca double
store double* %0, double** %11
store double* %1, double** %12
store double* %2, double** %13
store double* %3, double** %14
store i32 %4, i32* %15
store double* %5, double** %16
store i32 %6, i32* %17
store double* %7, double** %18
store i32 %8, i32* %19
store i32 %9, i32* %20
store i32 0, i32* %23
br label %27
27: ; preds = %220, %10
%28 = load i32, i32* %23
%29 = load i32, i32* %19
%30 = icmp ult i32 %28, %29
br i1 %30, label %31, label %223
31: ; preds = %27
store i32 0, i32* %22
br label %32
32: ; preds = %216, %31
%33 = load i32, i32* %22
%34 = load i32, i32* %17
%35 = icmp ult i32 %33, %34
br i1 %35, label %36, label %219
36: ; preds = %32
store i32 0, i32* %21
br label %37
37: ; preds = %212, %36
%38 = load i32, i32* %21
%39 = load i32, i32* %15
%40 = icmp ult i32 %38, %39
br i1 %40, label %41, label %215
41: ; preds = %37
store double 0.000000e+00, double* %24
store double 0.000000e+00, double* %25
store double 0.000000e+00, double* %26
%42 = load i32, i32* %20
switch i32 %42, label %154 [
i32 0, label %43
i32 1, label %61
i32 2, label %80
i32 3, label %98
i32 4, label %117
i32 5, label %135
]
43: ; preds = %41
%44 = load double*, double** %16
%45 = load i32, i32* %22
%46 = zext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = load double, double* %47
%49 = fmul double 0x400921FB54442D18, %48
%50 = fdiv double %49, 2.000000e+00
%51 = call double @cos(double %50)
%52 = load double*, double** %18
%53 = load i32, i32* %23
%54 = zext i32 %53 to i64
%55 = getelementptr inbounds double, double* %52, i64 %54
%56 = load double, double* %55
%57 = fmul double 0x400921FB54442D18, %56
%58 = fdiv double %57, 2.000000e+00
%59 = call double @cos(double %58)
%60 = fmul double %51, %59
store double %60, double* %24
br label %154
61: ; preds = %41
%62 = load double*, double** %16
%63 = load i32, i32* %22
%64 = zext i32 %63 to i64
%65 = getelementptr inbounds double, double* %62, i64 %64
%66 = load double, double* %65
%67 = fmul double 0x400921FB54442D18, %66
%68 = fdiv double %67, 2.000000e+00
%69 = call double @cos(double %68)
%70 = fneg double %69
%71 = load double*, double** %18
%72 = load i32, i32* %23
%73 = zext i32 %72 to i64
%74 = getelementptr inbounds double, double* %71, i64 %73
%75 = load double, double* %74
%76 = fmul double 0x400921FB54442D18, %75
%77 = fdiv double %76, 2.000000e+00
%78 = call double @cos(double %77)
%79 = fmul double %70, %78
store double %79, double* %24
br label %154
80: ; preds = %41
%81 = load double*, double** %18
%82 = load i32, i32* %23
%83 = zext i32 %82 to i64
%84 = getelementptr inbounds double, double* %81, i64 %83
%85 = load double, double* %84
%86 = fmul double 0x400921FB54442D18, %85
%87 = fdiv double %86, 2.000000e+00
%88 = call double @cos(double %87)
%89 = load double*, double** %14
%90 = load i32, i32* %21
%91 = zext i32 %90 to i64
%92 = getelementptr inbounds double, double* %89, i64 %91
%93 = load double, double* %92
%94 = fmul double 0x400921FB54442D18, %93
%95 = fdiv double %94, 2.000000e+00
%96 = call double @cos(double %95)
%97 = fmul double %88, %96
store double %97, double* %25
br label %154
98: ; preds = %41
%99 = load double*, double** %18
%100 = load i32, i32* %23
%101 = zext i32 %100 to i64
%102 = getelementptr inbounds double, double* %99, i64 %101
%103 = load double, double* %102
%104 = fmul double 0x400921FB54442D18, %103
%105 = fdiv double %104, 2.000000e+00
%106 = call double @cos(double %105)
%107 = fneg double %106
%108 = load double*, double** %14
%109 = load i32, i32* %21
%110 = zext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
%112 = load double, double* %111
%113 = fmul double 0x400921FB54442D18, %112
%114 = fdiv double %113, 2.000000e+00
%115 = call double @cos(double %114)
%116 = fmul double %107, %115
store double %116, double* %25
br label %154
117: ; preds = %41
%118 = load double*, double** %14
%119 = load i32, i32* %21
%120 = zext i32 %119 to i64
%121 = getelementptr inbounds double, double* %118, i64 %120
%122 = load double, double* %121
%123 = fmul double 0x400921FB54442D18, %122
%124 = fdiv double %123, 2.000000e+00
%125 = call double @cos(double %124)
%126 = load double*, double** %16
%127 = load i32, i32* %22
%128 = zext i32 %127 to i64
%129 = getelementptr inbounds double, double* %126, i64 %128
%130 = load double, double* %129
%131 = fmul double 0x400921FB54442D18, %130
%132 = fdiv double %131, 2.000000e+00
%133 = call double @cos(double %132)
%134 = fmul double %125, %133
store double %134, double* %26
br label %154
135: ; preds = %41
%136 = load double*, double** %14
%137 = load i32, i32* %21
%138 = zext i32 %137 to i64
%139 = getelementptr inbounds double, double* %136, i64 %138
%140 = load double, double* %139
%141 = fmul double 0x400921FB54442D18, %140
%142 = fdiv double %141, 2.000000e+00
%143 = call double @cos(double %142)
%144 = fneg double %143
%145 = load double*, double** %16
%146 = load i32, i32* %22
%147 = zext i32 %146 to i64
%148 = getelementptr inbounds double, double* %145, i64 %147
%149 = load double, double* %148
%150 = fmul double 0x400921FB54442D18, %149
%151 = fdiv double %150, 2.000000e+00
%152 = call double @cos(double %151)
%153 = fmul double %144, %152
store double %153, double* %26
br label %154
154: ; preds = %41, %135, %117, %98, %80, %61, %43
%155 = load double*, double** %14
%156 = load i32, i32* %21
%157 = zext i32 %156 to i64
%158 = getelementptr inbounds double, double* %155, i64 %157
%159 = load double, double* %158
%160 = load double, double* %24
%161 = fadd double %159, %160
%162 = load double*, double** %11
%163 = load i32, i32* %23
%164 = load i32, i32* %17
%165 = mul i32 %163, %164
%166 = load i32, i32* %22
%167 = add i32 %165, %166
%168 = load i32, i32* %15
%169 = mul i32 %167, %168
%170 = load i32, i32* %21
%171 = add i32 %169, %170
%172 = zext i32 %171 to i64
%173 = getelementptr inbounds double, double* %162, i64 %172
store double %161, double* %173
%174 = load double*, double** %16
%175 = load i32, i32* %22
%176 = zext i32 %175 to i64
%177 = getelementptr inbounds double, double* %174, i64 %176
%178 = load double, double* %177
%179 = load double, double* %25
%180 = fadd double %178, %179
%181 = load double*, double** %12
%182 = load i32, i32* %23
%183 = load i32, i32* %17
%184 = mul i32 %182, %183
%185 = load i32, i32* %22
%186 = add i32 %184, %185
%187 = load i32, i32* %15
%188 = mul i32 %186, %187
%189 = load i32, i32* %21
%190 = add i32 %188, %189
%191 = zext i32 %190 to i64
%192 = getelementptr inbounds double, double* %181, i64 %191
store double %180, double* %192
%193 = load double*, double** %18
%194 = load i32, i32* %23
%195 = zext i32 %194 to i64
%196 = getelementptr inbounds double, double* %193, i64 %195
%197 = load double, double* %196
%198 = load double, double* %26
%199 = fadd double %197, %198
%200 = load double*, double** %13
%201 = load i32, i32* %23
%202 = load i32, i32* %17
%203 = mul i32 %201, %202
%204 = load i32, i32* %22
%205 = add i32 %203, %204
%206 = load i32, i32* %15
%207 = mul i32 %205, %206
%208 = load i32, i32* %21
%209 = add i32 %207, %208
%210 = zext i32 %209 to i64
%211 = getelementptr inbounds double, double* %200, i64 %210
store double %199, double* %211
br label %212
212: ; preds = %154
%213 = load i32, i32* %21
%214 = add i32 %213, 1
store i32 %214, i32* %21
br label %37
215: ; preds = %37
br label %216
216: ; preds = %215
%217 = load i32, i32* %22
%218 = add i32 %217, 1
store i32 %218, i32* %22
br label %32
219: ; preds = %32
br label %220
220: ; preds = %219
%221 = load i32, i32* %23
%222 = add i32 %221, 1
store i32 %222, i32* %23
br label %27
223: ; preds = %27
ret void
}

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