#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*/ chronometer_stop();
int /*<<< orphan*/ consolemanager_println(char *);
int /*<<< orphan*/ controller_battleship_stop();
int /*<<< orphan*/ controller_home_start();
int /*<<< orphan*/ controller_home_stop();
int /*<<< orphan*/ controller_score_stop();
int /*<<< orphan*/ controller_tictactoe_stop();
scalar_t__ strcasecmp(char *, char *);
int /*<<< orphan*/ thermometer_thread_stop();
void shell_program_app_stop(int argc, char *argv[]) {
  if (argc != 1)
    return;
  if (strcasecmp(argv[0], "chronometre") == 0) {
    chronometer_stop();
    consolemanager_println("The chronometer app is stopped");
  } else if (strcasecmp(argv[0], "thermometre") == 0) {
    thermometer_thread_stop();
    consolemanager_println("The thermometer app is stopped");
  } else if (strcasecmp(argv[0], "battleship") == 0) {
    controller_battleship_stop();
    consolemanager_println("The battleship app is stopped");
  } else if (strcasecmp(argv[0], "tictactoe") == 0) {
    controller_tictactoe_stop();
    consolemanager_println("The TicTacToe app is stopped");
  } else if (strcasecmp(argv[0], "shell") == 0) {
    controller_home_start();
    consolemanager_println("The Shell app is stopped");
  } else if (strcasecmp(argv[0], "home") == 0) {
    controller_home_stop();
    consolemanager_println("The Home app is stopped");
  } else if (strcasecmp(argv[0], "scores") == 0) {
    controller_score_stop();
    consolemanager_println("The Scores app is stopped");
  } else {
    consolemanager_println(
        "Unable to define which app do you want to stop ...");
  }
}


