#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 asprintf(char **, char *);
int /*<<< orphan*/ send_free(int, char **, int);
void not_found(int client) {
  char *buffer = NULL;
  int bytes = asprintf(&buffer, "HTTP/1.0 404 NOT FOUND\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "Server: dinohttp/0.1\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "Content-Type: text/html\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "<HTML><TITLE>Not Found</TITLE>\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "<BODY><P>The server could not fulfill\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "your request because the resource specified\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "is unavailable or nonexistent.\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "</BODY></HTML>\r\n");
  send_free(client, &buffer, bytes);
  ;
}


x86 assembly (clang, -O0):
<not_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
lea    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
lea    -0x10(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
lea    -0x10(%rbp),%rdi
lea    0xf3b(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
lea    -0x10(%rbp),%rdi
lea    0xe84(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
lea    -0x10(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
lea    -0x10(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
lea    -0x10(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
lea    -0x10(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_found>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movq   $0x0,(%rsp)
lea    0xecb(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xec6(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xec2(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xf56(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xea6(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xeac(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xeb9(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xecc(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xed2(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"HTTP/1.0 404 NOT FOUND\0D\0A\00"
@.str.1 = [23 x i8] c"Server: dinohttp/0.1\0D\0A\00"
@.str.2 = [26 x i8] c"Content-Type: text/html\0D\0A\00"
@.str.3 = [3 x i8] c"\0D\0A\00"
@.str.4 = [33 x i8] c"<HTML><TITLE>Not Found</TITLE>\0D\0A\00"
@.str.5 = [40 x i8] c"<BODY><P>The server could not fulfill\0D\0A\00"
@.str.6 = [46 x i8] c"your request because the resource specified\0D\0A\00"
@.str.7 = [33 x i8] c"is unavailable or nonexistent.\0D\0A\00"
@.str.8 = [17 x i8] c"</BODY></HTML>\0D\0A\00"
define void @not_found(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
store i8* null, i8** %3
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = call i32 @send_free(i32 %6, i8** %3, i32 %7)
%9 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = call i32 @send_free(i32 %10, i8** %3, i32 %11)
%13 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = call i32 @send_free(i32 %14, i8** %3, i32 %15)
%17 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32 %17, i32* %4
%18 = load i32, i32* %2
%19 = load i32, i32* %4
%20 = call i32 @send_free(i32 %18, i8** %3, i32 %19)
%21 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
store i32 %21, i32* %4
%22 = load i32, i32* %2
%23 = load i32, i32* %4
%24 = call i32 @send_free(i32 %22, i8** %3, i32 %23)
%25 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
store i32 %25, i32* %4
%26 = load i32, i32* %2
%27 = load i32, i32* %4
%28 = call i32 @send_free(i32 %26, i8** %3, i32 %27)
%29 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
store i32 %29, i32* %4
%30 = load i32, i32* %2
%31 = load i32, i32* %4
%32 = call i32 @send_free(i32 %30, i8** %3, i32 %31)
%33 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
store i32 %33, i32* %4
%34 = load i32, i32* %2
%35 = load i32, i32* %4
%36 = call i32 @send_free(i32 %34, i8** %3, i32 %35)
%37 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
store i32 %37, i32* %4
%38 = load i32, i32* %2
%39 = load i32, i32* %4
%40 = call i32 @send_free(i32 %38, i8** %3, i32 %39)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"HTTP/1.0 404 NOT FOUND\0D\0A\00"
@.str.1 = [23 x i8] c"Server: dinohttp/0.1\0D\0A\00"
@.str.2 = [26 x i8] c"Content-Type: text/html\0D\0A\00"
@.str.3 = [3 x i8] c"\0D\0A\00"
@.str.4 = [33 x i8] c"<HTML><TITLE>Not Found</TITLE>\0D\0A\00"
@.str.5 = [40 x i8] c"<BODY><P>The server could not fulfill\0D\0A\00"
@.str.6 = [46 x i8] c"your request because the resource specified\0D\0A\00"
@.str.7 = [33 x i8] c"is unavailable or nonexistent.\0D\0A\00"
@.str.8 = [17 x i8] c"</BODY></HTML>\0D\0A\00"
define void @not_found(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @send_free(i32 %0, i8** %2, i32 %4)
%6 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @send_free(i32 %0, i8** %2, i32 %6)
%8 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @send_free(i32 %0, i8** %2, i32 %8)
%10 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @send_free(i32 %0, i8** %2, i32 %10)
%12 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @send_free(i32 %0, i8** %2, i32 %12)
%14 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @send_free(i32 %0, i8** %2, i32 %14)
%16 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 @send_free(i32 %0, i8** %2, i32 %16)
%18 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 @send_free(i32 %0, i8** %2, i32 %18)
%20 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
%21 = call i32 @send_free(i32 %0, i8** %2, i32 %20)
ret void
}