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


x86 assembly (clang, -O0):
<request_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x1,(%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   $0xd,0x4(%rax)
mov    -0x8(%rbp),%rax
movb   $0xa,0x5(%rax)
movswl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0xa(%rbp),%ax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x7(%rax)
mov    -0x8(%rbp),%rax
movb   $0xd,0x8(%rax)
mov    -0x8(%rbp),%rax
movb   $0xa,0x9(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0xa(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe5b(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1030 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<request_create>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %esi,%eax
mov    %rdi,%rbx
movl   $0xff0a0d01,(%rdi)
movw   $0xa0d,0x4(%rdi)
mov    %ah,0x6(%rdi)
mov    %al,0x7(%rdi)
movw   $0xa0d,0x8(%rdi)
movb   $0x0,0xa(%rdi)
mov    %rdx,%rsi
call   1030 <strcat@plt>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcat@plt>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcat@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
@.str.1 = [5 x i8] c"\0D\0A\0D\0A\00"
define void @request_create(i8* %0, i16 signext %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i16 %1, i16* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 1, i8* %10
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 13, i8* %12
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 2
store i8 10, i8* %14
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 3
store i8 -1, i8* %16
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 4
store i8 13, i8* %18
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 5
store i8 10, i8* %20
%21 = load i16, i16* %6
%22 = sext i16 %21 to i32
%23 = ashr i32 %22, 8
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %5
%26 = getelementptr inbounds i8, i8* %25, i64 6
store i8 %24, i8* %26
%27 = load i16, i16* %6
%28 = trunc i16 %27 to i8
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 7
store i8 %28, i8* %30
%31 = load i8*, i8** %5
%32 = getelementptr inbounds i8, i8* %31, i64 8
store i8 13, i8* %32
%33 = load i8*, i8** %5
%34 = getelementptr inbounds i8, i8* %33, i64 9
store i8 10, i8* %34
%35 = load i8*, i8** %5
%36 = getelementptr inbounds i8, i8* %35, i64 10
store i8 0, i8* %36
%37 = load i8*, i8** %5
%38 = load i8*, i8** %7
%39 = call i32 @strcat(i8* %37, i8* %38)
%40 = load i8*, i8** %5
%41 = call i32 @strcat(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%42 = load i8*, i8** %5
%43 = load i8*, i8** %8
%44 = call i32 @strcat(i8* %42, i8* %43)
%45 = load i8*, i8** %5
%46 = call i32 @strcat(i8* %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
@.str.1 = [5 x i8] c"\0D\0A\0D\0A\00"
define void @request_create(i8* %0, i16 signext %1, i8* %2, i8* %3) {
store i8 1, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 13, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 2
store i8 10, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 3
store i8 -1, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 4
store i8 13, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 5
store i8 10, i8* %9
%10 = lshr i16 %1, 8
%11 = trunc i16 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %11, i8* %12
%13 = trunc i16 %1 to i8
%14 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %13, i8* %14
%15 = getelementptr inbounds i8, i8* %0, i64 8
store i8 13, i8* %15
%16 = getelementptr inbounds i8, i8* %0, i64 9
store i8 10, i8* %16
%17 = getelementptr inbounds i8, i8* %0, i64 10
store i8 0, i8* %17
%18 = tail call i32 @strcat(i8* %0, i8* %2)
%19 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = tail call i32 @strcat(i8* %0, i8* %3)
%21 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}