#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ mvmul(double *, double **, double *);
int /*<<< orphan*/ stderr;
void print_transform(double M[3][3], double axis[3]) {
  fprintf(stderr, "M = \n");
  fprintf(stderr, "[[%lf, %lf, %lf], ", M[0][0], M[0][1], M[0][2]);
  fprintf(stderr, "[%lf, %lf, %lf], ", M[1][0], M[1][1], M[1][2]);
  fprintf(stderr, "[%lf, %lf, %lf]]\n", M[2][0], M[2][1], M[2][2]);
  double v[3];
  mvmul(axis, M, v);
  fprintf(stderr, "After transform:\n");
  fprintf(stderr, "[%lf, %lf, %lf]\n", v[0], v[1], v[2]);
}


x86 assembly (clang, -O0):
<print_transform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
lea    0xe95(%rip),%rsi
mov    $0x3,%al
call   1030 <fprintf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm2
lea    0xe64(%rip),%rsi
mov    $0x3,%al
call   1030 <fprintf@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
lea    0xe44(%rip),%rsi
mov    $0x3,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1040 <mvmul@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
lea    0xe2e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dd5(%rip),%rax
mov    (%rax),%edi
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xe1a(%rip),%rsi
mov    $0x3,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_transform>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eaa(%rip),%r15
mov    (%r15),%edi
lea    0xec0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
movsd  0x10(%rbx),%xmm2
lea    0xea7(%rip),%rsi
mov    $0x3,%al
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsd  0x18(%rbx),%xmm0
movsd  0x20(%rbx),%xmm1
movsd  0x28(%rbx),%xmm2
lea    0xe88(%rip),%rsi
mov    $0x3,%al
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsd  0x30(%rbx),%xmm0
movsd  0x38(%rbx),%xmm1
movsd  0x40(%rbx),%xmm2
lea    0xe7a(%rip),%rsi
mov    $0x3,%al
call   1030 <fprintf@plt>
mov    %rsp,%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <mvmul@plt>
mov    (%r15),%edi
lea    0xe6d(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
lea    0xe5d(%rip),%rsi
mov    $0x3,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"M = \0A\00"
@.str.1 = [19 x i8] c"[[%lf, %lf, %lf], \00"
@.str.2 = [18 x i8] c"[%lf, %lf, %lf], \00"
@.str.3 = [18 x i8] c"[%lf, %lf, %lf]]\0A\00"
@.str.4 = [18 x i8] c"After transform:\0A\00"
@.str.5 = [17 x i8] c"[%lf, %lf, %lf]\0A\00"
define void @print_transform([3 x double]* %0, double* %1) {
%3 = alloca [3 x double]*
%4 = alloca double*
%5 = alloca [3 x double]
store [3 x double]* %0, [3 x double]** %3
store double* %1, double** %4
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = load [3 x double]*, [3 x double]** %3
%10 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0
%11 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
%12 = load double, double* %11
%13 = load [3 x double]*, [3 x double]** %3
%14 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0
%15 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0, i64 1
%16 = load double, double* %15
%17 = load [3 x double]*, [3 x double]** %3
%18 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0
%19 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 2
%20 = load double, double* %19
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %12, double %16, double %20)
%22 = load i32, i32* @stderr
%23 = load [3 x double]*, [3 x double]** %3
%24 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 1
%25 = getelementptr inbounds [3 x double], [3 x double]* %24, i64 0, i64 0
%26 = load double, double* %25
%27 = load [3 x double]*, [3 x double]** %3
%28 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 1
%29 = getelementptr inbounds [3 x double], [3 x double]* %28, i64 0, i64 1
%30 = load double, double* %29
%31 = load [3 x double]*, [3 x double]** %3
%32 = getelementptr inbounds [3 x double], [3 x double]* %31, i64 1
%33 = getelementptr inbounds [3 x double], [3 x double]* %32, i64 0, i64 2
%34 = load double, double* %33
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %26, double %30, double %34)
%36 = load i32, i32* @stderr
%37 = load [3 x double]*, [3 x double]** %3
%38 = getelementptr inbounds [3 x double], [3 x double]* %37, i64 2
%39 = getelementptr inbounds [3 x double], [3 x double]* %38, i64 0, i64 0
%40 = load double, double* %39
%41 = load [3 x double]*, [3 x double]** %3
%42 = getelementptr inbounds [3 x double], [3 x double]* %41, i64 2
%43 = getelementptr inbounds [3 x double], [3 x double]* %42, i64 0, i64 1
%44 = load double, double* %43
%45 = load [3 x double]*, [3 x double]** %3
%46 = getelementptr inbounds [3 x double], [3 x double]* %45, i64 2
%47 = getelementptr inbounds [3 x double], [3 x double]* %46, i64 0, i64 2
%48 = load double, double* %47
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), double %40, double %44, double %48)
%50 = load double*, double** %4
%51 = load [3 x double]*, [3 x double]** %3
%52 = bitcast [3 x double]* %51 to double**
%53 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%54 = call i32 @mvmul(double* %50, double** %52, double* %53)
%55 = load i32, i32* @stderr
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%57 = load i32, i32* @stderr
%58 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%59 = load double, double* %58
%60 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
%61 = load double, double* %60
%62 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
%63 = load double, double* %62
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %59, double %61, double %63)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"M = \0A\00"
@.str.1 = [19 x i8] c"[[%lf, %lf, %lf], \00"
@.str.2 = [18 x i8] c"[%lf, %lf, %lf], \00"
@.str.3 = [18 x i8] c"[%lf, %lf, %lf]]\0A\00"
@.str.4 = [18 x i8] c"After transform:\0A\00"
@.str.5 = [17 x i8] c"[%lf, %lf, %lf]\0A\00"
define void @print_transform([3 x double]* %0, double* %1) {
%3 = alloca [3 x double]
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0
%8 = load double, double* %7
%9 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2
%12 = load double, double* %11
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %8, double %10, double %12)
%14 = load i32, i32* @stderr
%15 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%16 = load double, double* %15
%17 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 1
%18 = load double, double* %17
%19 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
%20 = load double, double* %19
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %16, double %18, double %20)
%22 = load i32, i32* @stderr
%23 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%24 = load double, double* %23
%25 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 1
%26 = load double, double* %25
%27 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
%28 = load double, double* %27
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), double %24, double %26, double %28)
%30 = bitcast [3 x double]* %3 to i8*
%31 = bitcast [3 x double]* %0 to double**
%32 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%33 = call i32 @mvmul(double* %1, double** %31, double* %32)
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = load double, double* %32
%38 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%39 = load double, double* %38
%40 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%41 = load double, double* %40
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %37, double %39, double %41)
ret void
}