void swapRows(double aug_matrix[][10 * 10 + 1], int row1, int row2) {
  int i;
  double temp;
  for (i = 0; i < 10 * 10 + 1; i++) {
    temp = aug_matrix[row1][i];
    aug_matrix[row1][i] = aug_matrix[row2][i];
    aug_matrix[row2][i] = temp;
  }
}


x86 assembly (clang, -O0):
<swapRows>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x65,-0x14(%rbp)
jge    11a3 <swapRows+0xa3>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x328,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x328,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x328,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x328,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <swapRows+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapRows>:
movslq %esi,%rax
movslq %edx,%rcx
imul   $0x328,%rax,%rdx
lea    (%rdi,%rdx,1),%rax
add    %rdi,%rdx
add    $0x328,%rdx
imul   $0x328,%rcx,%rsi
lea    (%rdi,%rsi,1),%rcx
add    %rdi,%rsi
add    $0x328,%rsi
cmp    %rsi,%rax
jae    113e <swapRows+0x3e>
cmp    %rdx,%rcx
jae    113e <swapRows+0x3e>
xor    %edi,%edi
jmp    1183 <swapRows+0x83>
mov    $0x2,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups -0x10(%rax,%rdi,8),%xmm0
movups -0x10(%rcx,%rdi,8),%xmm1
movups %xmm1,-0x10(%rax,%rdi,8)
movups %xmm0,-0x10(%rcx,%rdi,8)
movups (%rax,%rdi,8),%xmm0
movups (%rcx,%rdi,8),%xmm1
movups %xmm1,(%rax,%rdi,8)
movups %xmm0,(%rcx,%rdi,8)
add    $0x4,%rdi
cmp    $0x66,%rdi
jne    1150 <swapRows+0x50>
mov    $0x64,%edi
movsd  (%rax,%rdi,8),%xmm0
movsd  (%rcx,%rdi,8),%xmm1
movsd  %xmm1,(%rax,%rdi,8)
movsd  %xmm0,(%rcx,%rdi,8)
cmp    %rsi,%rax
jae    11e6 <swapRows+0xe6>
cmp    %rdx,%rcx
jae    11e6 <swapRows+0xe6>
add    $0x2,%rdi
cs nopw 0x0(%rax,%rax,1)
nop
movsd  -0x8(%rax,%rdi,8),%xmm0
movsd  -0x8(%rcx,%rdi,8),%xmm1
movsd  %xmm1,-0x8(%rax,%rdi,8)
movsd  %xmm0,-0x8(%rcx,%rdi,8)
movsd  (%rax,%rdi,8),%xmm0
movsd  (%rcx,%rdi,8),%xmm1
movsd  %xmm1,(%rax,%rdi,8)
movsd  %xmm0,(%rcx,%rdi,8)
add    $0x2,%rdi
cmp    $0x66,%rdi
jne    11b0 <swapRows+0xb0>
ret

LLVM IR (-O0):
define void @swapRows([101 x double]* %0, i32 %1, i32 %2) {
%4 = alloca [101 x double]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store [101 x double]* %0, [101 x double]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %9
9: ; preds = %44, %3
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 101
br i1 %11, label %12, label %47
12: ; preds = %9
%13 = load [101 x double]*, [101 x double]** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [101 x double], [101 x double]* %13, i64 %15
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [101 x double], [101 x double]* %16, i64 0, i64 %18
%20 = load double, double* %19
store double %20, double* %8
%21 = load [101 x double]*, [101 x double]** %4
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [101 x double], [101 x double]* %21, i64 %23
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [101 x double], [101 x double]* %24, i64 0, i64 %26
%28 = load double, double* %27
%29 = load [101 x double]*, [101 x double]** %4
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [101 x double], [101 x double]* %29, i64 %31
%33 = load i32, i32* %7
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [101 x double], [101 x double]* %32, i64 0, i64 %34
store double %28, double* %35
%36 = load double, double* %8
%37 = load [101 x double]*, [101 x double]** %4
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [101 x double], [101 x double]* %37, i64 %39
%41 = load i32, i32* %7
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [101 x double], [101 x double]* %40, i64 0, i64 %42
store double %36, double* %43
br label %44
44: ; preds = %12
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
store i32 %46, i32* %7
br label %9
47: ; preds = %9
ret void
}

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