#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 */
typedef int /*<<< orphan*/ fileBuffer;

/* Variables and functions */
int /*<<< orphan*/ Notice(char *);
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ read(int, char *, int);
int /*<<< orphan*/ readMsg(int, char *, char *);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ sscanf(char *, char *, char *, char *);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ writeData(int, char *);
int /*<<< orphan*/ writeMsg(int, char *, char *);
void doShellMode(int socket) {
  char head[10 + 1], value[239 + 1];
  char buffer[239 + 1];
  char fileBuffer[512 + 1];
  int fd;
  while (1) {
    printf("SHELL #> ");
    fgets(buffer, 239 + 1, stdin);
    if (!strcmp(buffer, "usage") || !strcmp(buffer, "help")) {
      printf("usage: (add|delete) filename\n");
      continue;
    } else if (buffer[0] == '\n') {
      continue;
    }
    sscanf(buffer, "%s %s", head, value);
    if (!strcmp(head, "add")) {
      fd = open(value, O_RDONLY);
      if (fd == -1) {
        Notice("Cannot find ");
        printf("%s\n", value);
        continue;
      }
      writeMsg(socket, "ADD", value);
      readMsg(socket, head, value);
      if (strcmp(head, "ACT") != 0) {
        Notice("Denied by server.\n");
        continue;
      }
      writeMsg(socket, "CNK", "=====CHUNK=====");
      readMsg(socket, head, value);
      memset(fileBuffer, 0, sizeof(fileBuffer));
      while (0 < read(fd, fileBuffer, 512 - 1)) {
        writeData(socket, fileBuffer);
        readMsg(socket, head, value);
        memset(fileBuffer, 0, sizeof(fileBuffer));
      }
      writeData(socket, "=====CHUNK=====");
      close(fd);
      readMsg(socket, head, value);
    } else if (!strcmp(head, "delete")) {
      writeMsg(socket, "DEL", value);
      remove(value);
    } else {
      printf("Unknown command\n");
      printf("usage: (add|delete) filename\n");
      continue;
    }
  }
}


