#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 *, int, int, char);
void printing(char new_chessboard[8][8]) {
  int i, j = 0;
  for (i = 0; i < 8; j++) {
    printf("Square(%d;%d) : %c\n", (i + 1), (j + 1), new_chessboard[i][j]);
    if (j == 7) {
      j = -1;
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<printing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1190 <printing+0x80>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
lea    0xea6(%rip),%rdi
movsbl (%rax,%rcx,1),%ecx
call   1030 <printf@plt>
cmpl   $0x7,-0x10(%rbp)
jne    117d <printing+0x6d>
movl   $0xffffffff,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1182 <printing+0x72>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <printing+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printing>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
lea    0xedb(%rip),%r14
xor    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
movslq %ebx,%r13
add    $0x1,%ebx
movslq %ebp,%r12
add    $0x1,%ebp
lea    (%r15,%r13,8),%rax
movsbl (%r12,%rax,1),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
cmp    $0x7,%r12d
mov    $0x0,%eax
cmove  %eax,%ebp
cmove  %ebx,%r13d
mov    %r13d,%ebx
cmp    $0x8,%r13d
jl     1130 <printing+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Square(%d;%d) : %c\0A\00"
define void @printing([8 x i8]* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %13, %2 ]
%4 = phi i32 [ 0, %1 ], [ %14, %2 ]
%5 = add nsw i32 %4, 1
%6 = add nsw i32 %3, 1
%7 = sext i32 %4 to i64
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %0, i64 %7, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i8 signext %10)
%12 = icmp eq i32 %3, 7
%13 = select i1 %12, i32 0, i32 %6
%14 = select i1 %12, i32 %5, i32 %4
%15 = icmp slt i32 %14, 8
br i1 %15, label %2, label %16
16: ; preds = %2
ret void
}