#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 */
double **deye2(double **m, const size_t n) {
  size_t i, j;
  for (i = 0; i < n; i++) {
    m[i][i] = 1.;
    for (j = i + 1; j < n; j++) {
      m[i][j] = m[j][i] = 0.;
    }
  }
  return m;
}


x86 assembly (clang, -O0):
<deye2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11b0 <deye2+0xb0>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x18(%rbp),%rcx
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    119a <deye2+0x9a>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    114b <deye2+0x4b>
jmp    119f <deye2+0x9f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <deye2+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deye2>:
mov    %rdi,%rax
test   %rsi,%rsi
je     115f <deye2+0x5f>
xor    %r9d,%r9d
movabs $0x3ff0000000000000,%r8
jmp    1125 <deye2+0x25>
nopw   0x0(%rax,%rax,1)
cmp    %rsi,%r9
je     115f <deye2+0x5f>
mov    %r9,%rdi
mov    (%rax,%r9,8),%r10
mov    %r8,(%r10,%r9,8)
add    $0x1,%r9
cmp    %rsi,%r9
jae    1120 <deye2+0x20>
mov    %r9,%rdx
nopl   0x0(%rax)
mov    (%rax,%rdx,8),%rcx
movq   $0x0,(%rcx,%rdi,8)
movq   $0x0,(%r10,%rdx,8)
add    $0x1,%rdx
cmp    %rsi,%rdx
jb     1140 <deye2+0x40>
jmp    1120 <deye2+0x20>
ret

LLVM IR (-O0):
define double** @deye2(double** %0, i64 %1) {
%3 = alloca double**
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store double** %0, double*** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %7
7: ; preds = %41, %2
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %44
11: ; preds = %7
%12 = load double**, double*** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds double*, double** %12, i64 %13
%15 = load double*, double** %14
%16 = load i64, i64* %5
%17 = getelementptr inbounds double, double* %15, i64 %16
store double 1.000000e+00, double* %17
%18 = load i64, i64* %5
%19 = add i64 %18, 1
store i64 %19, i64* %6
br label %20
20: ; preds = %37, %11
%21 = load i64, i64* %6
%22 = load i64, i64* %4
%23 = icmp ult i64 %21, %22
br i1 %23, label %24, label %40
24: ; preds = %20
%25 = load double**, double*** %3
%26 = load i64, i64* %6
%27 = getelementptr inbounds double*, double** %25, i64 %26
%28 = load double*, double** %27
%29 = load i64, i64* %5
%30 = getelementptr inbounds double, double* %28, i64 %29
store double 0.000000e+00, double* %30
%31 = load double**, double*** %3
%32 = load i64, i64* %5
%33 = getelementptr inbounds double*, double** %31, i64 %32
%34 = load double*, double** %33
%35 = load i64, i64* %6
%36 = getelementptr inbounds double, double* %34, i64 %35
store double 0.000000e+00, double* %36
br label %37
37: ; preds = %24
%38 = load i64, i64* %6
%39 = add i64 %38, 1
store i64 %39, i64* %6
br label %20
40: ; preds = %20
br label %41
41: ; preds = %40
%42 = load i64, i64* %5
%43 = add i64 %42, 1
store i64 %43, i64* %5
br label %7
44: ; preds = %7
%45 = load double**, double*** %3
ret double** %45
}

LLVM IR (-O2):
define double** @deye2(double** returned %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %21, label %6
4: ; preds = %13, %6
%5 = icmp eq i64 %11, %1
br i1 %5, label %21, label %6
6: ; preds = %2, %4
%7 = phi i64 [ %11, %4 ], [ 0, %2 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = load double*, double** %8
%10 = getelementptr inbounds double, double* %9, i64 %7
store double 1.000000e+00, double* %10
%11 = add nuw i64 %7, 1
%12 = icmp ult i64 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %6, %13
%14 = phi i64 [ %19, %13 ], [ %11, %6 ]
%15 = getelementptr inbounds double*, double** %0, i64 %14
%16 = load double*, double** %15
%17 = getelementptr inbounds double, double* %16, i64 %7
store double 0.000000e+00, double* %17
%18 = getelementptr inbounds double, double* %9, i64 %14
store double 0.000000e+00, double* %18
%19 = add nuw i64 %14, 1
%20 = icmp ult i64 %19, %1
br i1 %20, label %13, label %4
21: ; preds = %4, %2
ret double** %0
}