#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 */
typedef int /*<<< orphan*/ uint32_t;
struct web_server {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ web_server_create(struct web_server **, char *);
int /*<<< orphan*/ web_server_destroy(struct web_server **);
int /*<<< orphan*/ web_server_join(struct web_server *, int /*<<< orphan*/);
int /*<<< orphan*/ web_server_start(struct web_server *);
int /*<<< orphan*/ web_server_stop(struct web_server *);
int main(void) {
  struct web_server *server = NULL;
  web_server_create(&server, "8000");
  web_server_start(server);
  web_server_join(server, (uint32_t)1000);
  web_server_stop(server);
  web_server_destroy(&server);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1050 <web_server_create@plt>
mov    -0x10(%rbp),%rdi
call   1060 <web_server_start@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <web_server_join@plt>
mov    -0x10(%rbp),%rdi
call   1040 <web_server_stop@plt>
lea    -0x10(%rbp),%rdi
call   1070 <web_server_destroy@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0xe9b(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <web_server_create@plt>
mov    0x8(%rsp),%rdi
call   1060 <web_server_start@plt>
mov    0x8(%rsp),%rdi
mov    $0x3e8,%esi
call   1030 <web_server_join@plt>
mov    0x8(%rsp),%rdi
call   1040 <web_server_stop@plt>
mov    %rbx,%rdi
call   1070 <web_server_destroy@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.web_server = type { i32 }
@.str = [5 x i8] c"8000\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.web_server*
store i32 0, i32* %1
store %struct.web_server* null, %struct.web_server** %2
%3 = call i32 @web_server_create(%struct.web_server** %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.web_server*, %struct.web_server** %2
%5 = call i32 @web_server_start(%struct.web_server* %4)
%6 = load %struct.web_server*, %struct.web_server** %2
%7 = call i32 @web_server_join(%struct.web_server* %6, i32 1000)
%8 = load %struct.web_server*, %struct.web_server** %2
%9 = call i32 @web_server_stop(%struct.web_server* %8)
%10 = call i32 @web_server_destroy(%struct.web_server** %2)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
%struct.web_server = type { i32 }
@.str = [5 x i8] c"8000\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca %struct.web_server*
%2 = bitcast %struct.web_server** %1 to i8*
store %struct.web_server* null, %struct.web_server** %1
%3 = call i32 @web_server_create(%struct.web_server** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.web_server*, %struct.web_server** %1
%5 = call i32 @web_server_start(%struct.web_server* %4)
%6 = load %struct.web_server*, %struct.web_server** %1
%7 = call i32 @web_server_join(%struct.web_server* %6, i32 1000)
%8 = load %struct.web_server*, %struct.web_server** %1
%9 = call i32 @web_server_stop(%struct.web_server* %8)
%10 = call i32 @web_server_destroy(%struct.web_server** %1)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}