#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  char sin_zero;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ MP_get_ext(char *, char *, int);
int /*<<< orphan*/ SOCK_DGRAM;
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ htons(int);
scalar_t__ memcmp(char *, char *, int);
int /*<<< orphan*/ memcpy(char *, char *, scalar_t__);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int sendto(int, char *, scalar_t__, int /*<<< orphan*/, struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ system(char *);
int main(void) {
  int sockfd;
  struct sockaddr_in my_addr;
  struct sockaddr_in their_addr;
  int addr_len, numbytes;
  FILE *fp;
  char buf[128], buf_tmp[128], pre_result[128];
  if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
    perror("socket");
    exit(1);
  }
  my_addr.sin_family = AF_INET;
  my_addr.sin_port = htons(9034);
  my_addr.sin_addr.s_addr = INADDR_ANY;
  memset(&(my_addr.sin_zero), '\0', 8);
  if (bind(sockfd, (struct sockaddr *)&my_addr, sizeof(struct sockaddr)) ==
      -1) {
    perror("bind");
    close(sockfd);
    exit(1);
  }
  addr_len = sizeof(struct sockaddr);
  printf("MP AUTOMATION daemon (ver 1.0)\n");
  while (1) {
    memset(buf, 0, 128);
    if ((numbytes = recvfrom(sockfd, buf, 128, 0,
                             (struct sockaddr *)&their_addr, &addr_len)) ==
        -1) {
      fprintf(stderr, "Receive failed!!!\n");
      close(sockfd);
      exit(1);
    }
    if (!memcmp(buf, "query", 5)) {
      strcpy(buf, pre_result);
    } else {
      if (!memcmp(buf, "flash get", 9))
        sprintf(pre_result, "%s > /tmp/MP.txt ok", buf);
      else
        sprintf(pre_result, "%s ok", buf);
      if (!memcmp(buf, "iwpriv wlan0 mp_brx stop", 24)) {
        strcpy(buf, "stop");
        MP_get_ext("wlan0", buf, 0x8B73);
      } else if (!memcmp(buf, "iwpriv wlan0 mp_tx", 18) && buf[18] == ' ') {
        memcpy(buf_tmp, buf + 19, strlen(buf) - 19);
        MP_get_ext("wlan0", buf_tmp, 0x8B71);
        strcpy(buf, buf_tmp);
      } else if (!memcmp(buf, "probe", 5))
        strcpy(buf, "ack");
      else if (!memcmp(buf, "verify_flw", 10)) {
        if ((fp = fopen("/tmp/MP.txt", "r")) == NULL)
          fprintf(stderr, "opening MP.txt failed !\n");
        if (fp) {
          fgets(buf, 128, fp);
          buf[128 - 1] = '\0';
          fclose(fp);
        }
      } else {
        if (!memcmp(buf, "flash get", 9))
          strcat(buf, " > /tmp/MP.txt");
        if (!memcmp(buf, "flash set", 9)) {
          if ((numbytes = sendto(sockfd, pre_result, strlen(pre_result), 0,
                                 (struct sockaddr *)&their_addr,
                                 sizeof(struct sockaddr))) == -1) {
            fprintf(stderr, "send failed\n");
            close(sockfd);
            exit(1);
          }
        }
        system(buf);
      }
      strcpy(buf_tmp, pre_result);
      strcpy(pre_result, buf);
      strcpy(buf, buf_tmp);
    }
    if (memcmp(buf, "flash set", 9) != 0) {
      if ((numbytes = sendto(sockfd, buf, strlen(buf), 0,
                             (struct sockaddr *)&their_addr,
                             sizeof(struct sockaddr))) == -1) {
        fprintf(stderr, "send failed\n");
        close(sockfd);
        exit(1);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2d6f(%rip),%rax
mov    (%rax),%edi
mov    0x2d56(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1180 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    12ad <main+0x4d>
lea    0xd62(%rip),%rdi
call   1140 <perror@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
mov    0x2d34(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x234a,%edi
call   1070 <htons@plt>
mov    %eax,-0x10(%rbp)
mov    0x2d13(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   10a0 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1120 <bind@plt>
cmp    $0xffffffff,%eax
jne    131a <main+0xba>
lea    0xd04(%rip),%rdi
call   1140 <perror@plt>
mov    -0x8(%rbp),%edi
call   10c0 <close@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
movl   $0x4,-0x2c(%rbp)
lea    0xce4(%rip),%rdi
call   1080 <printf@plt>
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   10a0 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0xc0(%rbp),%rsi
lea    -0x28(%rbp),%r8
mov    $0x80,%edx
xor    %ecx,%ecx
lea    -0x2c(%rbp),%r9
call   1110 <recvfrom@plt>
mov    %eax,-0x30(%rbp)
cmp    $0xffffffff,%eax
jne    1391 <main+0x131>
mov    0x2c57(%rip),%rax
mov    (%rax),%edi
lea    0xcb2(%rip),%rsi
call   10f0 <fprintf@plt>
mov    -0x8(%rbp),%edi
call   10c0 <close@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
lea    -0xc0(%rbp),%rdi
lea    0xca0(%rip),%rsi
mov    $0x5,%edx
call   10d0 <memcmp@plt>
cmp    $0x0,%rax
jne    13cb <main+0x16b>
lea    -0xc0(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    170b <main+0x4ab>
lea    -0xc0(%rbp),%rdi
lea    0xc6c(%rip),%rsi
mov    $0x9,%edx
call   10d0 <memcmp@plt>
cmp    $0x0,%rax
jne    140c <main+0x1ac>
lea    -0x1c0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xc4d(%rip),%rsi
call   1160 <sprintf@plt>
jmp    1426 <main+0x1c6>
lea    -0x1c0(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xc42(%rip),%rsi
call   1160 <sprintf@plt>
lea    -0xc0(%rbp),%rdi
lea    0xc35(%rip),%rsi
mov    $0x18,%edx
call   10d0 <memcmp@plt>
cmp    $0x0,%rax
jne    1478 <main+0x218>
lea    -0xc0(%rbp),%rdi
lea    0xc27(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xc0(%rbp),%rsi
lea    0xc19(%rip),%rdi
mov    $0x8b73,%edx
call   1090 <MP_get_ext@plt>
jmp    16d2 <main+0x472>
lea    -0xc0(%rbp),%rdi
lea    0xc02(%rip),%rsi
mov    $0x12,%edx
call   10d0 <memcmp@plt>
cmp    $0x0,%rax
jne    1520 <main+0x2c0>
movsbl -0xae(%rbp),%eax
cmp    $0x20,%eax
jne    1520 <main+0x2c0>
lea    -0x140(%rbp),%rax
mov    %rax,-0x1d0(%rbp)
lea    -0xc0(%rbp),%rax
add    $0x13,%rax
mov    %rax,-0x1c8(%rbp)
lea    -0xc0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x1d0(%rbp),%rdi
mov    -0x1c8(%rbp),%rsi
mov    %rax,%rdx
sub    $0x13,%rdx
call   1100 <memcpy@plt>
lea    -0x140(%rbp),%rsi
lea    0xb84(%rip),%rdi
mov    $0x8b71,%edx
call   1090 <MP_get_ext@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x140(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    16cd <main+0x46d>
lea    -0xc0(%rbp),%rdi
lea    0xb6d(%rip),%rsi
mov    $0x5,%edx
call   10d0 <memcmp@plt>
cmp    $0x0,%rax
jne    155a <main+0x2fa>
lea    -0xc0(%rbp),%rdi
lea    0xb51(%rip),%rsi
call   1030 <strcpy@plt>
jmp    16c8 <main+0x468>
lea    -0xc0(%rbp),%rdi
lea    0xb3d(%rip),%rsi
mov    $0xa,%edx
call   10d0 <memcmp@plt>
cmp    $0x0,%rax
jne    15e4 <main+0x384>
lea    0xb4b(%rip),%rdi
lea    0xb26(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    15b2 <main+0x352>
mov    0x2a24(%rip),%rax
mov    (%rax),%edi
lea    0xb05(%rip),%rsi
call   10f0 <fprintf@plt>
cmpq   $0x0,-0x38(%rbp)
je     15df <main+0x37f>
lea    -0xc0(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x80,%esi
call   10e0 <fgets@plt>
movb   $0x0,-0x41(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
jmp    16c3 <main+0x463>
lea    -0xc0(%rbp),%rdi
lea    0xa53(%rip),%rsi
mov    $0x9,%edx
call   10d0 <memcmp@plt>
cmp    $0x0,%rax
jne    1619 <main+0x3b9>
lea    -0xc0(%rbp),%rdi
lea    0xab7(%rip),%rsi
call   1150 <strcat@plt>
lea    -0xc0(%rbp),%rdi
lea    0xab3(%rip),%rsi
mov    $0x9,%edx
call   10d0 <memcmp@plt>
cmp    $0x0,%rax
jne    16b7 <main+0x457>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1dc(%rbp)
lea    -0x1c0(%rbp),%rax
mov    %rax,-0x1d8(%rbp)
lea    -0x1c0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x1dc(%rbp),%edi
mov    -0x1d8(%rbp),%rsi
mov    %rax,%rdx
lea    -0x28(%rbp),%r8
xor    %ecx,%ecx
mov    $0x4,%r9d
call   10b0 <sendto@plt>
mov    %eax,-0x30(%rbp)
cmp    $0xffffffff,%eax
jne    16b2 <main+0x452>
mov    0x2936(%rip),%rax
mov    (%rax),%edi
lea    0xa49(%rip),%rsi
call   10f0 <fprintf@plt>
mov    -0x8(%rbp),%edi
call   10c0 <close@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
jmp    16b7 <main+0x457>
lea    -0xc0(%rbp),%rdi
call   1060 <system@plt>
jmp    16c8 <main+0x468>
jmp    16cd <main+0x46d>
jmp    16d2 <main+0x472>
lea    -0x140(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x1c0(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x140(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xc0(%rbp),%rdi
lea    0x9c1(%rip),%rsi
mov    $0x9,%edx
call   10d0 <memcmp@plt>
cmp    $0x0,%rax
je     17a9 <main+0x549>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1ec(%rbp)
lea    -0xc0(%rbp),%rax
mov    %rax,-0x1e8(%rbp)
lea    -0xc0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x1ec(%rbp),%edi
mov    -0x1e8(%rbp),%rsi
mov    %rax,%rdx
lea    -0x28(%rbp),%r8
xor    %ecx,%ecx
mov    $0x4,%r9d
call   10b0 <sendto@plt>
mov    %eax,-0x30(%rbp)
cmp    $0xffffffff,%eax
jne    17a4 <main+0x544>
mov    0x2844(%rip),%rax
mov    (%rax),%edi
lea    0x957(%rip),%rsi
call   10f0 <fprintf@plt>
mov    -0x8(%rbp),%edi
call   10c0 <close@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
jmp    17a9 <main+0x549>
jmp    132d <main+0xcd>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1b8,%rsp
mov    0x2d70(%rip),%rbx
mov    (%rbx),%edi
mov    0x2d57(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1180 <socket@plt>
cmp    $0xffffffff,%eax
jne    12a5 <main+0x45>
lea    0xd6a(%rip),%rdi
call   1140 <perror@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
mov    %eax,%r12d
mov    (%rbx),%eax
mov    %eax,0x1c(%rsp)
mov    $0x234a,%edi
call   1080 <htons@plt>
mov    %eax,0x18(%rsp)
mov    0x2d1d(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   10a0 <memset@plt>
mov    %r12d,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1120 <bind@plt>
cmp    $0xffffffff,%eax
jne    1303 <main+0xa3>
lea    0xd0e(%rip),%rdi
call   1140 <perror@plt>
jmp    164d <main+0x3ed>
movl   $0x4,0xc(%rsp)
lea    0xdbf(%rip),%rdi
call   1040 <puts@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   10a0 <memset@plt>
lea    0x20(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %r12d,%edi
mov    %rbx,%rsi
mov    $0x80,%edx
xor    %ecx,%ecx
call   1110 <recvfrom@plt>
cmp    $0xffffffff,%eax
jne    1361 <main+0x101>
mov    0x2c75(%rip),%rax
mov    (%rax),%edi
lea    0xcb0(%rip),%rsi
jmp    1648 <main+0x3e8>
lea    0x43(%rsp),%r13
lea    0xb0(%rsp),%rbx
lea    0x30(%rsp),%rbp
lea    0x20(%rsp),%r14
lea    0x130(%rsp),%r15
jmp    13be <main+0x15e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   10a0 <memset@plt>
mov    %r12d,%edi
mov    %rbp,%rsi
mov    $0x80,%edx
xor    %ecx,%ecx
mov    %r14,%r8
lea    0xc(%rsp),%r9
call   1110 <recvfrom@plt>
cmp    $0xffffffff,%eax
je     134c <main+0xec>
mov    %rbp,%rdi
lea    0xc57(%rip),%rsi
mov    $0x5,%edx
call   10d0 <memcmp@plt>
mov    %rbx,%rsi
test   %rax,%rax
je     15e9 <main+0x389>
mov    %rbp,%rdi
lea    0xc3d(%rip),%rsi
mov    $0x9,%edx
call   10d0 <memcmp@plt>
test   %rax,%rax
lea    0xc47(%rip),%rsi
lea    0xc2c(%rip),%rax
cmove  %rax,%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1160 <sprintf@plt>
mov    %rbp,%rdi
lea    0xc2d(%rip),%rsi
mov    $0x18,%edx
call   10d0 <memcmp@plt>
mov    %rbp,%rdi
test   %rax,%rax
je     1490 <main+0x230>
lea    0xc33(%rip),%rsi
mov    $0x12,%edx
call   10d0 <memcmp@plt>
test   %rax,%rax
jne    14b5 <main+0x255>
cmpb   $0x20,0x42(%rsp)
jne    14b5 <main+0x255>
mov    %rbp,%rdi
call   1060 <strlen@plt>
lea    -0x13(%rax),%rdx
mov    %r15,%rdi
mov    %r13,%rsi
call   1100 <memcpy@plt>
lea    0xbf9(%rip),%rdi
mov    %r15,%rsi
mov    $0x8b71,%edx
call   1090 <MP_get_ext@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
jmp    15d0 <main+0x370>
cs nopw 0x0(%rax,%rax,1)
lea    0xbc6(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xbbf(%rip),%rdi
mov    %rbp,%rsi
mov    $0x8b73,%edx
call   1090 <MP_get_ext@plt>
jmp    15d0 <main+0x370>
mov    %rbp,%rdi
lea    0xbbc(%rip),%rsi
mov    $0x5,%edx
call   10d0 <memcmp@plt>
mov    %rbp,%rdi
test   %rax,%rax
je     1564 <main+0x304>
lea    0xba9(%rip),%rsi
mov    $0xa,%edx
call   10d0 <memcmp@plt>
test   %rax,%rax
je     1572 <main+0x312>
mov    %rbp,%rdi
lea    0xb2c(%rip),%rsi
mov    $0x9,%edx
call   10d0 <memcmp@plt>
test   %rax,%rax
jne    1517 <main+0x2b7>
mov    %rbp,%rdi
lea    0xb99(%rip),%rsi
call   1150 <strcat@plt>
mov    %rbp,%rdi
lea    0xb99(%rip),%rsi
mov    $0x9,%edx
call   10d0 <memcmp@plt>
test   %rax,%rax
jne    155a <main+0x2fa>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r12d,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %ecx,%ecx
mov    %r14,%r8
mov    $0x4,%r9d
call   10b0 <sendto@plt>
cmp    $0xffffffff,%eax
je     1638 <main+0x3d8>
mov    %rbp,%rdi
call   1070 <system@plt>
jmp    15d0 <main+0x370>
lea    0xb16(%rip),%rsi
call   1030 <strcpy@plt>
jmp    15d0 <main+0x370>
lea    0xb35(%rip),%rdi
lea    0xb10(%rip),%rsi
call   1130 <fopen@plt>
test   %rax,%rax
je     15af <main+0x34f>
mov    %rax,%r13
mov    %rbp,%rdi
mov    $0x80,%esi
mov    %rax,%rdx
call   10e0 <fgets@plt>
movb   $0x0,0xaf(%rsp)
mov    %r13,%rdi
call   1050 <fclose@plt>
jmp    15c4 <main+0x364>
mov    0x2a12(%rip),%rax
mov    (%rax),%edi
lea    0xad3(%rip),%rsi
call   10f0 <fprintf@plt>
lea    0x43(%rsp),%r13
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rsi
mov    %rbp,%rdi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
lea    0xabf(%rip),%rsi
mov    $0x9,%edx
call   10d0 <memcmp@plt>
test   %rax,%rax
je     1390 <main+0x130>
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %r12d,%edi
mov    %rbp,%rsi
mov    %rax,%rdx
xor    %ecx,%ecx
mov    %r14,%r8
mov    $0x4,%r9d
call   10b0 <sendto@plt>
cmp    $0xffffffff,%eax
jne    1390 <main+0x130>
mov    0x2989(%rip),%rax
mov    (%rax),%edi
lea    0xa7c(%rip),%rsi
call   10f0 <fprintf@plt>
mov    %r12d,%edi
call   10c0 <close@plt>
mov    $0x1,%edi
call   1170 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i8, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [7 x i8] c"socket\00"
@INADDR_ANY = global i32 0
@.str.1 = [5 x i8] c"bind\00"
@.str.2 = [32 x i8] c"MP AUTOMATION daemon (ver 1.0)\0A\00"
@stderr = global i32 0
@.str.3 = [19 x i8] c"Receive failed!!!\0A\00"
@.str.4 = [6 x i8] c"query\00"
@.str.5 = [10 x i8] c"flash get\00"
@.str.6 = [20 x i8] c"%s > /tmp/MP.txt ok\00"
@.str.7 = [6 x i8] c"%s ok\00"
@.str.8 = [25 x i8] c"iwpriv wlan0 mp_brx stop\00"
@.str.9 = [5 x i8] c"stop\00"
@.str.10 = [6 x i8] c"wlan0\00"
@.str.11 = [19 x i8] c"iwpriv wlan0 mp_tx\00"
@.str.12 = [6 x i8] c"probe\00"
@.str.13 = [4 x i8] c"ack\00"
@.str.14 = [11 x i8] c"verify_flw\00"
@.str.15 = [12 x i8] c"/tmp/MP.txt\00"
@.str.16 = [2 x i8] c"r\00"
@.str.17 = [25 x i8] c"opening MP.txt failed !\0A\00"
@.str.18 = [15 x i8] c" > /tmp/MP.txt\00"
@.str.19 = [10 x i8] c"flash set\00"
@.str.20 = [13 x i8] c"send failed\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca [128 x i8]
%9 = alloca [128 x i8]
%10 = alloca [128 x i8]
store i32 0, i32* %1
%11 = load i32, i32* @AF_INET
%12 = load i32, i32* @SOCK_DGRAM
%13 = call i32 @socket(i32 %11, i32 %12, i32 0)
store i32 %13, i32* %2
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %0
%19 = load i32, i32* @AF_INET
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 3
store i32 %19, i32* %20
%21 = call i32 @htons(i32 9034)
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 2
store i32 %21, i32* %22
%23 = load i32, i32* @INADDR_ANY
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 1
%25 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %24, i32 0, i32 0
store i32 %23, i32* %25
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%27 = call i32 @memset(i8* %26, i8 signext 0, i32 8)
%28 = load i32, i32* %2
%29 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%30 = call i32 @bind(i32 %28, %struct.sockaddr* %29, i32 4)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %37
32: ; preds = %18
%33 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%34 = load i32, i32* %2
%35 = call i32 @close(i32 %34)
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %18
store i32 4, i32* %5
%38 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %37, %193
%40 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%41 = call i32 @memset(i8* %40, i8 signext 0, i32 128)
%42 = load i32, i32* %2
%43 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%44 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%45 = call i32 @recvfrom(i32 %42, i8* %43, i32 128, i32 0, %struct.sockaddr* %44, i32* %5)
store i32 %45, i32* %6
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %53
47: ; preds = %39
%48 = load i32, i32* @stderr
%49 = call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%50 = load i32, i32* %2
%51 = call i32 @close(i32 %50)
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %39
%54 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%55 = call i64 @memcmp(i8* %54, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 5)
%56 = icmp ne i64 %55, 0
br i1 %56, label %61, label %57
57: ; preds = %53
%58 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%59 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%60 = call i32 @strcpy(i8* %58, i8* %59)
br label %174
61: ; preds = %53
%62 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%63 = call i64 @memcmp(i8* %62, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 9)
%64 = icmp ne i64 %63, 0
br i1 %64, label %69, label %65
65: ; preds = %61
%66 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%67 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%68 = call i32 @sprintf(i8* %66, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %67)
br label %73
69: ; preds = %61
%70 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%71 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%72 = call i32 @sprintf(i8* %70, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %71)
br label %73
73: ; preds = %69, %65
%74 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%75 = call i64 @memcmp(i8* %74, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i32 24)
%76 = icmp ne i64 %75, 0
br i1 %76, label %82, label %77
77: ; preds = %73
%78 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%79 = call i32 @strcpy(i8* %78, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%80 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%81 = call i32 @MP_get_ext(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* %80, i32 35699)
br label %164
82: ; preds = %73
%83 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%84 = call i64 @memcmp(i8* %83, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i32 18)
%85 = icmp ne i64 %84, 0
br i1 %85, label %104, label %86
86: ; preds = %82
%87 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 18
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 32
br i1 %90, label %91, label %104
91: ; preds = %86
%92 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%93 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%94 = getelementptr inbounds i8, i8* %93, i64 19
%95 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%96 = call i64 @strlen(i8* %95)
%97 = sub nsw i64 %96, 19
%98 = call i32 @memcpy(i8* %92, i8* %94, i64 %97)
%99 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%100 = call i32 @MP_get_ext(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* %99, i32 35697)
%101 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%102 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%103 = call i32 @strcpy(i8* %101, i8* %102)
br label %163
104: ; preds = %86, %82
%105 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%106 = call i64 @memcmp(i8* %105, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%107 = icmp ne i64 %106, 0
br i1 %107, label %111, label %108
108: ; preds = %104
%109 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%110 = call i32 @strcpy(i8* %109, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
br label %162
111: ; preds = %104
%112 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%113 = call i64 @memcmp(i8* %112, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 10)
%114 = icmp ne i64 %113, 0
br i1 %114, label %132, label %115
115: ; preds = %111
%116 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
store i32* %116, i32** %7
%117 = icmp eq i32* %116, null
br i1 %117, label %118, label %121
118: ; preds = %115
%119 = load i32, i32* @stderr
%120 = call i32 @fprintf(i32 %119, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0))
br label %121
121: ; preds = %118, %115
%122 = load i32*, i32** %7
%123 = icmp ne i32* %122, null
br i1 %123, label %124, label %131
124: ; preds = %121
%125 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%126 = load i32*, i32** %7
%127 = call i32 @fgets(i8* %125, i32 128, i32* %126)
%128 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 127
store i8 0, i8* %128
%129 = load i32*, i32** %7
%130 = call i32 @fclose(i32* %129)
br label %131
131: ; preds = %124, %121
br label %161
132: ; preds = %111
%133 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%134 = call i64 @memcmp(i8* %133, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 9)
%135 = icmp ne i64 %134, 0
br i1 %135, label %139, label %136
136: ; preds = %132
%137 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%138 = call i32 @strcat(i8* %137, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0))
br label %139
139: ; preds = %136, %132
%140 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%141 = call i64 @memcmp(i8* %140, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i64 0, i64 0), i32 9)
%142 = icmp ne i64 %141, 0
br i1 %142, label %158, label %143
143: ; preds = %139
%144 = load i32, i32* %2
%145 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%146 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%147 = call i64 @strlen(i8* %146)
%148 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%149 = call i32 @sendto(i32 %144, i8* %145, i64 %147, i32 0, %struct.sockaddr* %148, i32 4)
store i32 %149, i32* %6
%150 = icmp eq i32 %149, -1
br i1 %150, label %151, label %157
151: ; preds = %143
%152 = load i32, i32* @stderr
%153 = call i32 @fprintf(i32 %152, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0))
%154 = load i32, i32* %2
%155 = call i32 @close(i32 %154)
%156 = call i32 @exit(i32 1)
unreachable
157: ; preds = %143
br label %158
158: ; preds = %157, %139
%159 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%160 = call i32 @system(i8* %159)
br label %161
161: ; preds = %158, %131
br label %162
162: ; preds = %161, %108
br label %163
163: ; preds = %162, %91
br label %164
164: ; preds = %163, %77
%165 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%166 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%167 = call i32 @strcpy(i8* %165, i8* %166)
%168 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%169 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%170 = call i32 @strcpy(i8* %168, i8* %169)
%171 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%172 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%173 = call i32 @strcpy(i8* %171, i8* %172)
br label %174
174: ; preds = %164, %57
%175 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%176 = call i64 @memcmp(i8* %175, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i64 0, i64 0), i32 9)
%177 = icmp ne i64 %176, 0
br i1 %177, label %178, label %193
178: ; preds = %174
%179 = load i32, i32* %2
%180 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%181 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%182 = call i64 @strlen(i8* %181)
%183 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%184 = call i32 @sendto(i32 %179, i8* %180, i64 %182, i32 0, %struct.sockaddr* %183, i32 4)
store i32 %184, i32* %6
%185 = icmp eq i32 %184, -1
br i1 %185, label %186, label %192
186: ; preds = %178
%187 = load i32, i32* @stderr
%188 = call i32 @fprintf(i32 %187, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0))
%189 = load i32, i32* %2
%190 = call i32 @close(i32 %189)
%191 = call i32 @exit(i32 1)
unreachable
192: ; preds = %178
br label %193
193: ; preds = %192, %174
br label %39
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i8, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [7 x i8] c"socket\00"
@INADDR_ANY = global i32 0
@.str.1 = [5 x i8] c"bind\00"
@stderr = global i32 0
@.str.3 = [19 x i8] c"Receive failed!!!\0A\00"
@.str.4 = [6 x i8] c"query\00"
@.str.5 = [10 x i8] c"flash get\00"
@.str.6 = [20 x i8] c"%s > /tmp/MP.txt ok\00"
@.str.7 = [6 x i8] c"%s ok\00"
@.str.8 = [25 x i8] c"iwpriv wlan0 mp_brx stop\00"
@.str.9 = [5 x i8] c"stop\00"
@.str.10 = [6 x i8] c"wlan0\00"
@.str.11 = [19 x i8] c"iwpriv wlan0 mp_tx\00"
@.str.12 = [6 x i8] c"probe\00"
@.str.13 = [4 x i8] c"ack\00"
@.str.14 = [11 x i8] c"verify_flw\00"
@.str.15 = [12 x i8] c"/tmp/MP.txt\00"
@.str.16 = [2 x i8] c"r\00"
@.str.17 = [25 x i8] c"opening MP.txt failed !\0A\00"
@.str.18 = [15 x i8] c" > /tmp/MP.txt\00"
@.str.19 = [10 x i8] c"flash set\00"
@.str.20 = [13 x i8] c"send failed\0A\00"
@str = [31 x i8] c"MP AUTOMATION daemon (ver 1.0)\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = alloca [128 x i8]
%5 = alloca [128 x i8]
%6 = alloca [128 x i8]
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%9 = bitcast i32* %3 to i8*
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%13 = load i32, i32* @AF_INET
%14 = load i32, i32* @SOCK_DGRAM
%15 = tail call i32 @socket(i32 %13, i32 %14, i32 0)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %0
%21 = load i32, i32* @AF_INET
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 3
store i32 %21, i32* %22
%23 = tail call i32 @htons(i32 9034)
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %23, i32* %24
%25 = load i32, i32* @INADDR_ANY
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1, i32 0
store i32 %25, i32* %26
%27 = call i32 @memset(i8* %7, i8 signext 0, i32 8)
%28 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%29 = call i32 @bind(i32 %15, %struct.sockaddr* %28, i32 4)
%30 = icmp eq i32 %29, -1
br i1 %30, label %31, label %35
31: ; preds = %20
%32 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%33 = call i32 @close(i32 %15)
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %20
store i32 4, i32* %3
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%37 = call i32 @memset(i8* %10, i8 signext 0, i32 128)
%38 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%39 = call i32 @recvfrom(i32 %15, i8* %10, i32 128, i32 0, %struct.sockaddr* %38, i32* %3)
%40 = icmp eq i32 %39, -1
br i1 %40, label %45, label %41
41: ; preds = %35
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 18
%43 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 127
%44 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 19
br label %50
45: ; preds = %128, %35
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%48 = call i32 @close(i32 %15)
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %41, %128
%51 = call i64 @memcmp(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 5)
%52 = icmp eq i64 %51, 0
br i1 %52, label %114, label %53
53: ; preds = %50
%54 = call i64 @memcmp(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 9)
%55 = icmp eq i64 %54, 0
%56 = select i1 %55, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0)
%57 = call i32 @sprintf(i8* %12, i8* dereferenceable(1) %56, i8* %10)
%58 = call i64 @memcmp(i8* %10, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i32 24)
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %63
60: ; preds = %53
%61 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%62 = call i32 @MP_get_ext(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* %10, i32 35699)
br label %111
63: ; preds = %53
%64 = call i64 @memcmp(i8* %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i32 18)
%65 = icmp eq i64 %64, 0
%66 = load i8, i8* %42
%67 = icmp eq i8 %66, 32
%68 = select i1 %65, i1 %67, i1 false
br i1 %68, label %69, label %75
69: ; preds = %63
%70 = call i64 @strlen(i8* %10)
%71 = add nsw i64 %70, -19
%72 = call i32 @memcpy(i8* %11, i8* %44, i64 %71)
%73 = call i32 @MP_get_ext(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* %11, i32 35697)
%74 = call i32 @strcpy(i8* %10, i8* %11)
br label %111
75: ; preds = %63
%76 = call i64 @memcmp(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %75
%79 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
br label %111
80: ; preds = %75
%81 = call i64 @memcmp(i8* %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 10)
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %92
83: ; preds = %80
%84 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%85 = icmp eq i32* %84, null
br i1 %85, label %86, label %89
86: ; preds = %83
%87 = load i32, i32* @stderr
%88 = call i32 @fprintf(i32 %87, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0))
br label %111
89: ; preds = %83
%90 = call i32 @fgets(i8* %10, i32 128, i32* %84)
store i8 0, i8* %43
%91 = call i32 @fclose(i32* %84)
br label %111
92: ; preds = %80
%93 = call i64 @memcmp(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 9)
%94 = icmp eq i64 %93, 0
br i1 %94, label %95, label %97
95: ; preds = %92
%96 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0))
br label %97
97: ; preds = %95, %92
%98 = call i64 @memcmp(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i64 0, i64 0), i32 9)
%99 = icmp eq i64 %98, 0
br i1 %99, label %100, label %109
100: ; preds = %97
%101 = call i64 @strlen(i8* %12)
%102 = call i32 @sendto(i32 %15, i8* %12, i64 %101, i32 0, %struct.sockaddr* %38, i32 4)
%103 = icmp eq i32 %102, -1
br i1 %103, label %104, label %109
104: ; preds = %100
%105 = load i32, i32* @stderr
%106 = call i32 @fprintf(i32 %105, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0))
%107 = call i32 @close(i32 %15)
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %100, %97
%110 = call i32 @system(i8* %10)
br label %111
111: ; preds = %86, %69, %109, %89, %78, %60
%112 = call i32 @strcpy(i8* %11, i8* %12)
%113 = call i32 @strcpy(i8* %12, i8* %10)
br label %114
114: ; preds = %50, %111
%115 = phi i8* [ %11, %111 ], [ %12, %50 ]
%116 = call i32 @strcpy(i8* %10, i8* %115)
%117 = call i64 @memcmp(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i64 0, i64 0), i32 9)
%118 = icmp eq i64 %117, 0
br i1 %118, label %128, label %119
119: ; preds = %114
%120 = call i64 @strlen(i8* %10)
%121 = call i32 @sendto(i32 %15, i8* %10, i64 %120, i32 0, %struct.sockaddr* %38, i32 4)
%122 = icmp eq i32 %121, -1
br i1 %122, label %123, label %128
123: ; preds = %119
%124 = load i32, i32* @stderr
%125 = call i32 @fprintf(i32 %124, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0))
%126 = call i32 @close(i32 %15)
%127 = call i32 @exit(i32 1)
unreachable
128: ; preds = %119, %114
%129 = call i32 @memset(i8* %10, i8 signext 0, i32 128)
%130 = call i32 @recvfrom(i32 %15, i8* %10, i32 128, i32 0, %struct.sockaddr* %38, i32* %3)
%131 = icmp eq i32 %130, -1
br i1 %131, label %45, label %50
}