#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 option {
  int dummy;
};
struct octave_getopt_options {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct option *);
int getopt_long(int, char **, char const *, struct option *, int *);
struct option *make_option_struct(struct octave_getopt_options const *);
int octave_getopt_long_wrapper(int argc, char **argv, const char *shortopts,
                               const struct octave_getopt_options *longopts,
                               int *longind) {
  struct option *lopts = make_option_struct(longopts);
  int retval = getopt_long(argc, argv, shortopts, lopts, longind);
  free(lopts);
  return retval;
}


x86 assembly (clang, -O0):
<octave_getopt_long_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <make_option_struct@plt>
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1050 <getopt_long@plt>
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_getopt_long_wrapper>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %edi,%ebp
mov    %rcx,%rdi
call   1040 <make_option_struct@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %rax,%rcx
mov    %r14,%r8
call   1050 <getopt_long@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.octave_getopt_options = type { i32 }
%struct.option = type { i32 }
define i32 @octave_getopt_long_wrapper(i32 %0, i8** %1, i8* %2, %struct.octave_getopt_options* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.octave_getopt_options*
%10 = alloca i32*
%11 = alloca %struct.option*
%12 = alloca i32
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.octave_getopt_options* %3, %struct.octave_getopt_options** %9
store i32* %4, i32** %10
%13 = load %struct.octave_getopt_options*, %struct.octave_getopt_options** %9
%14 = call %struct.option* @make_option_struct(%struct.octave_getopt_options* %13)
store %struct.option* %14, %struct.option** %11
%15 = load i32, i32* %6
%16 = load i8**, i8*** %7
%17 = load i8*, i8** %8
%18 = load %struct.option*, %struct.option** %11
%19 = load i32*, i32** %10
%20 = call i32 @getopt_long(i32 %15, i8** %16, i8* %17, %struct.option* %18, i32* %19)
store i32 %20, i32* %12
%21 = load %struct.option*, %struct.option** %11
%22 = call i32 @free(%struct.option* %21)
%23 = load i32, i32* %12
ret i32 %23
}

LLVM IR (-O2):
%struct.octave_getopt_options = type { i32 }
%struct.option = type { i32 }
define i32 @octave_getopt_long_wrapper(i32 %0, i8** %1, i8* %2, %struct.octave_getopt_options* %3, i32* %4) {
%6 = tail call %struct.option* @make_option_struct(%struct.octave_getopt_options* %3)
%7 = tail call i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %6, i32* %4)
%8 = tail call i32 @free(%struct.option* %6)
ret i32 %7
}