#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*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ send_headers(int, char *, char *, char *, int, int);
int /*<<< orphan*/ stdout;
void send_error(int status, char *title, char *extra_header, char *text) {
  send_headers(status, title, extra_header, "text/html", -1, -1);
  (void)printf("<html><head><title>%d %s</title></head>\n<body "
               "bgcolor=\"#cc9999\"><h4>%d %s</h4>\n",
               status, title, status, title);
  (void)printf("%s\n", text);
  (void)printf(
      "<hr>\n<address><a href=\"%s\">%s</a></address>\n</body></html>\n",
      "http://www.acme.com/software/micro_httpd/", "micro_httpd");
  (void)fflush(stdout);
  exit(1);
}


x86 assembly (clang, -O0):
<send_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe97(%rip),%rcx
mov    $0xffffffff,%r9d
mov    %r9d,%r8d
call   1040 <send_headers@plt>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xf0a(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<send_error>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe9d(%rip),%rcx
mov    $0xffffffff,%r8d
mov    $0xffffffff,%r9d
call   1050 <send_headers@plt>
lea    0xe8f(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    %rbx,%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xebf(%rip),%rdi
lea    0xef4(%rip),%rsi
lea    0xf17(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"text/html\00"
@.str.1 = [80 x i8] c"<html><head><title>%d %s</title></head>\0A<body bgcolor=\22#cc9999\22><h4>%d %s</h4>\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [60 x i8] c"<hr>\0A<address><a href=\22%s\22>%s</a></address>\0A</body></html>\0A\00"
@.str.4 = [42 x i8] c"http://www.acme.com/software/micro_httpd/\00"
@.str.5 = [12 x i8] c"micro_httpd\00"
@stdout = global i32 0
define void @send_error(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i32 @send_headers(i32 %9, i8* %10, i8* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -1, i32 -1)
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %5
%16 = load i8*, i8** %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0), i32 %13, i8* %14, i32 %15, i8* %16)
%18 = load i8*, i8** %8
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%21 = load i32, i32* @stdout
%22 = call i32 @fflush(i32 %21)
%23 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"text/html\00"
@.str.1 = [80 x i8] c"<html><head><title>%d %s</title></head>\0A<body bgcolor=\22#cc9999\22><h4>%d %s</h4>\0A\00"
@.str.3 = [60 x i8] c"<hr>\0A<address><a href=\22%s\22>%s</a></address>\0A</body></html>\0A\00"
@.str.4 = [42 x i8] c"http://www.acme.com/software/micro_httpd/\00"
@.str.5 = [12 x i8] c"micro_httpd\00"
@stdout = global i32 0
define void @send_error(i32 %0, i8* %1, i8* %2, i8* nocapture %3) {
%5 = tail call i32 @send_headers(i32 %0, i8* %1, i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -1, i32 -1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8* %1, i32 %0, i8* %1)
%7 = tail call i32 @puts(i8* dereferenceable(1) %3)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
%11 = tail call i32 @exit(i32 1)
unreachable
}