#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*/ close(int);
int connect_to_daemon();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ print_usage();
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  int socket, t, i;
  char str[1024];
  if (argc == 1) {
    print_usage();
    return 1;
  } else if (argc == 2) {
    if (!(strcmp(argv[1], "q") == 0 || strcmp(argv[1], "l") == 0 ||
          strcmp(argv[1], "i") == 0 || strcmp(argv[1], "s") == 0 ||
          strcmp(argv[1], "r") == 0 || strcmp(argv[1], "8") == 0 ||
          strcmp(argv[1], "f") == 0)) {
      print_usage();
      return 1;
    }
  } else if (argc == 3) {
    if (!(strcmp(argv[1], "d") == 0)) {
      print_usage();
      return 1;
    }
  } else if (!(strcmp(argv[1], "a") == 0)) {
    print_usage();
    return 1;
  }
  if ((socket = connect_to_daemon()) == -1) {
    perror("q");
    return 1;
  }
  sprintf(str, "%s", argv[1]);
  for (i = 2; i < argc; i++)
    sprintf(str, "%s %s", str, argv[i]);
  if (send(socket, str, strlen(str), 0) == -1) {
    perror("q");
    return 1;
  }
  if ((t = recv(socket, str, 1024, 0)) > 0) {
    str[t] = '\0';
    printf("%s", str);
  } else {
    if (t < 0) {
      perror("recv");
    } else {
      printf("Server closed connection\n");
    }
    return 1;
  }
  close(socket);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11d6 <main+0x36>
