#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 */
typedef double GLdouble;

/* Variables and functions */
void identifymat3(GLdouble m[3][3]) {
  int i, j;
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++)
      m[i][j] = (i == j) ? 1.0 : 0.0;
}


x86 assembly (clang, -O0):
<identifymat3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1195 <identifymat3+0x95>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1182 <identifymat3+0x82>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
movsd  0xec8(%rip),%xmm0
xorps  %xmm1,%xmm1
movsd  %xmm1,-0x20(%rbp)
cmp    %ecx,%eax
movsd  %xmm0,-0x18(%rbp)
je     1157 <identifymat3+0x57>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <identifymat3+0x20>
jmp    1187 <identifymat3+0x87>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <identifymat3+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<identifymat3>:
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rdi)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rdi)
movq   $0x0,0x18(%rdi)
mov    %rax,0x20(%rdi)
movups %xmm0,0x28(%rdi)
movq   $0x0,0x38(%rdi)
mov    %rax,0x40(%rdi)
ret

LLVM IR (-O0):
define void @identifymat3([3 x double]* %0) {
%2 = alloca [3 x double]*
%3 = alloca i32
%4 = alloca i32
store [3 x double]* %0, [3 x double]** %2
store i32 0, i32* %3
br label %5
5: ; preds = %29, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %32
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %25, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %28
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, double 1.000000e+00, double 0.000000e+00
%18 = load [3 x double]*, [3 x double]** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 %20
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [3 x double], [3 x double]* %21, i64 0, i64 %23
store double %17, double* %24
br label %25
25: ; preds = %12
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %9
28: ; preds = %9
br label %29
29: ; preds = %28
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %5
32: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @identifymat3([3 x double]* nocapture writeonly %0) {
%2 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0
store double 1.000000e+00, double* %2
%3 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1
%4 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 1
%5 = bitcast double* %3 to i8*
store double 1.000000e+00, double* %4
%6 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
%7 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
%8 = bitcast double* %6 to i8*
store double 1.000000e+00, double* %7
ret void
}