#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fin_connection(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void envoie_404(FILE *stream, char *url) {
  fprintf(stream, "HTTP/1.1 404 Not found\r\n");
  fprintf(stream, "Connection: close\r\n");
  fprintf(stream, "Content-type: text/html\r\n");
  fprintf(stream, "\r\n");
  fprintf(stream,
          "<html><head><title>Not Found</title></head>"
          "<body><p>Sorry, the object you requested was not found: "
          "<tt>/%s</tt>.</body></html>\r\n",
          url);
  fin_connection(stream, "erreur 404");
}


x86 assembly (clang, -O0):
<envoie_404>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf54(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf2f(%rip),%rsi
call   1040 <fin_connection@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<envoie_404>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xebf(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xeba(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xf39(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xf0f(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fin_connection@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"HTTP/1.1 404 Not found\0D\0A\00"
@.str.1 = [20 x i8] c"Connection: close\0D\0A\00"
@.str.2 = [26 x i8] c"Content-type: text/html\0D\0A\00"
@.str.3 = [3 x i8] c"\0D\0A\00"
@.str.4 = [129 x i8] c"<html><head><title>Not Found</title></head><body><p>Sorry, the object you requested was not found: <tt>/%s</tt>.</body></html>\0D\0A\00"
@.str.5 = [11 x i8] c"erreur 404\00"
define void @envoie_404(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 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32*, i32** %3
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32*, i32** %3
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%13 = load i32*, i32** %3
%14 = load i8*, i8** %4
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str.4, i64 0, i64 0), i8* %14)
%16 = load i32*, i32** %3
%17 = call i32 @fin_connection(i32* %16, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"HTTP/1.1 404 Not found\0D\0A\00"
@.str.1 = [20 x i8] c"Connection: close\0D\0A\00"
@.str.2 = [26 x i8] c"Content-type: text/html\0D\0A\00"
@.str.3 = [3 x i8] c"\0D\0A\00"
@.str.4 = [129 x i8] c"<html><head><title>Not Found</title></head><body><p>Sorry, the object you requested was not found: <tt>/%s</tt>.</body></html>\0D\0A\00"
@.str.5 = [11 x i8] c"erreur 404\00"
define void @envoie_404(i32* %0, i8* %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 24, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 19, i64 1, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i64 25, i64 1, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i64 2, i64 1, i32* %0)
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str.4, i64 0, i64 0), i8* %1)
%8 = tail call i32 @fin_connection(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
ret void
}