#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 *, char *);
int /*<<< orphan*/ puts(char *);
void html_error(char *str1, char *str2) {
  puts("Content-type: text/html");
  puts("");
  printf("<html><head><title>%s</title></head><body>\n", str1);
  printf("<h2>%s</h2>\n", str1);
  if (str2)
    printf("<b>%s</b>\n", str2);
  puts("</body></html>");
}


x86 assembly (clang, -O0):
<html_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee1(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1183 <html_error+0x63>
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
lea    0xede(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
test   %r14,%r14
je     1182 <html_error+0x52>
lea    0xed7(%rip),%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
lea    0xed3(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Content-type: text/html\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [44 x i8] c"<html><head><title>%s</title></head><body>\0A\00"
@.str.3 = [13 x i8] c"<h2>%s</h2>\0A\00"
@.str.4 = [11 x i8] c"<b>%s</b>\0A\00"
@.str.5 = [15 x i8] c"</body></html>\00"
define void @html_error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %2
%17 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Content-type: text/html\00"
@.str.2 = [44 x i8] c"<html><head><title>%s</title></head><body>\0A\00"
@.str.3 = [13 x i8] c"<h2>%s</h2>\0A\00"
@.str.4 = [11 x i8] c"<b>%s</b>\0A\00"
@.str.5 = [15 x i8] c"</body></html>\00"
define void @html_error(i8* %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%7 = icmp eq i8* %1, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %1)
br label %10
10: ; preds = %8, %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
ret void
}