#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 */
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(struct connection *, char *, int);
int strlen(char *);
void IProtoASK(struct connection *conn, char opcode, char *data) {
  do {
    char Ch = 19;
    Write(conn, &Ch, 1);
  } while (0);
  do {
    char Ch = opcode;
    Write(conn, &Ch, 1);
  } while (0);
  if (data)
    Write(conn, data, strlen(data));
  do {
    char Ch = 17;
    Write(conn, &Ch, 1);
  } while (0);
}


x86 assembly (clang, -O0):
<IProtoASK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x13,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x19(%rbp),%rsi
mov    $0x1,%edx
call   1040 <Write@plt>
jmp    1151 <IProtoASK+0x31>
mov    -0x9(%rbp),%al
mov    %al,-0x1a(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x1a(%rbp),%rsi
mov    $0x1,%edx
call   1040 <Write@plt>
cmpq   $0x0,-0x18(%rbp)
je     119c <IProtoASK+0x7c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1040 <Write@plt>
jmp    11a1 <IProtoASK+0x81>
movb   $0x11,-0x1b(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x1b(%rbp),%rsi
mov    $0x1,%edx
call   1040 <Write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IProtoASK>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
movb   $0x13,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1040 <Write@plt>
mov    %bpl,0xe(%rsp)
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <Write@plt>
test   %r14,%r14
je     1175 <IProtoASK+0x55>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <Write@plt>
movb   $0x11,0xd(%rsp)
lea    0xd(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <Write@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.connection = type { i32 }
define void @IProtoASK(%struct.connection* %0, i8 signext %1, i8* %2) {
%4 = alloca %struct.connection*
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store %struct.connection* %0, %struct.connection** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
br label %10
10: ; preds = %3
store i8 19, i8* %7
%11 = load %struct.connection*, %struct.connection** %4
%12 = call i32 @Write(%struct.connection* %11, i8* %7, i32 1)
br label %13
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load i8, i8* %5
store i8 %15, i8* %8
%16 = load %struct.connection*, %struct.connection** %4
%17 = call i32 @Write(%struct.connection* %16, i8* %8, i32 1)
br label %18
18: ; preds = %14
%19 = load i8*, i8** %6
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load %struct.connection*, %struct.connection** %4
%23 = load i8*, i8** %6
%24 = load i8*, i8** %6
%25 = call i32 @strlen(i8* %24)
%26 = call i32 @Write(%struct.connection* %22, i8* %23, i32 %25)
br label %27
27: ; preds = %21, %18
br label %28
28: ; preds = %27
store i8 17, i8* %9
%29 = load %struct.connection*, %struct.connection** %4
%30 = call i32 @Write(%struct.connection* %29, i8* %9, i32 1)
br label %31
31: ; preds = %28
ret void
}

LLVM IR (-O2):
%struct.connection = type { i32 }
define void @IProtoASK(%struct.connection* %0, i8 signext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 19, i8* %4
%7 = call i32 @Write(%struct.connection* %0, i8* %4, i32 1)
store i8 %1, i8* %5
%8 = call i32 @Write(%struct.connection* %0, i8* %5, i32 1)
%9 = icmp eq i8* %2, null
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = call i32 @strlen(i8* %2)
%12 = call i32 @Write(%struct.connection* %0, i8* %2, i32 %11)
br label %13
13: ; preds = %3, %10
store i8 17, i8* %6
%14 = call i32 @Write(%struct.connection* %0, i8* %6, i32 1)
ret void
}