void middle_tw_trsp_blk(long N, long N_SQRT, long I,
                        double _Complex data[N_SQRT][N_SQRT]) {
  long i, j;
  for (i = 0; i < 8; i += 2) {
    for (j = 0; j < i; j += 2) {
      micro_tw_trsp_swap(N, N_SQRT, I + i, I + j,
                         (double _Complex(*)[N_SQRT]) & data[i][j],
                         (double _Complex(*)[N_SQRT]) & data[j][i]);
    }
    micro_tw_trsp_blk(N, N_SQRT, I + i,
                      (double _Complex(*)[N_SQRT]) & data[i][i]);
  }
}


x86 assembly (clang, -O0):
<middle_tw_trsp_blk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x8,-0x28(%rbp)
jge    121d <middle_tw_trsp_blk+0xfd>
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    11d6 <middle_tw_trsp_blk+0xb6>
mov    -0x38(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x28(%rbp),%rdx
mov    -0x18(%rbp),%rcx
add    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    %rax,%r9
imul   -0x28(%rbp),%r9
shl    $0x4,%r9
add    %r9,%r8
mov    -0x30(%rbp),%r9
shl    $0x4,%r9
add    %r9,%r8
mov    -0x20(%rbp),%r9
imul   -0x30(%rbp),%rax
shl    $0x4,%rax
add    %rax,%r9
mov    -0x28(%rbp),%rax
shl    $0x4,%rax
add    %rax,%r9
mov    $0x0,%al
call   1030 <micro_tw_trsp_swap@plt>
mov    -0x30(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x30(%rbp)
jmp    115b <middle_tw_trsp_blk+0x3b>
mov    -0x38(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
imul   -0x28(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rcx
mov    -0x28(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rcx
mov    $0x0,%al
call   1040 <micro_tw_trsp_blk@plt>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    1148 <middle_tw_trsp_blk+0x28>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<middle_tw_trsp_blk>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%rbx
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1040 <micro_tw_trsp_blk@plt>
lea    0x2(%r12),%rbp
mov    %r14,%rax
shl    $0x5,%rax
lea    (%rbx,%rax,1),%r8
mov    %rax,%r13
mov    %rax,0x8(%rsp)
lea    0x20(%rbx),%r9
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1030 <micro_tw_trsp_swap@plt>
lea    (%rbx,%r13,1),%rcx
add    $0x20,%rcx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    %rbp,%r13
mov    %rbp,0x18(%rsp)
xor    %eax,%eax
call   1040 <micro_tw_trsp_blk@plt>
mov    %r12,%rcx
mov    %r12,0x10(%rsp)
lea    0x4(%r12),%rbp
mov    %rbp,0x20(%rsp)
mov    %r14,%r12
shl    $0x6,%r12
lea    (%rbx,%r12,1),%r8
lea    0x40(%rbx),%r9
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1030 <micro_tw_trsp_swap@plt>
lea    (%rbx,%r12,1),%r8
add    $0x20,%r8
mov    0x8(%rsp),%rax
lea    0x40(%rbx,%rax,1),%r9
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1030 <micro_tw_trsp_swap@plt>
lea    (%rbx,%r12,1),%rcx
add    $0x40,%rcx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <micro_tw_trsp_blk@plt>
mov    0x10(%rsp),%rcx
lea    0x6(%rcx),%rbp
lea    (%r14,%r14,2),%r13
shl    $0x5,%r13
lea    (%rbx,%r13,1),%r8
lea    0x60(%rbx),%r9
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1030 <micro_tw_trsp_swap@plt>
lea    (%rbx,%r13,1),%r8
add    $0x20,%r8
mov    0x8(%rsp),%rax
lea    0x60(%rbx,%rax,1),%r9
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    0x18(%rsp),%rcx
xor    %eax,%eax
call   1030 <micro_tw_trsp_swap@plt>
lea    (%rbx,%r13,1),%r8
add    $0x40,%r8
lea    0x60(%rbx,%r12,1),%r9
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    0x20(%rsp),%rcx
xor    %eax,%eax
call   1030 <micro_tw_trsp_swap@plt>
lea    (%rbx,%r13,1),%rcx
add    $0x60,%rcx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <micro_tw_trsp_blk@plt>

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

LLVM IR (-O2):
define void @middle_tw_trsp_blk(i64 %0, i64 %1, i64 %2, { double, double }* %3) {
%5 = tail call i32 (i64, i64, i64, { double, double }*, ...) bitcast (i32 (...)* @micro_tw_trsp_blk to i32 (i64, i64, i64, { double, double }*, ...)*)(i64 %0, i64 %1, i64 %2, { double, double }* %3)
%6 = add nsw i64 %2, 2
%7 = shl nsw i64 %1, 1
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i64 %7
%9 = getelementptr inbounds { double, double }, { double, double }* %3, i64 2
%10 = tail call i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...) bitcast (i32 (...)* @micro_tw_trsp_swap to i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...)*)(i64 %0, i64 %1, i64 %6, i64 %2, { double, double }* %8, { double, double }* %9)
%11 = getelementptr inbounds { double, double }, { double, double }* %3, i64 %7
%12 = getelementptr inbounds { double, double }, { double, double }* %11, i64 2
%13 = tail call i32 (i64, i64, i64, { double, double }*, ...) bitcast (i32 (...)* @micro_tw_trsp_blk to i32 (i64, i64, i64, { double, double }*, ...)*)(i64 %0, i64 %1, i64 %6, { double, double }* %12)
%14 = add nsw i64 %2, 4
%15 = shl nsw i64 %1, 2
%16 = getelementptr inbounds { double, double }, { double, double }* %3, i64 %15
%17 = getelementptr inbounds { double, double }, { double, double }* %3, i64 4
%18 = tail call i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...) bitcast (i32 (...)* @micro_tw_trsp_swap to i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...)*)(i64 %0, i64 %1, i64 %14, i64 %2, { double, double }* %16, { double, double }* %17)
%19 = getelementptr inbounds { double, double }, { double, double }* %16, i64 2
%20 = getelementptr inbounds { double, double }, { double, double }* %11, i64 4
%21 = tail call i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...) bitcast (i32 (...)* @micro_tw_trsp_swap to i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...)*)(i64 %0, i64 %1, i64 %14, i64 %6, { double, double }* %19, { double, double }* %20)
%22 = getelementptr inbounds { double, double }, { double, double }* %3, i64 %15
%23 = getelementptr inbounds { double, double }, { double, double }* %22, i64 4
%24 = tail call i32 (i64, i64, i64, { double, double }*, ...) bitcast (i32 (...)* @micro_tw_trsp_blk to i32 (i64, i64, i64, { double, double }*, ...)*)(i64 %0, i64 %1, i64 %14, { double, double }* %23)
%25 = add nsw i64 %2, 6
%26 = mul nsw i64 %1, 6
%27 = getelementptr inbounds { double, double }, { double, double }* %3, i64 %26
%28 = getelementptr inbounds { double, double }, { double, double }* %3, i64 6
%29 = tail call i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...) bitcast (i32 (...)* @micro_tw_trsp_swap to i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...)*)(i64 %0, i64 %1, i64 %25, i64 %2, { double, double }* %27, { double, double }* %28)
%30 = getelementptr inbounds { double, double }, { double, double }* %27, i64 2
%31 = getelementptr inbounds { double, double }, { double, double }* %11, i64 6
%32 = tail call i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...) bitcast (i32 (...)* @micro_tw_trsp_swap to i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...)*)(i64 %0, i64 %1, i64 %25, i64 %6, { double, double }* %30, { double, double }* %31)
%33 = getelementptr inbounds { double, double }, { double, double }* %27, i64 4
%34 = getelementptr inbounds { double, double }, { double, double }* %22, i64 6
%35 = tail call i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...) bitcast (i32 (...)* @micro_tw_trsp_swap to i32 (i64, i64, i64, i64, { double, double }*, { double, double }*, ...)*)(i64 %0, i64 %1, i64 %25, i64 %14, { double, double }* %33, { double, double }* %34)
%36 = getelementptr inbounds { double, double }, { double, double }* %3, i64 %26
%37 = getelementptr inbounds { double, double }, { double, double }* %36, i64 6
%38 = tail call i32 (i64, i64, i64, { double, double }*, ...) bitcast (i32 (...)* @micro_tw_trsp_blk to i32 (i64, i64, i64, { double, double }*, ...)*)(i64 %0, i64 %1, i64 %25, { double, double }* %37)
ret void
}