#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 print_config(int spin[][30], int itime) {
  int ix, iy;
  for (ix = 0; ix < 30; ix++) {
    for (iy = 0; iy < 30; iy++) {
      printf("%d", (spin[ix][iy] + 1) / 2);
    }
    printf("\n");
  }
  printf(" %d \n", itime);
}


x86 assembly (clang, -O0):
<print_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1e,-0x10(%rbp)
jge    119c <print_config+0x8c>
movl   $0x0,-0x14(%rbp)
cmpl   $0x1e,-0x14(%rbp)
jge    1180 <print_config+0x70>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x78,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <print_config+0x27>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_config+0x16>
mov    -0xc(%rbp),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_config>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xecb(%rip),%r12
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%rbp,4),%eax
mov    %eax,%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
sar    %esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    $0x1e,%rbp
jne    1150 <print_config+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
add    $0x78,%rbx
cmp    $0x1e,%r15
jne    1140 <print_config+0x20>
lea    0xe6d(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c" %d \0A\00"
define void @print_config([30 x i32]* nocapture %0, i32 %1) {
br label %3
3: ; preds = %2, %14
%4 = phi i64 [ 0, %2 ], [ %16, %14 ]
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ 0, %3 ], [ %12, %5 ]
%7 = getelementptr inbounds [30 x i32], [30 x i32]* %0, i64 %4, i64 %6
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
%10 = sdiv i32 %9, 2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %6, 1
%13 = icmp eq i64 %12, 30
br i1 %13, label %14, label %5
14: ; preds = %5
%15 = tail call i32 @putchar(i32 10)
%16 = add nuw nsw i64 %4, 1
%17 = icmp eq i64 %16, 30
br i1 %17, label %18, label %3
18: ; preds = %14
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret void
}