#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 getAt(int *, int, int);
char *test_getAt() {
  static int grid[81] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                         0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  do {
    if (!(getAt(grid, 2, 4) == 3))
      return "e: test_getAt";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_getAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f11(%rip),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1030 <getAt@plt>
cmp    $0x3,%eax
je     1147 <test_getAt+0x37>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <test_getAt+0x44>
jmp    114c <test_getAt+0x3c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_getAt>:
push   %rax
lea    0x2f18(%rip),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1030 <getAt@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
lea    0xecd(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@test_getAt.grid = internal global <{ [39 x i32], [42 x i32] }> <{ [39 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 3], [42 x i32] zeroinitializer }>
@.str = [14 x i8] c"e: test_getAt\00"
define i8* @test_getAt() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 @getAt(i32* getelementptr inbounds ([81 x i32], [81 x i32]* bitcast (<{ [39 x i32], [42 x i32] }>* @test_getAt.grid to [81 x i32]*), i64 0, i64 0), i32 2, i32 4)
%4 = icmp eq i32 %3, 3
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@test_getAt.grid = internal global <{ [39 x i32], [42 x i32] }> <{ [39 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 3], [42 x i32] zeroinitializer }>
@.str = [14 x i8] c"e: test_getAt\00"
define i8* @test_getAt() {
%1 = tail call i32 @getAt(i32* getelementptr inbounds (<{ [39 x i32], [42 x i32] }>, <{ [39 x i32], [42 x i32] }>* @test_getAt.grid, i64 0, i32 0, i64 0), i32 2, i32 4)
%2 = icmp eq i32 %1, 3
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}