#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*/ printf(char *);
int /*<<< orphan*/ sendError(int, char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strlcpy(char *, char *);
void sendForbiddenError(int clientsd) {
  char title[30], content[128];
  printf("Forbidden Error\n");
  strlcpy(title, "403 Forbidden\n");
  strlcpy(content, "<html><body>\n");
  strcat(content, "<h2>Permission denied</h2>\n");
  strcat(content, "You cannot see this document.\n");
  strcat(content, "</body></html>\n");
  sendError(clientsd, title, content);
}


x86 assembly (clang, -O0):
<sendForbiddenError>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strlcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1040 <strlcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1050 <strcat@plt>
lea    -0xb0(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1050 <strcat@plt>
lea    -0xb0(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0xb0(%rbp),%rdx
call   1060 <sendError@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendForbiddenError>:
push   %rbp
push   %r14
push   %rbx
sub    $0xa0,%rsp
mov    %edi,%ebp
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <strlcpy@plt>
lea    0xe9d(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlcpy@plt>
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <sendError@plt>
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Forbidden Error\0A\00"
@.str.1 = [15 x i8] c"403 Forbidden\0A\00"
@.str.2 = [14 x i8] c"<html><body>\0A\00"
@.str.3 = [28 x i8] c"<h2>Permission denied</h2>\0A\00"
@.str.4 = [31 x i8] c"You cannot see this document.\0A\00"
@.str.5 = [16 x i8] c"</body></html>\0A\00"
define void @sendForbiddenError(i32 %0) {
%2 = alloca i32
%3 = alloca [30 x i8]
%4 = alloca [128 x i8]
store i32 %0, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%7 = call i32 @strlcpy(i8* %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%9 = call i32 @strlcpy(i8* %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%13 = call i32 @strcat(i8* %12, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%15 = call i32 @strcat(i8* %14, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%16 = load i32, i32* %2
%17 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%19 = call i32 @sendError(i32 %16, i8* %17, i8* %18)
ret void
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"403 Forbidden\0A\00"
@.str.2 = [14 x i8] c"<html><body>\0A\00"
@.str.3 = [28 x i8] c"<h2>Permission denied</h2>\0A\00"
@.str.4 = [31 x i8] c"You cannot see this document.\0A\00"
@.str.5 = [16 x i8] c"</body></html>\0A\00"
@str = [16 x i8] c"Forbidden Error\00"
define void @sendForbiddenError(i32 %0) {
%2 = alloca [30 x i8]
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%7 = call i32 @strlcpy(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @strlcpy(i8* %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 @sendError(i32 %0, i8* %4, i8* %5)
ret void
}