#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*/ cleanup_server();
int /*<<< orphan*/ destroy_message();
int /*<<< orphan*/ destroy_threads();
int /*<<< orphan*/ init_config();
int /*<<< orphan*/ init_message();
int /*<<< orphan*/ init_threads();
long long mstime();
int /*<<< orphan*/ parse_args(int, char **);
int /*<<< orphan*/ print_statistics(long long, long long);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ process_threads();
int /*<<< orphan*/ setup_server();
int main(int argc, char *argv[]) {
  long long start, end;
  init_config();
  parse_args(argc, argv);
  printf("Starting benchmarking...\n");
  start = mstime();
  setup_server();
  init_message();
  init_threads();
  process_threads();
  end = mstime();
  print_statistics(start, end);
  destroy_message();
  destroy_threads();
  cleanup_server();
  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)
mov    $0x0,%al
call   10a0 <init_config@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <parse_args@plt>
lea    0xe10(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10d0 <mstime@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1070 <setup_server@plt>
mov    $0x0,%al
call   1050 <init_message@plt>
mov    $0x0,%al
call   1090 <init_threads@plt>
mov    $0x0,%al
call   1030 <process_threads@plt>
mov    $0x0,%al
call   10d0 <mstime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10e0 <print_statistics@plt>
mov    $0x0,%al
call   1040 <destroy_message@plt>
mov    $0x0,%al
call   10b0 <destroy_threads@plt>
mov    $0x0,%al
call   10c0 <cleanup_server@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   10a0 <init_config@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1080 <parse_args@plt>
lea    0xe20(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10d0 <mstime@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1070 <setup_server@plt>
xor    %eax,%eax
call   1060 <init_message@plt>
xor    %eax,%eax
call   1090 <init_threads@plt>
xor    %eax,%eax
call   1030 <process_threads@plt>
xor    %eax,%eax
call   10d0 <mstime@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   10e0 <print_statistics@plt>
xor    %eax,%eax
call   1050 <destroy_message@plt>
xor    %eax,%eax
call   10b0 <destroy_threads@plt>
xor    %eax,%eax
call   10c0 <cleanup_server@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Starting benchmarking...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @init_config()
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @parse_args(i32 %9, i8** %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%13 = call i64 (...) @mstime()
store i64 %13, i64* %6
%14 = call i32 (...) @setup_server()
%15 = call i32 (...) @init_message()
%16 = call i32 (...) @init_threads()
%17 = call i32 (...) @process_threads()
%18 = call i64 (...) @mstime()
store i64 %18, i64* %7
%19 = load i64, i64* %6
%20 = load i64, i64* %7
%21 = call i32 @print_statistics(i64 %19, i64 %20)
%22 = call i32 (...) @destroy_message()
%23 = call i32 (...) @destroy_threads()
%24 = call i32 (...) @cleanup_server()
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Starting benchmarking...\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @init_config()
%4 = tail call i32 @parse_args(i32 %0, i8** %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = tail call i64 (...) @mstime()
%7 = tail call i32 (...) @setup_server()
%8 = tail call i32 (...) @init_message()
%9 = tail call i32 (...) @init_threads()
%10 = tail call i32 (...) @process_threads()
%11 = tail call i64 (...) @mstime()
%12 = tail call i32 @print_statistics(i64 %6, i64 %11)
%13 = tail call i32 (...) @destroy_message()
%14 = tail call i32 (...) @destroy_threads()
%15 = tail call i32 (...) @cleanup_server()
ret i32 0
}