#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_middle() {
  return 2 == get(2, 1) && 3 == get(3, 1) && 3 == get(3, 2) && 4 == get(4, 1) &&
         6 == get(4, 2) && 4 == get(4, 3) && 5 == get(5, 1) &&
         10 == get(5, 2) && 10 == get(5, 3);
}


x86 assembly (clang, -O0):
<test_middle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x2,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    124e <test_middle+0x13e>
mov    $0x3,%edi
mov    $0x1,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x3,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    124e <test_middle+0x13e>
mov    $0x3,%edi
mov    $0x2,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x3,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    124e <test_middle+0x13e>
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x4,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    124e <test_middle+0x13e>
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x6,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    124e <test_middle+0x13e>
mov    $0x4,%edi
mov    $0x3,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x4,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    124e <test_middle+0x13e>
mov    $0x5,%edi
mov    $0x1,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    124e <test_middle+0x13e>
mov    $0x5,%edi
mov    $0x2,%esi
call   1030 <get@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xa,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    124e <test_middle+0x13e>
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <get@plt>
mov    %eax,%ecx
mov    $0xa,%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_middle>:
push   %rbx
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <get@plt>
xor    %ebx,%ebx
cmp    $0x2,%eax
jne    11d2 <test_middle+0xc2>
mov    $0x3,%edi
mov    $0x1,%esi
call   1030 <get@plt>
cmp    $0x3,%eax
jne    11d2 <test_middle+0xc2>
mov    $0x3,%edi
mov    $0x2,%esi
call   1030 <get@plt>
cmp    $0x3,%eax
jne    11d2 <test_middle+0xc2>
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <get@plt>
cmp    $0x4,%eax
jne    11d2 <test_middle+0xc2>
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <get@plt>
cmp    $0x6,%eax
jne    11d2 <test_middle+0xc2>
mov    $0x4,%edi
mov    $0x3,%esi
call   1030 <get@plt>
cmp    $0x4,%eax
jne    11d2 <test_middle+0xc2>
mov    $0x5,%edi
mov    $0x1,%esi
call   1030 <get@plt>
cmp    $0x5,%eax
jne    11d2 <test_middle+0xc2>
mov    $0x5,%edi
mov    $0x2,%esi
call   1030 <get@plt>
cmp    $0xa,%eax
jne    11d2 <test_middle+0xc2>
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <get@plt>
xor    %ebx,%ebx
cmp    $0xa,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_middle() {
%1 = call i32 @get(i32 2, i32 1)
%2 = icmp eq i32 2, %1
br i1 %2, label %3, label %27
3: ; preds = %0
%4 = call i32 @get(i32 3, i32 1)
%5 = icmp eq i32 3, %4
br i1 %5, label %6, label %27
6: ; preds = %3
%7 = call i32 @get(i32 3, i32 2)
%8 = icmp eq i32 3, %7
br i1 %8, label %9, label %27
9: ; preds = %6
%10 = call i32 @get(i32 4, i32 1)
%11 = icmp eq i32 4, %10
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = call i32 @get(i32 4, i32 2)
%14 = icmp eq i32 6, %13
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = call i32 @get(i32 4, i32 3)
%17 = icmp eq i32 4, %16
br i1 %17, label %18, label %27
18: ; preds = %15
%19 = call i32 @get(i32 5, i32 1)
%20 = icmp eq i32 5, %19
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = call i32 @get(i32 5, i32 2)
%23 = icmp eq i32 10, %22
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = call i32 @get(i32 5, i32 3)
%26 = icmp eq i32 10, %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_middle() {
%1 = tail call i32 @get(i32 2, i32 1)
%2 = icmp eq i32 %1, 2
br i1 %2, label %3, label %28
3: ; preds = %0
%4 = tail call i32 @get(i32 3, i32 1)
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %28
6: ; preds = %3
%7 = tail call i32 @get(i32 3, i32 2)
%8 = icmp eq i32 %7, 3
br i1 %8, label %9, label %28
9: ; preds = %6
%10 = tail call i32 @get(i32 4, i32 1)
%11 = icmp eq i32 %10, 4
br i1 %11, label %12, label %28
12: ; preds = %9
%13 = tail call i32 @get(i32 4, i32 2)
%14 = icmp eq i32 %13, 6
br i1 %14, label %15, label %28
15: ; preds = %12
%16 = tail call i32 @get(i32 4, i32 3)
%17 = icmp eq i32 %16, 4
br i1 %17, label %18, label %28
18: ; preds = %15
%19 = tail call i32 @get(i32 5, i32 1)
%20 = icmp eq i32 %19, 5
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = tail call i32 @get(i32 5, i32 2)
%23 = icmp eq i32 %22, 10
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = tail call i32 @get(i32 5, i32 3)
%26 = icmp eq i32 %25, 10
%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
}