#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 get(int, int);
int test_edges() {
  return 1 == get(0, 0) && 1 == get(1, 0) && 1 == get(1, 1) && 1 == get(2, 0) &&
         1 == get(2, 2) && 1 == get(3, 0) && 1 == get(3, 3) &&
         1 == get(100, 0) && 1 == get(100, 100);
}


x86 assembly (clang, -O0):
<test_edges>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1230 <test_edges+0x120>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1230 <test_edges+0x120>
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1230 <test_edges+0x120>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1230 <test_edges+0x120>
mov    $0x2,%esi
mov    %esi,%edi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1230 <test_edges+0x120>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1230 <test_edges+0x120>
mov    $0x3,%esi
mov    %esi,%edi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1230 <test_edges+0x120>
mov    $0x64,%edi
xor    %esi,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1230 <test_edges+0x120>
mov    $0x64,%esi
mov    %esi,%edi
call   1030 <get@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_edges>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <get@plt>
cmp    $0x1,%eax
jne    11c8 <test_edges+0xb8>
xor    %ebx,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <get@plt>
cmp    $0x1,%eax
jne    11c8 <test_edges+0xb8>
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <get@plt>
cmp    $0x1,%eax
jne    11c8 <test_edges+0xb8>
xor    %ebx,%ebx
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <get@plt>
cmp    $0x1,%eax
jne    11c8 <test_edges+0xb8>
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <get@plt>
cmp    $0x1,%eax
jne    11c8 <test_edges+0xb8>
xor    %ebx,%ebx
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <get@plt>
cmp    $0x1,%eax
jne    11c8 <test_edges+0xb8>
mov    $0x3,%edi
mov    $0x3,%esi
call   1030 <get@plt>
cmp    $0x1,%eax
jne    11c8 <test_edges+0xb8>
xor    %ebx,%ebx
mov    $0x64,%edi
xor    %esi,%esi
call   1030 <get@plt>
cmp    $0x1,%eax
jne    11c8 <test_edges+0xb8>
mov    $0x64,%edi
mov    $0x64,%esi
call   1030 <get@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_edges() {
%1 = call i32 @get(i32 0, i32 0)
%2 = icmp eq i32 1, %1
br i1 %2, label %3, label %27
3: ; preds = %0
%4 = call i32 @get(i32 1, i32 0)
%5 = icmp eq i32 1, %4
br i1 %5, label %6, label %27
6: ; preds = %3
%7 = call i32 @get(i32 1, i32 1)
%8 = icmp eq i32 1, %7
br i1 %8, label %9, label %27
9: ; preds = %6
%10 = call i32 @get(i32 2, i32 0)
%11 = icmp eq i32 1, %10
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = call i32 @get(i32 2, i32 2)
%14 = icmp eq i32 1, %13
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = call i32 @get(i32 3, i32 0)
%17 = icmp eq i32 1, %16
br i1 %17, label %18, label %27
18: ; preds = %15
%19 = call i32 @get(i32 3, i32 3)
%20 = icmp eq i32 1, %19
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = call i32 @get(i32 100, i32 0)
%23 = icmp eq i32 1, %22
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = call i32 @get(i32 100, i32 100)
%26 = icmp eq i32 1, %25
br label %27
27: ; preds = %24, %21, %18, %15, %12, %9, %6, %3, %0
%28 = phi i1 [ false, %21 ], [ false, %18 ], [ false, %15 ], [ false, %12 ], [ false, %9 ], [ false, %6 ], [ false, %3 ], [ false, %0 ], [ %26, %24 ]
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @test_edges() {
%1 = tail call i32 @get(i32 0, i32 0)
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %28
3: ; preds = %0
%4 = tail call i32 @get(i32 1, i32 0)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %28
6: ; preds = %3
%7 = tail call i32 @get(i32 1, i32 1)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %28
9: ; preds = %6
%10 = tail call i32 @get(i32 2, i32 0)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %28
12: ; preds = %9
%13 = tail call i32 @get(i32 2, i32 2)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %28
15: ; preds = %12
%16 = tail call i32 @get(i32 3, i32 0)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %28
18: ; preds = %15
%19 = tail call i32 @get(i32 3, i32 3)
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = tail call i32 @get(i32 100, i32 0)
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = tail call i32 @get(i32 100, i32 100)
%26 = icmp eq i32 %25, 1
%27 = zext i1 %26 to i32
br label %28
28: ; preds = %24, %21, %18, %15, %12, %9, %6, %3, %0
%29 = phi i32 [ 0, %21 ], [ 0, %18 ], [ 0, %15 ], [ 0, %12 ], [ 0, %9 ], [ 0, %6 ], [ 0, %3 ], [ 0, %0 ], [ %27, %24 ]
ret i32 %29
}