mov    $0x0,%al
call   10c0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x321>
cmpl   $0x2,-0x8(%rbp)
jne    12ca <main+0x12a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe11(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     12c5 <main+0x125>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf5(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     12c5 <main+0x125>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd9(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     12c5 <main+0x125>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdcb(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     12c5 <main+0x125>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd9f(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     12c5 <main+0x125>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd83(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     12c5 <main+0x125>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd67(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     12c5 <main+0x125>
mov    $0x0,%al
call   10c0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x321>
jmp    1345 <main+0x1a5>
cmpl   $0x3,-0x8(%rbp)
jne    130a <main+0x16a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd29(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1305 <main+0x165>
mov    $0x0,%al
call   10c0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x321>
jmp    1340 <main+0x1a0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcf5(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     133b <main+0x19b>
mov    $0x0,%al
call   10c0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x321>
jmp    1340 <main+0x1a0>
jmp    1345 <main+0x1a5>
jmp    134a <main+0x1aa>
mov    $0x0,%al
call   1040 <connect_to_daemon@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1375 <main+0x1d5>
lea    0xc9c(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x321>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xc88(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
movl   $0x2,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13db <main+0x23b>
lea    -0x420(%rbp),%rdi
lea    -0x420(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xc4a(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1399 <main+0x1f9>
mov    -0x14(%rbp),%eax
mov    %eax,-0x42c(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x428(%rbp)
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x42c(%rbp),%edi
mov    -0x428(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
cmp    $0xffffffff,%eax
jne    1435 <main+0x295>
lea    0xbdc(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x321>
mov    -0x14(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jle    147d <main+0x2dd>
movslq -0x18(%rbp),%rax
movb   $0x0,-0x420(%rbp,%rax,1)
lea    -0x420(%rbp),%rsi
lea    0xba2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    14b2 <main+0x312>
cmpl   $0x0,-0x18(%rbp)
jge    1498 <main+0x2f8>
lea    0xb88(%rip),%rdi
call   10a0 <perror@plt>
jmp    14a6 <main+0x306>
lea    0xb7c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x321>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
cmp    $0x3,%edi
je     11f2 <main+0x32>
cmp    $0x2,%ebp
je     121c <main+0x5c>
cmp    $0x1,%ebp
je     120b <main+0x4b>
mov    0x8(%r15),%rdi
lea    0xe1e(%rip),%rsi
jmp    11fd <main+0x3d>
mov    0x8(%r15),%rdi
lea    0xe0f(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12aa <main+0xea>
xor    %eax,%eax
call   10e0 <print_usage@plt>
mov    $0x1,%ebx
jmp    1353 <main+0x193>
mov    0x8(%r15),%rdi
lea    0xdd9(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12aa <main+0xea>
mov    0x8(%r15),%rdi
lea    0xdc6(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12aa <main+0xea>
mov    0x8(%r15),%rdi
lea    0xdb3(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12aa <main+0xea>
mov    0x8(%r15),%rdi
lea    0xdae(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12aa <main+0xea>
mov    0x8(%r15),%rdi
lea    0xd8b(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12aa <main+0xea>
mov    0x8(%r15),%rdi
lea    0xd78(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12aa <main+0xea>
mov    0x8(%r15),%rdi
lea    0xd65(%rip),%rsi
jmp    11fd <main+0x3d>
xor    %eax,%eax
call   1040 <connect_to_daemon@plt>
cmp    $0xffffffff,%eax
je     137a <main+0x1ba>
mov    %eax,%r14d
mov    0x8(%r15),%rsi
mov    %rsp,%rdi
call   1050 <strcpy@plt>
cmp    $0x3,%ebp
jl     12fd <main+0x13d>
mov    %ebp,%r13d
mov    $0x2,%ebp
lea    0xd33(%rip),%r12
mov    %rsp,%rbx
mov    (%r15,%rbp,8),%rcx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   10d0 <sprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    12e0 <main+0x120>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1070 <strlen@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
cmp    $0xffffffff,%eax
je     137a <main+0x1ba>
mov    %rsp,%rsi
xor    %ebx,%ebx
mov    %r14d,%edi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
jle    1367 <main+0x1a7>
mov    %eax,%eax
movb   $0x0,(%rsp,%rax,1)
lea    0xcd2(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r14d,%edi
call   10a0 <close@plt>
mov    %ebx,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
js     138b <main+0x1cb>
lea    0xcab(%rip),%rdi
call   1060 <puts@plt>
jmp    1212 <main+0x52>
lea    0xc7f(%rip),%rdi
call   10c0 <perror@plt>
jmp    1212 <main+0x52>
lea    0xc84(%rip),%rdi
call   10c0 <perror@plt>
jmp    1212 <main+0x52>

LLVM IR (-O0):
@.str = [2 x i8] c"q\00"
@.str.1 = [2 x i8] c"l\00"
@.str.2 = [2 x i8] c"i\00"
@.str.3 = [2 x i8] c"s\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [2 x i8] c"8\00"
@.str.6 = [2 x i8] c"f\00"
@.str.7 = [2 x i8] c"d\00"
@.str.8 = [2 x i8] c"a\00"
@.str.9 = [3 x i8] c"%s\00"
@.str.10 = [6 x i8] c"%s %s\00"
@.str.11 = [5 x i8] c"recv\00"
@.str.12 = [26 x i8] c"Server closed connection\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @print_usage()
store i32 1, i32* %3
br label %143
14: ; preds = %2
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %62
17: ; preds = %14
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %61, label %23
23: ; preds = %17
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %61, label %29
29: ; preds = %23
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %61, label %35
35: ; preds = %29
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %61, label %41
41: ; preds = %35
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %61, label %47
47: ; preds = %41
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 1
%50 = load i8*, i8** %49
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %61, label %53
53: ; preds = %47
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %53
%60 = call i32 (...) @print_usage()
store i32 1, i32* %3
br label %143
61: ; preds = %53, %47, %41, %35, %29, %23, %17
br label %84
62: ; preds = %14
%63 = load i32, i32* %4
%64 = icmp eq i32 %63, 3
br i1 %64, label %65, label %74
65: ; preds = %62
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 1
%68 = load i8*, i8** %67
%69 = call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %73, label %71
71: ; preds = %65
%72 = call i32 (...) @print_usage()
store i32 1, i32* %3
br label %143
73: ; preds = %65
br label %83
74: ; preds = %62
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 1
%77 = load i8*, i8** %76
%78 = call i64 @strcmp(i8* %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br i1 %79, label %82, label %80
80: ; preds = %74
%81 = call i32 (...) @print_usage()
store i32 1, i32* %3
br label %143
82: ; preds = %74
br label %83
83: ; preds = %82, %73
br label %84
84: ; preds = %83, %61
br label %85
85: ; preds = %84
%86 = call i32 (...) @connect_to_daemon()
store i32 %86, i32* %6
%87 = icmp eq i32 %86, -1
br i1 %87, label %88, label %90
88: ; preds = %85
%89 = call i32 @perror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %143
90: ; preds = %85
%91 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 1
%94 = load i8*, i8** %93
%95 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %91, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %94)
store i32 2, i32* %8
br label %96
96: ; preds = %109, %90
%97 = load i32, i32* %8
%98 = load i32, i32* %4
%99 = icmp slt i32 %97, %98
br i1 %99, label %100, label %112
100: ; preds = %96
%101 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%102 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%103 = load i8**, i8*** %5
%104 = load i32, i32* %8
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %103, i64 %105
%107 = load i8*, i8** %106
%108 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %101, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* %102, i8* %107)
br label %109
109: ; preds = %100
%110 = load i32, i32* %8
%111 = add nsw i32 %110, 1
store i32 %111, i32* %8
br label %96
112: ; preds = %96
%113 = load i32, i32* %6
%114 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%115 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%116 = call i32 @strlen(i8* %115)
%117 = call i32 @send(i32 %113, i8* %114, i32 %116, i32 0)
%118 = icmp eq i32 %117, -1
br i1 %118, label %119, label %121
119: ; preds = %112
%120 = call i32 @perror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %143
121: ; preds = %112
%122 = load i32, i32* %6
%123 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%124 = call i32 @recv(i32 %122, i8* %123, i32 1024, i32 0)
store i32 %124, i32* %7
%125 = icmp sgt i32 %124, 0
br i1 %125, label %126, label %132
126: ; preds = %121
%127 = load i32, i32* %7
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %128
store i8 0, i8* %129
%130 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %130)
br label %140
132: ; preds = %121
%133 = load i32, i32* %7
%134 = icmp slt i32 %133, 0
br i1 %134, label %135, label %137
135: ; preds = %132
%136 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
br label %139
137: ; preds = %132
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0))
br label %139
139: ; preds = %137, %135
store i32 1, i32* %3
br label %143
140: ; preds = %126
%141 = load i32, i32* %6
%142 = call i32 @close(i32 %141)
store i32 0, i32* %3
br label %143
143: ; preds = %140, %139, %119, %88, %80, %71, %59, %12
%144 = load i32, i32* %3
ret i32 %144
}

LLVM IR (-O2):
@.str = [2 x i8] c"q\00"
@.str.1 = [2 x i8] c"l\00"
@.str.2 = [2 x i8] c"i\00"
@.str.3 = [2 x i8] c"s\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [2 x i8] c"8\00"
@.str.6 = [2 x i8] c"f\00"
@.str.7 = [2 x i8] c"d\00"
@.str.8 = [2 x i8] c"a\00"
@.str.9 = [3 x i8] c"%s\00"
@.str.10 = [6 x i8] c"%s %s\00"
@.str.11 = [5 x i8] c"recv\00"
@str = [25 x i8] c"Server closed connection\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
switch i32 %0, label %45 [
i32 1, label %5
i32 2, label %7
i32 3, label %38
]
5: ; preds = %2
%6 = tail call i32 (...) @print_usage()
br label %91
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %52, label %12
12: ; preds = %7
%13 = load i8*, i8** %8
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %52, label %16
16: ; preds = %12
%17 = load i8*, i8** %8
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %52, label %20
20: ; preds = %16
%21 = load i8*, i8** %8
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %52, label %24
24: ; preds = %20
%25 = load i8*, i8** %8
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %52, label %28
28: ; preds = %24
%29 = load i8*, i8** %8
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %52, label %32
32: ; preds = %28
%33 = load i8*, i8** %8
%34 = tail call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %52, label %36
36: ; preds = %32
%37 = tail call i32 (...) @print_usage()
br label %91
38: ; preds = %2
%39 = getelementptr inbounds i8*, i8** %1, i64 1
%40 = load i8*, i8** %39
%41 = tail call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %52, label %43
43: ; preds = %38
%44 = tail call i32 (...) @print_usage()
br label %91
45: ; preds = %2
%46 = getelementptr inbounds i8*, i8** %1, i64 1
%47 = load i8*, i8** %46
%48 = tail call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %45
%51 = tail call i32 (...) @print_usage()
br label %91
52: ; preds = %32, %28, %24, %20, %16, %12, %7, %45, %38
%53 = tail call i32 (...) @connect_to_daemon()
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = tail call i32 @perror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %91
57: ; preds = %52
%58 = getelementptr inbounds i8*, i8** %1, i64 1
%59 = load i8*, i8** %58
%60 = call i8* @strcpy(i8* %4, i8* dereferenceable(1) %59)
%61 = icmp sgt i32 %0, 2
br i1 %61, label %62, label %71
62: ; preds = %57
%63 = zext i32 %0 to i64
br label %64
64: ; preds = %62, %64
%65 = phi i64 [ 2, %62 ], [ %69, %64 ]
%66 = getelementptr inbounds i8*, i8** %1, i64 %65
%67 = load i8*, i8** %66
%68 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* %4, i8* %67)
%69 = add nuw nsw i64 %65, 1
%70 = icmp eq i64 %69, %63
br i1 %70, label %71, label %64
71: ; preds = %64, %57
%72 = call i32 @strlen(i8* %4)
%73 = call i32 @send(i32 %53, i8* %4, i32 %72, i32 0)
%74 = icmp eq i32 %73, -1
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = call i32 @perror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %91
77: ; preds = %71
%78 = call i32 @recv(i32 %53, i8* %4, i32 1024, i32 0)
%79 = icmp sgt i32 %78, 0
br i1 %79, label %80, label %85
80: ; preds = %77
%81 = zext i32 %78 to i64
%82 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %81
store i8 0, i8* %82
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %4)
%84 = call i32 @close(i32 %53)
br label %91
85: ; preds = %77
%86 = icmp slt i32 %78, 0
br i1 %86, label %87, label %89
87: ; preds = %85
%88 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
br label %91
89: ; preds = %85
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %91
91: ; preds = %87, %89, %80, %75, %55, %50, %43, %36, %5
%92 = phi i32 [ 1, %5 ], [ 1, %55 ], [ 1, %75 ], [ 0, %80 ], [ 1, %36 ], [ 1, %43 ], [ 1, %50 ], [ 1, %89 ], [ 1, %87 ]
ret i32 %92
}