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

/* Variables and functions */
int argconfig_parse(int, char **, char const *,
                    struct argconfig_commandline_options const *, void *,
                    size_t);
int /*<<< orphan*/
argconfig_print_help(char const *,
                     struct argconfig_commandline_options const *);
int get_dev(int, char **);
int parse_and_open(int argc, char **argv, const char *desc,
                   const struct argconfig_commandline_options *clo, void *cfg,
                   size_t size) {
  int ret;
  ret = argconfig_parse(argc, argv, desc, clo, cfg, size);
  if (ret)
    return ret;
  ret = get_dev(argc, argv);
  if (ret < 0)
    argconfig_print_help(desc, clo);
  return ret;
}


x86 assembly (clang, -O0):
<parse_and_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <argconfig_parse@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     1183 <parse_and_open+0x53>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11af <parse_and_open+0x7f>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <get_dev@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    11a9 <parse_and_open+0x79>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <argconfig_print_help@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_and_open>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %edi,%ebx
call   1030 <argconfig_parse@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1169 <parse_and_open+0x39>
mov    %ebx,%edi
mov    %r12,%rsi
call   1050 <get_dev@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1169 <parse_and_open+0x39>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <argconfig_print_help@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.argconfig_commandline_options = type { i32 }
define i32 @parse_and_open(i32 %0, i8** %1, i8* %2, %struct.argconfig_commandline_options* %3, i8* %4, i64 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i8*
%11 = alloca %struct.argconfig_commandline_options*
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32
store i32 %0, i32* %8
store i8** %1, i8*** %9
store i8* %2, i8** %10
store %struct.argconfig_commandline_options* %3, %struct.argconfig_commandline_options** %11
store i8* %4, i8** %12
store i64 %5, i64* %13
%15 = load i32, i32* %8
%16 = load i8**, i8*** %9
%17 = load i8*, i8** %10
%18 = load %struct.argconfig_commandline_options*, %struct.argconfig_commandline_options** %11
%19 = load i8*, i8** %12
%20 = load i64, i64* %13
%21 = call i32 @argconfig_parse(i32 %15, i8** %16, i8* %17, %struct.argconfig_commandline_options* %18, i8* %19, i64 %20)
store i32 %21, i32* %14
%22 = load i32, i32* %14
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %6
%25 = load i32, i32* %14
store i32 %25, i32* %7
br label %38
26: ; preds = %6
%27 = load i32, i32* %8
%28 = load i8**, i8*** %9
%29 = call i32 @get_dev(i32 %27, i8** %28)
store i32 %29, i32* %14
%30 = load i32, i32* %14
%31 = icmp slt i32 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %26
%33 = load i8*, i8** %10
%34 = load %struct.argconfig_commandline_options*, %struct.argconfig_commandline_options** %11
%35 = call i32 @argconfig_print_help(i8* %33, %struct.argconfig_commandline_options* %34)
br label %36
36: ; preds = %32, %26
%37 = load i32, i32* %14
store i32 %37, i32* %7
br label %38
38: ; preds = %36, %24
%39 = load i32, i32* %7
ret i32 %39
}

LLVM IR (-O2):
%struct.argconfig_commandline_options = type { i32 }
define i32 @parse_and_open(i32 %0, i8** %1, i8* %2, %struct.argconfig_commandline_options* %3, i8* %4, i64 %5) {
%7 = tail call i32 @argconfig_parse(i32 %0, i8** %1, i8* %2, %struct.argconfig_commandline_options* %3, i8* %4, i64 %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = tail call i32 @get_dev(i32 %0, i8** %1)
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @argconfig_print_help(i8* %2, %struct.argconfig_commandline_options* %3)
br label %14
14: ; preds = %9, %12, %6
%15 = phi i32 [ %7, %6 ], [ %10, %12 ], [ %10, %9 ]
ret i32 %15
}