#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*/ printw(char *);
int /*<<< orphan*/ refresh();
void print_grid(int *x, int *y) {
  for (int j = 0; j < 10; j++) {
    for (int i = 0; i < 10; i++) {
      if (*x == i && *y == j) {
        printw("@");
      } else {
        printw(".");
      }
    }
    printw("\n");
  }
  refresh();
}


x86 assembly (clang, -O0):
<print_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11ba <print_grid+0x9a>
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    11a0 <print_grid+0x80>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0x18(%rbp),%eax
jne    1181 <print_grid+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1181 <print_grid+0x61>
lea    0xe89(%rip),%rdi
call   1030 <printw@plt>
jmp    118d <print_grid+0x6d>
lea    0xe7a(%rip),%rdi
call   1030 <printw@plt>
jmp    1192 <print_grid+0x72>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1148 <print_grid+0x28>
lea    0xe5d(%rip),%rdi
call   1030 <printw@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <print_grid+0x17>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_grid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %ebp,%ebp
lea    0xec6(%rip),%r12
lea    0xec1(%rip),%r13
lea    0xebc(%rip),%r15
jmp    1169 <print_grid+0x49>
nopw   0x0(%rax,%rax,1)
call   1030 <printw@plt>
mov    %r15,%rdi
call   1030 <printw@plt>
add    $0x1,%ebp
cmp    $0xa,%ebp
je     125e <print_grid+0x13e>
cmpl   $0x0,(%rbx)
jne    1176 <print_grid+0x56>
mov    %r12,%rdi
cmp    (%r14),%ebp
je     1179 <print_grid+0x59>
mov    %r13,%rdi
call   1030 <printw@plt>
cmpl   $0x1,(%rbx)
mov    %r13,%rdi
jne    1191 <print_grid+0x71>
mov    %r12,%rdi
cmp    (%r14),%ebp
je     1191 <print_grid+0x71>
mov    %r13,%rdi
call   1030 <printw@plt>
cmpl   $0x2,(%rbx)
mov    %r13,%rdi
jne    11a9 <print_grid+0x89>
mov    %r12,%rdi
cmp    (%r14),%ebp
je     11a9 <print_grid+0x89>
mov    %r13,%rdi
call   1030 <printw@plt>
cmpl   $0x3,(%rbx)
mov    %r13,%rdi
jne    11c1 <print_grid+0xa1>
mov    %r12,%rdi
cmp    (%r14),%ebp
je     11c1 <print_grid+0xa1>
mov    %r13,%rdi
call   1030 <printw@plt>
cmpl   $0x4,(%rbx)
mov    %r13,%rdi
jne    11d9 <print_grid+0xb9>
mov    %r12,%rdi
cmp    (%r14),%ebp
je     11d9 <print_grid+0xb9>
mov    %r13,%rdi
call   1030 <printw@plt>
cmpl   $0x5,(%rbx)
mov    %r13,%rdi
jne    11f1 <print_grid+0xd1>
mov    %r12,%rdi
cmp    (%r14),%ebp
je     11f1 <print_grid+0xd1>
mov    %r13,%rdi
call   1030 <printw@plt>
cmpl   $0x6,(%rbx)
mov    %r13,%rdi
jne    1209 <print_grid+0xe9>
mov    %r12,%rdi
cmp    (%r14),%ebp
je     1209 <print_grid+0xe9>
mov    %r13,%rdi
call   1030 <printw@plt>
cmpl   $0x7,(%rbx)
mov    %r13,%rdi
jne    1221 <print_grid+0x101>
mov    %r12,%rdi
cmp    (%r14),%ebp
je     1221 <print_grid+0x101>
mov    %r13,%rdi
call   1030 <printw@plt>
cmpl   $0x8,(%rbx)
mov    %r13,%rdi
jne    1239 <print_grid+0x119>
mov    %r12,%rdi
cmp    (%r14),%ebp
je     1239 <print_grid+0x119>
mov    %r13,%rdi
call   1030 <printw@plt>
cmpl   $0x9,(%rbx)
mov    %r13,%rdi
jne    1150 <print_grid+0x30>
mov    %r12,%rdi
cmp    (%r14),%ebp
je     1150 <print_grid+0x30>
mov    %r13,%rdi
jmp    1150 <print_grid+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <refresh@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"@\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print_grid(i32* nocapture %0, i32* nocapture %1) {
br label %3
3: ; preds = %2, %94
%4 = phi i32 [ 0, %2 ], [ %98, %94 ]
%5 = load i32, i32* %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %12
7: ; preds = %94
%8 = tail call i32 (...) @refresh()
ret void
9: ; preds = %3
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, %4
br i1 %11, label %13, label %12
12: ; preds = %9, %3
br label %13
13: ; preds = %9, %12
%14 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %12 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %9 ]
%15 = tail call i32 @printw(i8* %14)
%16 = load i32, i32* %0
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i32, i32* %1
%20 = icmp eq i32 %19, %4
%21 = select i1 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
br label %22
22: ; preds = %18, %13
%23 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %13 ], [ %21, %18 ]
%24 = tail call i32 @printw(i8* %23)
%25 = load i32, i32* %0
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %31
27: ; preds = %22
%28 = load i32, i32* %1
%29 = icmp eq i32 %28, %4
%30 = select i1 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
br label %31
31: ; preds = %27, %22
%32 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %22 ], [ %30, %27 ]
%33 = tail call i32 @printw(i8* %32)
%34 = load i32, i32* %0
%35 = icmp eq i32 %34, 3
br i1 %35, label %36, label %40
36: ; preds = %31
%37 = load i32, i32* %1
%38 = icmp eq i32 %37, %4
%39 = select i1 %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
br label %40
40: ; preds = %36, %31
%41 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %31 ], [ %39, %36 ]
%42 = tail call i32 @printw(i8* %41)
%43 = load i32, i32* %0
%44 = icmp eq i32 %43, 4
br i1 %44, label %45, label %49
45: ; preds = %40
%46 = load i32, i32* %1
%47 = icmp eq i32 %46, %4
%48 = select i1 %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
br label %49
49: ; preds = %45, %40
%50 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %40 ], [ %48, %45 ]
%51 = tail call i32 @printw(i8* %50)
%52 = load i32, i32* %0
%53 = icmp eq i32 %52, 5
br i1 %53, label %54, label %58
54: ; preds = %49
%55 = load i32, i32* %1
%56 = icmp eq i32 %55, %4
%57 = select i1 %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
br label %58
58: ; preds = %54, %49
%59 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %49 ], [ %57, %54 ]
%60 = tail call i32 @printw(i8* %59)
%61 = load i32, i32* %0
%62 = icmp eq i32 %61, 6
br i1 %62, label %63, label %67
63: ; preds = %58
%64 = load i32, i32* %1
%65 = icmp eq i32 %64, %4
%66 = select i1 %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
br label %67
67: ; preds = %63, %58
%68 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %58 ], [ %66, %63 ]
%69 = tail call i32 @printw(i8* %68)
%70 = load i32, i32* %0
%71 = icmp eq i32 %70, 7
br i1 %71, label %72, label %76
72: ; preds = %67
%73 = load i32, i32* %1
%74 = icmp eq i32 %73, %4
%75 = select i1 %74, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
br label %76
76: ; preds = %72, %67
%77 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %67 ], [ %75, %72 ]
%78 = tail call i32 @printw(i8* %77)
%79 = load i32, i32* %0
%80 = icmp eq i32 %79, 8
br i1 %80, label %81, label %85
81: ; preds = %76
%82 = load i32, i32* %1
%83 = icmp eq i32 %82, %4
%84 = select i1 %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
br label %85
85: ; preds = %81, %76
%86 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %76 ], [ %84, %81 ]
%87 = tail call i32 @printw(i8* %86)
%88 = load i32, i32* %0
%89 = icmp eq i32 %88, 9
br i1 %89, label %90, label %94
90: ; preds = %85
%91 = load i32, i32* %1
%92 = icmp eq i32 %91, %4
%93 = select i1 %92, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
br label %94
94: ; preds = %90, %85
%95 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %85 ], [ %93, %90 ]
%96 = tail call i32 @printw(i8* %95)
%97 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%98 = add nuw nsw i32 %4, 1
%99 = icmp eq i32 %98, 10
br i1 %99, label %7, label %3
}