#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ matrix_ij_A(int, double *, double, double, double, double,
                               double);
int /*<<< orphan*/ matrix_ij_B(int, double *, double, double, double, double);
int /*<<< orphan*/ matrix_ij_C(int, double *, double, double, double, double,
                               double);
void matrix_ft_ij(int i, int j, double ex, double ey, double ez, double xa,
                  double ya, double yb, double xc, double yc, int n6,
                  double *mat) {
  int i1, i4;
  int j1, j4;
  i1 = i * 6;
  i4 = i1 + 3;
  j1 = j * 6;
  j4 = j1 + 3;
  matrix_ij_A(n6, &mat[i1 * n6 + j1], ex, ey, ez, xa, ya);
  matrix_ij_B(n6, &mat[i4 * n6 + j1], ex, ey, ez, yb);
  if (i == j) {
    matrix_ij_B(n6, &mat[i1 * n6 + j4], ex, ey, ez, -yb);
  } else {
    matrix_ij_B(n6, &mat[i1 * n6 + j4], ex, ey, ez, yb);
  }
  matrix_ij_C(n6, &mat[i4 * n6 + j4], ex, ey, ez, xc, yc);
}


x86 assembly (clang, -O0):
<matrix_ft_ij>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
mov    %edx,-0x4c(%rbp)
mov    %rcx,-0x58(%rbp)
imul   $0x6,-0x4(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x60(%rbp)
imul   $0x6,-0x8(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x68(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x58(%rbp),%rsi
mov    -0x5c(%rbp),%eax
imul   -0x4c(%rbp),%eax
add    -0x64(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
call   1030 <matrix_ij_A@plt>
mov    -0x4c(%rbp),%edi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%eax
imul   -0x4c(%rbp),%eax
add    -0x64(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
call   1050 <matrix_ij_B@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1253 <matrix_ft_ij+0x123>
mov    -0x4c(%rbp),%edi
mov    -0x58(%rbp),%rsi
mov    -0x5c(%rbp),%eax
imul   -0x4c(%rbp),%eax
add    -0x68(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
call   1050 <matrix_ij_B@plt>
jmp    1286 <matrix_ft_ij+0x156>
mov    -0x4c(%rbp),%edi
mov    -0x58(%rbp),%rsi
mov    -0x5c(%rbp),%eax
imul   -0x4c(%rbp),%eax
add    -0x68(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
call   1050 <matrix_ij_B@plt>
mov    -0x4c(%rbp),%edi
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%eax
imul   -0x4c(%rbp),%eax
add    -0x68(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
movsd  -0x48(%rbp),%xmm4
call   1040 <matrix_ij_C@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_ft_ij>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rcx,%r14
mov    %edx,%ebx
movsd  %xmm7,0x40(%rsp)
movsd  %xmm6,0x38(%rsp)
movaps %xmm5,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rsi,0x30(%rsp)
mov    %edi,%r12d
lea    (%r12,%r12,1),%eax
lea    (%rax,%rax,2),%r15d
lea    (%rax,%rax,2),%r13d
add    $0x3,%r13d
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,2),%ebp
imul   %edx,%r15d
lea    (%r15,%rbp,1),%eax
cltq
lea    (%rcx,%rax,8),%rsi
mov    %edx,%edi
call   1030 <matrix_ij_A@plt>
imul   %ebx,%r13d
lea    0x0(%r13,%rbp,1),%eax
cltq
lea    (%r14,%rax,8),%rsi
mov    %ebx,%edi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movaps 0x20(%rsp),%xmm3
call   1050 <matrix_ij_B@plt>
lea    (%r15,%rbp,1),%eax
add    $0x3,%eax
cltq
lea    (%r14,%rax,8),%rsi
cmp    0x30(%rsp),%r12d
je     11e1 <matrix_ft_ij+0xb1>
movaps 0x20(%rsp),%xmm3
jmp    11ed <matrix_ft_ij+0xbd>
movaps 0x20(%rsp),%xmm3
xorps  0xe13(%rip),%xmm3
mov    %ebx,%edi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1050 <matrix_ij_B@plt>
lea    0x3(%r13,%rbp,1),%eax
cltq
lea    (%r14,%rax,8),%rsi
mov    %ebx,%edi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x38(%rsp),%xmm3
movsd  0x40(%rsp),%xmm4
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <matrix_ij_C@plt>

LLVM IR (-O0):
define void @matrix_ft_ij(i32 %0, i32 %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, i32 %10, double* %11) {
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca i32
%24 = alloca double*
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
store i32 %0, i32* %13
store i32 %1, i32* %14
store double %2, double* %15
store double %3, double* %16
store double %4, double* %17
store double %5, double* %18
store double %6, double* %19
store double %7, double* %20
store double %8, double* %21
store double %9, double* %22
store i32 %10, i32* %23
store double* %11, double** %24
%29 = load i32, i32* %13
%30 = mul nsw i32 %29, 6
store i32 %30, i32* %25
%31 = load i32, i32* %25
%32 = add nsw i32 %31, 3
store i32 %32, i32* %26
%33 = load i32, i32* %14
%34 = mul nsw i32 %33, 6
store i32 %34, i32* %27
%35 = load i32, i32* %27
%36 = add nsw i32 %35, 3
store i32 %36, i32* %28
%37 = load i32, i32* %23
%38 = load double*, double** %24
%39 = load i32, i32* %25
%40 = load i32, i32* %23
%41 = mul nsw i32 %39, %40
%42 = load i32, i32* %27
%43 = add nsw i32 %41, %42
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %38, i64 %44
%46 = load double, double* %15
%47 = load double, double* %16
%48 = load double, double* %17
%49 = load double, double* %18
%50 = load double, double* %19
%51 = call i32 @matrix_ij_A(i32 %37, double* %45, double %46, double %47, double %48, double %49, double %50)
%52 = load i32, i32* %23
%53 = load double*, double** %24
%54 = load i32, i32* %26
%55 = load i32, i32* %23
%56 = mul nsw i32 %54, %55
%57 = load i32, i32* %27
%58 = add nsw i32 %56, %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %53, i64 %59
%61 = load double, double* %15
%62 = load double, double* %16
%63 = load double, double* %17
%64 = load double, double* %20
%65 = call i32 @matrix_ij_B(i32 %52, double* %60, double %61, double %62, double %63, double %64)
%66 = load i32, i32* %13
%67 = load i32, i32* %14
%68 = icmp eq i32 %66, %67
br i1 %68, label %69, label %85
69: ; preds = %12
%70 = load i32, i32* %23
%71 = load double*, double** %24
%72 = load i32, i32* %25
%73 = load i32, i32* %23
%74 = mul nsw i32 %72, %73
%75 = load i32, i32* %28
%76 = add nsw i32 %74, %75
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %71, i64 %77
%79 = load double, double* %15
%80 = load double, double* %16
%81 = load double, double* %17
%82 = load double, double* %20
%83 = fneg double %82
%84 = call i32 @matrix_ij_B(i32 %70, double* %78, double %79, double %80, double %81, double %83)
br label %100
85: ; preds = %12
%86 = load i32, i32* %23
%87 = load double*, double** %24
%88 = load i32, i32* %25
%89 = load i32, i32* %23
%90 = mul nsw i32 %88, %89
%91 = load i32, i32* %28
%92 = add nsw i32 %90, %91
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %87, i64 %93
%95 = load double, double* %15
%96 = load double, double* %16
%97 = load double, double* %17
%98 = load double, double* %20
%99 = call i32 @matrix_ij_B(i32 %86, double* %94, double %95, double %96, double %97, double %98)
br label %100
100: ; preds = %85, %69
%101 = load i32, i32* %23
%102 = load double*, double** %24
%103 = load i32, i32* %26
%104 = load i32, i32* %23
%105 = mul nsw i32 %103, %104
%106 = load i32, i32* %28
%107 = add nsw i32 %105, %106
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %102, i64 %108
%110 = load double, double* %15
%111 = load double, double* %16
%112 = load double, double* %17
%113 = load double, double* %21
%114 = load double, double* %22
%115 = call i32 @matrix_ij_C(i32 %101, double* %109, double %110, double %111, double %112, double %113, double %114)
ret void
}

LLVM IR (-O2):
define void @matrix_ft_ij(i32 %0, i32 %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, i32 %10, double* %11) {
%13 = mul nsw i32 %0, 6
%14 = add nsw i32 %13, 3
%15 = mul nsw i32 %1, 6
%16 = add nsw i32 %15, 3
%17 = mul nsw i32 %13, %10
%18 = add nsw i32 %17, %15
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %11, i64 %19
%21 = tail call i32 @matrix_ij_A(i32 %10, double* %20, double %2, double %3, double %4, double %5, double %6)
%22 = mul nsw i32 %14, %10
%23 = add nsw i32 %22, %15
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %11, i64 %24
%26 = tail call i32 @matrix_ij_B(i32 %10, double* %25, double %2, double %3, double %4, double %7)
%27 = icmp eq i32 %0, %1
%28 = add nsw i32 %17, %16
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %11, i64 %29
%31 = fneg double %7
%32 = select i1 %27, double %31, double %7
%33 = tail call i32 @matrix_ij_B(i32 %10, double* %30, double %2, double %3, double %4, double %32)
%34 = add nsw i32 %22, %16
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %11, i64 %35
%37 = tail call i32 @matrix_ij_C(i32 %10, double* %36, double %2, double %3, double %4, double %8, double %9)
ret void
}