#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*/ deal_with_it();
int /*<<< orphan*/ feof(int /*<<< orphan*/);
size_t fread(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(char *, size_t, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  char buffer[512];
  while (!feof(stdin)) {
    size_t bytes = fread(buffer, 512, sizeof(char), stdin);
    fwrite(buffer, bytes, sizeof(char), stdout);
  }
  printf("200\n");
  printf("Content-Type: text/html; charset=utf-8\n");
  printf("%s", argv[1]);
  deal_with_it();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    118c <main+0x3c>
jmp    11d8 <main+0x88>
lea    -0x210(%rbp),%rdi
mov    0x2e4e(%rip),%rax
mov    (%rax),%ecx
mov    $0x200,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
mov    %rax,-0x218(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x218(%rbp),%rsi
mov    0x2e11(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1070 <fwrite@plt>
jmp    1169 <main+0x19>
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <deal_with_it@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rsi,%r14
mov    0x2e70(%rip),%r15
mov    (%r15),%edi
call   1070 <feof@plt>
test   %eax,%eax
jne    11c5 <main+0x65>
mov    %rsp,%rbx
mov    0x2e4a(%rip),%r12
xchg   %ax,%ax
mov    (%r15),%ecx
mov    %rbx,%rdi
mov    $0x200,%esi
mov    $0x1,%edx
call   1050 <fread@plt>
mov    (%r12),%ecx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1080 <fwrite@plt>
mov    (%r15),%edi
call   1070 <feof@plt>
test   %eax,%eax
je     1190 <main+0x30>
lea    0xe37(%rip),%rdi
call   1030 <puts@plt>
lea    0xe2f(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%r14),%rsi
lea    0xe18(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1040 <deal_with_it@plt>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
@.str = [5 x i8] c"200\0A\00"
@.str.1 = [40 x i8] c"Content-Type: text/html; charset=utf-8\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [512 x i8]
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %13, %2
%9 = load i32, i32* @stdin
%10 = call i32 @feof(i32 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %21
13: ; preds = %8
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%15 = load i32, i32* @stdin
%16 = call i64 @fread(i8* %14, i32 512, i32 1, i32 %15)
store i64 %16, i64* %7
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%18 = load i64, i64* %7
%19 = load i32, i32* @stdout
%20 = call i32 @fwrite(i8* %17, i64 %18, i32 1, i32 %19)
br label %8
21: ; preds = %8
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = call i32 (...) @deal_with_it()
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
@.str.2 = [3 x i8] c"%s\00"
@str = [4 x i8] c"200\00"
@str.3 = [39 x i8] c"Content-Type: text/html; charset=utf-8\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @feof(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2, %8
%9 = load i32, i32* @stdin
%10 = call i64 @fread(i8* %4, i32 512, i32 1, i32 %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fwrite(i8* %4, i64 %10, i32 1, i32 %11)
%13 = load i32, i32* @stdin
%14 = call i32 @feof(i32 %13)
%15 = icmp eq i32 %14, 0
br i1 %15, label %8, label %16
16: ; preds = %8, %2
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.3, i64 0, i64 0))
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %20)
%22 = call i32 (...) @deal_with_it()
ret i32 0
}