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


x86 assembly (clang, -O0):
<send_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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    0xeb7(%rip),%rcx
mov    $0xffffffff,%r9d
mov    %r9d,%r8d
movl   $0x1,(%rsp)
call   1040 <send_headers@plt>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_error>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x1,(%rsp)
lea    0xeb2(%rip),%rcx
mov    $0xffffffff,%r8d
mov    $0xffffffff,%r9d
call   1050 <send_headers@plt>
lea    0xea4(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@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, 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, i32 1)
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %13, i8* %14)
%16 = load i32, i32* %5
%17 = load i8*, i8** %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %16, i8* %17)
%19 = load i8*, i8** %8
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %19)
%21 = call i32 (i8*, ...) @printf(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 = [16 x i8] c"</BODY></HTML>\0D\00"
define void @send_error(i32 %0, i8* %1, i8* %2, i8* %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, i32 1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8* %1)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %0, i8* %1)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}