#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void sendError(FILE *stream, char *error, char *msg) {
  fprintf(stream, "HTTP/1.1 %s\n", error);
  fprintf(stream, "Content-type: text/html\n\n");
  fprintf(stream, "<html><title>Drakkar Error</title>");
  fprintf(stream, "<body bgcolor=\"000000\" style=\"color:white\">\n");
  fprintf(stream, "%s : %s\n", error, msg);
  fprintf(stream, "<hr><em>Drakkar web server</em>\n</body></html>");
}


x86 assembly (clang, -O0):
<sendError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xecd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xef4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendError>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xecb(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xec7(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xec8(%rip),%rdi
mov    $0x22,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xed2(%rip),%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xee6(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xed8(%rip),%rdi
mov    $0x2e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"HTTP/1.1 %s\0A\00"
@.str.1 = [26 x i8] c"Content-type: text/html\0A\0A\00"
@.str.2 = [35 x i8] c"<html><title>Drakkar Error</title>\00"
@.str.3 = [45 x i8] c"<body bgcolor=\22000000\22 style=\22color:white\22>\0A\00"
@.str.4 = [9 x i8] c"%s : %s\0A\00"
@.str.5 = [47 x i8] c"<hr><em>Drakkar web server</em>\0A</body></html>\00"
define void @sendError(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32*, i32** %4
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32*, i32** %4
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32*, i32** %4
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32*, i32** %4
%17 = load i8*, i8** %5
%18 = load i8*, i8** %6
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* %17, i8* %18)
%20 = load i32*, i32** %4
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"HTTP/1.1 %s\0A\00"
@.str.1 = [26 x i8] c"Content-type: text/html\0A\0A\00"
@.str.2 = [35 x i8] c"<html><title>Drakkar Error</title>\00"
@.str.3 = [45 x i8] c"<body bgcolor=\22000000\22 style=\22color:white\22>\0A\00"
@.str.4 = [9 x i8] c"%s : %s\0A\00"
@.str.5 = [47 x i8] c"<hr><em>Drakkar web server</em>\0A</body></html>\00"
define void @sendError(i32* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i64 25, i64 1, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i64 34, i64 1, i32* %0)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i64 44, i64 1, i32* %0)
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* %1, i8* %2)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i64 46, i64 1, i32* %0)
ret void
}