#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 */
struct HTTPRequest {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ output_common_header_fields(struct HTTPRequest *,
                                               int /*<<< orphan*/ *, char *);
void not_found(struct HTTPRequest *req, FILE *out) {
  output_common_header_fields(req, out, "404 Not Found");
  fprintf(out, "Content-Type: text/html\r\n");
  fprintf(out, "\r\n");
  fprintf(out, "File not found\r\n");
  fflush(out);
}


x86 assembly (clang, -O0):
<not_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdx
call   1040 <output_common_header_fields@plt>
mov    -0x10(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_found>:
push   %rbx
mov    %rsi,%rbx
lea    0xec5(%rip),%rdx
call   1030 <output_common_header_fields@plt>
lea    0xec7(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xed6(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xeaf(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
%struct.HTTPRequest = type { i32 }
@.str = [14 x i8] c"404 Not Found\00"
@.str.1 = [26 x i8] c"Content-Type: text/html\0D\0A\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [17 x i8] c"File not found\0D\0A\00"
define void @not_found(%struct.HTTPRequest* %0, i32* %1) {
%3 = alloca %struct.HTTPRequest*
%4 = alloca i32*
store %struct.HTTPRequest* %0, %struct.HTTPRequest** %3
store i32* %1, i32** %4
%5 = load %struct.HTTPRequest*, %struct.HTTPRequest** %3
%6 = load i32*, i32** %4
%7 = call i32 @output_common_header_fields(%struct.HTTPRequest* %5, i32* %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %4
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %4
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32*, i32** %4
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32*, i32** %4
%15 = call i32 @fflush(i32* %14)
ret void
}

LLVM IR (-O2):
%struct.HTTPRequest = type { i32 }
@.str = [14 x i8] c"404 Not Found\00"
@.str.1 = [26 x i8] c"Content-Type: text/html\0D\0A\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [17 x i8] c"File not found\0D\0A\00"
define void @not_found(%struct.HTTPRequest* %0, i32* %1) {
%3 = tail call i32 @output_common_header_fields(%struct.HTTPRequest* %0, i32* %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i64 25, i64 1, i32* %1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 2, i64 1, i32* %1)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i64 16, i64 1, i32* %1)
%7 = tail call i32 @fflush(i32* %1)
ret void
}