#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 forbidden_response(char *buf, size_t buflen) {
  char buffer[buflen];
  bzero(buffer, buflen);
  strncpy(buffer, "HTTP/1.1 403 Forbidden\r\n", 24);
  strncat(buffer, "Content-type: text/html\n\n", 25);
  strncat(buffer, "<html>\n", 7);
  strncat(buffer, " <body>\n", 8);
  strncat(buffer, "  <h1>403 Forbidden</h1>\n", 25);
  strncat(buffer, "  <p>Access to this site is denied.</p>\n", 36);
  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):
<forbidden_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    $0x18,%edx
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rdi
lea    0xe79(%rip),%rsi
mov    $0x19,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe7e(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe71(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe65(%rip),%rsi
mov    $0x19,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x24,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe32(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xe15(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xde3(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncat@plt>
mov    -0x28(%rbp),%rdi
lea    0xdce(%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):
<forbidden_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    $0x18,%edx
call   1030 <strncpy@plt>
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
mov    $0x19,%edx
call   1040 <strncat@plt>
lea    0xe97(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x7,%edx
call   1040 <strncat@plt>
lea    0xe88(%rip),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x8,%edx
call   1040 <strncat@plt>
lea    0xe7a(%rip),%rsi
mov    %rbx,%rdi
mov    $0x19,%edx
call   1040 <strncat@plt>
lea    0xe80(%rip),%rsi
mov    %rbx,%rdi
mov    $0x24,%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    0xe04(%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 = [25 x i8] c"HTTP/1.1 403 Forbidden\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 = [26 x i8] c" <h1>403 Forbidden</h1>\0A\00"
@.str.5 = [41 x i8] c" <p>Access to this site is denied.</p>\0A\00"
@.str.6 = [3 x i8] c"\0D\0A\00"
define void @forbidden_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 ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 24)
%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 ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 25)
%17 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 36)
%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 = [25 x i8] c"HTTP/1.1 403 Forbidden\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 = [26 x i8] c" <h1>403 Forbidden</h1>\0A\00"
@.str.5 = [41 x i8] c" <p>Access to this site is denied.</p>\0A\00"
@.str.6 = [3 x i8] c"\0D\0A\00"
define void @forbidden_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 ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 24)
%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 ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 25)
%10 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 36)
%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
}