x86 assembly (clang, -O0):
<doShellMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1f0(%rbp),%rdi
mov    0x2de6(%rip),%rax
mov    (%rax),%edx
mov    $0xf0,%esi
call   1080 <fgets@plt>
lea    -0x1f0(%rbp),%rdi
lea    0xdf6(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1240 <doShellMode+0x70>
lea    -0x1f0(%rbp),%rdi
lea    0xddf(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1253 <doShellMode+0x83>
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11de <doShellMode+0xe>
movsbl -0x1f0(%rbp),%eax
cmp    $0xa,%eax
jne    1268 <doShellMode+0x98>
jmp    11de <doShellMode+0xe>
jmp    126d <doShellMode+0x9d>
lea    -0x1f0(%rbp),%rdi
lea    -0xf(%rbp),%rdx
lea    -0x100(%rbp),%rcx
lea    0xdad(%rip),%rsi
call   10b0 <sscanf@plt>
lea    -0xf(%rbp),%rdi
lea    0xda3(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1414 <doShellMode+0x244>
lea    -0x100(%rbp),%rdi
mov    0x2d35(%rip),%rax
mov    (%rax),%esi
call   10e0 <open@plt>
mov    %eax,-0x404(%rbp)
cmpl   $0xffffffff,-0x404(%rbp)
jne    12f3 <doShellMode+0x123>
lea    0xd69(%rip),%rdi
call   10d0 <Notice@plt>
lea    -0x100(%rbp),%rsi
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11de <doShellMode+0xe>
mov    -0x4(%rbp),%edi
lea    -0x100(%rbp),%rdx
lea    0xd4a(%rip),%rsi
call   10a0 <writeMsg@plt>
mov    -0x4(%rbp),%edi
lea    -0xf(%rbp),%rsi
lea    -0x100(%rbp),%rdx
call   10c0 <readMsg@plt>
lea    -0xf(%rbp),%rdi
lea    0xd2b(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1347 <doShellMode+0x177>
lea    0xd19(%rip),%rdi
call   10d0 <Notice@plt>
jmp    11de <doShellMode+0xe>
mov    -0x4(%rbp),%edi
lea    0xd18(%rip),%rsi
lea    0xd15(%rip),%rdx
call   10a0 <writeMsg@plt>
mov    -0x4(%rbp),%edi
lea    -0xf(%rbp),%rsi
lea    -0x100(%rbp),%rdx
call   10c0 <readMsg@plt>
lea    -0x400(%rbp),%rdi
xor    %esi,%esi
mov    $0x201,%edx
call   1050 <memset@plt>
mov    -0x404(%rbp),%edi
lea    -0x400(%rbp),%rsi
mov    $0x1ff,%edx
call   1070 <read@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jge    13e2 <doShellMode+0x212>
mov    -0x4(%rbp),%edi
lea    -0x400(%rbp),%rsi
call   10f0 <writeData@plt>
mov    -0x4(%rbp),%edi
lea    -0xf(%rbp),%rsi
lea    -0x100(%rbp),%rdx
call   10c0 <readMsg@plt>
lea    -0x400(%rbp),%rdi
xor    %esi,%esi
mov    $0x201,%edx
call   1050 <memset@plt>
jmp    1383 <doShellMode+0x1b3>
mov    -0x4(%rbp),%edi
lea    0xc81(%rip),%rsi
call   10f0 <writeData@plt>
mov    -0x404(%rbp),%edi
call   1060 <close@plt>
mov    -0x4(%rbp),%edi
lea    -0xf(%rbp),%rsi
lea    -0x100(%rbp),%rdx
call   10c0 <readMsg@plt>
jmp    147b <doShellMode+0x2ab>
lea    -0xf(%rbp),%rdi
lea    0xc5e(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1455 <doShellMode+0x285>
mov    -0x4(%rbp),%edi
lea    -0x100(%rbp),%rdx
lea    0xc45(%rip),%rsi
call   10a0 <writeMsg@plt>
lea    -0x100(%rbp),%rdi
call   1030 <remove@plt>
jmp    1476 <doShellMode+0x2a6>
lea    0xc2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11de <doShellMode+0xe>
jmp    147b <doShellMode+0x2ab>
jmp    11de <doShellMode+0xe>

x86 assembly (clang, -O2):
<doShellMode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3f8,%rsp
mov    %edi,%r13d
lea    0xe05(%rip),%r14
mov    0x2dde(%rip),%rbx
lea    0x10(%rsp),%r15
lea    0xdfc(%rip),%rbp
mov    %edi,(%rsp)
jmp    122c <doShellMode+0x4c>
lea    0xe4c(%rip),%rdi
call   1040 <puts@plt>
nop
lea    0xe4f(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%edx
mov    %r15,%rdi
mov    $0xf0,%esi
call   1090 <fgets@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1220 <doShellMode+0x40>
mov    %r15,%rdi
lea    0xdb1(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1220 <doShellMode+0x40>
cmpb   $0xa,0x10(%rsp)
je     122c <doShellMode+0x4c>
mov    %r15,%rdi
lea    0xd9b(%rip),%rsi
lea    0x5(%rsp),%r12
mov    %r12,%rdx
lea    0x100(%rsp),%r13
mov    %r13,%rcx
call   10c0 <sscanf@plt>
mov    %r12,%rdi
lea    0xd7f(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12e5 <doShellMode+0x105>
mov    %r12,%rdi
lea    0xdab(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    1213 <doShellMode+0x33>
mov    (%rsp),%edi
lea    0xd9a(%rip),%rsi
lea    0x100(%rsp),%r12
mov    %r12,%rdx
call   10b0 <writeMsg@plt>
mov    %r12,%rdi
call   1030 <remove@plt>
jmp    122c <doShellMode+0x4c>
mov    0x2cfc(%rip),%rax
mov    (%rax),%esi
mov    %r13,%rdi
call   10f0 <open@plt>
cmp    $0xffffffff,%eax
mov    %r13,%r12
je     134f <doShellMode+0x16f>
mov    %eax,%r14d
mov    (%rsp),%r13d
mov    %r13d,%edi
lea    0xd1d(%rip),%rsi
mov    %r12,%rdx
call   10b0 <writeMsg@plt>
mov    %r13d,%edi
lea    0x5(%rsp),%rbx
mov    %rbx,%rsi
mov    %r12,%rdx
call   10d0 <readMsg@plt>
mov    %rbx,%rdi
lea    0xcfc(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1368 <doShellMode+0x188>
lea    0xcef(%rip),%rdi
call   10e0 <Notice@plt>
jmp    1401 <doShellMode+0x221>
lea    0xcc9(%rip),%rdi
call   10e0 <Notice@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
jmp    1401 <doShellMode+0x221>
mov    %r13d,%edi
lea    0xcd5(%rip),%rsi
lea    0xcd2(%rip),%rdx
call   10b0 <writeMsg@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   10d0 <readMsg@plt>
lea    0x1f0(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x201,%edx
call   1060 <memset@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    $0x1ff,%edx
call   1080 <read@plt>
mov    %r13d,%edi
test   %rax,%rax
jle    13df <doShellMode+0x1ff>
mov    %rbp,%rsi
call   1100 <writeData@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   10d0 <readMsg@plt>
jmp    13a0 <doShellMode+0x1c0>
lea    0xc65(%rip),%rsi
call   1100 <writeData@plt>
mov    %r14d,%edi
call   1070 <close@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   10d0 <readMsg@plt>
lea    0xbf8(%rip),%r14
mov    0x2bd1(%rip),%rbx
lea    0xbf4(%rip),%rbp
jmp    122c <doShellMode+0x4c>

LLVM IR (-O0):
@.str = [10 x i8] c"SHELL #> \00"
@stdin = global i32 0
@.str.1 = [6 x i8] c"usage\00"
@.str.2 = [5 x i8] c"help\00"
@.str.3 = [30 x i8] c"usage: (add|delete) filename\0A\00"
@.str.4 = [6 x i8] c"%s %s\00"
@.str.5 = [4 x i8] c"add\00"
@O_RDONLY = global i32 0
@.str.6 = [13 x i8] c"Cannot find \00"
@.str.7 = [4 x i8] c"%s\0A\00"
@.str.8 = [4 x i8] c"ADD\00"
@.str.9 = [4 x i8] c"ACT\00"
@.str.10 = [19 x i8] c"Denied by server.\0A\00"
@.str.11 = [4 x i8] c"CNK\00"
@.str.12 = [16 x i8] c"=====CHUNK=====\00"
@.str.13 = [7 x i8] c"delete\00"
@.str.14 = [4 x i8] c"DEL\00"
@.str.15 = [17 x i8] c"Unknown command\0A\00"
define void @doShellMode(i32 %0) {
%2 = alloca i32
%3 = alloca [11 x i8]
%4 = alloca [240 x i8]
%5 = alloca [240 x i8]
%6 = alloca [513 x i8]
%7 = alloca i32
store i32 %0, i32* %2
br label %8
8: ; preds = %1, %20, %27, %43, %58, %103, %107
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [240 x i8], [240 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %10, i32 240, i32 %11)
%13 = getelementptr inbounds [240 x i8], [240 x i8]* %5, i64 0, i64 0
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %8
%17 = getelementptr inbounds [240 x i8], [240 x i8]* %5, i64 0, i64 0
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp ne i64 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %16, %8
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %8
22: ; preds = %16
%23 = getelementptr inbounds [240 x i8], [240 x i8]* %5, i64 0, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 10
br i1 %26, label %27, label %28
27: ; preds = %22
br label %8
28: ; preds = %22
br label %29
29: ; preds = %28
%30 = getelementptr inbounds [240 x i8], [240 x i8]* %5, i64 0, i64 0
%31 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%32 = getelementptr inbounds [240 x i8], [240 x i8]* %4, i64 0, i64 0
%33 = call i32 @sscanf(i8* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %31, i8* %32)
%34 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp ne i64 %35, 0
br i1 %36, label %93, label %37
37: ; preds = %29
%38 = getelementptr inbounds [240 x i8], [240 x i8]* %4, i64 0, i64 0
%39 = load i32, i32* @O_RDONLY
%40 = call i32 @open(i8* %38, i32 %39)
store i32 %40, i32* %7
%41 = load i32, i32* %7
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %47
43: ; preds = %37
%44 = call i32 @Notice(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%45 = getelementptr inbounds [240 x i8], [240 x i8]* %4, i64 0, i64 0
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %45)
br label %8
47: ; preds = %37
%48 = load i32, i32* %2
%49 = getelementptr inbounds [240 x i8], [240 x i8]* %4, i64 0, i64 0
%50 = call i32 @writeMsg(i32 %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %49)
%51 = load i32, i32* %2
%52 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%53 = getelementptr inbounds [240 x i8], [240 x i8]* %4, i64 0, i64 0
%54 = call i32 @readMsg(i32 %51, i8* %52, i8* %53)
%55 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%56 = call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%57 = icmp ne i64 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %47
%59 = call i32 @Notice(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
br label %8
60: ; preds = %47
%61 = load i32, i32* %2
%62 = call i32 @writeMsg(i32 %61, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
%63 = load i32, i32* %2
%64 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%65 = getelementptr inbounds [240 x i8], [240 x i8]* %4, i64 0, i64 0
%66 = call i32 @readMsg(i32 %63, i8* %64, i8* %65)
%67 = getelementptr inbounds [513 x i8], [513 x i8]* %6, i64 0, i64 0
%68 = call i32 @memset(i8* %67, i32 0, i32 513)
br label %69
69: ; preds = %74, %60
%70 = load i32, i32* %7
%71 = getelementptr inbounds [513 x i8], [513 x i8]* %6, i64 0, i64 0
%72 = call i64 @read(i32 %70, i8* %71, i32 511)
%73 = icmp slt i64 0, %72
br i1 %73, label %74, label %84
74: ; preds = %69
%75 = load i32, i32* %2
%76 = getelementptr inbounds [513 x i8], [513 x i8]* %6, i64 0, i64 0
%77 = call i32 @writeData(i32 %75, i8* %76)
%78 = load i32, i32* %2
%79 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%80 = getelementptr inbounds [240 x i8], [240 x i8]* %4, i64 0, i64 0
%81 = call i32 @readMsg(i32 %78, i8* %79, i8* %80)
%82 = getelementptr inbounds [513 x i8], [513 x i8]* %6, i64 0, i64 0
%83 = call i32 @memset(i8* %82, i32 0, i32 513)
br label %69
84: ; preds = %69
%85 = load i32, i32* %2
%86 = call i32 @writeData(i32 %85, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
%87 = load i32, i32* %7
%88 = call i32 @close(i32 %87)
%89 = load i32, i32* %2
%90 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%91 = getelementptr inbounds [240 x i8], [240 x i8]* %4, i64 0, i64 0
%92 = call i32 @readMsg(i32 %89, i8* %90, i8* %91)
br label %107
93: ; preds = %29
%94 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%96 = icmp ne i64 %95, 0
br i1 %96, label %103, label %97
97: ; preds = %93
%98 = load i32, i32* %2
%99 = getelementptr inbounds [240 x i8], [240 x i8]* %4, i64 0, i64 0
%100 = call i32 @writeMsg(i32 %98, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8* %99)
%101 = getelementptr inbounds [240 x i8], [240 x i8]* %4, i64 0, i64 0
%102 = call i32 @remove(i8* %101)
br label %106
103: ; preds = %93
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %8
106: ; preds = %97
br label %107
107: ; preds = %106, %84
br label %8
}

LLVM IR (-O2):
@.str = [10 x i8] c"SHELL #> \00"
@stdin = global i32 0
@.str.1 = [6 x i8] c"usage\00"
@.str.2 = [5 x i8] c"help\00"
@.str.4 = [6 x i8] c"%s %s\00"
@.str.5 = [4 x i8] c"add\00"
@O_RDONLY = global i32 0
@.str.6 = [13 x i8] c"Cannot find \00"
@.str.8 = [4 x i8] c"ADD\00"
@.str.9 = [4 x i8] c"ACT\00"
@.str.10 = [19 x i8] c"Denied by server.\0A\00"
@.str.11 = [4 x i8] c"CNK\00"
@.str.12 = [16 x i8] c"=====CHUNK=====\00"
@.str.13 = [7 x i8] c"delete\00"
@.str.14 = [4 x i8] c"DEL\00"
@str.16 = [16 x i8] c"Unknown command\00"
@str.17 = [29 x i8] c"usage: (add|delete) filename\00"
define void @doShellMode(i32 %0) {
%2 = alloca [11 x i8]
%3 = alloca [240 x i8]
%4 = alloca [240 x i8]
%5 = alloca [513 x i8]
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [240 x i8], [240 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [240 x i8], [240 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [513 x i8], [513 x i8]* %5, i64 0, i64 0
br label %10
10: ; preds = %58, %1
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stdin
%13 = call i32 @fgets(i8* %8, i32 240, i32 %12)
%14 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %10
%17 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16, %10
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.17, i64 0, i64 0))
br label %58
21: ; preds = %16
%22 = load i8, i8* %8
%23 = icmp eq i8 %22, 10
br i1 %23, label %58, label %24
24: ; preds = %21
%25 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %6, i8* %7)
%26 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %59
28: ; preds = %24
%29 = load i32, i32* @O_RDONLY
%30 = call i32 @open(i8* %7, i32 %29)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = call i32 @Notice(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%34 = call i32 @puts(i8* %7)
br label %58
35: ; preds = %28
%36 = call i32 @writeMsg(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %7)
%37 = call i32 @readMsg(i32 %0, i8* %6, i8* %7)
%38 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %35
%41 = call i32 @Notice(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
br label %58
42: ; preds = %35
%43 = call i32 @writeMsg(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
%44 = call i32 @readMsg(i32 %0, i8* %6, i8* %7)
%45 = call i32 @memset(i8* %9, i32 0, i32 513)
%46 = call i64 @read(i32 %30, i8* %9, i32 511)
%47 = icmp sgt i64 %46, 0
br i1 %47, label %48, label %54
48: ; preds = %42, %48
%49 = call i32 @writeData(i32 %0, i8* %9)
%50 = call i32 @readMsg(i32 %0, i8* %6, i8* %7)
%51 = call i32 @memset(i8* %9, i32 0, i32 513)
%52 = call i64 @read(i32 %30, i8* %9, i32 511)
%53 = icmp sgt i64 %52, 0
br i1 %53, label %48, label %54
54: ; preds = %48, %42
%55 = call i32 @writeData(i32 %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
%56 = call i32 @close(i32 %30)
%57 = call i32 @readMsg(i32 %0, i8* %6, i8* %7)
br label %58
58: ; preds = %54, %62, %19, %32, %40, %65, %21
br label %10
59: ; preds = %24
%60 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = call i32 @writeMsg(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8* %7)
%64 = call i32 @remove(i8* %7)
br label %58
65: ; preds = %59
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.16, i64 0, i64 0))
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.17, i64 0, i64 0))
br label %58
}