#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*/ write(int, char *, int);
void send_response(int connfd) {
  write(connfd, "HTTP/1.1 200 OK\n", 16);
  write(connfd, "Content-length: 70\n", 19);
  write(connfd, "Content-Type: text/html\n\n", 25);
  write(
      connfd,
      "<html><body><h1>Welcome to Thomas' homemade server!</h1></body></html>",
      70);
}


x86 assembly (clang, -O0):
<send_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    0xed8(%rip),%rsi
mov    $0x13,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    0xed8(%rip),%rsi
mov    $0x19,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    0xede(%rip),%rsi
mov    $0x46,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_response>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
lea    0xee6(%rip),%rsi
mov    %ebx,%edi
mov    $0x13,%edx
call   1030 <write@plt>
lea    0xee7(%rip),%rsi
mov    %ebx,%edi
mov    $0x19,%edx
call   1030 <write@plt>
lea    0xeee(%rip),%rsi
mov    %ebx,%edi
mov    $0x46,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"HTTP/1.1 200 OK\0A\00"
@.str.1 = [20 x i8] c"Content-length: 70\0A\00"
@.str.2 = [26 x i8] c"Content-Type: text/html\0A\0A\00"
@.str.3 = [71 x i8] c"<html><body><h1>Welcome to Thomas' homemade server!</h1></body></html>\00"
define void @send_response(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
%5 = load i32, i32* %2
%6 = call i32 @write(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 19)
%7 = load i32, i32* %2
%8 = call i32 @write(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 25)
%9 = load i32, i32* %2
%10 = call i32 @write(i32 %9, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0), i32 70)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"HTTP/1.1 200 OK\0A\00"
@.str.1 = [20 x i8] c"Content-length: 70\0A\00"
@.str.2 = [26 x i8] c"Content-Type: text/html\0A\0A\00"
@.str.3 = [71 x i8] c"<html><body><h1>Welcome to Thomas' homemade server!</h1></body></html>\00"
define void @send_response(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 19)
%4 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 25)
%5 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0), i32 70)
ret void
}