#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 */

/* Variables and functions */
int /*<<< orphan*/ generate_ControllersStruct();
int /*<<< orphan*/ generate_control_variables_m();
int /*<<< orphan*/ generate_simu_variables_m();
int /*<<< orphan*/ generate_user_sf_IO();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("Error, missing argument !\n");
  } else if (argc > 2) {
    printf("Error: only one argument required, but received %d arguments !\n",
           argc - 1);
  } else {
    if (!strcmp(argv[1], "simu")) {
      generate_user_sf_IO();
    } else if (!strcmp(argv[1], "ctrl")) {
      generate_ControllersStruct();
    } else if (!strcmp(argv[1], "simu_sync")) {
      generate_simu_variables_m();
    } else if (!strcmp(argv[1], "ctrl_sync")) {
      generate_control_variables_m();
    } else {
      printf("Error: %s is not a good argument !\n", argv[1]);
      printf("Arguments accepted: 'simu', 'ctrl', 'simu_sync' or 'ctrl_sync' "
             "(without '')\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1193 <main+0x33>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1297 <main+0x137>
cmpl   $0x2,-0x8(%rbp)
jle    11b6 <main+0x56>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1292 <main+0x132>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe96(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    11df <main+0x7f>
mov    $0x0,%al
call   1070 <generate_user_sf_IO@plt>
jmp    128d <main+0x12d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe72(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1208 <main+0xa8>
mov    $0x0,%al
call   1030 <generate_ControllersStruct@plt>
jmp    1288 <main+0x128>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe4e(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1231 <main+0xd1>
mov    $0x0,%al
call   1040 <generate_simu_variables_m@plt>
jmp    1283 <main+0x123>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2f(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    125a <main+0xfa>
mov    $0x0,%al
call   1060 <generate_control_variables_m@plt>
jmp    127e <main+0x11e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1283 <main+0x123>
jmp    1288 <main+0x128>
jmp    128d <main+0x12d>
jmp    1292 <main+0x132>
jmp    1297 <main+0x137>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jg     1187 <main+0x17>
lea    0xf51(%rip),%rdi
call   1040 <puts@plt>
jmp    122f <main+0xbf>
mov    %edi,%eax
cmp    $0x2,%edi
jne    11f8 <main+0x88>
mov    0x8(%rsi),%rbx
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %eax,%eax
je     120d <main+0x9d>
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %eax,%eax
je     1216 <main+0xa6>
lea    0xe8b(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %eax,%eax
je     121f <main+0xaf>
lea    0xe82(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %eax,%eax
je     1228 <main+0xb8>
lea    0xe79(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe8c(%rip),%rdi
jmp    117d <main+0xd>
add    $0xffffffff,%eax
lea    0xdfe(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    122f <main+0xbf>
xor    %eax,%eax
call   1080 <generate_user_sf_IO@plt>
jmp    122f <main+0xbf>
xor    %eax,%eax
call   1030 <generate_ControllersStruct@plt>
jmp    122f <main+0xbf>
xor    %eax,%eax
call   1050 <generate_simu_variables_m@plt>
jmp    122f <main+0xbf>
xor    %eax,%eax
call   1070 <generate_control_variables_m@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Error, missing argument !\0A\00"
@.str.1 = [64 x i8] c"Error: only one argument required, but received %d arguments !\0A\00"
@.str.2 = [5 x i8] c"simu\00"
@.str.3 = [5 x i8] c"ctrl\00"
@.str.4 = [10 x i8] c"simu_sync\00"
@.str.5 = [10 x i8] c"ctrl_sync\00"
@.str.6 = [36 x i8] c"Error: %s is not a good argument !\0A\00"
@.str.7 = [77 x i8] c"Arguments accepted: 'simu', 'ctrl', 'simu_sync' or 'ctrl_sync' (without '')\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %60
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 2
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %59
17: ; preds = %10
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @strcmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %17
%24 = call i32 (...) @generate_user_sf_IO()
br label %58
25: ; preds = %17
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %25
%32 = call i32 (...) @generate_ControllersStruct()
br label %57
33: ; preds = %25
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call i32 @strcmp(i8* %36, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp ne i32 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %33
%40 = call i32 (...) @generate_simu_variables_m()
br label %56
41: ; preds = %33
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i32 @strcmp(i8* %44, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%46 = icmp ne i32 %45, 0
br i1 %46, label %49, label %47
47: ; preds = %41
%48 = call i32 (...) @generate_control_variables_m()
br label %55
49: ; preds = %41
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 1
%52 = load i8*, i8** %51
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0), i8* %52)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.7, i64 0, i64 0))
br label %55
55: ; preds = %49, %47
br label %56
56: ; preds = %55, %39
br label %57
57: ; preds = %56, %31
br label %58
58: ; preds = %57, %23
br label %59
59: ; preds = %58, %13
br label %60
60: ; preds = %59, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [64 x i8] c"Error: only one argument required, but received %d arguments !\0A\00"
@.str.2 = [5 x i8] c"simu\00"
@.str.3 = [5 x i8] c"ctrl\00"
@.str.4 = [10 x i8] c"simu_sync\00"
@.str.5 = [10 x i8] c"ctrl_sync\00"
@.str.6 = [36 x i8] c"Error: %s is not a good argument !\0A\00"
@str = [76 x i8] c"Arguments accepted: 'simu', 'ctrl', 'simu_sync' or 'ctrl_sync' (without '')\00"
@str.8 = [26 x i8] c"Error, missing argument !\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.8, i64 0, i64 0))
br label %36
6: ; preds = %2
%7 = icmp eq i32 %0, 2
br i1 %7, label %11, label %8
8: ; preds = %6
%9 = add nsw i32 %0, -1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %36
11: ; preds = %6
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %13, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = tail call i32 (...) @generate_user_sf_IO()
br label %36
18: ; preds = %11
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %13, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = tail call i32 (...) @generate_ControllersStruct()
br label %36
23: ; preds = %18
%24 = tail call i32 @strcmp(i8* dereferenceable(1) %13, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = tail call i32 (...) @generate_simu_variables_m()
br label %36
28: ; preds = %23
%29 = tail call i32 @strcmp(i8* dereferenceable(1) %13, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = tail call i32 (...) @generate_control_variables_m()
br label %36
33: ; preds = %28
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0), i8* %13)
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str, i64 0, i64 0))
br label %36
36: ; preds = %8, %21, %31, %33, %26, %16, %4
ret i32 0
}