#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 EXIT_SUCCESS;
int connectToBroker(char const *);
int /*<<< orphan*/ createTaskOnBroker(int, char const *);
int /*<<< orphan*/ pollAndLockOnBroker(int, char const *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("Welcome to the Team8-Client\n");
  const char host[10] = "localhost\0";
  int fileDescriptor = connectToBroker(host);
  const char *topic = "TaskTopic";
  createTaskOnBroker(fileDescriptor, topic);
  pollAndLockOnBroker(fileDescriptor, topic);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
mov    0xeb4(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xeb1(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x1a(%rbp),%rdi
call   1050 <connectToBroker@plt>
mov    %eax,-0x20(%rbp)
lea    0xe9c(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1060 <createTaskOnBroker@plt>
mov    -0x20(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1030 <pollAndLockOnBroker@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
movabs $0x736f686c61636f6c,%rax
68 6f 73
mov    %rax,0x8(%rsp)
movw   $0x74,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1050 <connectToBroker@plt>
mov    %eax,%ebx
lea    0xeab(%rip),%r14
mov    %eax,%edi
mov    %r14,%rsi
call   1060 <createTaskOnBroker@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <pollAndLockOnBroker@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Welcome to the Team8-Client\0A\00"
@__const.main.host = [10 x i8] c"localhost\00"
@.str.1 = [10 x i8] c"TaskTopic\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i32
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%10 = bitcast [10 x i8]* %6 to i8*
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%12 = call i32 @connectToBroker(i8* %11)
store i32 %12, i32* %7
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %8
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = call i32 @createTaskOnBroker(i32 %13, i8* %14)
%16 = load i32, i32* %7
%17 = load i8*, i8** %8
%18 = call i32 @pollAndLockOnBroker(i32 %16, i8* %17)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}

LLVM IR (-O2):
@.str = [29 x i8] c"Welcome to the Team8-Client\0A\00"
@__const.main.host = [10 x i8] c"localhost\00"
@.str.1 = [10 x i8] c"TaskTopic\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = call i32 @connectToBroker(i8* %5)
%7 = call i32 @createTaskOnBroker(i32 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @pollAndLockOnBroker(i32 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}