#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 *, ...);
int /*<<< orphan*/ send_headers(int /*<<< orphan*/ *, int, char *, char *,
                                char *, int, int);
void send_error(FILE *f, int status, char *title, char *extra, char *text) {
  send_headers(f, status, title, extra, "text/html", -1, -1);
  fprintf(f, "<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>\r\n", status, title);
  fprintf(f, "<BODY><H4>%d %s</H4>\r\n", status, title);
  fprintf(f, "%s\r\n", text);
  fprintf(f, "</BODY></HTML>\r\n");
}


x86 assembly (clang, -O0):
<send_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xeaf(%rip),%r8
mov    $0xffffffff,%r9d
movl   $0xffffffff,(%rsp)
call   1030 <send_headers@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe95(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xea7(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_error>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
movl   $0xffffffff,(%rsp)
lea    0xeb0(%rip),%r8
mov    $0xffffffff,%r9d
call   1030 <send_headers@plt>
lea    0xea8(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xeae(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fwrite@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"text/html\00"
@.str.1 = [42 x i8] c"<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>\0D\0A\00"
@.str.2 = [23 x i8] c"<BODY><H4>%d %s</H4>\0D\0A\00"
@.str.3 = [5 x i8] c"%s\0D\0A\00"
@.str.4 = [17 x i8] c"</BODY></HTML>\0D\0A\00"
define void @send_error(i32* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = call i32 @send_headers(i32* %11, i32 %12, i8* %13, i8* %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -1, i32 -1)
%16 = load i32*, i32** %6
%17 = load i32, i32* %7
%18 = load i8*, i8** %8
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %17, i8* %18)
%20 = load i32*, i32** %6
%21 = load i32, i32* %7
%22 = load i8*, i8** %8
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %21, i8* %22)
%24 = load i32*, i32** %6
%25 = load i8*, i8** %10
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %25)
%27 = load i32*, i32** %6
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"text/html\00"
@.str.1 = [42 x i8] c"<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>\0D\0A\00"
@.str.2 = [23 x i8] c"<BODY><H4>%d %s</H4>\0D\0A\00"
@.str.3 = [5 x i8] c"%s\0D\0A\00"
@.str.4 = [17 x i8] c"</BODY></HTML>\0D\0A\00"
define void @send_error(i32* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @send_headers(i32* %0, i32 %1, i8* %2, i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -1, i32 -1)
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %1, i8* %2)
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %1, i8* %2)
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i64 16, i64 1, i32* %0)
ret void
}