void middle_trsp_blk(long N, long N_SQRT,
                     double _Complex data[N_SQRT][N_SQRT]) {
  long i, j;
  for (i = 0; i < 8; i += 4) {
    for (j = 0; j < i; j += 4) {
      micro_trsp_swap(N, N_SQRT, (double _Complex(*)[N_SQRT]) & data[i][j],
                      (double _Complex(*)[N_SQRT]) & data[j][i]);
    }
    micro_trsp_blk(N, N_SQRT, (double _Complex(*)[N_SQRT]) & data[i][i]);
  }
}


x86 assembly (clang, -O0):
<middle_trsp_blk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x8,-0x20(%rbp)
jge    1201 <middle_trsp_blk+0xe1>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    11c2 <middle_trsp_blk+0xa2>
mov    -0x30(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
imul   -0x20(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rdx
mov    -0x28(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rdx
mov    -0x18(%rbp),%rcx
imul   -0x28(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rcx
mov    -0x20(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rcx
mov    $0x0,%al
call   1030 <micro_trsp_swap@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
jmp    1157 <middle_trsp_blk+0x37>
mov    -0x30(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
imul   -0x20(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rdx
mov    -0x20(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rdx
mov    $0x0,%al
call   1040 <micro_trsp_blk@plt>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    1144 <middle_trsp_blk+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<middle_trsp_blk>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1040 <micro_trsp_blk@plt>
mov    %r14,%rbx
shl    $0x6,%rbx
lea    (%r12,%rbx,1),%rdx
lea    0x40(%r12),%rcx
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <micro_trsp_swap@plt>
lea    (%r12,%rbx,1),%rdx
add    $0x40,%rdx
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <micro_trsp_blk@plt>

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

LLVM IR (-O2):
define void @middle_trsp_blk(i64 %0, i64 %1, { double, double }* %2) {
%4 = tail call i32 (i64, i64, { double, double }*, ...) bitcast (i32 (...)* @micro_trsp_blk to i32 (i64, i64, { double, double }*, ...)*)(i64 %0, i64 %1, { double, double }* %2)
%5 = shl nsw i64 %1, 2
%6 = getelementptr inbounds { double, double }, { double, double }* %2, i64 %5
%7 = getelementptr inbounds { double, double }, { double, double }* %2, i64 4
%8 = tail call i32 (i64, i64, { double, double }*, { double, double }*, ...) bitcast (i32 (...)* @micro_trsp_swap to i32 (i64, i64, { double, double }*, { double, double }*, ...)*)(i64 %0, i64 %1, { double, double }* %6, { double, double }* %7)
%9 = getelementptr inbounds { double, double }, { double, double }* %2, i64 %5
%10 = getelementptr inbounds { double, double }, { double, double }* %9, i64 4
%11 = tail call i32 (i64, i64, { double, double }*, ...) bitcast (i32 (...)* @micro_trsp_blk to i32 (i64, i64, { double, double }*, ...)*)(i64 %0, i64 %1, { double, double }* %10)
ret void
}