#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 cos(double);
int /*<<< orphan*/ mat333Multiply(double **, double **, double **);
int sin(double);
void mat33Isometry(double theta, double x, double y, double isom[3][3]) {
  double rotMat[3][3] = {
      cos(theta), -sin(theta), 0, sin(theta), cos(theta), 0, 0, 0, 1,
  };
  double transMat[3][3] = {
      1, 0, x, 0, 1, y, 0, 0, 1,
  };
  mat333Multiply(transMat, rotMat, isom);
}


x86 assembly (clang, -O0):
<mat33Isometry>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x2e81(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0x2e7e(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0x2e7b(%rip),%rax
mov    %rax,-0x30(%rbp)
movsd  0xe27(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xdf4(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    0x2e28(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0x2e22(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0x2e1c(%rip),%rax
mov    %rax,-0x80(%rbp)
lea    -0xc0(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <mat333Multiply@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat33Isometry>:
push   %rbx
sub    $0xc0,%rsp
mov    %rdi,%rbx
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1050 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x28(%rsp)
movq   $0x0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x40(%rsp)
movq   $0x0,0x48(%rsp)
movups 0xe46(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
mov    0xe4a(%rip),%rax
mov    %rax,0x60(%rsp)
movsd  0xe25(%rip),%xmm1
movaps %xmm1,0x70(%rsp)
movsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x80(%rsp)
xorps  %xmm1,%xmm1
movhps 0xe07(%rip),%xmm1
movups %xmm1,0x88(%rsp)
movsd  0x18(%rsp),%xmm1
movsd  %xmm1,0x98(%rsp)
movaps %xmm0,0xa0(%rsp)
mov    %rax,0xb0(%rsp)
lea    0x70(%rsp),%rdi
lea    0x20(%rsp),%rsi
mov    %rbx,%rdx
call   1030 <mat333Multiply@plt>
add    $0xc0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@constinit = private global [3 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@constinit.1 = private global [3 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
define void @mat33Isometry(double %0, double %1, double %2, [3 x double]* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca [3 x double]*
%9 = alloca [3 x [3 x double]]
%10 = alloca [3 x [3 x double]]
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store [3 x double]* %3, [3 x double]** %8
%11 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 0
%12 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%13 = load double, double* %5
%14 = call i32 @cos(double %13)
%15 = sitofp i32 %14 to double
store double %15, double* %12
%16 = getelementptr inbounds double, double* %12, i64 1
%17 = load double, double* %5
%18 = call i32 @sin(double %17)
%19 = sub nsw i32 0, %18
%20 = sitofp i32 %19 to double
store double %20, double* %16
%21 = getelementptr inbounds double, double* %16, i64 1
store double 0.000000e+00, double* %21
%22 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 1
%23 = getelementptr inbounds [3 x double], [3 x double]* %22, i64 0, i64 0
%24 = load double, double* %5
%25 = call i32 @sin(double %24)
%26 = sitofp i32 %25 to double
store double %26, double* %23
%27 = getelementptr inbounds double, double* %23, i64 1
%28 = load double, double* %5
%29 = call i32 @cos(double %28)
%30 = sitofp i32 %29 to double
store double %30, double* %27
%31 = getelementptr inbounds double, double* %27, i64 1
store double 0.000000e+00, double* %31
%32 = getelementptr inbounds [3 x double], [3 x double]* %22, i64 1
%33 = getelementptr inbounds [3 x double], [3 x double]* %32, i64 0, i64 0
%34 = bitcast [3 x double]* %32 to i8*
%35 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %10, i64 0, i64 0
%36 = getelementptr inbounds [3 x double], [3 x double]* %35, i64 0, i64 0
store double 1.000000e+00, double* %36
%37 = getelementptr inbounds double, double* %36, i64 1
store double 0.000000e+00, double* %37
%38 = getelementptr inbounds double, double* %37, i64 1
%39 = load double, double* %6
store double %39, double* %38
%40 = getelementptr inbounds [3 x double], [3 x double]* %35, i64 1
%41 = getelementptr inbounds [3 x double], [3 x double]* %40, i64 0, i64 0
store double 0.000000e+00, double* %41
%42 = getelementptr inbounds double, double* %41, i64 1
store double 1.000000e+00, double* %42
%43 = getelementptr inbounds double, double* %42, i64 1
%44 = load double, double* %7
store double %44, double* %43
%45 = getelementptr inbounds [3 x double], [3 x double]* %40, i64 1
%46 = getelementptr inbounds [3 x double], [3 x double]* %45, i64 0, i64 0
%47 = bitcast [3 x double]* %45 to i8*
%48 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %10, i64 0, i64 0
%49 = bitcast [3 x double]* %48 to double**
%50 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 0
%51 = bitcast [3 x double]* %50 to double**
%52 = load [3 x double]*, [3 x double]** %8
%53 = bitcast [3 x double]* %52 to double**
%54 = call i32 @mat333Multiply(double** %49, double** %51, double** %53)
ret void
}

LLVM IR (-O2):
@constinit.1 = [3 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
define void @mat33Isometry(double %0, double %1, double %2, [3 x double]* %3) {
%5 = alloca [3 x [3 x double]]
%6 = alloca [3 x [3 x double]]
%7 = bitcast [3 x [3 x double]]* %5 to i8*
%8 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0, i64 0
%9 = tail call i32 @cos(double %0)
%10 = sitofp i32 %9 to double
store double %10, double* %8
%11 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0, i64 1
%12 = tail call i32 @sin(double %0)
%13 = sub nsw i32 0, %12
%14 = sitofp i32 %13 to double
store double %14, double* %11
%15 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0, i64 2
store double 0.000000e+00, double* %15
%16 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 1, i64 0
%17 = tail call i32 @sin(double %0)
%18 = sitofp i32 %17 to double
store double %18, double* %16
%19 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 1, i64 1
%20 = tail call i32 @cos(double %0)
%21 = sitofp i32 %20 to double
store double %21, double* %19
%22 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 1, i64 2
store double 0.000000e+00, double* %22
%23 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 2
%24 = bitcast [3 x double]* %23 to i8*
%25 = bitcast [3 x [3 x double]]* %6 to i8*
%26 = bitcast [3 x [3 x double]]* %6 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 0.000000e+00>, <2 x double>* %26
%27 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %6, i64 0, i64 0, i64 2
store double %1, double* %27
%28 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %6, i64 0, i64 1, i64 0
%29 = bitcast double* %28 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 1.000000e+00>, <2 x double>* %29
%30 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %6, i64 0, i64 1, i64 2
store double %2, double* %30
%31 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %6, i64 0, i64 2
%32 = bitcast [3 x double]* %31 to i8*
%33 = bitcast [3 x [3 x double]]* %6 to double**
%34 = bitcast [3 x [3 x double]]* %5 to double**
%35 = bitcast [3 x double]* %3 to double**
%36 = call i32 @mat333Multiply(double** %33, double** %34, double** %35)
ret void
}