void BubbleSortIIIV(int n, double *V, double *I1, double *I2, double *I3,
                    double *I4) {
  int a, b, s;
  double c;
  for (a = 0; a < (n - 1); a++) {
    s = 1;
    for (b = 0; b < n - a - 1; b++) {
      if (V[b] > V[b + 1]) {
        c = V[b];
        V[b] = V[b + 1];
        V[b + 1] = c;
        c = I1[b];
        I1[b] = I1[b + 1];
        I1[b + 1] = c;
        c = I2[b];
        I2[b] = I2[b + 1];
        I2[b + 1] = c;
        c = I3[b];
        I3[b] = I3[b + 1];
        I3[b + 1] = c;
        c = I4[b];
        I4[b] = I4[b + 1];
        I4[b + 1] = c;
        s = 0;
      }
    }
    if (s)
      break;
  }
}


x86 assembly (clang, -O0):
<BubbleSortIIIV>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    131e <BubbleSortIIIV+0x21e>
movl   $0x1,-0x3c(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x34(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12fc <BubbleSortIIIV+0x1fc>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    12e9 <BubbleSortIIIV+0x1e9>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x3c(%rbp)
jmp    12ee <BubbleSortIIIV+0x1ee>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1141 <BubbleSortIIIV+0x41>
cmpl   $0x0,-0x3c(%rbp)
je     130b <BubbleSortIIIV+0x20b>
jmp    131e <BubbleSortIIIV+0x21e>
jmp    1310 <BubbleSortIIIV+0x210>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1122 <BubbleSortIIIV+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BubbleSortIIIV>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     11c5 <BubbleSortIIIV+0xc5>
lea    -0x1(%rdi),%r10d
xor    %r11d,%r11d
mov    %r10d,%r14d
nopw   0x0(%rax,%rax,1)
mov    %r11d,%eax
not    %eax
add    %edi,%eax
test   %eax,%eax
jle    11c5 <BubbleSortIIIV+0xc5>
mov    %r14d,%r14d
mov    $0x1,%ebp
xor    %ebx,%ebx
jmp    1148 <BubbleSortIIIV+0x48>
nopl   0x0(%rax,%rax,1)
mov    %rax,%rbx
cmp    %rax,%r14
je     11b0 <BubbleSortIIIV+0xb0>
movsd  (%rsi,%rbx,8),%xmm0
movsd  0x8(%rsi,%rbx,8),%xmm1
lea    0x1(%rbx),%rax
ucomisd %xmm1,%xmm0
jbe    1140 <BubbleSortIIIV+0x40>
movsd  %xmm1,(%rsi,%rbx,8)
movsd  %xmm0,0x8(%rsi,%rbx,8)
movups (%rdx,%rbx,8),%xmm0
shufps $0x4e,%xmm0,%xmm0
movups %xmm0,(%rdx,%rbx,8)
movups (%rcx,%rbx,8),%xmm0
shufps $0x4e,%xmm0,%xmm0
movups %xmm0,(%rcx,%rbx,8)
movups (%r8,%rbx,8),%xmm0
shufps $0x4e,%xmm0,%xmm0
movups %xmm0,(%r8,%rbx,8)
movupd (%r9,%rbx,8),%xmm0
shufpd $0x1,%xmm0,%xmm0
movupd %xmm0,(%r9,%rbx,8)
xor    %ebp,%ebp
jmp    1140 <BubbleSortIIIV+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %ebp,%ebp
jne    11c5 <BubbleSortIIIV+0xc5>
add    $0x1,%r11d
add    $0xffffffff,%r14d
cmp    %r10d,%r11d
jl     1120 <BubbleSortIIIV+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @BubbleSortIIIV(i32 %0, double* %1, double* %2, double* %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
store i32 %0, i32* %7
store double* %1, double** %8
store double* %2, double** %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
store i32 0, i32* %13
br label %17
17: ; preds = %158, %6
%18 = load i32, i32* %13
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %161
22: ; preds = %17
store i32 1, i32* %15
store i32 0, i32* %14
br label %23
23: ; preds = %150, %22
%24 = load i32, i32* %14
%25 = load i32, i32* %7
%26 = load i32, i32* %13
%27 = sub nsw i32 %25, %26
%28 = sub nsw i32 %27, 1
%29 = icmp slt i32 %24, %28
br i1 %29, label %30, label %153
30: ; preds = %23
%31 = load double*, double** %8
%32 = load i32, i32* %14
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = load double*, double** %8
%37 = load i32, i32* %14
%38 = add nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %36, i64 %39
%41 = load double, double* %40
%42 = fcmp ogt double %35, %41
br i1 %42, label %43, label %149
43: ; preds = %30
%44 = load double*, double** %8
%45 = load i32, i32* %14
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = load double, double* %47
store double %48, double* %16
%49 = load double*, double** %8
%50 = load i32, i32* %14
%51 = add nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %49, i64 %52
%54 = load double, double* %53
%55 = load double*, double** %8
%56 = load i32, i32* %14
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
store double %54, double* %58
%59 = load double, double* %16
%60 = load double*, double** %8
%61 = load i32, i32* %14
%62 = add nsw i32 %61, 1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %60, i64 %63
store double %59, double* %64
%65 = load double*, double** %9
%66 = load i32, i32* %14
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %65, i64 %67
%69 = load double, double* %68
store double %69, double* %16
%70 = load double*, double** %9
%71 = load i32, i32* %14
%72 = add nsw i32 %71, 1
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %70, i64 %73
%75 = load double, double* %74
%76 = load double*, double** %9
%77 = load i32, i32* %14
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %76, i64 %78
store double %75, double* %79
%80 = load double, double* %16
%81 = load double*, double** %9
%82 = load i32, i32* %14
%83 = add nsw i32 %82, 1
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %81, i64 %84
store double %80, double* %85
%86 = load double*, double** %10
%87 = load i32, i32* %14
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %86, i64 %88
%90 = load double, double* %89
store double %90, double* %16
%91 = load double*, double** %10
%92 = load i32, i32* %14
%93 = add nsw i32 %92, 1
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double, double* %91, i64 %94
%96 = load double, double* %95
%97 = load double*, double** %10
%98 = load i32, i32* %14
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %97, i64 %99
store double %96, double* %100
%101 = load double, double* %16
%102 = load double*, double** %10
%103 = load i32, i32* %14
%104 = add nsw i32 %103, 1
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %102, i64 %105
store double %101, double* %106
%107 = load double*, double** %11
%108 = load i32, i32* %14
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %107, i64 %109
%111 = load double, double* %110
store double %111, double* %16
%112 = load double*, double** %11
%113 = load i32, i32* %14
%114 = add nsw i32 %113, 1
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds double, double* %112, i64 %115
%117 = load double, double* %116
%118 = load double*, double** %11
%119 = load i32, i32* %14
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %118, i64 %120
store double %117, double* %121
%122 = load double, double* %16
%123 = load double*, double** %11
%124 = load i32, i32* %14
%125 = add nsw i32 %124, 1
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %123, i64 %126
store double %122, double* %127
%128 = load double*, double** %12
%129 = load i32, i32* %14
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %128, i64 %130
%132 = load double, double* %131
store double %132, double* %16
%133 = load double*, double** %12
%134 = load i32, i32* %14
%135 = add nsw i32 %134, 1
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds double, double* %133, i64 %136
%138 = load double, double* %137
%139 = load double*, double** %12
%140 = load i32, i32* %14
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double, double* %139, i64 %141
store double %138, double* %142
%143 = load double, double* %16
%144 = load double*, double** %12
%145 = load i32, i32* %14
%146 = add nsw i32 %145, 1
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds double, double* %144, i64 %147
store double %143, double* %148
store i32 0, i32* %15
br label %149
149: ; preds = %43, %30
br label %150
150: ; preds = %149
%151 = load i32, i32* %14
%152 = add nsw i32 %151, 1
store i32 %152, i32* %14
br label %23
153: ; preds = %23
%154 = load i32, i32* %15
%155 = icmp ne i32 %154, 0
br i1 %155, label %156, label %157
156: ; preds = %153
br label %161
157: ; preds = %153
br label %158
158: ; preds = %157
%159 = load i32, i32* %13
%160 = add nsw i32 %159, 1
store i32 %160, i32* %13
br label %17
161: ; preds = %156, %17
ret void
}

LLVM IR (-O2):
define void @BubbleSortIIIV(i32 %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5) {
%7 = add i32 %0, -1
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %56
9: ; preds = %6, %50
%10 = phi i32 [ %55, %50 ], [ %7, %6 ]
%11 = phi i32 [ %52, %50 ], [ 0, %6 ]
%12 = xor i32 %11, -1
%13 = add i32 %12, %0
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %56
15: ; preds = %9
%16 = zext i32 %10 to i64
br label %17
17: ; preds = %15, %47
%18 = phi i64 [ 0, %15 ], [ %22, %47 ]
%19 = phi i32 [ 1, %15 ], [ %48, %47 ]
%20 = getelementptr inbounds double, double* %1, i64 %18
%21 = load double, double* %20
%22 = add nuw nsw i64 %18, 1
%23 = getelementptr inbounds double, double* %1, i64 %22
%24 = load double, double* %23
%25 = fcmp ogt double %21, %24
br i1 %25, label %26, label %47
26: ; preds = %17
store double %24, double* %20
store double %21, double* %23
%27 = getelementptr inbounds double, double* %2, i64 %18
%28 = bitcast double* %27 to <2 x double>*
%29 = load <2 x double>, <2 x double>* %28
%30 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%31 = bitcast double* %27 to <2 x double>*
store <2 x double> %30, <2 x double>* %31
%32 = getelementptr inbounds double, double* %3, i64 %18
%33 = bitcast double* %32 to <2 x double>*
%34 = load <2 x double>, <2 x double>* %33
%35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%36 = bitcast double* %32 to <2 x double>*
store <2 x double> %35, <2 x double>* %36
%37 = getelementptr inbounds double, double* %4, i64 %18
%38 = bitcast double* %37 to <2 x double>*
%39 = load <2 x double>, <2 x double>* %38
%40 = shufflevector <2 x double> %39, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%41 = bitcast double* %37 to <2 x double>*
store <2 x double> %40, <2 x double>* %41
%42 = getelementptr inbounds double, double* %5, i64 %18
%43 = bitcast double* %42 to <2 x double>*
%44 = load <2 x double>, <2 x double>* %43
%45 = shufflevector <2 x double> %44, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%46 = bitcast double* %42 to <2 x double>*
store <2 x double> %45, <2 x double>* %46
br label %47
47: ; preds = %17, %26
%48 = phi i32 [ 0, %26 ], [ %19, %17 ]
%49 = icmp eq i64 %22, %16
br i1 %49, label %50, label %17
50: ; preds = %47
%51 = icmp eq i32 %48, 0
%52 = add nuw nsw i32 %11, 1
%53 = icmp slt i32 %52, %7
%54 = select i1 %51, i1 %53, i1 false
%55 = add i32 %10, -1
br i1 %54, label %9, label %56
56: ; preds = %9, %50, %6
ret void
}