#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*/ fill_one(int **, int, int);
int /*<<< orphan*/ fill_two(int **, int, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i, A[8][8], j;
  for (i = 0; i < 8; i++)
    if (i % 2 == 0)
      fill_one(A, 8, i);
    else
      fill_two(A, 8, i);
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++)
      printf("%d", A[i][j]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    11a7 <main+0x77>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1180 <main+0x50>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    $0x8,%esi
call   1040 <fill_one@plt>
jmp    1194 <main+0x64>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    $0x8,%esi
call   1050 <fill_two@plt>
jmp    1199 <main+0x69>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <main+0x19>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1229 <main+0xf9>
movl   $0x0,-0x114(%rbp)
cmpl   $0x8,-0x114(%rbp)
jge    120d <main+0xdd>
movslq -0x8(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x114(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    11c2 <main+0x92>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ae <main+0x7e>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1050 <fill_one@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1060 <fill_two@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x2,%edx
call   1050 <fill_one@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x3,%edx
call   1060 <fill_two@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1050 <fill_one@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x5,%edx
call   1060 <fill_two@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x6,%edx
call   1050 <fill_one@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x7,%edx
call   1060 <fill_two@plt>
lea    0xe1f(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rbx
cmp    $0x100,%rbx
jne    11f0 <main+0xb0>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [8 x [8 x i32]]
%2 = bitcast [8 x [8 x i32]]* %1 to i8*
%3 = bitcast [8 x [8 x i32]]* %1 to i32**
%4 = call i32 @fill_one(i32** %3, i32 8, i32 0)
%5 = call i32 @fill_two(i32** %3, i32 8, i32 1)
%6 = call i32 @fill_one(i32** %3, i32 8, i32 2)
%7 = call i32 @fill_two(i32** %3, i32 8, i32 3)
%8 = call i32 @fill_one(i32** %3, i32 8, i32 4)
%9 = call i32 @fill_two(i32** %3, i32 8, i32 5)
%10 = call i32 @fill_one(i32** %3, i32 8, i32 6)
%11 = call i32 @fill_two(i32** %3, i32 8, i32 7)
br label %12
12: ; preds = %0, %12
%13 = phi i64 [ 0, %0 ], [ %39, %12 ]
%14 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %13, i64 0
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %13, i64 1
%18 = load i32, i32* %17
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %13, i64 2
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %13, i64 3
%24 = load i32, i32* %23
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %13, i64 4
%27 = load i32, i32* %26
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %13, i64 5
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %13, i64 6
%33 = load i32, i32* %32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %13, i64 7
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = call i32 @putchar(i32 10)
%39 = add nuw nsw i64 %13, 1
%40 = icmp eq i64 %39, 8
br i1 %40, label %41, label %12
41: ; preds = %12
ret i32 0
}