#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 /*<<< orphan*/ system(char *);
void printField(char campo[25][50]) {
  int i, j;
  i = j = 0;
  int lin, col;
  lin = 25 / 2 + 7;
  col = 50 / 2;
  system("clear");
  printf("-----------The Dining Savages Problem-------------\n");
  for (i = 0; i < 25; i++) {
    for (j = 0; j < 50; j++)
      printf("%c", campo[i][j]);
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printField>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x13,-0x14(%rbp)
movl   $0x19,-0x18(%rbp)
lea    0xeb1(%rip),%rdi
call   1030 <system@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x19,-0xc(%rbp)
jge    11d3 <printField+0xb3>
movl   $0x0,-0x10(%rbp)
cmpl   $0x32,-0x10(%rbp)
jge    11b7 <printField+0x97>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117a <printField+0x5a>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1169 <printField+0x49>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printField>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xec1(%rip),%rdi
call   1050 <system@plt>
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xffffffffffffffce,%rbx
nopw   0x0(%rax,%rax,1)
movsbl 0x32(%r15,%rbx,1),%edi
call   1030 <putchar@plt>
inc    %rbx
jne    1170 <printField+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
add    $0x32,%r15
cmp    $0x19,%r14
jne    1160 <printField+0x30>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@str = [51 x i8] c"-----------The Dining Savages Problem-------------\00"
define void @printField([50 x i8]* nocapture %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %1, %14
%5 = phi i64 [ 0, %1 ], [ %16, %14 ]
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %0, i64 %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, 50
br i1 %13, label %14, label %6
14: ; preds = %6
%15 = tail call i32 @putchar(i32 10)
%16 = add nuw nsw i64 %5, 1
%17 = icmp eq i64 %16, 25
br i1 %17, label %18, label %4
18: ; preds = %14
%19 = tail call i32 @putchar(i32 10)
ret void
}