#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*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void do_404(char *item, char *buf) {
  strcpy(buf, "HTTP/1.0 404 Not Found\r\n");
  strcat(buf, "Content-type: text/plain\r\n");
  strcat(buf, "\r\n");
  strcat(buf, "The item you requested: ");
  strcat(buf, "\r\n");
  strcat(buf, item);
  strcat(buf, " is not found\r\n");
}


x86 assembly (clang, -O0):
<do_404>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_404>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xec6(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcat@plt>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"HTTP/1.0 404 Not Found\0D\0A\00"
@.str.1 = [27 x i8] c"Content-type: text/plain\0D\0A\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [25 x i8] c"The item you requested: \00"
@.str.4 = [16 x i8] c" is not found\0D\0A\00"
define void @do_404(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %4
%8 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %4
%10 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%11 = load i8*, i8** %4
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%13 = load i8*, i8** %4
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%15 = load i8*, i8** %4
%16 = load i8*, i8** %3
%17 = call i32 @strcat(i8* %15, i8* %16)
%18 = load i8*, i8** %4
%19 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"HTTP/1.0 404 Not Found\0D\0A\00"
@.str.1 = [27 x i8] c"Content-type: text/plain\0D\0A\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [25 x i8] c"The item you requested: \00"
@.str.4 = [16 x i8] c" is not found\0D\0A\00"
define void @do_404(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @strcat(i8* %1, i8* %0)
%9 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
ret void
}