#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*/ send_str(int, char *);
void headerHtml(int sock, char *filePath) {
  send_str(sock, "<html><head><title>Index of ");
  send_str(sock, filePath);
  send_str(sock,
           "</title><style "
           "type=\"text/css\">td,tr{font-family:monospace;font-size:10pt;}</"
           "style></head><body><h1><caption>Index of ");
  send_str(sock, filePath);
  send_str(sock, "</caption></h1>");
  send_str(sock, "<table cellpadding=\"2\"><tr>");
  send_str(sock, "<th>File Name</th>");
  send_str(sock, "<th>File Size</th>");
  send_str(sock, "<th>Last Modified</th>");
  send_str(sock, "</tr>");
}


x86 assembly (clang, -O0):
<headerHtml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    0xed7(%rip),%rsi
call   1030 <send_str@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <send_str@plt>
mov    -0x4(%rbp),%edi
lea    0xed9(%rip),%rsi
call   1030 <send_str@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <send_str@plt>
mov    -0x4(%rbp),%edi
lea    0xf35(%rip),%rsi
call   1030 <send_str@plt>
mov    -0x4(%rbp),%edi
lea    0xf36(%rip),%rsi
call   1030 <send_str@plt>
mov    -0x4(%rbp),%edi
lea    0xf43(%rip),%rsi
call   1030 <send_str@plt>
mov    -0x4(%rbp),%edi
lea    0xf47(%rip),%rsi
call   1030 <send_str@plt>
mov    -0x4(%rbp),%edi
lea    0xf4b(%rip),%rsi
call   1030 <send_str@plt>
mov    -0x4(%rbp),%edi
lea    0xf53(%rip),%rsi
call   1030 <send_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<headerHtml>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
lea    0xee0(%rip),%rsi
call   1030 <send_str@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <send_str@plt>
lea    0xee7(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_str@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <send_str@plt>
lea    0xf46(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_str@plt>
lea    0xf48(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_str@plt>
lea    0xf56(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_str@plt>
lea    0xf5b(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_str@plt>
lea    0xf60(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_str@plt>
lea    0xf69(%rip),%rsi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <send_str@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"<html><head><title>Index of \00"
@.str.1 = [119 x i8] c"</title><style type=\22text/css\22>td,tr{font-family:monospace;font-size:10pt;}</style></head><body><h1><caption>Index of \00"
@.str.2 = [16 x i8] c"</caption></h1>\00"
@.str.3 = [28 x i8] c"<table cellpadding=\222\22><tr>\00"
@.str.4 = [19 x i8] c"<th>File Name</th>\00"
@.str.5 = [19 x i8] c"<th>File Size</th>\00"
@.str.6 = [23 x i8] c"<th>Last Modified</th>\00"
@.str.7 = [6 x i8] c"</tr>\00"
define void @headerHtml(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @send_str(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @send_str(i32 %7, i8* %8)
%10 = load i32, i32* %3
%11 = call i32 @send_str(i32 %10, i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = load i8*, i8** %4
%14 = call i32 @send_str(i32 %12, i8* %13)
%15 = load i32, i32* %3
%16 = call i32 @send_str(i32 %15, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%17 = load i32, i32* %3
%18 = call i32 @send_str(i32 %17, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%19 = load i32, i32* %3
%20 = call i32 @send_str(i32 %19, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%21 = load i32, i32* %3
%22 = call i32 @send_str(i32 %21, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%23 = load i32, i32* %3
%24 = call i32 @send_str(i32 %23, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%25 = load i32, i32* %3
%26 = call i32 @send_str(i32 %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"<html><head><title>Index of \00"
@.str.1 = [119 x i8] c"</title><style type=\22text/css\22>td,tr{font-family:monospace;font-size:10pt;}</style></head><body><h1><caption>Index of \00"
@.str.2 = [16 x i8] c"</caption></h1>\00"
@.str.3 = [28 x i8] c"<table cellpadding=\222\22><tr>\00"
@.str.4 = [19 x i8] c"<th>File Name</th>\00"
@.str.5 = [19 x i8] c"<th>File Size</th>\00"
@.str.6 = [23 x i8] c"<th>Last Modified</th>\00"
@.str.7 = [6 x i8] c"</tr>\00"
define void @headerHtml(i32 %0, i8* %1) {
%3 = tail call i32 @send_str(i32 %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @send_str(i32 %0, i8* %1)
%5 = tail call i32 @send_str(i32 %0, i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @send_str(i32 %0, i8* %1)
%7 = tail call i32 @send_str(i32 %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @send_str(i32 %0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @send_str(i32 %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @send_str(i32 %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @send_str(i32 %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%12 = tail call i32 @send_str(i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
ret void
}