#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 change_dyn(int *, int, int);
scalar_t__ change_greedy(int *, int, int);
int change_rec(int *, int, int);
int test_none() {
  int denom[] = {4, 15, 22, 51};
  return 0 == change_greedy(denom, 4, 17) && -1 == change_rec(denom, 4, 17) &&
         -1 == change_dyn(denom, 4, 17);
}


x86 assembly (clang, -O0):
<test_none>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x11,%edx
call   1040 <change_greedy@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x11(%rbp)
jne    11bd <test_none+0x8d>
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x11,%edx
call   1050 <change_rec@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    11bd <test_none+0x8d>
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x11,%edx
call   1030 <change_dyn@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_none>:
push   %rbx
sub    $0x10,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x11,%edx
call   1040 <change_greedy@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    118a <test_none+0x5a>
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x11,%edx
call   1050 <change_rec@plt>
cmp    $0xffffffff,%eax
jne    118a <test_none+0x5a>
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x11,%edx
call   1030 <change_dyn@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
sete   %bl
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_none.denom = [4 x i32] [i32 4, i32 15, i32 22, i32 51]
define i32 @test_none() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i64 @change_greedy(i32* %3, i32 4, i32 17)
%5 = icmp eq i64 0, %4
br i1 %5, label %6, label %14
6: ; preds = %0
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%8 = call i32 @change_rec(i32* %7, i32 4, i32 17)
%9 = icmp eq i32 -1, %8
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%12 = call i32 @change_dyn(i32* %11, i32 4, i32 17)
%13 = icmp eq i32 -1, %12
br label %14
14: ; preds = %10, %6, %0
%15 = phi i1 [ false, %6 ], [ false, %0 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@__const.test_none.denom = [4 x i32] [i32 4, i32 15, i32 22, i32 51]
define i32 @test_none() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i64 @change_greedy(i32* %3, i32 4, i32 17)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = call i32 @change_rec(i32* %3, i32 4, i32 17)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = call i32 @change_dyn(i32* %3, i32 4, i32 17)
%11 = icmp eq i32 %10, -1
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %6, %0
%14 = phi i32 [ 0, %6 ], [ 0, %0 ], [ %12, %9 ]
ret i32 %14
}