#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*/ printf(char *, double);
int main(void) {
  double ident[10][10], *p;
  int count_zeros = 0, col_count = 1;
  for (p = ident[0]; p < &ident[10 - 1][10 - 1]; p++)
    if (count_zeros % 10 == 0) {
      *p = 1.0;
      count_zeros++;
    } else {
      *p = 0.0;
      count_zeros++;
    }
  for (p = ident[0]; p < &ident[10 - 1][10 - 1]; p++)
    if (col_count % (10 - 1) == 0) {
      printf("%f\n", *p);
      col_count++;
    } else {
      printf("%f ", *p);
      col_count++;
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x33c(%rbp)
movl   $0x1,-0x340(%rbp)
lea    -0x330(%rbp),%rax
mov    %rax,-0x338(%rbp)
mov    -0x338(%rbp),%rax
lea    -0x330(%rbp),%rcx
add    $0x2d0,%rcx
add    $0x48,%rcx
cmp    %rcx,%rax
jae    11dd <main+0xcd>
mov    -0x33c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a4 <main+0x94>
mov    -0x338(%rbp),%rax
movsd  0xe74(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x33c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x33c(%rbp)
jmp    11c1 <main+0xb1>
mov    -0x338(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x33c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x33c(%rbp)
jmp    11c6 <main+0xb6>
mov    -0x338(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x338(%rbp)
jmp    1144 <main+0x34>
lea    -0x330(%rbp),%rax
mov    %rax,-0x338(%rbp)
mov    -0x338(%rbp),%rax
lea    -0x330(%rbp),%rcx
add    $0x2d0,%rcx
add    $0x48,%rcx
cmp    %rcx,%rax
jae    1291 <main+0x181>
mov    -0x340(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    124f <main+0x13f>
mov    -0x338(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xdd2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x340(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x340(%rbp)
jmp    1275 <main+0x165>
mov    -0x338(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xdab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x340(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x340(%rbp)
jmp    127a <main+0x16a>
mov    -0x338(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x338(%rbp)
jmp    11eb <main+0xdb>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x328,%rsp
mov    %rsp,%rsi
lea    0x318(%rsp),%r14
lea    0x8(%rsp),%rcx
cmp    %rcx,%r14
cmova  %r14,%rcx
mov    %rsi,%rax
not    %rax
add    %rcx,%rax
xor    %ecx,%ecx
cmp    $0x7,%rax
je     12ec <main+0x1dc>
shr    $0x3,%rax
lea    -0x2(%rax),%rdx
mov    %rdx,%rcx
shr    %rcx
add    $0x1,%rcx
cmp    $0x2,%rdx
jae    1174 <main+0x64>
movdqa 0xe93(%rip),%xmm0
xor    %edx,%edx
jmp    12c3 <main+0x1b3>
mov    %rcx,%rsi
and    $0xfffffffffffffffe,%rsi
movdqa 0xe7d(%rip),%xmm0
xor    %edx,%edx
movdqa 0xe82(%rip),%xmm10
movaps 0xe8b(%rip),%xmm2
movdqa 0xe93(%rip),%xmm3
pcmpeqd %xmm4,%xmm4
movdqa 0xe97(%rip),%xmm5
movdqa 0xe9e(%rip),%xmm8
movdqa 0xea5(%rip),%xmm9
nopl   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm6
pmuludq %xmm10,%xmm6
pshufd $0xe8,%xmm6,%xmm1
pshufd $0xf5,%xmm0,%xmm7
pmuludq %xmm10,%xmm7
pshufd $0xe8,%xmm7,%xmm7
punpckldq %xmm7,%xmm1
movdqa %xmm1,%xmm7
psrld  $0x1,%xmm7
movdqa %xmm1,%xmm6
pslld  $0x1f,%xmm6
por    %xmm7,%xmm6
shufps $0xe4,%xmm1,%xmm6
xorps  %xmm2,%xmm6
pcmpgtd %xmm3,%xmm6
pshufd $0x50,%xmm6,%xmm6
pxor   %xmm4,%xmm6
pxor   %xmm7,%xmm7
pcmpgtd %xmm6,%xmm7
pand   %xmm5,%xmm7
movdqa %xmm7,(%rsp,%rdx,8)
paddd  %xmm8,%xmm1
movdqa %xmm1,%xmm6
psrld  $0x1,%xmm6
movdqa %xmm1,%xmm7
pslld  $0x1f,%xmm7
por    %xmm6,%xmm7
shufps $0xe4,%xmm1,%xmm7
xorps  %xmm2,%xmm7
pcmpgtd %xmm3,%xmm7
pshufd $0x50,%xmm7,%xmm1
pxor   %xmm4,%xmm1
pxor   %xmm6,%xmm6
pcmpgtd %xmm1,%xmm6
pand   %xmm5,%xmm6
movdqa %xmm6,0x10(%rsp,%rdx,8)
add    $0x4,%rdx
paddd  %xmm9,%xmm0
add    $0xfffffffffffffffe,%rsi
jne    11c0 <main+0xb0>
movdqa 0xdf8(%rip),%xmm1
movdqa %xmm0,%xmm2
pmuludq %xmm1,%xmm2
pshufd $0xed,%xmm2,%xmm2
pshufd $0xf5,%xmm0,%xmm3
pmuludq %xmm1,%xmm3
pshufd $0xed,%xmm3,%xmm1
punpckldq %xmm1,%xmm2
psrld  $0x3,%xmm2
movdqa 0xddc(%rip),%xmm1
pshufd $0xf5,%xmm2,%xmm3
pmuludq %xmm1,%xmm2
pshufd $0xe8,%xmm2,%xmm2
pmuludq %xmm1,%xmm3
pshufd $0xe8,%xmm3,%xmm1
punpckldq %xmm1,%xmm2
psubd  %xmm2,%xmm0
lea    (%rsp,%rax,8),%rsi
test   $0x1,%cl
je     12ea <main+0x1da>
pshufd $0x50,%xmm0,%xmm0
pxor   %xmm1,%xmm1
pcmpeqd %xmm1,%xmm0
pcmpgtd %xmm0,%xmm1
pand   0xd5b(%rip),%xmm1
movdqa %xmm1,(%rsp,%rdx,8)
mov    %eax,%ecx
mov    $0xcccccccd,%eax
movq   0xd97(%rip),%xmm0
jmp    1310 <main+0x200>
nopl   0x0(%rax,%rax,1)
movq   %xmm1,(%rsi)
add    $0x1,%ecx
add    $0x8,%rsi
cmp    %r14,%rsi
jae    132d <main+0x21d>
mov    %ecx,%edx
imul   %rax,%rdx
shr    $0x23,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
movdqa %xmm0,%xmm1
cmp    %edx,%ecx
je     1300 <main+0x1f0>
pxor   %xmm1,%xmm1
jmp    1300 <main+0x1f0>
mov    $0x1,%r15d
mov    $0xffffffff,%ebx
mov    %rsp,%rbp
lea    0xd56(%rip),%r12
lea    0xd53(%rip),%r13
nopl   0x0(%rax)
mov    %r15d,%eax
imul   $0x38e38e39,%rax,%rax
shr    $0x21,%rax
lea    (%rax,%rax,8),%eax
add    %ebx,%eax
movq   0x0(%rbp),%xmm0
mov    %r13,%rdi
cmove  %r12,%rdi
call   1030 <printf@plt>
add    $0x1,%r15d
add    $0x8,%rbp
add    $0xffffffff,%ebx
cmp    %r14,%rbp
jb     1350 <main+0x240>
xor    %eax,%eax
add    $0x328,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [4 x i8] c"%f \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x double]]
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 1, i32* %5
%6 = getelementptr inbounds [10 x [10 x double]], [10 x [10 x double]]* %2, i64 0, i64 0
%7 = getelementptr inbounds [10 x double], [10 x double]* %6, i64 0, i64 0
store double* %7, double** %3
br label %8
8: ; preds = %26, %0
%9 = load double*, double** %3
%10 = getelementptr inbounds [10 x [10 x double]], [10 x [10 x double]]* %2, i64 0, i64 9
%11 = getelementptr inbounds [10 x double], [10 x double]* %10, i64 0, i64 9
%12 = icmp ult double* %9, %11
br i1 %12, label %13, label %29
13: ; preds = %8
%14 = load i32, i32* %4
%15 = srem i32 %14, 10
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load double*, double** %3
store double 1.000000e+00, double* %18
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %25
21: ; preds = %13
%22 = load double*, double** %3
store double 0.000000e+00, double* %22
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %25
25: ; preds = %21, %17
br label %26
26: ; preds = %25
%27 = load double*, double** %3
%28 = getelementptr inbounds double, double* %27, i32 1
store double* %28, double** %3
br label %8
29: ; preds = %8
%30 = getelementptr inbounds [10 x [10 x double]], [10 x [10 x double]]* %2, i64 0, i64 0
%31 = getelementptr inbounds [10 x double], [10 x double]* %30, i64 0, i64 0
store double* %31, double** %3
br label %32
32: ; preds = %54, %29
%33 = load double*, double** %3
%34 = getelementptr inbounds [10 x [10 x double]], [10 x [10 x double]]* %2, i64 0, i64 9
%35 = getelementptr inbounds [10 x double], [10 x double]* %34, i64 0, i64 9
%36 = icmp ult double* %33, %35
br i1 %36, label %37, label %57
37: ; preds = %32
%38 = load i32, i32* %5
%39 = srem i32 %38, 9
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %47
41: ; preds = %37
%42 = load double*, double** %3
%43 = load double, double* %42
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %43)
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %53
47: ; preds = %37
%48 = load double*, double** %3
%49 = load double, double* %48
%50 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %49)
%51 = load i32, i32* %5
%52 = add nsw i32 %51, 1
store i32 %52, i32* %5
br label %53
53: ; preds = %47, %41
br label %54
54: ; preds = %53
%55 = load double*, double** %3
%56 = getelementptr inbounds double, double* %55, i32 1
store double* %56, double** %3
br label %32
57: ; preds = %32
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [4 x i8] c"%f \00"
define i32 @main() {
%1 = alloca [10 x [10 x double]]
%2 = ptrtoint [10 x [10 x double]]* %1 to i64
%3 = bitcast [10 x [10 x double]]* %1 to i8*
%4 = getelementptr inbounds [10 x [10 x double]], [10 x [10 x double]]* %1, i64 0, i64 0, i64 0
%5 = getelementptr inbounds [10 x [10 x double]], [10 x [10 x double]]* %1, i64 0, i64 9, i64 9
%6 = add i64 %2, 792
%7 = or i64 %2, 8
%8 = call i64 @llvm.umax.i64(i64 %6, i64 %7)
%9 = xor i64 %2, -1
%10 = add i64 %8, %9
%11 = lshr i64 %10, 3
%12 = icmp eq i64 %10, 7
br i1 %12, label %54, label %13
13: ; preds = %0
%14 = trunc i64 %11 to i32
%15 = getelementptr [10 x [10 x double]], [10 x [10 x double]]* %1, i64 0, i64 0, i64 %11
%16 = add nsw i64 %11, -2
%17 = lshr i64 %16, 1
%18 = add nuw i64 %17, 1
%19 = and i64 %18, 1
%20 = icmp ult i64 %16, 2
br i1 %20, label %45, label %21
21: ; preds = %13
%22 = and i64 %18, -2
br label %23
23: ; preds = %23, %21
%24 = phi i64 [ 0, %21 ], [ %39, %23 ]
%25 = phi <2 x i32> [ <i32 0, i32 1>, %21 ], [ %40, %23 ]
%26 = phi i64 [ 0, %21 ], [ %41, %23 ]
%27 = getelementptr [10 x [10 x double]], [10 x [10 x double]]* %1, i64 0, i64 0, i64 %24
%28 = urem <2 x i32> %25, <i32 10, i32 10>
%29 = icmp eq <2 x i32> %28, zeroinitializer
%30 = select <2 x i1> %29, <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double> zeroinitializer
%31 = bitcast double* %27 to <2 x double>*
store <2 x double> %30, <2 x double>* %31
%32 = or i64 %24, 2
%33 = add <2 x i32> %25, <i32 2, i32 2>
%34 = getelementptr [10 x [10 x double]], [10 x [10 x double]]* %1, i64 0, i64 0, i64 %32
%35 = urem <2 x i32> %33, <i32 10, i32 10>
%36 = icmp eq <2 x i32> %35, zeroinitializer
%37 = select <2 x i1> %36, <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double> zeroinitializer
%38 = bitcast double* %34 to <2 x double>*
store <2 x double> %37, <2 x double>* %38
%39 = add nuw i64 %24, 4
%40 = add <2 x i32> %25, <i32 4, i32 4>
%41 = add nuw i64 %26, 2
%42 = icmp eq i64 %41, %22
br i1 %42, label %43, label %23
43: ; preds = %23
%44 = urem <2 x i32> %40, <i32 10, i32 10>
br label %45
45: ; preds = %43, %13
%46 = phi i64 [ 0, %13 ], [ %39, %43 ]
%47 = phi <2 x i32> [ <i32 0, i32 1>, %13 ], [ %44, %43 ]
%48 = icmp eq i64 %19, 0
br i1 %48, label %54, label %49
49: ; preds = %45
%50 = getelementptr [10 x [10 x double]], [10 x [10 x double]]* %1, i64 0, i64 0, i64 %46
%51 = icmp eq <2 x i32> %47, zeroinitializer
%52 = select <2 x i1> %51, <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double> zeroinitializer
%53 = bitcast double* %50 to <2 x double>*
store <2 x double> %52, <2 x double>* %53
br label %54
54: ; preds = %49, %45, %0
%55 = phi i32 [ 0, %0 ], [ %14, %45 ], [ %14, %49 ]
%56 = phi double* [ %4, %0 ], [ %15, %45 ], [ %15, %49 ]
br label %57
57: ; preds = %54, %57
%58 = phi i32 [ %63, %57 ], [ %55, %54 ]
%59 = phi double* [ %64, %57 ], [ %56, %54 ]
%60 = urem i32 %58, 10
%61 = icmp eq i32 %60, 0
%62 = select i1 %61, double 1.000000e+00, double 0.000000e+00
store double %62, double* %59
%63 = add nuw nsw i32 %58, 1
%64 = getelementptr inbounds double, double* %59, i64 1
%65 = icmp ult double* %64, %5
br i1 %65, label %57, label %66
66: ; preds = %57, %66
%67 = phi i32 [ %74, %66 ], [ 1, %57 ]
%68 = phi double* [ %75, %66 ], [ %4, %57 ]
%69 = urem i32 %67, 9
%70 = icmp eq i32 %69, 0
%71 = load double, double* %68
%72 = select i1 %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%73 = call i32 @printf(i8* %72, double %71)
%74 = add nuw nsw i32 %67, 1
%75 = getelementptr inbounds double, double* %68, i64 1
%76 = icmp ult double* %75, %5
br i1 %76, label %66, label %77
77: ; preds = %66
ret i32 0
}