#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 unimplemented(int client) {
  char *buffer = NULL;
  int bytes = asprintf(&buffer, "HTTP/1.0 501 Method Not Implemented\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><HEAD><TITLE>Method Not Implemented\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "</TITLE></HEAD>\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "<BODY><P>HTTP request method not supported.\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "</BODY></HTML>\r\n");
  send_free(client, &buffer, bytes);
  ;
}


x86 assembly (clang, -O0):
<unimplemented>:
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    0xec6(%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    0xebb(%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    0xf1c(%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    0xe91(%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    0xe9b(%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    0xe8b(%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    0xe97(%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):
<unimplemented>:
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    0xed3(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xecf(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xf37(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xeb3(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xec4(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xebb(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xece(%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 = [38 x i8] c"HTTP/1.0 501 Method Not Implemented\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 = [44 x i8] c"<HTML><HEAD><TITLE>Method Not Implemented\0D\0A\00"
@.str.5 = [18 x i8] c"</TITLE></HEAD>\0D\0A\00"
@.str.6 = [46 x i8] c"<BODY><P>HTTP request method not supported.\0D\0A\00"
@.str.7 = [17 x i8] c"</BODY></HTML>\0D\0A\00"
define void @unimplemented(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 ([38 x i8], [38 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 ([44 x i8], [44 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 ([18 x i8], [18 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 ([17 x i8], [17 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)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"HTTP/1.0 501 Method Not Implemented\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 = [44 x i8] c"<HTML><HEAD><TITLE>Method Not Implemented\0D\0A\00"
@.str.5 = [18 x i8] c"</TITLE></HEAD>\0D\0A\00"
@.str.6 = [46 x i8] c"<BODY><P>HTTP request method not supported.\0D\0A\00"
@.str.7 = [17 x i8] c"</BODY></HTML>\0D\0A\00"
define void @unimplemented(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 ([38 x i8], [38 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 ([44 x i8], [44 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 ([18 x i8], [18 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 ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 @send_free(i32 %0, i8** %2, i32 %18)
ret void
}