#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*/ bzero(char *, size_t);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int /*<<< orphan*/ strncat(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void unimplmented_response(char *buf, size_t buflen) {
  char buffer[buflen];
  bzero(buffer, buflen);
  strncpy(buffer, "HTTP/1.1 501 Not Implemented\r\n", 30);
  strncat(buffer, "Content-type: text/html\n\n", 25);
  strncat(buffer, "<html>\n", 7);
  strncat(buffer, " <body>\n", 8);
  strncat(buffer, "  <h1>501 Not Implemented</h1>\n", 31);
  strncat(buffer, "  <p>The HTTP request you made is not implemented.</p>\n",
          55);
  strncat(buffer, " <body>\n", 8);
  strncat(buffer, "<html>\n", 7);
  strncat(buffer, "\r\n", 2);
  strncat(buffer, "\r\n", 2);
  memcpy(buf, buffer, buflen);
}


x86 assembly (clang, -O0):
<unimplmented_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
call   1060 <bzero@plt>
mov    -0x28(%rbp),%rdi
lea    0xe75(%rip),%rsi
mov    $0x1e,%edx
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rdi
lea    0xe7f(%rip),%rsi
mov    $0x19,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe84(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe77(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe6b(%rip),%rsi
mov    $0x1f,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x37,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe38(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe1b(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xde9(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xdd4(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rsi
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unimplmented_response>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsp,%rbx
lea    0xf(%rsi),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1060 <bzero@plt>
lea    0xe8c(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1e,%edx
call   1030 <strncpy@plt>
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
mov    $0x19,%edx
call   1040 <strncat@plt>
lea    0xe9d(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x7,%edx
call   1040 <strncat@plt>
lea    0xe8e(%rip),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x8,%edx
call   1040 <strncat@plt>
lea    0xe80(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1f,%edx
call   1040 <strncat@plt>
lea    0xe8c(%rip),%rsi
mov    %rbx,%rdi
mov    $0x37,%edx
call   1040 <strncat@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x8,%edx
call   1040 <strncat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x7,%edx
call   1040 <strncat@plt>
lea    0xe0a(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x2,%edx
call   1040 <strncat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x2,%edx
call   1040 <strncat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"HTTP/1.1 501 Not Implemented\0D\0A\00"
@.str.1 = [26 x i8] c"Content-type: text/html\0A\0A\00"
@.str.2 = [8 x i8] c"<html>\0A\00"
@.str.3 = [9 x i8] c" <body>\0A\00"
@.str.4 = [32 x i8] c" <h1>501 Not Implemented</h1>\0A\00"
@.str.5 = [56 x i8] c" <p>The HTTP request you made is not implemented.</p>\0A\00"
@.str.6 = [3 x i8] c"\0D\0A\00"
define void @unimplmented_response(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %5
%9 = alloca i8, i64 %7
store i64 %7, i64* %6
%10 = load i64, i64* %4
%11 = call i32 @bzero(i8* %9, i64 %10)
%12 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 30)
%13 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 25)
%14 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 7)
%15 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 8)
%16 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 31)
%17 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0), i32 55)
%18 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 8)
%19 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 7)
%20 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%21 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%22 = load i8*, i8** %3
%23 = load i64, i64* %4
%24 = call i32 @memcpy(i8* %22, i8* %9, i64 %23)
%25 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"HTTP/1.1 501 Not Implemented\0D\0A\00"
@.str.1 = [26 x i8] c"Content-type: text/html\0A\0A\00"
@.str.2 = [8 x i8] c"<html>\0A\00"
@.str.3 = [9 x i8] c" <body>\0A\00"
@.str.4 = [32 x i8] c" <h1>501 Not Implemented</h1>\0A\00"
@.str.5 = [56 x i8] c" <p>The HTTP request you made is not implemented.</p>\0A\00"
@.str.6 = [3 x i8] c"\0D\0A\00"
define void @unimplmented_response(i8* %0, i64 %1) {
%3 = alloca i8, i64 %1
%4 = call i32 @bzero(i8* %3, i64 %1)
%5 = call i32 @strncpy(i8* %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 30)
%6 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 25)
%7 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 7)
%8 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 8)
%9 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 31)
%10 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0), i32 55)
%11 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 8)
%12 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 7)
%13 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%14 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%15 = call i32 @memcpy(i8* %0, i8* %3, i64 %1)
ret void
}