#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*/ perror(char *);
int sendBinary(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
int sendGetAllObjectBid() {
  int length = 6;
  char msg[length + 1];
  strcpy(msg, "GET");
  msg[strlen("GET")] = ' ';
  msg[length - 2] = ';';
  msg[length - 1] = '\n';
  msg[length] = '\0';
  if (sendBinary(msg, length) == -1) {
    perror("sendGet error.");
    return -20;
  }
  return -10;
}


x86 assembly (clang, -O0):
<sendGetAllObjectBid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x6,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
lea    0xe81(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xe75(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
movb   $0x20,(%rdi,%rax,1)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
cltq
movb   $0x3b,(%rdi,%rax,1)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0xa,(%rdi,%rax,1)
movslq -0x8(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
mov    -0x8(%rbp),%esi
call   1060 <sendBinary@plt>
cmp    $0xffffffff,%eax
jne    11e8 <sendGetAllObjectBid+0xa8>
lea    0xe34(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffec,-0x4(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    11f6 <sendGetAllObjectBid+0xb6>
movl   $0xfffffff6,-0x4(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendGetAllObjectBid>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
movl   $0xa3b20,0x3(%rsp)
mov    %rbx,%rdi
mov    $0x6,%esi
call   1050 <sendBinary@plt>
mov    %eax,%ecx
mov    $0xfffffff6,%eax
cmp    $0xffffffff,%ecx
je     116e <sendGetAllObjectBid+0x3e>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe8f(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffec,%eax
jmp    1168 <sendGetAllObjectBid+0x38>

LLVM IR (-O0):
@.str = [4 x i8] c"GET\00"
@.str.1 = [15 x i8] c"sendGet error.\00"
define i32 @sendGetAllObjectBid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i32 6, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i8, i64 %8
store i64 %8, i64* %4
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = call i64 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 32, i8* %13
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %10, i64 %16
store i8 59, i8* %17
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %10, i64 %20
store i8 10, i8* %21
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %10, i64 %23
store i8 0, i8* %24
%25 = load i32, i32* %2
%26 = call i32 @sendBinary(i8* %10, i32 %25)
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %30
28: ; preds = %0
%29 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i32 -20, i32* %1
store i32 1, i32* %5
br label %31
30: ; preds = %0
store i32 -10, i32* %1
store i32 1, i32* %5
br label %31
31: ; preds = %30, %28
%32 = load i8*, i8** %3
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [4 x i8] c"GET\00"
@.str.1 = [15 x i8] c"sendGet error.\00"
define i32 @sendGetAllObjectBid() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 3
store i8 32, i8* %4
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 4
store i8 59, i8* %5
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 5
store i8 10, i8* %6
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 6
store i8 0, i8* %7
%8 = call i32 @sendBinary(i8* %2, i32 6)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %0, %10
%13 = phi i32 [ -20, %10 ], [ -10, %0 ]
ret i32 %13
}