#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 smallest(int, int, int);
int smallest_bit(int, int, int);
int smallest_div(int, int, int);
int test_two_same() {
  return 5 == smallest(5, 5, 7) && 5 == smallest(7, 5, 7) &&
         5 == smallest_div(5, 5, 7) && 5 == smallest_div(7, 5, 7) &&
         5 == smallest_bit(5, 5, 7) && 5 == smallest_bit(7, 5, 7);
}


x86 assembly (clang, -O0):
<test_two_same>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%esi
mov    $0x7,%edx
mov    %esi,%edi
call   1050 <smallest@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1211 <test_two_same+0xe1>
mov    $0x7,%edx
mov    $0x5,%esi
mov    %edx,%edi
call   1050 <smallest@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1211 <test_two_same+0xe1>
mov    $0x5,%esi
mov    $0x7,%edx
mov    %esi,%edi
call   1030 <smallest_div@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1211 <test_two_same+0xe1>
mov    $0x7,%edx
mov    $0x5,%esi
mov    %edx,%edi
call   1030 <smallest_div@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1211 <test_two_same+0xe1>
mov    $0x5,%esi
mov    $0x7,%edx
mov    %esi,%edi
call   1040 <smallest_bit@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1211 <test_two_same+0xe1>
mov    $0x7,%edx
mov    $0x5,%esi
mov    %edx,%edi
call   1040 <smallest_bit@plt>
mov    %eax,%ecx
mov    $0x5,%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_two_same>:
push   %rbx
mov    $0x5,%edi
mov    $0x5,%esi
mov    $0x7,%edx
call   1050 <smallest@plt>
xor    %ebx,%ebx
cmp    $0x5,%eax
jne    11d0 <test_two_same+0xa0>
mov    $0x7,%edi
mov    $0x5,%esi
mov    $0x7,%edx
call   1050 <smallest@plt>
cmp    $0x5,%eax
jne    11d0 <test_two_same+0xa0>
mov    $0x5,%edi
mov    $0x5,%esi
mov    $0x7,%edx
call   1030 <smallest_div@plt>
cmp    $0x5,%eax
jne    11d0 <test_two_same+0xa0>
mov    $0x7,%edi
mov    $0x5,%esi
mov    $0x7,%edx
call   1030 <smallest_div@plt>
cmp    $0x5,%eax
jne    11d0 <test_two_same+0xa0>
mov    $0x5,%edi
mov    $0x5,%esi
mov    $0x7,%edx
call   1040 <smallest_bit@plt>
cmp    $0x5,%eax
jne    11d0 <test_two_same+0xa0>
mov    $0x7,%edi
mov    $0x5,%esi
mov    $0x7,%edx
call   1040 <smallest_bit@plt>
xor    %ebx,%ebx
cmp    $0x5,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_two_same() {
%1 = call i32 @smallest(i32 5, i32 5, i32 7)
%2 = icmp eq i32 5, %1
br i1 %2, label %3, label %18
3: ; preds = %0
%4 = call i32 @smallest(i32 7, i32 5, i32 7)
%5 = icmp eq i32 5, %4
br i1 %5, label %6, label %18
6: ; preds = %3
%7 = call i32 @smallest_div(i32 5, i32 5, i32 7)
%8 = icmp eq i32 5, %7
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = call i32 @smallest_div(i32 7, i32 5, i32 7)
%11 = icmp eq i32 5, %10
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = call i32 @smallest_bit(i32 5, i32 5, i32 7)
%14 = icmp eq i32 5, %13
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 @smallest_bit(i32 7, i32 5, i32 7)
%17 = icmp eq i32 5, %16
br label %18
18: ; preds = %15, %12, %9, %6, %3, %0
%19 = phi i1 [ false, %12 ], [ false, %9 ], [ false, %6 ], [ false, %3 ], [ false, %0 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @test_two_same() {
%1 = tail call i32 @smallest(i32 5, i32 5, i32 7)
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %19
3: ; preds = %0
%4 = tail call i32 @smallest(i32 7, i32 5, i32 7)
%5 = icmp eq i32 %4, 5
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = tail call i32 @smallest_div(i32 5, i32 5, i32 7)
%8 = icmp eq i32 %7, 5
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = tail call i32 @smallest_div(i32 7, i32 5, i32 7)
%11 = icmp eq i32 %10, 5
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = tail call i32 @smallest_bit(i32 5, i32 5, i32 7)
%14 = icmp eq i32 %13, 5
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = tail call i32 @smallest_bit(i32 7, i32 5, i32 7)
%17 = icmp eq i32 %16, 5
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %15, %12, %9, %6, %3, %0
%20 = phi i32 [ 0, %12 ], [ 0, %9 ], [ 0, %6 ], [ 0, %3 ], [ 0, %0 ], [ %18, %15 ]
ret i32 %20
}