#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 subsetsum_min_set_size();
int subsetsum_min_target();
int valid_subsetsum_params(int target, int *set, int set_size) {
  return (set != NULL) && (target >= subsetsum_min_target()) &&
         (target <= 2147483647) && (set_size >= subsetsum_min_set_size()) &&
         (set_size <= 2147483647);
}


x86 assembly (clang, -O0):
<valid_subsetsum_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
je     119f <valid_subsetsum_params+0x7f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <subsetsum_min_target@plt>
mov    -0x1c(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
jl     119f <valid_subsetsum_params+0x7f>
xor    %eax,%eax
cmpl   $0x7fffffff,-0x4(%rbp)
mov    %al,-0x15(%rbp)
jg     119f <valid_subsetsum_params+0x7f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <subsetsum_min_set_size@plt>
mov    -0x20(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
jl     119f <valid_subsetsum_params+0x7f>
cmpl   $0x7fffffff,-0x14(%rbp)
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_subsetsum_params>:
push   %rbp
push   %r14
push   %rbx
test   %rsi,%rsi
je     114d <valid_subsetsum_params+0x2d>
mov    %edx,%r14d
mov    %edi,%ebx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <subsetsum_min_target@plt>
cmp    %ebx,%eax
jg     114f <valid_subsetsum_params+0x2f>
xor    %eax,%eax
call   1040 <subsetsum_min_set_size@plt>
xor    %ebp,%ebp
cmp    %r14d,%eax
setle  %bpl
jmp    114f <valid_subsetsum_params+0x2f>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @valid_subsetsum_params(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %5
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %23
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 (...) @subsetsum_min_target()
%12 = icmp sge i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32, i32* %4
%15 = icmp sle i32 %14, 2147483647
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %6
%18 = call i32 (...) @subsetsum_min_set_size()
%19 = icmp sge i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* %6
%22 = icmp sle i32 %21, 2147483647
br label %23
23: ; preds = %20, %16, %13, %9, %3
%24 = phi i1 [ false, %16 ], [ false, %13 ], [ false, %9 ], [ false, %3 ], [ %22, %20 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @valid_subsetsum_params(i32 %0, i32* readnone %1, i32 %2) {
%4 = icmp eq i32* %1, null
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = tail call i32 (...) @subsetsum_min_target()
%7 = icmp sgt i32 %6, %0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i32 (...) @subsetsum_min_set_size()
%10 = icmp sle i32 %9, %2
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5, %3
%13 = phi i32 [ 0, %5 ], [ 0, %3 ], [ %11, %8 ]
ret i32 %13
}