#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 clp_posparam {
  int dummy;
};
struct clp_option {
  int dummy;
};

/* Variables and functions */
int clp_breakargs(char const *, char const *, int *, char ***);
int clp_parsev(int, char **, struct clp_option *, struct clp_posparam *);
int /*<<< orphan*/ free(char **);
int clp_parsel(const char *line, const char *delim, struct clp_option *optionv,
               struct clp_posparam *paramv) {
  char **argv;
  int argc;
  int rc;
  rc = clp_breakargs(line, delim, &argc, &argv);
  if (rc)
    return rc;
  rc = clp_parsev(argc, argv, optionv, paramv);
  free(argv);
  return rc;
}


x86 assembly (clang, -O0):
<clp_parsel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x34(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1040 <clp_breakargs@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
je     1175 <clp_parsel+0x45>
mov    -0x38(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119b <clp_parsel+0x6b>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1050 <clp_parsev@plt>
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clp_parsel>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <clp_breakargs@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1173 <clp_parsel+0x43>
mov    0x4(%rsp),%edi
mov    0x8(%rsp),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1050 <clp_parsev@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.clp_option = type { i32 }
%struct.clp_posparam = type { i32 }
define i32 @clp_parsel(i8* %0, i8* %1, %struct.clp_option* %2, %struct.clp_posparam* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca %struct.clp_option*
%9 = alloca %struct.clp_posparam*
%10 = alloca i8**
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store %struct.clp_option* %2, %struct.clp_option** %8
store %struct.clp_posparam* %3, %struct.clp_posparam** %9
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = call i32 @clp_breakargs(i8* %13, i8* %14, i32* %11, i8*** %10)
store i32 %15, i32* %12
%16 = load i32, i32* %12
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %4
%19 = load i32, i32* %12
store i32 %19, i32* %5
br label %29
20: ; preds = %4
%21 = load i32, i32* %11
%22 = load i8**, i8*** %10
%23 = load %struct.clp_option*, %struct.clp_option** %8
%24 = load %struct.clp_posparam*, %struct.clp_posparam** %9
%25 = call i32 @clp_parsev(i32 %21, i8** %22, %struct.clp_option* %23, %struct.clp_posparam* %24)
store i32 %25, i32* %12
%26 = load i8**, i8*** %10
%27 = call i32 @free(i8** %26)
%28 = load i32, i32* %12
store i32 %28, i32* %5
br label %29
29: ; preds = %20, %18
%30 = load i32, i32* %5
ret i32 %30
}

LLVM IR (-O2):
%struct.clp_option = type { i32 }
%struct.clp_posparam = type { i32 }
define i32 @clp_parsel(i8* %0, i8* %1, %struct.clp_option* %2, %struct.clp_posparam* %3) {
%5 = alloca i8**
%6 = alloca i32
%7 = bitcast i8*** %5 to i8*
%8 = bitcast i32* %6 to i8*
%9 = call i32 @clp_breakargs(i8* %0, i8* %1, i32* %6, i8*** %5)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = call i32 @clp_parsev(i32 %12, i8** %13, %struct.clp_option* %2, %struct.clp_posparam* %3)
%15 = load i8**, i8*** %5
%16 = call i32 @free(i8** %15)
br label %17
17: ; preds = %4, %11
%18 = phi i32 [ %14, %11 ], [ %9, %4 ]
ret i32 %18
}