#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 gengetopt_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ cmdline_parser_free(struct gengetopt_args_info *);
scalar_t__ cmdline_parser_required2(struct gengetopt_args_info *, char const *,
                                    int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int cmdline_parser_required(struct gengetopt_args_info *args_info,
                            const char *prog_name) {
  int result = EXIT_SUCCESS;
  if (cmdline_parser_required2(args_info, prog_name, 0) > 0) {
    result = EXIT_FAILURE;
  }
  if (result == EXIT_FAILURE) {
    cmdline_parser_free(args_info);
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<cmdline_parser_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   1030 <cmdline_parser_required2@plt>
cmp    $0x0,%rax
jle    1171 <cmdline_parser_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 <cmdline_parser_required+0x6a>
mov    -0x8(%rbp),%rdi
call   1040 <cmdline_parser_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):
<cmdline_parser_required>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2e9a(%rip),%rax
mov    (%rax),%ebp
xor    %edx,%edx
call   1030 <cmdline_parser_required2@plt>
test   %rax,%rax
mov    0x2e8f(%rip),%r14
mov    (%r14),%eax
cmovg  %eax,%ebp
cmp    %eax,%ebp
je     1162 <cmdline_parser_required+0x32>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
call   1040 <cmdline_parser_free@plt>
mov    (%r14),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.gengetopt_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @cmdline_parser_required(%struct.gengetopt_args_info* %0, i8* %1) {
%3 = alloca %struct.gengetopt_args_info*
%4 = alloca i8*
%5 = alloca i32
store %struct.gengetopt_args_info* %0, %struct.gengetopt_args_info** %3
store i8* %1, i8** %4
%6 = load i32, i32* @EXIT_SUCCESS
store i32 %6, i32* %5
%7 = load %struct.gengetopt_args_info*, %struct.gengetopt_args_info** %3
%8 = load i8*, i8** %4
%9 = call i64 @cmdline_parser_required2(%struct.gengetopt_args_info* %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.gengetopt_args_info*, %struct.gengetopt_args_info** %3
%19 = call i32 @cmdline_parser_free(%struct.gengetopt_args_info* %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.gengetopt_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @cmdline_parser_required(%struct.gengetopt_args_info* %0, i8* %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i64 @cmdline_parser_required2(%struct.gengetopt_args_info* %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 @cmdline_parser_free(%struct.gengetopt_args_info* %0)
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret i32 %7
}