#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*/ atoi(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ thread_dispatcher(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc != 3) {
    printf("    Usage : web_client SCENARIO nCLIENT\n"
           "       SCENARIO = 1 (periodic) or 2 (aperiodic)\n"
           "       nCLIENT = n (number of clients)\n");
    return -1;
  }
  thread_dispatcher(atoi(argv[1]), atoi(argv[2]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1196 <main+0x66>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <thread_dispatcher@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x3,%edi
jne    115c <main+0x2c>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <thread_dispatcher@plt>
xor    %eax,%eax
jmp    116d <main+0x3d>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [128 x i8] c" Usage : web_client SCENARIO nCLIENT\0A SCENARIO = 1 (periodic) or 2 (aperiodic)\0A nCLIENT = n (number of clients)\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 ne i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %20
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = call i32 @thread_dispatcher(i32 %14, i32 %18)
store i32 0, i32* %3
br label %20
20: ; preds = %10, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@str = [127 x i8] c" Usage : web_client SCENARIO nCLIENT\0A SCENARIO = 1 (periodic) or 2 (aperiodic)\0A nCLIENT = n (number of clients)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([127 x i8], [127 x i8]* @str, i64 0, i64 0))
br label %14
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = tail call i32 @thread_dispatcher(i32 %9, i32 %12)
br label %14
14: ; preds = %6, %4
%15 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %15
}