#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 /*<<< orphan*/ cmdline_parser_free(struct gengetopt_args_info *);
int cmdline_parser_internal(int, char *const *, struct gengetopt_args_info *,
                            int, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int cmdline_parser2(int argc, char *const *argv,
                    struct gengetopt_args_info *args_info, int override,
                    int initialize, int check_required) {
  int result;
  result = cmdline_parser_internal(argc, argv, args_info, override, initialize,
                                   check_required, NULL);
  if (result == EXIT_FAILURE) {
    cmdline_parser_free(args_info);
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<cmdline_parser2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
xor    %eax,%eax
movq   $0x0,(%rsp)
call   1040 <cmdline_parser_internal@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x2e60(%rip),%rcx
cmp    (%rcx),%eax
jne    119f <cmdline_parser2+0x6f>
mov    -0x18(%rbp),%rdi
call   1030 <cmdline_parser_free@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdline_parser2>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
movq   $0x0,(%rsp)
call   1040 <cmdline_parser_internal@plt>
mov    0x2e95(%rip),%r14
cmp    (%r14),%eax
je     1158 <cmdline_parser2+0x28>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
call   1030 <cmdline_parser_free@plt>
mov    (%r14),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.gengetopt_args_info = type { i32 }
@EXIT_FAILURE = global i32 0
define i32 @cmdline_parser2(i32 %0, i8** %1, %struct.gengetopt_args_info* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca %struct.gengetopt_args_info*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %7
store i8** %1, i8*** %8
store %struct.gengetopt_args_info* %2, %struct.gengetopt_args_info** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i32, i32* %7
%15 = load i8**, i8*** %8
%16 = load %struct.gengetopt_args_info*, %struct.gengetopt_args_info** %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = call i32 @cmdline_parser_internal(i32 %14, i8** %15, %struct.gengetopt_args_info* %16, i32 %17, i32 %18, i32 %19, i32* null)
store i32 %20, i32* %13
%21 = load i32, i32* %13
%22 = load i32, i32* @EXIT_FAILURE
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %29
24: ; preds = %6
%25 = load %struct.gengetopt_args_info*, %struct.gengetopt_args_info** %9
%26 = call i32 @cmdline_parser_free(%struct.gengetopt_args_info* %25)
%27 = load i32, i32* @EXIT_FAILURE
%28 = call i32 @exit(i32 %27)
unreachable
29: ; preds = %6
%30 = load i32, i32* %13
ret i32 %30
}

LLVM IR (-O2):
%struct.gengetopt_args_info = type { i32 }
@EXIT_FAILURE = global i32 0
define i32 @cmdline_parser2(i32 %0, i8** %1, %struct.gengetopt_args_info* %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @cmdline_parser_internal(i32 %0, i8** %1, %struct.gengetopt_args_info* %2, i32 %3, i32 %4, i32 %5, i32* null)
%8 = load i32, i32* @EXIT_FAILURE
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = tail call i32 @cmdline_parser_free(%struct.gengetopt_args_info* %2)
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %6
ret i32 %7
}