#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*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ strlen(char *);
void not_found(int client) {
  char buf[1024];
  sprintf(buf, "HTTP/1.0 404 NOT FOUND\r\n");
  send(client, buf, strlen(buf), 0);
  sprintf(buf, "Server: httpd/0.1.0\r\n");
  send(client, buf, strlen(buf), 0);
  sprintf(buf, "Content-Type: text/html\r\n");
  send(client, buf, strlen(buf), 0);
  sprintf(buf, "\r\n");
  send(client, buf, strlen(buf), 0);
  sprintf(buf, "<HTML><TITLE>Not Found</TITLE>\r\n");
  send(client, buf, strlen(buf), 0);
  sprintf(buf, "<BODY><P>The server could not fulfill\r\n");
  send(client, buf, strlen(buf), 0);
  sprintf(buf, "your request because the resource specified\r\n");
  send(client, buf, strlen(buf), 0);
  sprintf(buf, "is unavailable or nonexistent.\r\n");
  send(client, buf, strlen(buf), 0);
  sprintf(buf, "</BODY></HTML>\r\n");
  send(client, buf, strlen(buf), 0);
}


x86 assembly (clang, -O0):
<not_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4a0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x49c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x498(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x49c(%rbp),%edi
mov    -0x498(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    -0x410(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x48c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x488(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x48c(%rbp),%edi
mov    -0x488(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    -0x410(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x47c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x478(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x47c(%rbp),%edi
mov    -0x478(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    -0x410(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x46c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x468(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x46c(%rbp),%edi
mov    -0x468(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    -0x410(%rbp),%rdi
lea    0xdcd(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x45c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x458(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x45c(%rbp),%edi
mov    -0x458(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    -0x410(%rbp),%rdi
lea    0xda2(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x44c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x448(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x44c(%rbp),%edi
mov    -0x448(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    -0x410(%rbp),%rdi
lea    0xd7e(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x43c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x438(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x43c(%rbp),%edi
mov    -0x438(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    -0x410(%rbp),%rdi
lea    0xd60(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x42c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x428(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x42c(%rbp),%edi
mov    -0x428(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    -0x410(%rbp),%rdi
lea    0xd35(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x41c(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x41c(%rbp),%edi
mov    -0x418(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x4a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_found>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %edi,%ebx
movups 0xed6(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movups 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
movabs $0xa0d302e312e30,%rax
mov    %rax,0xe(%rsp)
movups 0xea7(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
movups 0xe9c(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xe9b(%rip),%xmm0
movups %xmm0,0xa(%rsp)
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
movw   $0xa0d,(%rsp)
movb   $0x0,0x2(%rsp)
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
movups 0xe68(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xe6d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x20(%rsp)
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
movabs $0xa0d6c6c69666c,%rax
mov    %rax,0x20(%rsp)
movups 0xe48(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xe4d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
movups 0xe43(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xe48(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xe4a(%rip),%xmm0
movups %xmm0,0x1e(%rsp)
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
movups 0xe38(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xe3d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x20(%rsp)
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
movups 0xe27(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x408,%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 = [22 x i8] c"Server: httpd/0.1.0\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 [1024 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @send(i32 %6, i8* %7, i32 %9, i32 0)
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%12 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* %2
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
%17 = call i32 @send(i32 %13, i8* %14, i32 %16, i32 0)
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%19 = call i32 @sprintf(i8* %18, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* %2
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%23 = call i32 @strlen(i8* %22)
%24 = call i32 @send(i32 %20, i8* %21, i32 %23, i32 0)
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%26 = call i32 @sprintf(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%27 = load i32, i32* %2
%28 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%30 = call i32 @strlen(i8* %29)
%31 = call i32 @send(i32 %27, i8* %28, i32 %30, i32 0)
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%33 = call i32 @sprintf(i8* %32, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%34 = load i32, i32* %2
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%37 = call i32 @strlen(i8* %36)
%38 = call i32 @send(i32 %34, i8* %35, i32 %37, i32 0)
%39 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%40 = call i32 @sprintf(i8* %39, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
%41 = load i32, i32* %2
%42 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%43 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%44 = call i32 @strlen(i8* %43)
%45 = call i32 @send(i32 %41, i8* %42, i32 %44, i32 0)
%46 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%47 = call i32 @sprintf(i8* %46, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%48 = load i32, i32* %2
%49 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%51 = call i32 @strlen(i8* %50)
%52 = call i32 @send(i32 %48, i8* %49, i32 %51, i32 0)
%53 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%54 = call i32 @sprintf(i8* %53, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%55 = load i32, i32* %2
%56 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%58 = call i32 @strlen(i8* %57)
%59 = call i32 @send(i32 %55, i8* %56, i32 %58, i32 0)
%60 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%61 = call i32 @sprintf(i8* %60, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
%62 = load i32, i32* %2
%63 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%64 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%65 = call i32 @strlen(i8* %64)
%66 = call i32 @send(i32 %62, i8* %63, i32 %65, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"HTTP/1.0 404 NOT FOUND\0D\0A\00"
@.str.1 = [22 x i8] c"Server: httpd/0.1.0\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 [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @strlen(i8* %3)
%5 = call i32 @send(i32 %0, i8* %3, i32 %4, i32 0)
%6 = call i32 @strlen(i8* %3)
%7 = call i32 @send(i32 %0, i8* %3, i32 %6, i32 0)
%8 = call i32 @strlen(i8* %3)
%9 = call i32 @send(i32 %0, i8* %3, i32 %8, i32 0)
%10 = call i32 @strlen(i8* %3)
%11 = call i32 @send(i32 %0, i8* %3, i32 %10, i32 0)
%12 = call i32 @strlen(i8* %3)
%13 = call i32 @send(i32 %0, i8* %3, i32 %12, i32 0)
%14 = call i32 @strlen(i8* %3)
%15 = call i32 @send(i32 %0, i8* %3, i32 %14, i32 0)
%16 = call i32 @strlen(i8* %3)
%17 = call i32 @send(i32 %0, i8* %3, i32 %16, i32 0)
%18 = call i32 @strlen(i8* %3)
%19 = call i32 @send(i32 %0, i8* %3, i32 %18, i32 0)
%20 = call i32 @strlen(i8* %3)
%21 = call i32 @send(i32 %0, i8* %3, i32 %20, i32 0)
ret void
}