#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*/ Adjoint(double **, double **);
int /*<<< orphan*/ printf(char *, ...);
void test_Adjoint() {
  double T[4][4] = {1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 3, 0, 0, 0, 1};
  double AdT[6][6] = {{0}};
  Adjoint(T, AdT);
  int i;
  int j;
  printf("AdT:\n");
  for (i = 0; i < 6; i++) {
    for (j = 0; j < 6; j++) {
      printf("%lf  ", AdT[i][j]);
    }
    printf("\n");
  }
  return;
}


x86 assembly (clang, -O0):
<test_Adjoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe93(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe8e(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe79(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x120,%edx
call   1040 <memset@plt>
lea    -0x80(%rbp),%rdi
lea    -0x1a0(%rbp),%rsi
call   1050 <Adjoint@plt>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1a4(%rbp)
cmpl   $0x6,-0x1a4(%rbp)
jge    1250 <test_Adjoint+0x120>
movl   $0x0,-0x1a8(%rbp)
cmpl   $0x6,-0x1a8(%rbp)
jge    122e <test_Adjoint+0xfe>
movslq -0x1a4(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movslq -0x1a8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe0b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    11de <test_Adjoint+0xae>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    11c7 <test_Adjoint+0x97>
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_Adjoint>:
push   %r14
push   %rbx
sub    $0x1a8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rsp)
movabs $0xbff0000000000000,%rcx
mov    %rcx,0x30(%rsp)
mov    %rax,0x48(%rsp)
movabs $0x4008000000000000,%rcx
mov    %rcx,0x58(%rsp)
mov    %rax,0x78(%rsp)
lea    0x80(%rsp),%rbx
mov    $0x120,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1070 <Adjoint@plt>
lea    0xe23(%rip),%rdi
call   1040 <puts@plt>
mov    $0x28,%ebx
lea    0xe0c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0x58(%rsp,%rbx,1),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x60(%rsp,%rbx,1),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x68(%rsp,%rbx,1),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x70(%rsp,%rbx,1),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x78(%rsp,%rbx,1),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x80(%rsp,%rbx,1),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x30,%rbx
cmp    $0x148,%rbx
jne    1200 <test_Adjoint+0xb0>
add    $0x1a8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%lf \00"
@str = [5 x i8] c"AdT:\00"
define void @test_Adjoint() {
%1 = alloca [4 x [4 x double]]
%2 = alloca [6 x [6 x double]]
%3 = bitcast [4 x [4 x double]]* %1 to i8*
%4 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %1, i64 0, i64 0, i64 0
store double 1.000000e+00, double* %4
%5 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %1, i64 0, i64 1, i64 2
store double -1.000000e+00, double* %5
%6 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %1, i64 0, i64 2, i64 1
store double 1.000000e+00, double* %6
%7 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %1, i64 0, i64 2, i64 3
store double 3.000000e+00, double* %7
%8 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %1, i64 0, i64 3, i64 3
store double 1.000000e+00, double* %8
%9 = bitcast [6 x [6 x double]]* %2 to i8*
%10 = bitcast [4 x [4 x double]]* %1 to double**
%11 = bitcast [6 x [6 x double]]* %2 to double**
%12 = call i32 @Adjoint(double** %10, double** %11)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %0, %14
%15 = phi i64 [ 0, %0 ], [ %35, %14 ]
%16 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %2, i64 0, i64 %15, i64 0
%17 = load double, double* %16
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %17)
%19 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %2, i64 0, i64 %15, i64 1
%20 = load double, double* %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %20)
%22 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %2, i64 0, i64 %15, i64 2
%23 = load double, double* %22
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %23)
%25 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %2, i64 0, i64 %15, i64 3
%26 = load double, double* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %26)
%28 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %2, i64 0, i64 %15, i64 4
%29 = load double, double* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %29)
%31 = getelementptr inbounds [6 x [6 x double]], [6 x [6 x double]]* %2, i64 0, i64 %15, i64 5
%32 = load double, double* %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %32)
%34 = call i32 @putchar(i32 10)
%35 = add nuw nsw i64 %15, 1
%36 = icmp eq i64 %35, 6
br i1 %36, label %37, label %14
37: ; preds = %14
ret void
}