#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*/ sendString(int, char *);
int sendHttpHeaders(int fd, char *rcode, char *headers) {
  sendString(fd, "HTTP/1.1 ");
  sendString(fd, rcode);
  sendString(fd, "\r\n");
  sendString(fd, headers);
  sendString(fd, "Content-type: text/plain\r\nConnection: close\r\nServer: "
                 "traccoon\r\n\r\n");
  return 0;
}


x86 assembly (clang, -O0):
<sendHttpHeaders>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    0xed3(%rip),%rsi
call   1030 <sendString@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <sendString@plt>
mov    -0x4(%rbp),%edi
lea    0xf01(%rip),%rsi
call   1030 <sendString@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <sendString@plt>
mov    -0x4(%rbp),%edi
lea    0xea7(%rip),%rsi
call   1030 <sendString@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendHttpHeaders>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xedd(%rip),%rsi
call   1030 <sendString@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <sendString@plt>
lea    0xf10(%rip),%rsi
mov    %ebp,%edi
call   1030 <sendString@plt>
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <sendString@plt>
lea    0xeb9(%rip),%rsi
mov    %ebp,%edi
call   1030 <sendString@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"HTTP/1.1 \00"
@.str.1 = [3 x i8] c"\0D\0A\00"
@.str.2 = [66 x i8] c"Content-type: text/plain\0D\0AConnection: close\0D\0AServer: traccoon\0D\0A\0D\0A\00"
define i32 @sendHttpHeaders(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i32 @sendString(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = call i32 @sendString(i32 %9, i8* %10)
%12 = load i32, i32* %4
%13 = call i32 @sendString(i32 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %4
%15 = load i8*, i8** %6
%16 = call i32 @sendString(i32 %14, i8* %15)
%17 = load i32, i32* %4
%18 = call i32 @sendString(i32 %17, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"HTTP/1.1 \00"
@.str.1 = [3 x i8] c"\0D\0A\00"
@.str.2 = [66 x i8] c"Content-type: text/plain\0D\0AConnection: close\0D\0AServer: traccoon\0D\0A\0D\0A\00"
define i32 @sendHttpHeaders(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @sendString(i32 %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @sendString(i32 %0, i8* %1)
%6 = tail call i32 @sendString(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @sendString(i32 %0, i8* %2)
%8 = tail call i32 @sendString(i32 %0, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}