#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*/ client_send(int, char *);
int /*<<< orphan*/ get_response(int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int hello(int socket, char *hostname) {
  char message[108] = "HELO ";
  strcat(message, hostname);
  client_send(socket, message);
  get_response(socket, message, 108);
  printf("%s", message);
  return 0;
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x6c,%edx
call   1050 <memset@plt>
movb   $0x48,-0x80(%rbp)
movb   $0x45,-0x7f(%rbp)
movb   $0x4c,-0x7e(%rbp)
movb   $0x4f,-0x7d(%rbp)
movb   $0x20,-0x7c(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <strcat@plt>
mov    -0x4(%rbp),%edi
lea    -0x80(%rbp),%rsi
call   1060 <client_send@plt>
mov    -0x4(%rbp),%edi
lea    -0x80(%rbp),%rsi
mov    $0x6c,%edx
call   1030 <get_response@plt>
lea    -0x80(%rbp),%rsi
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %r14
push   %rbx
sub    $0x78,%rsp
mov    %edi,%ebx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movups %xmm0,0x5c(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x4f4c4548,(%rsp)
movb   $0x20,0x4(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1060 <strcat@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <client_send@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x6c,%edx
call   1030 <get_response@plt>
lea    0xe5b(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @hello(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [108 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = bitcast [108 x i8]* %5 to i8*
%7 = bitcast i8* %6 to [108 x i8]*
%8 = getelementptr inbounds [108 x i8], [108 x i8]* %7, i32 0, i32 0
store i8 72, i8* %8
%9 = getelementptr inbounds [108 x i8], [108 x i8]* %7, i32 0, i32 1
store i8 69, i8* %9
%10 = getelementptr inbounds [108 x i8], [108 x i8]* %7, i32 0, i32 2
store i8 76, i8* %10
%11 = getelementptr inbounds [108 x i8], [108 x i8]* %7, i32 0, i32 3
store i8 79, i8* %11
%12 = getelementptr inbounds [108 x i8], [108 x i8]* %7, i32 0, i32 4
store i8 32, i8* %12
%13 = getelementptr inbounds [108 x i8], [108 x i8]* %5, i64 0, i64 0
%14 = load i8*, i8** %4
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = load i32, i32* %3
%17 = getelementptr inbounds [108 x i8], [108 x i8]* %5, i64 0, i64 0
%18 = call i32 @client_send(i32 %16, i8* %17)
%19 = load i32, i32* %3
%20 = getelementptr inbounds [108 x i8], [108 x i8]* %5, i64 0, i64 0
%21 = call i32 @get_response(i32 %19, i8* %20, i32 108)
%22 = getelementptr inbounds [108 x i8], [108 x i8]* %5, i64 0, i64 0
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @hello(i32 %0, i8* %1) {
%3 = alloca [108 x i8]
%4 = getelementptr inbounds [108 x i8], [108 x i8]* %3, i64 0, i64 0
store i8 72, i8* %4
%5 = getelementptr inbounds [108 x i8], [108 x i8]* %3, i64 0, i64 1
store i8 69, i8* %5
%6 = getelementptr inbounds [108 x i8], [108 x i8]* %3, i64 0, i64 2
store i8 76, i8* %6
%7 = getelementptr inbounds [108 x i8], [108 x i8]* %3, i64 0, i64 3
store i8 79, i8* %7
%8 = getelementptr inbounds [108 x i8], [108 x i8]* %3, i64 0, i64 4
store i8 32, i8* %8
%9 = call i32 @strcat(i8* %4, i8* %1)
%10 = call i32 @client_send(i32 %0, i8* %4)
%11 = call i32 @get_response(i32 %0, i8* %4, i32 108)
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}