void swap(double *values_a, int *cols_a, double *lowers_a, double *uppers_a,
          double *values_b, int *cols_b, double *lowers_b, double *uppers_b) {
  double values_save = *values_a;
  *values_a = *values_b;
  *values_b = values_save;
  int cols_save = *cols_a;
  *cols_a = *cols_b;
  *cols_b = cols_save;
  double lowers_save = *lowers_a;
  *lowers_a = *lowers_b;
  *lowers_b = lowers_save;
  double uppers_save = *uppers_a;
  *uppers_a = *uppers_b;
  *uppers_b = uppers_save;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x3c(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    0x10(%rsp),%r10
mov    0x8(%rsp),%r11
movsd  (%rdi),%xmm0
movsd  (%r8),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%r8)
mov    (%rsi),%edi
mov    (%r9),%eax
mov    %eax,(%rsi)
mov    %edi,(%r9)
movsd  (%rdx),%xmm0
movsd  (%r11),%xmm1
movsd  %xmm1,(%rdx)
movsd  %xmm0,(%r11)
movsd  (%rcx),%xmm0
movsd  (%r10),%xmm1
movsd  %xmm1,(%rcx)
movsd  %xmm0,(%r10)
ret

LLVM IR (-O0):
define void @swap(double* %0, i32* %1, double* %2, double* %3, double* %4, i32* %5, double* %6, double* %7) {
%9 = alloca double*
%10 = alloca i32*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double
%18 = alloca i32
%19 = alloca double
%20 = alloca double
store double* %0, double** %9
store i32* %1, i32** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store i32* %5, i32** %14
store double* %6, double** %15
store double* %7, double** %16
%21 = load double*, double** %9
%22 = load double, double* %21
store double %22, double* %17
%23 = load double*, double** %13
%24 = load double, double* %23
%25 = load double*, double** %9
store double %24, double* %25
%26 = load double, double* %17
%27 = load double*, double** %13
store double %26, double* %27
%28 = load i32*, i32** %10
%29 = load i32, i32* %28
store i32 %29, i32* %18
%30 = load i32*, i32** %14
%31 = load i32, i32* %30
%32 = load i32*, i32** %10
store i32 %31, i32* %32
%33 = load i32, i32* %18
%34 = load i32*, i32** %14
store i32 %33, i32* %34
%35 = load double*, double** %11
%36 = load double, double* %35
store double %36, double* %19
%37 = load double*, double** %15
%38 = load double, double* %37
%39 = load double*, double** %11
store double %38, double* %39
%40 = load double, double* %19
%41 = load double*, double** %15
store double %40, double* %41
%42 = load double*, double** %12
%43 = load double, double* %42
store double %43, double* %20
%44 = load double*, double** %16
%45 = load double, double* %44
%46 = load double*, double** %12
store double %45, double* %46
%47 = load double, double* %20
%48 = load double*, double** %16
store double %47, double* %48
ret void
}

LLVM IR (-O2):
define void @swap(double* nocapture %0, i32* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, i32* nocapture %5, double* nocapture %6, double* nocapture %7) {
%9 = load double, double* %0
%10 = load double, double* %4
store double %10, double* %0
store double %9, double* %4
%11 = load i32, i32* %1
%12 = load i32, i32* %5
store i32 %12, i32* %1
store i32 %11, i32* %5
%13 = load double, double* %2
%14 = load double, double* %6
store double %14, double* %2
store double %13, double* %6
%15 = load double, double* %3
%16 = load double, double* %7
store double %16, double* %3
store double %15, double* %7
ret void
}