#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 *, ...);
void genomeind(int gen[10000][10][2], int in) {
  int j, k;
  for (j = 0; j < 2; j++) {
    for (k = 0; k < 10; k++)
      printf("%d", gen[in][k][j]);
    printf(",");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<genomeind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    119a <genomeind+0x8a>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    117e <genomeind+0x6e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <genomeind+0x27>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <genomeind+0x16>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genomeind>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
movslq %esi,%rax
lea    (%rax,%rax,4),%rbx
shl    $0x4,%rbx
mov    (%rdi,%rbx,1),%esi
lea    0xec3(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x30(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x40(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x48(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x4(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2c(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x34(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x3c(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x44(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4c(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c",\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @genomeind([10 x [2 x i32]]* %0, i32 %1) {
%3 = alloca [10 x [2 x i32]]*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store [10 x [2 x i32]]* %0, [10 x [2 x i32]]** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %32, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %35
10: ; preds = %7
store i32 0, i32* %6
br label %11
11: ; preds = %27, %10
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 10
br i1 %13, label %14, label %30
14: ; preds = %11
%15 = load [10 x [2 x i32]]*, [10 x [2 x i32]]** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %15, i64 %17
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %18, i64 0, i64 %20
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %21, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %14
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %11
30: ; preds = %11
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %32
32: ; preds = %30
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %7
35: ; preds = %7
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @genomeind([10 x [2 x i32]]* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 0, i64 0
%5 = load i32, i32* %4
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 1, i64 0
%8 = load i32, i32* %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 2, i64 0
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 3, i64 0
%14 = load i32, i32* %13
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 4, i64 0
%17 = load i32, i32* %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 5, i64 0
%20 = load i32, i32* %19
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 6, i64 0
%23 = load i32, i32* %22
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 7, i64 0
%26 = load i32, i32* %25
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 8, i64 0
%29 = load i32, i32* %28
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 9, i64 0
%32 = load i32, i32* %31
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %32)
%34 = tail call i32 @putchar(i32 44)
%35 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 0, i64 1
%36 = load i32, i32* %35
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 1, i64 1
%39 = load i32, i32* %38
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 2, i64 1
%42 = load i32, i32* %41
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 3, i64 1
%45 = load i32, i32* %44
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 4, i64 1
%48 = load i32, i32* %47
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %48)
%50 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 5, i64 1
%51 = load i32, i32* %50
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %51)
%53 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 6, i64 1
%54 = load i32, i32* %53
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %54)
%56 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 7, i64 1
%57 = load i32, i32* %56
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %57)
%59 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 8, i64 1
%60 = load i32, i32* %59
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %60)
%62 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %0, i64 %3, i64 9, i64 1
%63 = load i32, i32* %62
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %63)
%65 = tail call i32 @putchar(i32 44)
%66 = tail call i32 @putchar(i32 10)
ret void
}