#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 */
char getchar();
int /*<<< orphan*/ placeAtom(int, int);
void read_grid(void) {
  for (int line = 1; line <= 8; line++) {
    for (int col = 1; col <= 8; col++) {
      if (getchar() == '@') {
        placeAtom(line, col);
      }
    }
    do {
      if (getchar() == '\r')
        getchar();
    } while (0);
  }
}


x86 assembly (clang, -O0):
<read_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jg     11b2 <read_grid+0x92>
movl   $0x1,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jg     117b <read_grid+0x5b>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0x40,%eax
jne    1168 <read_grid+0x48>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <placeAtom@plt>
jmp    116d <read_grid+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <read_grid+0x20>
jmp    1180 <read_grid+0x60>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xd,%eax
jne    119a <read_grid+0x7a>
mov    $0x0,%al
call   1040 <getchar@plt>
jmp    119f <read_grid+0x7f>
jmp    11a4 <read_grid+0x84>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <read_grid+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_grid>:
push   %rbx
mov    $0x1,%ebx
jmp    113c <read_grid+0x1c>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x9,%ebx
je     120f <read_grid+0xef>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x40,%al
jne    1153 <read_grid+0x33>
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <placeAtom@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x40,%al
jne    116a <read_grid+0x4a>
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <placeAtom@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x40,%al
jne    1181 <read_grid+0x61>
mov    %ebx,%edi
mov    $0x3,%esi
call   1030 <placeAtom@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x40,%al
jne    1198 <read_grid+0x78>
mov    %ebx,%edi
mov    $0x4,%esi
call   1030 <placeAtom@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x40,%al
jne    11af <read_grid+0x8f>
mov    %ebx,%edi
mov    $0x5,%esi
call   1030 <placeAtom@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x40,%al
jne    11c6 <read_grid+0xa6>
mov    %ebx,%edi
mov    $0x6,%esi
call   1030 <placeAtom@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x40,%al
jne    11dd <read_grid+0xbd>
mov    %ebx,%edi
mov    $0x7,%esi
call   1030 <placeAtom@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x40,%al
jne    11f4 <read_grid+0xd4>
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <placeAtom@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xd,%al
jne    1130 <read_grid+0x10>
xor    %eax,%eax
call   1040 <getchar@plt>
jmp    1130 <read_grid+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @read_grid() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
br label %3
3: ; preds = %31, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 8
br i1 %5, label %6, label %34
6: ; preds = %3
store i32 1, i32* %2
br label %7
7: ; preds = %19, %6
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 8
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = call signext i8 (...) @getchar()
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 64
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = call i32 @placeAtom(i32 %15, i32 %16)
br label %18
18: ; preds = %14, %10
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %7
22: ; preds = %7
br label %23
23: ; preds = %22
%24 = call signext i8 (...) @getchar()
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 13
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call signext i8 (...) @getchar()
br label %29
29: ; preds = %27, %23
br label %30
30: ; preds = %29
br label %31
31: ; preds = %30
%32 = load i32, i32* %1
%33 = add nsw i32 %32, 1
store i32 %33, i32* %1
br label %3
34: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @read_grid() {
br label %1
1: ; preds = %0, %48
%2 = phi i32 [ 1, %0 ], [ %49, %48 ]
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 64
br i1 %4, label %6, label %8
5: ; preds = %48
ret void
6: ; preds = %1
%7 = tail call i32 @placeAtom(i32 %2, i32 1)
br label %8
8: ; preds = %1, %6
%9 = tail call signext i8 (...) @getchar()
%10 = icmp eq i8 %9, 64
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @placeAtom(i32 %2, i32 2)
br label %13
13: ; preds = %11, %8
%14 = tail call signext i8 (...) @getchar()
%15 = icmp eq i8 %14, 64
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = tail call i32 @placeAtom(i32 %2, i32 3)
br label %18
18: ; preds = %16, %13
%19 = tail call signext i8 (...) @getchar()
%20 = icmp eq i8 %19, 64
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = tail call i32 @placeAtom(i32 %2, i32 4)
br label %23
23: ; preds = %21, %18
%24 = tail call signext i8 (...) @getchar()
%25 = icmp eq i8 %24, 64
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = tail call i32 @placeAtom(i32 %2, i32 5)
br label %28
28: ; preds = %26, %23
%29 = tail call signext i8 (...) @getchar()
%30 = icmp eq i8 %29, 64
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = tail call i32 @placeAtom(i32 %2, i32 6)
br label %33
33: ; preds = %31, %28
%34 = tail call signext i8 (...) @getchar()
%35 = icmp eq i8 %34, 64
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = tail call i32 @placeAtom(i32 %2, i32 7)
br label %38
38: ; preds = %36, %33
%39 = tail call signext i8 (...) @getchar()
%40 = icmp eq i8 %39, 64
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = tail call i32 @placeAtom(i32 %2, i32 8)
br label %43
43: ; preds = %41, %38
%44 = tail call signext i8 (...) @getchar()
%45 = icmp eq i8 %44, 13
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = tail call signext i8 (...) @getchar()
br label %48
48: ; preds = %43, %46
%49 = add nuw nsw i32 %2, 1
%50 = icmp eq i32 %49, 9
br i1 %50, label %5, label %1
}