#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*/ sendError(int, char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strlcpy(char *, char *);
void sendForbiddenError(int clientsd) {
  char title[30], content[128];
  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    -0x30(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strlcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <strlcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1040 <strcat@plt>
lea    -0xb0(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <strcat@plt>
lea    -0xb0(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0xb0(%rbp),%rdx
call   1050 <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    0xebc(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strlcpy@plt>
lea    0xeb9(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlcpy@plt>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <sendError@plt>
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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