#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 *);
void response_create(char *buffer, char *spec) {
  buffer[0] = 2;
  buffer[1] = '\r';
  buffer[2] = '\n';
  buffer[3] = 255;
  buffer[4] = 255;
  buffer[5] = 255;
  buffer[6] = '\r';
  buffer[7] = '\n';
  buffer[8] = '\0';
  strcat(buffer, spec);
  strcat(buffer, "\r\n\r\n");
}


x86 assembly (clang, -O0):
<response_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2,(%rax)
mov    -0x8(%rbp),%rax
movb   $0xd,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0xa,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0xff,0x3(%rax)
mov    -0x8(%rbp),%rax
movb   $0xff,0x4(%rax)
mov    -0x8(%rbp),%rax
movb   $0xff,0x5(%rax)
mov    -0x8(%rbp),%rax
movb   $0xd,0x6(%rax)
mov    -0x8(%rbp),%rax
movb   $0xa,0x7(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x8(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1030 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<response_create>:
push   %rbx
mov    %rdi,%rbx
movabs $0xa0dffffff0a0d02,%rax
ff 0d 0a
mov    %rax,(%rdi)
movb   $0x0,0x8(%rdi)
call   1030 <strcat@plt>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
define void @response_create(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 2, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 13, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8 10, i8* %10
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 3
store i8 -1, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 4
store i8 -1, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 5
store i8 -1, i8* %16
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 6
store i8 13, i8* %18
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 7
store i8 10, i8* %20
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 8
store i8 0, i8* %22
%23 = load i8*, i8** %3
%24 = load i8*, i8** %4
%25 = call i32 @strcat(i8* %23, i8* %24)
%26 = load i8*, i8** %3
%27 = call i32 @strcat(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
define void @response_create(i8* %0, i8* %1) {
store i8 2, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 13, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 2
store i8 10, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 3
store i8 -1, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 4
store i8 -1, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 5
store i8 -1, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 6
store i8 13, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 7
store i8 10, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 8
store i8 0, i8* %10
%11 = tail call i32 @strcat(i8* %0, i8* %1)
%12 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}