#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 sendBadRequestError(int clientsd) {
  char title[30], content[128];
  strlcpy(title, "400 Bad Request\n");
  strlcpy(content, "<html><body>\n");
  strcat(content, "<h2>Malformed Request</h2>\n");
  strcat(content, "Your browser sent a request I could not understand\n");
  strcat(content, "</body></html>\n");
  sendError(clientsd, title, content);
}


x86 assembly (clang, -O0):
<sendBadRequestError>:
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    0xeb5(%rip),%rsi
call   1030 <strlcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <strcat@plt>
lea    -0xb0(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strcat@plt>
lea    -0xb0(%rbp),%rdi
lea    0xeda(%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):
<sendBadRequestError>:
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    0xebb(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlcpy@plt>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xee7(%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 = [17 x i8] c"400 Bad Request\0A\00"
@.str.1 = [14 x i8] c"<html><body>\0A\00"
@.str.2 = [28 x i8] c"<h2>Malformed Request</h2>\0A\00"
@.str.3 = [52 x i8] c"Your browser sent a request I could not understand\0A\00"
@.str.4 = [16 x i8] c"</body></html>\0A\00"
define void @sendBadRequestError(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 ([17 x i8], [17 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 ([52 x i8], [52 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 = [17 x i8] c"400 Bad Request\0A\00"
@.str.1 = [14 x i8] c"<html><body>\0A\00"
@.str.2 = [28 x i8] c"<h2>Malformed Request</h2>\0A\00"
@.str.3 = [52 x i8] c"Your browser sent a request I could not understand\0A\00"
@.str.4 = [16 x i8] c"</body></html>\0A\00"
define void @sendBadRequestError(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 ([17 x i8], [17 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 ([52 x i8], [52 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
}