#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 {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ *member_2;
  int /*<<< orphan*/ member_1;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int getopt_long(int, char **, char *, struct option *, int *);
int /*<<< orphan*/ no_argument;
int /*<<< orphan*/ show_help();
int /*<<< orphan*/ show_version();
int /*<<< orphan*/ stderr;
int svd_if_cli_start(char *);
int main(int argc, char **argv) {
  int err = 0;
  int option_IDX;
  int option_rez;
  char *short_options = "hV";
  char err_msg[256] = {
      0,
  };
  struct option long_options[] = {{"help", no_argument, NULL, 'h'},
                                  {"version", no_argument, NULL, 'V'},
                                  {NULL, 0, NULL, 0}};
  while ((option_rez = getopt_long(argc, argv, short_options, long_options,
                                   &option_IDX)) != -1) {
    if ((option_rez == 'h') || (option_rez == '?')) {
      show_help();
    } else if (option_rez == 'V') {
      show_version();
    }
    goto __exit;
  }
  err = svd_if_cli_start(err_msg);
  if (err) {
    fprintf(stderr, "%s : %s\n", "svd_if", err_msg);
  }
__exit:
  return err;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe79(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
lea    -0x190(%rbp),%rdi
lea    0xe57(%rip),%rax
mov    %rax,-0x190(%rbp)
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x188(%rbp)
movq   $0x0,-0x180(%rbp)
movl   $0x68,-0x178(%rbp)
add    $0x20,%rdi
lea    0xe26(%rip),%rax
mov    %rax,-0x170(%rbp)
mov    0x2de8(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x168(%rbp)
movq   $0x0,-0x160(%rbp)
movl   $0x56,-0x158(%rbp)
add    $0x20,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    -0x190(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1040 <getopt_long@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     127f <main+0x11f>
cmpl   $0x68,-0x1c(%rbp)
je     1258 <main+0xf8>
cmpl   $0x3f,-0x1c(%rbp)
jne    1264 <main+0x104>
mov    $0x0,%al
call   1070 <show_help@plt>
jmp    127a <main+0x11a>
cmpl   $0x56,-0x1c(%rbp)
jne    1275 <main+0x115>
mov    $0x0,%al
call   1030 <show_version@plt>
jmp    127a <main+0x11a>
jmp    12c0 <main+0x160>
lea    -0x130(%rbp),%rdi
call   1080 <svd_if_cli_start@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     12bb <main+0x15b>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
lea    -0x130(%rbp),%rcx
lea    0xd61(%rip),%rsi
lea    0xd63(%rip),%rdx
call   1060 <fprintf@plt>
jmp    12c0 <main+0x160>
mov    -0x14(%rbp),%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x178,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
lea    0xe23(%rip),%rax
mov    %rax,0x10(%rsp)
mov    0x2dec(%rip),%rax
mov    (%rax),%al
mov    %al,0x18(%rsp)
movq   $0x0,0x20(%rsp)
movl   $0x68,0x28(%rsp)
lea    0xdfe(%rip),%rcx
mov    %rcx,0x30(%rsp)
mov    %al,0x38(%rsp)
movq   $0x0,0x40(%rsp)
movl   $0x56,0x48(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
lea    0xdcb(%rip),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1040 <getopt_long@plt>
xor    %ebx,%ebx
cmp    $0x55,%eax
jg     1257 <main+0x107>
cmp    $0xffffffff,%eax
je     126c <main+0x11c>
cmp    $0x3f,%eax
je     1261 <main+0x111>
jmp    12aa <main+0x15a>
cmp    $0x56,%eax
je     12a1 <main+0x151>
cmp    $0x68,%eax
jne    12aa <main+0x15a>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <show_help@plt>
jmp    12aa <main+0x15a>
lea    0x70(%rsp),%rdi
call   1070 <svd_if_cli_start@plt>
test   %eax,%eax
je     12aa <main+0x15a>
mov    %eax,%ebp
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
lea    0xd84(%rip),%rsi
lea    0xd86(%rip),%rdx
lea    0x70(%rsp),%rcx
call   1050 <fprintf@plt>
mov    %ebp,%ebx
jmp    12aa <main+0x15a>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <show_version@plt>
mov    %ebx,%eax
add    $0x178,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32*, i32 }
@.str = [3 x i8] c"hV\00"
@.str.1 = [5 x i8] c"help\00"
@no_argument = global i32 0
@.str.2 = [8 x i8] c"version\00"
@stderr = global i32 0
@.str.3 = [9 x i8] c"%s : %s\0A\00"
@.str.4 = [7 x i8] c"svd_if\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca [256 x i8]
%11 = alloca [3 x %struct.option]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %9
%12 = bitcast [256 x i8]* %10 to i8*
%13 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %11, i64 0, i64 0
%14 = getelementptr inbounds %struct.option, %struct.option* %13, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds %struct.option, %struct.option* %13, i32 0, i32 1
%16 = load i32, i32* @no_argument
%17 = trunc i32 %16 to i8
store i8 %17, i8* %15
%18 = getelementptr inbounds %struct.option, %struct.option* %13, i32 0, i32 2
store i32* null, i32** %18
%19 = getelementptr inbounds %struct.option, %struct.option* %13, i32 0, i32 3
store i32 104, i32* %19
%20 = getelementptr inbounds %struct.option, %struct.option* %13, i64 1
%21 = getelementptr inbounds %struct.option, %struct.option* %20, i32 0, i32 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %21
%22 = getelementptr inbounds %struct.option, %struct.option* %20, i32 0, i32 1
%23 = load i32, i32* @no_argument
%24 = trunc i32 %23 to i8
store i8 %24, i8* %22
%25 = getelementptr inbounds %struct.option, %struct.option* %20, i32 0, i32 2
store i32* null, i32** %25
%26 = getelementptr inbounds %struct.option, %struct.option* %20, i32 0, i32 3
store i32 86, i32* %26
%27 = getelementptr inbounds %struct.option, %struct.option* %20, i64 1
%28 = bitcast %struct.option* %27 to i8*
br label %29
29: ; preds = %2
%30 = load i32, i32* %4
%31 = load i8**, i8*** %5
%32 = load i8*, i8** %9
%33 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %11, i64 0, i64 0
%34 = call i32 @getopt_long(i32 %30, i8** %31, i8* %32, %struct.option* %33, i32* %7)
store i32 %34, i32* %8
%35 = icmp ne i32 %34, -1
br i1 %35, label %36, label %51
36: ; preds = %29
%37 = load i32, i32* %8
%38 = icmp eq i32 %37, 104
br i1 %38, label %42, label %39
39: ; preds = %36
%40 = load i32, i32* %8
%41 = icmp eq i32 %40, 63
br i1 %41, label %42, label %44
42: ; preds = %39, %36
%43 = call i32 (...) @show_help()
br label %50
44: ; preds = %39
%45 = load i32, i32* %8
%46 = icmp eq i32 %45, 86
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = call i32 (...) @show_version()
br label %49
49: ; preds = %47, %44
br label %50
50: ; preds = %49, %42
br label %61
51: ; preds = %29
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%53 = call i32 @svd_if_cli_start(i8* %52)
store i32 %53, i32* %6
%54 = load i32, i32* %6
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %60
56: ; preds = %51
%57 = load i32, i32* @stderr
%58 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%59 = call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %58)
br label %60
60: ; preds = %56, %51
br label %61
61: ; preds = %60, %50
%62 = load i32, i32* %6
ret i32 %62
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32*, i32 }
@.str = [3 x i8] c"hV\00"
@.str.1 = [5 x i8] c"help\00"
@no_argument = global i32 0
@.str.2 = [8 x i8] c"version\00"
@stderr = global i32 0
@.str.3 = [9 x i8] c"%s : %s\0A\00"
@.str.4 = [7 x i8] c"svd_if\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca [256 x i8]
%5 = alloca [3 x %struct.option]
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%8 = bitcast [3 x %struct.option]* %5 to i8*
%9 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %5, i64 0, i64 0
%10 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %5, i64 0, i64 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %5, i64 0, i64 0, i32 1
%12 = load i32, i32* @no_argument
%13 = trunc i32 %12 to i8
store i8 %13, i8* %11
%14 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %5, i64 0, i64 0, i32 2
store i32* null, i32** %14
%15 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %5, i64 0, i64 0, i32 3
store i32 104, i32* %15
%16 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %5, i64 0, i64 1, i32 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %5, i64 0, i64 1, i32 1
store i8 %13, i8* %17
%18 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %5, i64 0, i64 1, i32 2
store i32* null, i32** %18
%19 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %5, i64 0, i64 1, i32 3
store i32 86, i32* %19
%20 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %5, i64 0, i64 2
%21 = bitcast %struct.option* %20 to i8*
%22 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.option* %9, i32* %3)
switch i32 %22, label %33 [
i32 -1, label %27
i32 104, label %23
i32 63, label %23
i32 86, label %25
]
23: ; preds = %2, %2
%24 = call i32 (...) @show_help()
br label %33
25: ; preds = %2
%26 = call i32 (...) @show_version()
br label %33
27: ; preds = %2
%28 = call i32 @svd_if_cli_start(i8* %7)
%29 = icmp eq i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %27
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %7)
br label %33
33: ; preds = %2, %27, %30, %23, %25
%34 = phi i32 [ 0, %23 ], [ 0, %25 ], [ %28, %30 ], [ 0, %27 ], [ 0, %2 ]
ret i32 %34
}