#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*/ printf(char *);
int receive();
int receiveall();
int trasmit(int, char *);
int main(int argc, char *argv[]) {
  int Backmessage = -1;
  if (argc == 1) {
    printf("Please insert Arguments!\nInsert -h for help!\n");
  } else {
    char Mode[2];
    Mode[0] = argv[1][0];
    Mode[1] = argv[1][1];
    int Message_len = argc - 2;
    char Data[Message_len * 2];
    char datacount = 0;
    for (int i = 2; i < argc; i++) {
      char *tmppt = argv[i];
      while (*tmppt) {
        Data[datacount++] = *tmppt;
        tmppt++;
      }
    }
    Data[datacount++] = '\0';
    switch (Mode[0]) {
    case '-':
      switch (Mode[1]) {
      case 'b':
        printf("Transmit message and receive the answer.\n");
      case 'o':
        printf("Transmit message!\n");
        if (Message_len) {
          Backmessage = trasmit(Message_len, Data);
        } else
          printf("There is no Message to transmit!\n");
        if (Mode[1] == 'o' || !Message_len)
          break;
      case 'i':
        printf("Receive message!\n");
        Backmessage = receive();
        break;
      case 'd':
        printf("Receive message DEBUG!\n");
        Backmessage = receiveall();
        break;
      case 'h':
        printf("\n\n\nHausCom ---  Help!!!\n\n");
        printf("You can transmit an send data via the HausCom protocol, based "
               "on the MPC- Mode by Atmel. There are two directions you can "
               "choose:\n\n");
        printf("  -i: Input!   Here you can get data out of the UART. The data "
               "is printed in the file \"/dev/HausComI\" Please wait with "
               "reading this file until HausComC is closed by itself. Please "
               "notice that HausCom compare the XOR- checksum by itself and "
               "doesn't print it into the file!");
        printf("The Last sign is 255.");
        printf("\n\n  -o: Output!  Here you can write something in the UART. "
               "You have to write the message after \"-o\" in the commandline. "
               "Please don't write 255 at the end of the message, HausCom does "
               "it for you. Please notice that HausCom generates the XOR- "
               "checksum by itself, too!");
        printf("\n\nFor the configuration please use the file HausCom.conf. "
               "Insert \"PORT=[YOUR_PORT_NAME]\" for configure the UART- Port. "
               "For the Address please insert \"ADDRESS=[YOUR_ADDRESS]\".\n");
        printf("\n\n\n");
        break;
      default:
        printf("Please choose a direction!\nInsert -h for help! \n \n");
        break;
      }
      break;
    default:
      printf("Please choose a direction!\n");
      break;
    }
  }
  return Backmessage;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1178 <main+0x38>
lea    0xeca(%rip),%rdi
call   1050 <printf@plt>
jmp    13a0 <main+0x260>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%al
mov    %al,-0x16(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x1(%rax),%al
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movb   $0x0,-0x31(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    123b <main+0xfb>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmpb   $0x0,(%rax)
je     1228 <main+0xe8>
mov    -0x48(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    (%rcx),%dl
mov    -0x31(%rbp),%cl
mov    %cl,%sil
add    $0x1,%sil
mov    %sil,-0x31(%rbp)
movsbq %cl,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    11eb <main+0xab>
jmp    122d <main+0xed>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11cf <main+0x8f>
mov    -0x48(%rbp),%rax
movsbq -0x31(%rbp),%rcx
mov    %cl,%dl
add    $0x1,%dl
mov    %dl,-0x31(%rbp)
movb   $0x0,(%rax,%rcx,1)
mov    -0x16(%rbp),%al
sub    $0x2d,%al
jne    138d <main+0x24d>
jmp    1260 <main+0x120>
movsbl -0x15(%rbp),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x50(%rbp)
sub    $0xd,%eax
ja     137c <main+0x23c>
mov    -0x50(%rbp),%rax
lea    0xd7f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdd5(%rip),%rdi
call   1050 <printf@plt>
lea    0xdf3(%rip),%rdi
call   1050 <printf@plt>
cmpl   $0x0,-0x1c(%rbp)
je     12c0 <main+0x180>
mov    -0x48(%rbp),%rsi
mov    -0x1c(%rbp),%edi
call   1030 <trasmit@plt>
mov    %eax,-0x14(%rbp)
jmp    12cc <main+0x18c>
lea    0xddc(%rip),%rdi
call   1050 <printf@plt>
movsbl -0x15(%rbp),%eax
cmp    $0x6f,%eax
je     12e3 <main+0x1a3>
cmpl   $0x0,-0x1c(%rbp)
jne    12e8 <main+0x1a8>
jmp    1388 <main+0x248>
jmp    12ed <main+0x1ad>
lea    0xdd1(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <receive@plt>
mov    %eax,-0x14(%rbp)
jmp    1388 <main+0x248>
lea    0xdc8(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <receiveall@plt>
mov    %eax,-0x14(%rbp)
jmp    1388 <main+0x248>
lea    0xdc5(%rip),%rdi
call   1050 <printf@plt>
lea    0xdd3(%rip),%rdi
call   1050 <printf@plt>
lea    0xe4b(%rip),%rdi
call   1050 <printf@plt>
lea    0xf4f(%rip),%rdi
call   1050 <printf@plt>
lea    0xf59(%rip),%rdi
call   1050 <printf@plt>
lea    0x1057(%rip),%rdi
call   1050 <printf@plt>
lea    0x10fb(%rip),%rdi
call   1050 <printf@plt>
jmp    1388 <main+0x248>
lea    0x10ee(%rip),%rdi
call   1050 <printf@plt>
jmp    1399 <main+0x259>
lea    0x1110(%rip),%rdi
call   1050 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x14(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x1,%edi
jne    1176 <main+0x26>
lea    0x1320(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
jmp    1280 <main+0x130>
mov    %edi,%r14d
mov    %rsp,%r15
mov    0x8(%rsi),%rax
mov    (%rax),%r8b
movsbl 0x1(%rax),%r12d
lea    (%r14,%r14,1),%eax
add    $0xfffffffc,%eax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
cmp    $0x3,%edi
jl     11f7 <main+0xa7>
mov    %r14d,%r9d
mov    $0x2,%r10d
xor    %ecx,%ecx
jmp    11c9 <main+0x79>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r10
cmp    %r9,%r10
je     11f9 <main+0xa9>
mov    (%rsi,%r10,8),%rax
mov    (%rax),%dl
test   %dl,%dl
je     11c0 <main+0x70>
add    $0x1,%rax
nopw   0x0(%rax,%rax,1)
movsbq %cl,%rdi
add    $0x1,%cl
mov    %dl,(%rbx,%rdi,1)
movzbl (%rax),%edx
add    $0x1,%rax
test   %dl,%dl
jne    11e0 <main+0x90>
jmp    11c0 <main+0x70>
xor    %ecx,%ecx
movsbq %cl,%rax
movb   $0x0,(%rbx,%rax,1)
cmp    $0x2d,%r8b
jne    126c <main+0x11c>
lea    -0x62(%r12),%eax
cmp    $0xd,%eax
ja     128d <main+0x13d>
lea    0xde8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1204(%rip),%rdi
call   1030 <puts@plt>
add    $0xfffffffe,%r14d
lea    0x11c1(%rip),%rdi
call   1030 <puts@plt>
test   %r14d,%r14d
je     12ff <main+0x1af>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1040 <trasmit@plt>
cmp    $0x6f,%r12b
je     127d <main+0x12d>
lea    0x118a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <receive@plt>
jmp    127d <main+0x12d>
lea    0xff5(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
mov    %r15,%rsp
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x11c1(%rip),%rdi
jmp    1273 <main+0x123>
lea    0x1134(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <receiveall@plt>
jmp    127d <main+0x12d>
lea    0xfd1(%rip),%rdi
call   1030 <puts@plt>
lea    0xfde(%rip),%rdi
call   1030 <puts@plt>
lea    0xd6e(%rip),%rdi
call   1060 <printf@plt>
lea    0xe72(%rip),%rdi
call   1060 <printf@plt>
lea    0xe7c(%rip),%rdi
call   1060 <printf@plt>
lea    0x1031(%rip),%rdi
call   1030 <puts@plt>
lea    0x10d4(%rip),%rdi
jmp    1273 <main+0x123>
lea    0x1105(%rip),%rdi
jmp    1273 <main+0x123>

LLVM IR (-O0):
@.str = [46 x i8] c"Please insert Arguments!\0AInsert -h for help!\0A\00"
@.str.1 = [42 x i8] c"Transmit message and receive the answer.\0A\00"
@.str.2 = [19 x i8] c"Transmit message!\0A\00"
@.str.3 = [34 x i8] c"There is no Message to transmit!\0A\00"
@.str.4 = [18 x i8] c"Receive message!\0A\00"
@.str.5 = [24 x i8] c"Receive message DEBUG!\0A\00"
@.str.6 = [26 x i8] c"\0A\0A\0AHausCom --- Help!!!\0A\0A\00"
@.str.7 = [132 x i8] c"You can transmit an send data via the HausCom protocol, based on the MPC- Mode by Atmel. There are two directions you can choose:\0A\0A\00"
@.str.8 = [272 x i8] c" -i: Input! Here you can get data out of the UART. The data is printed in the file \22/dev/HausComI\22 Please wait with reading this file until HausComC is closed by itself. Please notice that HausCom compare the XOR- checksum by itself and doesn't print it into the file!\00"
@.str.9 = [22 x i8] c"The Last sign is 255.\00"
@.str.10 = [266 x i8] c"\0A\0A -o: Output! Here you can write something in the UART. You have to write the message after \22-o\22 in the commandline. Please don't write 255 at the end of the message, HausCom does it for you. Please notice that HausCom generates the XOR- checksum by itself, too!\00"
@.str.11 = [176 x i8] c"\0A\0AFor the configuration please use the file HausCom.conf. Insert \22PORT=[YOUR_PORT_NAME]\22 for configure the UART- Port. For the Address please insert \22ADDRESS=[YOUR_ADDRESS]\22.\0A\00"
@.str.12 = [4 x i8] c"\0A\0A\0A\00"
@.str.13 = [51 x i8] c"Please choose a direction!\0AInsert -h for help! \0A \0A\00"
@.str.14 = [28 x i8] c"Please choose a direction!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [2 x i8]
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8
%12 = alloca i32
%13 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %119
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 %23, i8* %24
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
store i8 %29, i8* %30
%31 = load i32, i32* %4
%32 = sub nsw i32 %31, 2
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = mul nsw i32 %33, 2
%35 = zext i32 %34 to i64
%36 = call i8* @llvm.stacksave()
store i8* %36, i8** %9
%37 = alloca i8, i64 %35
store i64 %35, i64* %10
store i8 0, i8* %11
store i32 2, i32* %12
br label %38
38: ; preds = %62, %18
%39 = load i32, i32* %12
%40 = load i32, i32* %4
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %65
42: ; preds = %38
%43 = load i8**, i8*** %5
%44 = load i32, i32* %12
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %43, i64 %45
%47 = load i8*, i8** %46
store i8* %47, i8** %13
br label %48
48: ; preds = %52, %42
%49 = load i8*, i8** %13
%50 = load i8, i8* %49
%51 = icmp ne i8 %50, 0
br i1 %51, label %52, label %61
52: ; preds = %48
%53 = load i8*, i8** %13
%54 = load i8, i8* %53
%55 = load i8, i8* %11
%56 = add i8 %55, 1
store i8 %56, i8* %11
%57 = sext i8 %55 to i64
%58 = getelementptr inbounds i8, i8* %37, i64 %57
store i8 %54, i8* %58
%59 = load i8*, i8** %13
%60 = getelementptr inbounds i8, i8* %59, i32 1
store i8* %60, i8** %13
br label %48
61: ; preds = %48
br label %62
62: ; preds = %61
%63 = load i32, i32* %12
%64 = add nsw i32 %63, 1
store i32 %64, i32* %12
br label %38
65: ; preds = %38
%66 = load i8, i8* %11
%67 = add i8 %66, 1
store i8 %67, i8* %11
%68 = sext i8 %66 to i64
%69 = getelementptr inbounds i8, i8* %37, i64 %68
store i8 0, i8* %69
%70 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
switch i32 %72, label %115 [
i32 45, label %73
]
73: ; preds = %65
%74 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
switch i32 %76, label %112 [
i32 98, label %77
i32 111, label %79
i32 105, label %98
i32 100, label %101
i32 104, label %104
]
77: ; preds = %73
%78 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
br label %79
79: ; preds = %73, %77
%80 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%81 = load i32, i32* %8
%82 = icmp ne i32 %81, 0
br i1 %82, label %83, label %86
83: ; preds = %79
%84 = load i32, i32* %8
%85 = call i32 @trasmit(i32 %84, i8* %37)
store i32 %85, i32* %6
br label %88
86: ; preds = %79
%87 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %88
88: ; preds = %86, %83
%89 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp eq i32 %91, 111
br i1 %92, label %96, label %93
93: ; preds = %88
%94 = load i32, i32* %8
%95 = icmp ne i32 %94, 0
br i1 %95, label %97, label %96
96: ; preds = %93, %88
br label %114
97: ; preds = %93
br label %98
98: ; preds = %73, %97
%99 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%100 = call i32 (...) @receive()
store i32 %100, i32* %6
br label %114
101: ; preds = %73
%102 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%103 = call i32 (...) @receiveall()
store i32 %103, i32* %6
br label %114
104: ; preds = %73
%105 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%106 = call i32 @printf(i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.7, i64 0, i64 0))
%107 = call i32 @printf(i8* getelementptr inbounds ([272 x i8], [272 x i8]* @.str.8, i64 0, i64 0))
%108 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%109 = call i32 @printf(i8* getelementptr inbounds ([266 x i8], [266 x i8]* @.str.10, i64 0, i64 0))
%110 = call i32 @printf(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.11, i64 0, i64 0))
%111 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
br label %114
112: ; preds = %73
%113 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.13, i64 0, i64 0))
br label %114
114: ; preds = %112, %104, %101, %98, %96
br label %117
115: ; preds = %65
%116 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
br label %117
117: ; preds = %115, %114
%118 = load i8*, i8** %9
br label %119
119: ; preds = %117, %16
%120 = load i32, i32* %6
ret i32 %120
}

LLVM IR (-O2):
@.str.8 = [272 x i8] c" -i: Input! Here you can get data out of the UART. The data is printed in the file \22/dev/HausComI\22 Please wait with reading this file until HausComC is closed by itself. Please notice that HausCom compare the XOR- checksum by itself and doesn't print it into the file!\00"
@.str.9 = [22 x i8] c"The Last sign is 255.\00"
@.str.10 = [266 x i8] c"\0A\0A -o: Output! Here you can write something in the UART. You have to write the message after \22-o\22 in the commandline. Please don't write 255 at the end of the message, HausCom does it for you. Please notice that HausCom generates the XOR- checksum by itself, too!\00"
@str = [27 x i8] c"Please choose a direction!\00"
@str.15 = [25 x i8] c"\0A\0A\0AHausCom --- Help!!!\0A\00"
@str.16 = [131 x i8] c"You can transmit an send data via the HausCom protocol, based on the MPC- Mode by Atmel. There are two directions you can choose:\0A\00"
@str.17 = [175 x i8] c"\0A\0AFor the configuration please use the file HausCom.conf. Insert \22PORT=[YOUR_PORT_NAME]\22 for configure the UART- Port. For the Address please insert \22ADDRESS=[YOUR_ADDRESS]\22.\00"
@str.18 = [3 x i8] c"\0A\0A\00"
@str.19 = [23 x i8] c"Receive message DEBUG!\00"
@str.20 = [17 x i8] c"Receive message!\00"
@str.21 = [18 x i8] c"Transmit message!\00"
@str.22 = [33 x i8] c"There is no Message to transmit!\00"
@str.23 = [41 x i8] c"Transmit message and receive the answer.\00"
@str.24 = [50 x i8] c"Please choose a direction!\0AInsert -h for help! \0A \00"
@str.25 = [45 x i8] c"Please insert Arguments!\0AInsert -h for help!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.25, i64 0, i64 0))
br label %78
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = add nsw i32 %0, -2
%13 = shl nsw i32 %12, 1
%14 = zext i32 %13 to i64
%15 = tail call i8* @llvm.stacksave()
%16 = alloca i8, i64 %14
%17 = icmp sgt i32 %0, 2
br i1 %17, label %18, label %20
18: ; preds = %6
%19 = zext i32 %0 to i64
br label %25
20: ; preds = %42, %6
%21 = phi i8 [ 0, %6 ], [ %43, %42 ]
%22 = sext i8 %21 to i64
%23 = getelementptr inbounds i8, i8* %16, i64 %22
store i8 0, i8* %23
%24 = icmp eq i8 %9, 45
br i1 %24, label %46, label %74
25: ; preds = %18, %42
%26 = phi i64 [ 2, %18 ], [ %44, %42 ]
%27 = phi i8 [ 0, %18 ], [ %43, %42 ]
%28 = getelementptr inbounds i8*, i8** %1, i64 %26
%29 = load i8*, i8** %28
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 0
br i1 %31, label %42, label %32
32: ; preds = %25, %32
%33 = phi i8 [ %40, %32 ], [ %30, %25 ]
%34 = phi i8* [ %39, %32 ], [ %29, %25 ]
%35 = phi i8 [ %36, %32 ], [ %27, %25 ]
%36 = add i8 %35, 1
%37 = sext i8 %35 to i64
%38 = getelementptr inbounds i8, i8* %16, i64 %37
store i8 %33, i8* %38
%39 = getelementptr inbounds i8, i8* %34, i64 1
%40 = load i8, i8* %39
%41 = icmp eq i8 %40, 0
br i1 %41, label %42, label %32
42: ; preds = %32, %25
%43 = phi i8 [ %27, %25 ], [ %36, %32 ]
%44 = add nuw nsw i64 %26, 1
%45 = icmp eq i64 %44, %19
br i1 %45, label %20, label %25
46: ; preds = %20
%47 = sext i8 %11 to i32
switch i32 %47, label %72 [
i32 98, label %48
i32 111, label %50
i32 105, label %58
i32 100, label %61
i32 104, label %64
]
48: ; preds = %46
%49 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.23, i64 0, i64 0))
br label %50
50: ; preds = %46, %48
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.21, i64 0, i64 0))
%52 = icmp eq i32 %12, 0
br i1 %52, label %53, label %55
53: ; preds = %50
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.22, i64 0, i64 0))
br label %76
55: ; preds = %50
%56 = call i32 @trasmit(i32 %12, i8* %16)
%57 = icmp eq i8 %11, 111
br i1 %57, label %76, label %58
58: ; preds = %55, %46
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.20, i64 0, i64 0))
%60 = call i32 (...) @receive()
br label %76
61: ; preds = %46
%62 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.19, i64 0, i64 0))
%63 = tail call i32 (...) @receiveall()
br label %76
64: ; preds = %46
%65 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.15, i64 0, i64 0))
%66 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([131 x i8], [131 x i8]* @str.16, i64 0, i64 0))
%67 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([272 x i8], [272 x i8]* @.str.8, i64 0, i64 0))
%68 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%69 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([266 x i8], [266 x i8]* @.str.10, i64 0, i64 0))
%70 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([175 x i8], [175 x i8]* @str.17, i64 0, i64 0))
%71 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.18, i64 0, i64 0))
br label %76
72: ; preds = %46
%73 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.24, i64 0, i64 0))
br label %76
74: ; preds = %20
%75 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %76
76: ; preds = %53, %58, %61, %64, %72, %55, %74
%77 = phi i32 [ -1, %72 ], [ -1, %64 ], [ %63, %61 ], [ %60, %58 ], [ %56, %55 ], [ -1, %74 ], [ -1, %53 ]
br label %78
78: ; preds = %76, %4
%79 = phi i32 [ -1, %4 ], [ %77, %76 ]
ret i32 %79
}