x86 assembly (clang, -O0):
<shell_program_app_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     11ae <shell_program_app_stop+0x1e>
jmp    134b <shell_program_app_stop+0x1bb>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe44(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11e3 <shell_program_app_stop+0x53>
mov    $0x0,%al
call   1080 <chronometer_stop@plt>
lea    0xe33(%rip),%rdi
call   1030 <consolemanager_println@plt>
jmp    134b <shell_program_app_stop+0x1bb>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe3a(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1218 <shell_program_app_stop+0x88>
mov    $0x0,%al
call   10b0 <thermometer_thread_stop@plt>
lea    0xe29(%rip),%rdi
call   1030 <consolemanager_println@plt>
jmp    1346 <shell_program_app_stop+0x1b6>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe30(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    124d <shell_program_app_stop+0xbd>
mov    $0x0,%al
call   1070 <controller_battleship_stop@plt>
lea    0xe1e(%rip),%rdi
call   1030 <consolemanager_println@plt>
jmp    1341 <shell_program_app_stop+0x1b1>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe24(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1282 <shell_program_app_stop+0xf2>
mov    $0x0,%al
call   1050 <controller_tictactoe_stop@plt>
lea    0xe11(%rip),%rdi
call   1030 <consolemanager_println@plt>
jmp    133c <shell_program_app_stop+0x1ac>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe16(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12b7 <shell_program_app_stop+0x127>
mov    $0x0,%al
call   1060 <controller_home_start@plt>
lea    0xdff(%rip),%rdi
call   1030 <consolemanager_println@plt>
jmp    1337 <shell_program_app_stop+0x1a7>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe00(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12ec <shell_program_app_stop+0x15c>
mov    $0x0,%al
call   1090 <controller_home_stop@plt>
lea    0xde8(%rip),%rdi
call   1030 <consolemanager_println@plt>
jmp    1332 <shell_program_app_stop+0x1a2>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xde8(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1321 <shell_program_app_stop+0x191>
mov    $0x0,%al
call   10a0 <controller_score_stop@plt>
lea    0xdd2(%rip),%rdi
call   1030 <consolemanager_println@plt>
jmp    132d <shell_program_app_stop+0x19d>
lea    0xddb(%rip),%rdi
call   1030 <consolemanager_println@plt>
jmp    1332 <shell_program_app_stop+0x1a2>
jmp    1337 <shell_program_app_stop+0x1a7>
jmp    133c <shell_program_app_stop+0x1ac>
jmp    1341 <shell_program_app_stop+0x1b1>
jmp    1346 <shell_program_app_stop+0x1b6>
jmp    134b <shell_program_app_stop+0x1bb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_program_app_stop>:
cmp    $0x1,%edi
jne    1252 <shell_program_app_stop+0xc2>
push   %rbx
mov    (%rsi),%rbx
lea    0xe5c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     1253 <shell_program_app_stop+0xc3>
lea    0xe6f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     1267 <shell_program_app_stop+0xd7>
lea    0xe82(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     127b <shell_program_app_stop+0xeb>
lea    0xe93(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     128f <shell_program_app_stop+0xff>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     12a3 <shell_program_app_stop+0x113>
lea    0xea9(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     12b7 <shell_program_app_stop+0x127>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     12cb <shell_program_app_stop+0x13b>
lea    0xeb7(%rip),%rdi
pop    %rbx
jmp    1030 <consolemanager_println@plt>
ret
xor    %eax,%eax
call   1080 <chronometer_stop@plt>
lea    0xdab(%rip),%rdi
pop    %rbx
jmp    1030 <consolemanager_println@plt>
xor    %eax,%eax
call   10b0 <thermometer_thread_stop@plt>
lea    0xdc2(%rip),%rdi
pop    %rbx
jmp    1030 <consolemanager_println@plt>
xor    %eax,%eax
call   1070 <controller_battleship_stop@plt>
lea    0xdd8(%rip),%rdi
pop    %rbx
jmp    1030 <consolemanager_println@plt>
xor    %eax,%eax
call   1050 <controller_tictactoe_stop@plt>
lea    0xdec(%rip),%rdi
pop    %rbx
jmp    1030 <consolemanager_println@plt>
xor    %eax,%eax
call   1060 <controller_home_start@plt>
lea    0xdfb(%rip),%rdi
pop    %rbx
jmp    1030 <consolemanager_println@plt>
xor    %eax,%eax
call   1090 <controller_home_stop@plt>
lea    0xe05(%rip),%rdi
pop    %rbx
jmp    1030 <consolemanager_println@plt>
xor    %eax,%eax
call   10a0 <controller_score_stop@plt>
lea    0xe10(%rip),%rdi
pop    %rbx
jmp    1030 <consolemanager_println@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"chronometre\00"
@.str.1 = [31 x i8] c"The chronometer app is stopped\00"
@.str.2 = [12 x i8] c"thermometre\00"
@.str.3 = [31 x i8] c"The thermometer app is stopped\00"
@.str.4 = [11 x i8] c"battleship\00"
@.str.5 = [30 x i8] c"The battleship app is stopped\00"
@.str.6 = [10 x i8] c"tictactoe\00"
@.str.7 = [29 x i8] c"The TicTacToe app is stopped\00"
@.str.8 = [6 x i8] c"shell\00"
@.str.9 = [25 x i8] c"The Shell app is stopped\00"
@.str.10 = [5 x i8] c"home\00"
@.str.11 = [24 x i8] c"The Home app is stopped\00"
@.str.12 = [7 x i8] c"scores\00"
@.str.13 = [26 x i8] c"The Scores app is stopped\00"
@.str.14 = [51 x i8] c"Unable to define which app do you want to stop ...\00"
define void @shell_program_app_stop(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %2
br label %79
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i64 @strcasecmp(i8* %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = call i32 (...) @chronometer_stop()
%16 = call i32 @consolemanager_println(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %79
17: ; preds = %8
%18 = load i8**, i8*** %4
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i64 @strcasecmp(i8* %20, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = call i32 (...) @thermometer_thread_stop()
%25 = call i32 @consolemanager_println(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %78
26: ; preds = %17
%27 = load i8**, i8*** %4
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = call i64 @strcasecmp(i8* %29, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %26
%33 = call i32 (...) @controller_battleship_stop()
%34 = call i32 @consolemanager_println(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
br label %77
35: ; preds = %26
%36 = load i8**, i8*** %4
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = call i64 @strcasecmp(i8* %38, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %35
%42 = call i32 (...) @controller_tictactoe_stop()
%43 = call i32 @consolemanager_println(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
br label %76
44: ; preds = %35
%45 = load i8**, i8*** %4
%46 = getelementptr inbounds i8*, i8** %45, i64 0
%47 = load i8*, i8** %46
%48 = call i64 @strcasecmp(i8* %47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %44
%51 = call i32 (...) @controller_home_start()
%52 = call i32 @consolemanager_println(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0))
br label %75
53: ; preds = %44
%54 = load i8**, i8*** %4
%55 = getelementptr inbounds i8*, i8** %54, i64 0
%56 = load i8*, i8** %55
%57 = call i64 @strcasecmp(i8* %56, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %53
%60 = call i32 (...) @controller_home_stop()
%61 = call i32 @consolemanager_println(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0))
br label %74
62: ; preds = %53
%63 = load i8**, i8*** %4
%64 = getelementptr inbounds i8*, i8** %63, i64 0
%65 = load i8*, i8** %64
%66 = call i64 @strcasecmp(i8* %65, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %62
%69 = call i32 (...) @controller_score_stop()
%70 = call i32 @consolemanager_println(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0))
br label %73
71: ; preds = %62
%72 = call i32 @consolemanager_println(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.14, i64 0, i64 0))
br label %73
73: ; preds = %71, %68
br label %74
74: ; preds = %73, %59
br label %75
75: ; preds = %74, %50
br label %76
76: ; preds = %75, %41
br label %77
77: ; preds = %76, %32
br label %78
78: ; preds = %77, %23
br label %79
79: ; preds = %7, %78, %14
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"chronometre\00"
@.str.1 = [31 x i8] c"The chronometer app is stopped\00"
@.str.2 = [12 x i8] c"thermometre\00"
@.str.3 = [31 x i8] c"The thermometer app is stopped\00"
@.str.4 = [11 x i8] c"battleship\00"
@.str.5 = [30 x i8] c"The battleship app is stopped\00"
@.str.6 = [10 x i8] c"tictactoe\00"
@.str.7 = [29 x i8] c"The TicTacToe app is stopped\00"
@.str.8 = [6 x i8] c"shell\00"
@.str.9 = [25 x i8] c"The Shell app is stopped\00"
@.str.10 = [5 x i8] c"home\00"
@.str.11 = [24 x i8] c"The Home app is stopped\00"
@.str.12 = [7 x i8] c"scores\00"
@.str.13 = [26 x i8] c"The Scores app is stopped\00"
@.str.14 = [51 x i8] c"Unable to define which app do you want to stop ...\00"
define void @shell_program_app_stop(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %43
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i64 @strcasecmp(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 (...) @chronometer_stop()
br label %40
10: ; preds = %4
%11 = tail call i64 @strcasecmp(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 (...) @thermometer_thread_stop()
br label %40
15: ; preds = %10
%16 = tail call i64 @strcasecmp(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 (...) @controller_battleship_stop()
br label %40
20: ; preds = %15
%21 = tail call i64 @strcasecmp(i8* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = tail call i32 (...) @controller_tictactoe_stop()
br label %40
25: ; preds = %20
%26 = tail call i64 @strcasecmp(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = tail call i32 (...) @controller_home_start()
br label %40
30: ; preds = %25
%31 = tail call i64 @strcasecmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = tail call i32 (...) @controller_home_stop()
br label %40
35: ; preds = %30
%36 = tail call i64 @strcasecmp(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = tail call i32 (...) @controller_score_stop()
br label %40
40: ; preds = %35, %8, %18, %28, %38, %33, %23, %13
%41 = phi i8* [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), %13 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), %23 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), %33 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), %38 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), %28 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), %18 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), %8 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @.str.14, i64 0, i64 0), %35 ]
%42 = tail call i32 @consolemanager_println(i8* %41)
br label %43
43: ; preds = %40, %2
ret void
}