#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 *test_is_present_for_area(char *, int);
char *test_is_present() {
  char *result = 0;
  result =
      test_is_present_for_area("test/resources/is_present_row_test.puzzle", 2);
  if (result) {
    return result;
  }
  result = test_is_present_for_area(
      "test/resources/is_present_column_test.puzzle", 1);
  if (result) {
    return result;
  }
  result = test_is_present_for_area(
      "test/resources/is_present_chamber_test.puzzle", 3);
  if (result) {
    return result;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_is_present>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x2,%esi
call   1030 <test_is_present_for_area@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <test_is_present+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11af <test_is_present+0x9f>
lea    0xed6(%rip),%rdi
mov    $0x1,%esi
call   1030 <test_is_present_for_area@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117a <test_is_present+0x6a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11af <test_is_present+0x9f>
lea    0xed6(%rip),%rdi
mov    $0x3,%esi
call   1030 <test_is_present_for_area@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a7 <test_is_present+0x97>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11af <test_is_present+0x9f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_is_present>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
call   1030 <test_is_present_for_area@plt>
test   %rax,%rax
jne    113d <test_is_present+0x2d>
lea    0xefc(%rip),%rdi
mov    $0x1,%esi
call   1030 <test_is_present_for_area@plt>
test   %rax,%rax
je     113f <test_is_present+0x2f>
pop    %rcx
ret
lea    0xf11(%rip),%rdi
mov    $0x3,%esi
pop    %rax
jmp    1030 <test_is_present_for_area@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"test/resources/is_present_row_test.puzzle\00"
@.str.1 = [45 x i8] c"test/resources/is_present_column_test.puzzle\00"
@.str.2 = [46 x i8] c"test/resources/is_present_chamber_test.puzzle\00"
define i8* @test_is_present() {
%1 = alloca i8*
%2 = alloca i8*
store i8* null, i8** %2
%3 = call i8* @test_is_present_for_area(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 2)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i8*, i8** %2
store i8* %7, i8** %1
br label %21
8: ; preds = %0
%9 = call i8* @test_is_present_for_area(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i32 1)
store i8* %9, i8** %2
%10 = load i8*, i8** %2
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i8*, i8** %2
store i8* %13, i8** %1
br label %21
14: ; preds = %8
%15 = call i8* @test_is_present_for_area(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i32 3)
store i8* %15, i8** %2
%16 = load i8*, i8** %2
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i8*, i8** %2
store i8* %19, i8** %1
br label %21
20: ; preds = %14
store i8* null, i8** %1
br label %21
21: ; preds = %20, %18, %12, %6
%22 = load i8*, i8** %1
ret i8* %22
}

LLVM IR (-O2):
@.str = [42 x i8] c"test/resources/is_present_row_test.puzzle\00"
@.str.1 = [45 x i8] c"test/resources/is_present_column_test.puzzle\00"
@.str.2 = [46 x i8] c"test/resources/is_present_chamber_test.puzzle\00"
define i8* @test_is_present() {
%1 = tail call i8* @test_is_present_for_area(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i8* @test_is_present_for_area(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i8* @test_is_present_for_area(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i32 3)
br label %8
8: ; preds = %6, %3, %0
%9 = phi i8* [ %1, %0 ], [ %4, %3 ], [ %7, %6 ]
ret i8* %9
}