#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 */
struct eucalyptus_opts {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ arguments_free(struct eucalyptus_opts *);
scalar_t__ arguments_required2(struct eucalyptus_opts *, char const *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int arguments_required(struct eucalyptus_opts *args_info,
                       const char *prog_name) {
  int result = EXIT_SUCCESS;
  if (arguments_required2(args_info, prog_name, 0) > 0)
    result = EXIT_FAILURE;
  if (result == EXIT_FAILURE) {
    arguments_free(args_info);
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<arguments_required>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <arguments_required2@plt>
cmp    $0x0,%rax
jle    1171 <arguments_required+0x41>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e65(%rip),%rcx
cmp    (%rcx),%eax
jne    119a <arguments_required+0x6a>
mov    -0x8(%rbp),%rdi
call   1030 <arguments_free@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arguments_required>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2e9a(%rip),%rax
mov    (%rax),%ebp
xor    %edx,%edx
call   1040 <arguments_required2@plt>
test   %rax,%rax
mov    0x2e8f(%rip),%r14
mov    (%r14),%eax
cmovg  %eax,%ebp
cmp    %eax,%ebp
je     1162 <arguments_required+0x32>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
call   1030 <arguments_free@plt>
mov    (%r14),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.eucalyptus_opts = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @arguments_required(%struct.eucalyptus_opts* %0, i8* %1) {
%3 = alloca %struct.eucalyptus_opts*
%4 = alloca i8*
%5 = alloca i32
store %struct.eucalyptus_opts* %0, %struct.eucalyptus_opts** %3
store i8* %1, i8** %4
%6 = load i32, i32* @EXIT_SUCCESS
store i32 %6, i32* %5
%7 = load %struct.eucalyptus_opts*, %struct.eucalyptus_opts** %3
%8 = load i8*, i8** %4
%9 = call i64 @arguments_required2(%struct.eucalyptus_opts* %7, i8* %8, i32 0)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %5
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
%15 = load i32, i32* @EXIT_FAILURE
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load %struct.eucalyptus_opts*, %struct.eucalyptus_opts** %3
%19 = call i32 @arguments_free(%struct.eucalyptus_opts* %18)
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %13
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
%struct.eucalyptus_opts = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @arguments_required(%struct.eucalyptus_opts* %0, i8* %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i64 @arguments_required2(%struct.eucalyptus_opts* %0, i8* %1, i32 0)
%5 = icmp sgt i64 %4, 0
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %5, i32 %6, i32 %3
%8 = icmp eq i32 %7, %6
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = tail call i32 @arguments_free(%struct.eucalyptus_opts* %0)
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret i32 %7
}