#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*/ LOG_INFO;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int);
int write(int, char *, int);
void forbidden(int socket_fd) {
  int written;
  written =
      write(socket_fd,
            "HTTP/1.1 403 Forbidden\nContent-Length: 185\nConnection: "
            "close\nContent-Type: text/html\n\n<html><head>\n<title>403 "
            "Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\nThe "
            "requested URL, file type or operation is not allowed on this "
            "simple static file webserver.\n</body></html>\n",
            sizeof("HTTP/1.1 403 Forbidden\nContent-Length: 185\nConnection: "
                   "close\nContent-Type: text/html\n\n<html><head>\n<title>403 "
                   "Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\nThe "
                   "requested URL, file type or operation is not allowed on "
                   "this simple static file webserver.\n</body></html>\n"));
  syslog((LOG_INFO), "INFO: Forbidden, wrote response size %d\n", written);
}


x86 assembly (clang, -O0):
<forbidden>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
mov    $0x110,%edx
call   1030 <write@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xfbb(%rip),%rsi
call   1040 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forbidden>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x110,%edx
call   1030 <write@plt>
mov    0x2ea7(%rip),%rcx
mov    (%rcx),%edi
lea    0xfce(%rip),%rsi
mov    %eax,%edx
pop    %rax
jmp    1040 <syslog@plt>

LLVM IR (-O0):
@.str = [272 x i8] c"HTTP/1.1 403 Forbidden\0AContent-Length: 185\0AConnection: close\0AContent-Type: text/html\0A\0A<html><head>\0A<title>403 Forbidden</title>\0A</head><body>\0A<h1>Forbidden</h1>\0AThe requested URL, file type or operation is not allowed on this simple static file webserver.\0A</body></html>\0A\00"
@LOG_INFO = global i32 0
@.str.1 = [41 x i8] c"INFO: Forbidden, wrote response size %d\0A\00"
define void @forbidden(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @write(i32 %4, i8* getelementptr inbounds ([272 x i8], [272 x i8]* @.str, i64 0, i64 0), i32 272)
store i32 %5, i32* %3
%6 = load i32, i32* @LOG_INFO
%7 = load i32, i32* %3
%8 = call i32 @syslog(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [272 x i8] c"HTTP/1.1 403 Forbidden\0AContent-Length: 185\0AConnection: close\0AContent-Type: text/html\0A\0A<html><head>\0A<title>403 Forbidden</title>\0A</head><body>\0A<h1>Forbidden</h1>\0AThe requested URL, file type or operation is not allowed on this simple static file webserver.\0A</body></html>\0A\00"
@LOG_INFO = global i32 0
@.str.1 = [41 x i8] c"INFO: Forbidden, wrote response size %d\0A\00"
define void @forbidden(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([272 x i8], [272 x i8]* @.str, i64 0, i64 0), i32 272)
%3 = load i32, i32* @LOG_INFO
%4 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}