#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*/ fail(char *);
int matrix_3x3to12x9(float *r, float *a, int n) {
  if (n != 9)
    fail("mto12x9 needs a 3x3 matrix");
  if (108 > 0x100)
    fail("MAX_PIXELDIM needs to be at least 108");
  for (int i = 0; i < 108; i++)
    r[i] = 0;
  r[0] = r[39] = r[78] = a[0];
  r[1] = r[40] = r[79] = a[1];
  r[2] = r[41] = r[80] = a[2];
  r[12] = r[51] = r[90] = a[3];
  r[13] = r[52] = r[91] = a[4];
  r[14] = r[53] = r[92] = a[5];
  r[24] = r[63] = r[102] = a[6];
  r[25] = r[64] = r[103] = a[7];
  r[26] = r[65] = r[104] = a[8];
  r[21] = r[34] = r[71] = 1;
  r[45] = r[82] = r[95] = -1;
  return 108;
}


x86 assembly (clang, -O0):
<matrix_3x3to12x9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
je     1139 <matrix_3x3to12x9+0x29>
lea    0xed4(%rip),%rdi
call   1030 <fail@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x6c,-0x18(%rbp)
jge    1168 <matrix_3x3to12x9+0x58>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1140 <matrix_3x3to12x9+0x30>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x138(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0x9c(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x13c(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0xa0(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x140(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0xa4(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x168(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0xcc(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0x30(%rax)
mov    -0x10(%rbp),%rax
movss  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x16c(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0xd0(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0x34(%rax)
mov    -0x10(%rbp),%rax
movss  0x14(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x170(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0xd4(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0x38(%rax)
mov    -0x10(%rbp),%rax
movss  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x198(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0xfc(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0x60(%rax)
mov    -0x10(%rbp),%rax
movss  0x1c(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x19c(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0x100(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0x64(%rax)
mov    -0x10(%rbp),%rax
movss  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x1a0(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0x104(%rax)
mov    -0x8(%rbp),%rax
movss  %xmm0,0x68(%rax)
mov    -0x8(%rbp),%rax
movss  0xd18(%rip),%xmm0
movss  %xmm0,0x11c(%rax)
mov    -0x8(%rbp),%rax
movss  0xd04(%rip),%xmm0
movss  %xmm0,0x88(%rax)
mov    -0x8(%rbp),%rax
movss  0xcf0(%rip),%xmm0
movss  %xmm0,0x54(%rax)
mov    -0x8(%rbp),%rax
movss  0xcdb(%rip),%xmm0
movss  %xmm0,0x17c(%rax)
mov    -0x8(%rbp),%rax
movss  0xcc7(%rip),%xmm0
movss  %xmm0,0x148(%rax)
mov    -0x8(%rbp),%rax
movss  0xcb3(%rip),%xmm0
movss  %xmm0,0xb4(%rax)
mov    $0x6c,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_3x3to12x9>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmp    $0x9,%edx
je     113b <matrix_3x3to12x9+0x1b>
lea    0xeca(%rip),%rdi
call   1030 <fail@plt>
mov    $0x1b0,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
movss  (%r14),%xmm0
movss  %xmm0,0x138(%rbx)
movss  %xmm0,0x9c(%rbx)
movss  %xmm0,(%rbx)
movss  0x4(%r14),%xmm0
movss  %xmm0,0x13c(%rbx)
movss  %xmm0,0xa0(%rbx)
movss  %xmm0,0x4(%rbx)
movss  0x8(%r14),%xmm0
movss  %xmm0,0x140(%rbx)
movss  %xmm0,0xa4(%rbx)
movss  %xmm0,0x8(%rbx)
movss  0xc(%r14),%xmm0
movss  %xmm0,0x168(%rbx)
movss  %xmm0,0xcc(%rbx)
movss  %xmm0,0x30(%rbx)
movss  0x10(%r14),%xmm0
movss  %xmm0,0x16c(%rbx)
movss  %xmm0,0xd0(%rbx)
movss  %xmm0,0x34(%rbx)
movss  0x14(%r14),%xmm0
movss  %xmm0,0x170(%rbx)
movss  %xmm0,0xd4(%rbx)
movss  %xmm0,0x38(%rbx)
movss  0x18(%r14),%xmm0
movss  %xmm0,0x198(%rbx)
movss  %xmm0,0xfc(%rbx)
movss  %xmm0,0x60(%rbx)
movss  0x1c(%r14),%xmm0
movss  %xmm0,0x19c(%rbx)
movss  %xmm0,0x100(%rbx)
movss  %xmm0,0x64(%rbx)
movss  0x20(%r14),%xmm0
movss  %xmm0,0x1a0(%rbx)
movss  %xmm0,0x104(%rbx)
movss  %xmm0,0x68(%rbx)
movl   $0x3f800000,0x11c(%rbx)
movl   $0x3f800000,0x88(%rbx)
movl   $0x3f800000,0x54(%rbx)
movl   $0xbf800000,0x17c(%rbx)
movl   $0xbf800000,0x148(%rbx)
movl   $0xbf800000,0xb4(%rbx)
mov    $0x6c,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"mto12x9 needs a 3x3 matrix\00"
define i32 @matrix_3x3to12x9(float* writeonly %0, float* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 9
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fail(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = bitcast float* %0 to i8*
%9 = load float, float* %1
%10 = getelementptr inbounds float, float* %0, i64 78
store float %9, float* %10
%11 = getelementptr inbounds float, float* %0, i64 39
store float %9, float* %11
store float %9, float* %0
%12 = getelementptr inbounds float, float* %1, i64 1
%13 = load float, float* %12
%14 = getelementptr inbounds float, float* %0, i64 79
store float %13, float* %14
%15 = getelementptr inbounds float, float* %0, i64 40
store float %13, float* %15
%16 = getelementptr inbounds float, float* %0, i64 1
store float %13, float* %16
%17 = getelementptr inbounds float, float* %1, i64 2
%18 = load float, float* %17
%19 = getelementptr inbounds float, float* %0, i64 80
store float %18, float* %19
%20 = getelementptr inbounds float, float* %0, i64 41
store float %18, float* %20
%21 = getelementptr inbounds float, float* %0, i64 2
store float %18, float* %21
%22 = getelementptr inbounds float, float* %1, i64 3
%23 = load float, float* %22
%24 = getelementptr inbounds float, float* %0, i64 90
store float %23, float* %24
%25 = getelementptr inbounds float, float* %0, i64 51
store float %23, float* %25
%26 = getelementptr inbounds float, float* %0, i64 12
store float %23, float* %26
%27 = getelementptr inbounds float, float* %1, i64 4
%28 = load float, float* %27
%29 = getelementptr inbounds float, float* %0, i64 91
store float %28, float* %29
%30 = getelementptr inbounds float, float* %0, i64 52
store float %28, float* %30
%31 = getelementptr inbounds float, float* %0, i64 13
store float %28, float* %31
%32 = getelementptr inbounds float, float* %1, i64 5
%33 = load float, float* %32
%34 = getelementptr inbounds float, float* %0, i64 92
store float %33, float* %34
%35 = getelementptr inbounds float, float* %0, i64 53
store float %33, float* %35
%36 = getelementptr inbounds float, float* %0, i64 14
store float %33, float* %36
%37 = getelementptr inbounds float, float* %1, i64 6
%38 = load float, float* %37
%39 = getelementptr inbounds float, float* %0, i64 102
store float %38, float* %39
%40 = getelementptr inbounds float, float* %0, i64 63
store float %38, float* %40
%41 = getelementptr inbounds float, float* %0, i64 24
store float %38, float* %41
%42 = getelementptr inbounds float, float* %1, i64 7
%43 = load float, float* %42
%44 = getelementptr inbounds float, float* %0, i64 103
store float %43, float* %44
%45 = getelementptr inbounds float, float* %0, i64 64
store float %43, float* %45
%46 = getelementptr inbounds float, float* %0, i64 25
store float %43, float* %46
%47 = getelementptr inbounds float, float* %1, i64 8
%48 = load float, float* %47
%49 = getelementptr inbounds float, float* %0, i64 104
store float %48, float* %49
%50 = getelementptr inbounds float, float* %0, i64 65
store float %48, float* %50
%51 = getelementptr inbounds float, float* %0, i64 26
store float %48, float* %51
%52 = getelementptr inbounds float, float* %0, i64 71
store float 1.000000e+00, float* %52
%53 = getelementptr inbounds float, float* %0, i64 34
store float 1.000000e+00, float* %53
%54 = getelementptr inbounds float, float* %0, i64 21
store float 1.000000e+00, float* %54
%55 = getelementptr inbounds float, float* %0, i64 95
store float -1.000000e+00, float* %55
%56 = getelementptr inbounds float, float* %0, i64 82
store float -1.000000e+00, float* %56
%57 = getelementptr inbounds float, float* %0, i64 45
store float -1.000000e+00, float* %57
ret i32 108
}