#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 analyseParameters(int, char **);
int areaAdd(char *);
int areaShow();
int areaSwitch(char *);
int /*<<< orphan*/ atol(char *);
int help();
int /*<<< orphan*/ printf(char *);
int sync();
int taskAdd(char *, char *);
int taskDone(int /*<<< orphan*/);
int taskShow();
int taskShowId(int /*<<< orphan*/);
int runClient(int argc, char *argv[]) {
  int opt = analyseParameters(argc, argv);
  switch (opt) {
  case 00: {
    if (0)
      printf("Sync...\n");
  };
    return sync();
  case 11: {
    if (0)
      printf("Area Show...\n");
  };
    return areaShow();
  case 12: {
    if (0)
      printf("Area Switch...\n");
  };
    return areaSwitch(argv[3]);
  case 13: {
    if (0)
      printf("Area Add...\n");
  };
    return areaAdd(argv[3]);
  case 21: {
    if (0)
      printf("Task Show...\n");
  };
    return taskShow();
  case 22: {
    if (0)
      printf("Task Show Id...\n");
  };
    return taskShowId(atol(argv[3]));
  case 23: {
    if (0)
      printf("Task Add...\n");
  };
    return taskAdd(argv[3], argv[4]);
  case 24: {
    if (0)
      printf("Task Done...\n");
  };
    return taskDone(atol(argv[3]));
  case 98: {
    if (0)
      printf("Help...\n");
  };
    return help();
  case 99:
  default:
    printf("Unrecognized parameters!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<runClient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <analyseParameters@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x63,%rax
ja     12c3 <runClient+0x103>
mov    -0x20(%rbp),%rax
lea    0xe06(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1060 <sync@plt>
mov    %eax,-0x4(%rbp)
jmp    12d6 <runClient+0x116>
mov    $0x0,%al
call   10e0 <areaShow@plt>
mov    %eax,-0x4(%rbp)
jmp    12d6 <runClient+0x116>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <areaSwitch@plt>
mov    %eax,-0x4(%rbp)
jmp    12d6 <runClient+0x116>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <areaAdd@plt>
mov    %eax,-0x4(%rbp)
jmp    12d6 <runClient+0x116>
mov    $0x0,%al
call   10c0 <taskShow@plt>
mov    %eax,-0x4(%rbp)
jmp    12d6 <runClient+0x116>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1090 <atol@plt>
mov    %eax,%edi
call   10a0 <taskShowId@plt>
mov    %eax,-0x4(%rbp)
jmp    12d6 <runClient+0x116>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
call   1040 <taskAdd@plt>
mov    %eax,-0x4(%rbp)
jmp    12d6 <runClient+0x116>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1090 <atol@plt>
mov    %eax,%edi
call   1070 <taskDone@plt>
mov    %eax,-0x4(%rbp)
jmp    12d6 <runClient+0x116>
mov    $0x0,%al
call   10b0 <help@plt>
mov    %eax,-0x4(%rbp)
jmp    12d6 <runClient+0x116>
jmp    12c3 <runClient+0x103>
lea    0xec6(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runClient>:
push   %rbx
mov    %rsi,%rbx
call   1030 <analyseParameters@plt>
cmp    $0x18,%eax
ja     11e8 <runClient+0x28>
mov    %eax,%eax
lea    0xe29(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
pop    %rbx
jmp    1060 <sync@plt>
cmp    $0x62,%eax
jne    11f5 <runClient+0x35>
xor    %eax,%eax
pop    %rbx
jmp    10b0 <help@plt>
lea    0xe68(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    10e0 <areaShow@plt>
mov    0x18(%rbx),%rdi
pop    %rbx
jmp    1080 <areaSwitch@plt>
mov    0x18(%rbx),%rdi
pop    %rbx
jmp    10d0 <areaAdd@plt>
xor    %eax,%eax
pop    %rbx
jmp    10c0 <taskShow@plt>
mov    0x18(%rbx),%rdi
call   1090 <atol@plt>
mov    %eax,%edi
pop    %rbx
jmp    10a0 <taskShowId@plt>
mov    0x18(%rbx),%rdi
mov    0x20(%rbx),%rsi
pop    %rbx
jmp    1050 <taskAdd@plt>
mov    0x18(%rbx),%rdi
call   1090 <atol@plt>
mov    %eax,%edi
pop    %rbx
jmp    1070 <taskDone@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Unrecognized parameters!\0A\00"
define i32 @runClient(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @analyseParameters(i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
switch i32 %10, label %50 [
i32 0, label %11
i32 11, label %13
i32 12, label %15
i32 13, label %20
i32 21, label %25
i32 22, label %27
i32 23, label %33
i32 24, label %41
i32 98, label %47
i32 99, label %49
]
11: ; preds = %2
%12 = call i32 (...) @sync()
store i32 %12, i32* %3
br label %53
13: ; preds = %2
%14 = call i32 (...) @areaShow()
store i32 %14, i32* %3
br label %53
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 3
%18 = load i8*, i8** %17
%19 = call i32 @areaSwitch(i8* %18)
store i32 %19, i32* %3
br label %53
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 3
%23 = load i8*, i8** %22
%24 = call i32 @areaAdd(i8* %23)
store i32 %24, i32* %3
br label %53
25: ; preds = %2
%26 = call i32 (...) @taskShow()
store i32 %26, i32* %3
br label %53
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 3
%30 = load i8*, i8** %29
%31 = call i32 @atol(i8* %30)
%32 = call i32 @taskShowId(i32 %31)
store i32 %32, i32* %3
br label %53
33: ; preds = %2
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 3
%36 = load i8*, i8** %35
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 4
%39 = load i8*, i8** %38
%40 = call i32 @taskAdd(i8* %36, i8* %39)
store i32 %40, i32* %3
br label %53
41: ; preds = %2
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 3
%44 = load i8*, i8** %43
%45 = call i32 @atol(i8* %44)
%46 = call i32 @taskDone(i32 %45)
store i32 %46, i32* %3
br label %53
47: ; preds = %2
%48 = call i32 (...) @help()
store i32 %48, i32* %3
br label %53
49: ; preds = %2
br label %50
50: ; preds = %2, %49
%51 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %52
52: ; preds = %50
store i32 0, i32* %3
br label %53
53: ; preds = %52, %47, %41, %33, %27, %25, %20, %15, %13, %11
%54 = load i32, i32* %3
ret i32 %54
}

LLVM IR (-O2):
@str = [25 x i8] c"Unrecognized parameters!\00"
define i32 @runClient(i32 %0, i8** %1) {
%3 = tail call i32 @analyseParameters(i32 %0, i8** %1)
switch i32 %3, label %36 [
i32 0, label %4
i32 11, label %6
i32 12, label %8
i32 13, label %12
i32 21, label %16
i32 22, label %18
i32 23, label %23
i32 24, label %29
i32 98, label %34
]
4: ; preds = %2
%5 = tail call i32 (...) @sync()
br label %38
6: ; preds = %2
%7 = tail call i32 (...) @areaShow()
br label %38
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = tail call i32 @areaSwitch(i8* %10)
br label %38
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 3
%14 = load i8*, i8** %13
%15 = tail call i32 @areaAdd(i8* %14)
br label %38
16: ; preds = %2
%17 = tail call i32 (...) @taskShow()
br label %38
18: ; preds = %2
%19 = getelementptr inbounds i8*, i8** %1, i64 3
%20 = load i8*, i8** %19
%21 = tail call i32 @atol(i8* %20)
%22 = tail call i32 @taskShowId(i32 %21)
br label %38
23: ; preds = %2
%24 = getelementptr inbounds i8*, i8** %1, i64 3
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8*, i8** %1, i64 4
%27 = load i8*, i8** %26
%28 = tail call i32 @taskAdd(i8* %25, i8* %27)
br label %38
29: ; preds = %2
%30 = getelementptr inbounds i8*, i8** %1, i64 3
%31 = load i8*, i8** %30
%32 = tail call i32 @atol(i8* %31)
%33 = tail call i32 @taskDone(i32 %32)
br label %38
34: ; preds = %2
%35 = tail call i32 (...) @help()
br label %38
36: ; preds = %2
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %38
38: ; preds = %36, %34, %29, %23, %18, %16, %12, %8, %6, %4
%39 = phi i32 [ 0, %36 ], [ %35, %34 ], [ %33, %29 ], [ %28, %23 ], [ %22, %18 ], [ %17, %16 ], [ %15, %12 ], [ %11, %8 ], [ %7, %6 ], [ %5, %4 ]
ret i32 %39
}