#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 {
  int /*<<< orphan*/ sin_zero;
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef scalar_t__ ssize_t;
typedef int /*<<< orphan*/ serverAddr;
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
char *HashGet(char *);
int /*<<< orphan*/ INADDR_LOOPBACK;
int /*<<< orphan*/ ParseArgs(int, char **);
int /*<<< orphan*/ SOCK_STREAM;
int STDIN_FILENO;
int STDOUT_FILENO;
char **calloc(size_t, int);
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ execve(char *, char **, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ geteuid();
int /*<<< orphan*/ getgid();
scalar_t__ getuid();
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
char *malloc(size_t);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, char, int);
int /*<<< orphan*/ perror(char *);
scalar_t__ read(int, char **, int);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int setegid(int /*<<< orphan*/);
int seteuid(scalar_t__);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ *strstr(char *, char *);
scalar_t__ write(int, char **, scalar_t__);
int main(int ac, char **av, char **env) {
  int isCommand = 0;
  int isSftp = 0;
  int status = 0;
  if (ac == 3 && av[1] != NULL && av[2] != NULL && strcmp("-c", av[1]) == 0 &&
      (strstr(av[2], "sftp-server") != NULL ||
       strstr(av[2], "MySecureShell") != NULL))
    isSftp = 1;
  else if (ac >= 3 && av[1] != NULL && av[2] != NULL &&
           strcmp("-c", av[1]) == 0)
    isCommand = 1;
  else
    ParseArgs(ac, av);
  if (isSftp == 1) {
    struct sockaddr_in serverAddr;
    fd_set fds;
    int socketFd = -1;
    serverAddr.sin_family = AF_INET;
    serverAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
    serverAddr.sin_port = htons(2020);
    memset(&(serverAddr.sin_zero), '\0', 8);
    if ((socketFd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
      perror("Unable to open socket");
      status = 1;
    } else if ((status = connect(socketFd, (struct sockaddr *)&serverAddr,
                                 sizeof(serverAddr))) < 0) {
      perror("Unable to connect socket");
      status = 1;
    } else {
      for (;;) {
        FD_ZERO(&fds);
        FD_SET(STDIN_FILENO, &fds);
        FD_SET(socketFd, &fds);
        status = select(socketFd + 1, &fds, NULL, NULL, NULL);
        if (status == -1)
          break;
        if (FD_ISSET(STDIN_FILENO, &fds)) {
          char data[4096];
          ssize_t dataSize;
          dataSize = read(STDIN_FILENO, &data, sizeof(data));
          if (dataSize > 0)
            dataSize = write(socketFd, &data, dataSize);
          else if (dataSize == 0)
            break;
        }
        if (FD_ISSET(socketFd, &fds)) {
          char data[4096];
          ssize_t dataSize;
          dataSize = read(socketFd, &data, sizeof(data));
          if (dataSize > 0)
            dataSize = write(STDOUT_FILENO, &data, dataSize);
          else if (dataSize == 0)
            break;
        }
      }
    }
    if (socketFd != -1)
      close(socketFd);
  } else {
    char *ptr;
    if (getuid() != geteuid()) {
      if (seteuid(getuid()) == -1 || setegid(getgid()) == -1) {
        perror("revoke root rights");
        exit(1);
      }
    }
    ptr = HashGet("Shell");
    if (ptr != NULL) {
      if (strcmp(ptr, av[0]) != 0) {
        av[0] = ptr;
        if (isCommand == 1) {
          size_t len = 0;
          char **newEnv;
          char *cmd, *envVar;
          int i;
          for (i = 2; i < ac; i++)
            len += strlen(av[i]);
          cmd = malloc(len + ac + 1);
          envVar = malloc(len + ac + 1 + 21);
          cmd[0] = '\0';
          for (i = 2; i < ac; i++) {
            if (i > 2)
              strcat(cmd, " ");
            strcat(cmd, av[i]);
          }
          av[2] = cmd;
          av[3] = NULL;
          strcpy(envVar, "SSH_ORIGINAL_COMMAND=");
          strcat(envVar, cmd);
          len = 0;
          for (i = 0; env[i] != NULL; i++)
            len++;
          newEnv = calloc(len + 2, sizeof(*newEnv));
          for (i = 0; i < len; i++)
            newEnv[i] = env[i];
          newEnv[len] = envVar;
          (void)execve(av[0], av, newEnv);
        } else
          (void)execve(av[0], av, env);
        perror("execute shell");
      } else
        (void)fprintf(stderr, "You cannot specify MySecureShell has shell (in "
                              "the MySecureShell configuration) !");
    } else
      (void)fprintf(stderr, "Shell access is disabled !");
    exit(1);
  }
  return status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2090,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    13a0 <main+0xc0>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     13a0 <main+0xc0>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     13a0 <main+0xc0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xcb7(%rip),%rdi
call   1100 <strcmp@plt>
cmp    $0x0,%rax
jne    13a0 <main+0xc0>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc9c(%rip),%rsi
call   11d0 <strstr@plt>
cmp    $0x0,%rax
jne    1394 <main+0xb4>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc8a(%rip),%rsi
call   11d0 <strstr@plt>
cmp    $0x0,%rax
je     13a0 <main+0xc0>
movl   $0x1,-0x20(%rbp)
jmp    1403 <main+0x123>
cmpl   $0x3,-0x8(%rbp)
jl     13f2 <main+0x112>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     13f2 <main+0x112>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     13f2 <main+0x112>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xc29(%rip),%rdi
call   1100 <strcmp@plt>
cmp    $0x0,%rax
jne    13f2 <main+0x112>
movl   $0x1,-0x1c(%rbp)
jmp    13fe <main+0x11e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   11a0 <ParseArgs@plt>
jmp    1403 <main+0x123>
cmpl   $0x1,-0x20(%rbp)
jne    164c <main+0x36c>
movl   $0xffffffff,-0x40(%rbp)
mov    0x2bc5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2bb1(%rip),%rax
mov    (%rax),%edi
call   1090 <htonl@plt>
mov    %eax,-0x30(%rbp)
mov    $0x7e4,%edi
call   1080 <htons@plt>
mov    %eax,-0x34(%rbp)
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   10a0 <memset@plt>
mov    0x2b8b(%rip),%rax
mov    (%rax),%edi
mov    0x2b62(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   11f0 <socket@plt>
mov    %eax,-0x40(%rbp)
cmp    $0x0,%eax
jge    148b <main+0x1ab>
lea    0xba3(%rip),%rdi
call   1160 <perror@plt>
movl   $0x1,-0x24(%rbp)
jmp    1635 <main+0x355>
mov    -0x40(%rbp),%edi
lea    -0x38(%rbp),%rsi
mov    $0x10,%edx
call   1190 <connect@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jge    14c0 <main+0x1e0>
lea    0xb84(%rip),%rdi
call   1160 <perror@plt>
movl   $0x1,-0x24(%rbp)
jmp    1630 <main+0x350>
jmp    14c5 <main+0x1e5>
lea    -0x3c(%rbp),%rdi
call   1130 <FD_ZERO@plt>
mov    0x2ae3(%rip),%rax
mov    (%rax),%edi
lea    -0x3c(%rbp),%rsi
call   11b0 <FD_SET@plt>
mov    -0x40(%rbp),%edi
lea    -0x3c(%rbp),%rsi
call   11b0 <FD_SET@plt>
mov    -0x40(%rbp),%edi
add    $0x1,%edi
lea    -0x3c(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1140 <select@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    1518 <main+0x238>
jmp    162b <main+0x34b>
mov    0x2a99(%rip),%rax
mov    (%rax),%edi
lea    -0x3c(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     15a2 <main+0x2c2>
mov    0x2a7d(%rip),%rax
mov    (%rax),%edi
lea    -0x1040(%rbp),%rsi
mov    $0x1000,%edx
call   10d0 <read@plt>
mov    %rax,-0x1048(%rbp)
cmpq   $0x0,-0x1048(%rbp)
jle    1585 <main+0x2a5>
mov    -0x40(%rbp),%edi
lea    -0x1040(%rbp),%rsi
mov    -0x1048(%rbp),%rdx
call   1040 <write@plt>
mov    %rax,-0x1048(%rbp)
jmp    159d <main+0x2bd>
cmpq   $0x0,-0x1048(%rbp)
jne    1598 <main+0x2b8>
jmp    162b <main+0x34b>
jmp    159d <main+0x2bd>
jmp    15a2 <main+0x2c2>
mov    -0x40(%rbp),%edi
lea    -0x3c(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1626 <main+0x346>
mov    -0x40(%rbp),%edi
lea    -0x2050(%rbp),%rsi
mov    $0x1000,%edx
call   10d0 <read@plt>
mov    %rax,-0x2058(%rbp)
cmpq   $0x0,-0x2058(%rbp)
jle    1609 <main+0x329>
mov    0x2a08(%rip),%rax
mov    (%rax),%edi
lea    -0x2050(%rbp),%rsi
mov    -0x2058(%rbp),%rdx
call   1040 <write@plt>
mov    %rax,-0x2058(%rbp)
jmp    1621 <main+0x341>
cmpq   $0x0,-0x2058(%rbp)
jne    161c <main+0x33c>
jmp    162b <main+0x34b>
jmp    1621 <main+0x341>
jmp    1626 <main+0x346>
jmp    14c5 <main+0x1e5>
jmp    1630 <main+0x350>
jmp    1635 <main+0x355>
cmpl   $0xffffffff,-0x40(%rbp)
je     1647 <main+0x367>
mov    -0x40(%rbp),%edi
call   10c0 <close@plt>
jmp    19b4 <main+0x6d4>
mov    $0x0,%al
call   1070 <getuid@plt>
mov    %rax,-0x2090(%rbp)
mov    $0x0,%al
call   10b0 <geteuid@plt>
mov    %rax,%rcx
mov    -0x2090(%rbp),%rax
cmp    %rcx,%rax
je     16be <main+0x3de>
mov    $0x0,%al
call   1070 <getuid@plt>
mov    %rax,%rdi
call   1200 <seteuid@plt>
cmp    $0xffffffff,%eax
je     16a3 <main+0x3c3>
mov    $0x0,%al
call   1120 <getgid@plt>
mov    %eax,%edi
call   11c0 <setegid@plt>
cmp    $0xffffffff,%eax
jne    16b9 <main+0x3d9>
lea    0x9a2(%rip),%rdi
call   1160 <perror@plt>
mov    $0x1,%edi
call   1180 <exit@plt>
jmp    16be <main+0x3de>
lea    0x952(%rip),%rdi
call   11e0 <HashGet@plt>
mov    %rax,-0x2060(%rbp)
cmpq   $0x0,-0x2060(%rbp)
je     1995 <main+0x6b5>
mov    -0x2060(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1100 <strcmp@plt>
cmp    $0x0,%rax
je     197b <main+0x69b>
mov    -0x2060(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
cmpl   $0x1,-0x1c(%rbp)
jne    1956 <main+0x676>
movq   $0x0,-0x2068(%rbp)
movl   $0x2,-0x2084(%rbp)
mov    -0x2084(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    176e <main+0x48e>
mov    -0x10(%rbp),%rax
movslq -0x2084(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <strlen@plt>
add    -0x2068(%rbp),%rax
mov    %rax,-0x2068(%rbp)
mov    -0x2084(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2084(%rbp)
jmp    1729 <main+0x449>
mov    -0x2068(%rbp),%rdi
movslq -0x8(%rbp),%rax
add    %rax,%rdi
add    $0x1,%rdi
call   1150 <malloc@plt>
mov    %rax,-0x2078(%rbp)
mov    -0x2068(%rbp),%rdi
movslq -0x8(%rbp),%rax
add    %rax,%rdi
add    $0x1,%rdi
add    $0x15,%rdi
call   1150 <malloc@plt>
mov    %rax,-0x2080(%rbp)
mov    -0x2078(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x2,-0x2084(%rbp)
mov    -0x2084(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1820 <main+0x540>
cmpl   $0x2,-0x2084(%rbp)
jle    17f1 <main+0x511>
mov    -0x2078(%rbp),%rdi
lea    0x873(%rip),%rsi
call   1170 <strcat@plt>
mov    -0x2078(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x2084(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1170 <strcat@plt>
mov    -0x2084(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2084(%rbp)
jmp    17c2 <main+0x4e2>
mov    -0x2078(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x2080(%rbp),%rdi
lea    0x818(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x2080(%rbp),%rdi
mov    -0x2078(%rbp),%rsi
call   1170 <strcat@plt>
movq   $0x0,-0x2068(%rbp)
movl   $0x0,-0x2084(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x2084(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     18b2 <main+0x5d2>
mov    -0x2068(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2068(%rbp)
mov    -0x2084(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2084(%rbp)
jmp    1876 <main+0x596>
mov    -0x2068(%rbp),%rdi
add    $0x2,%rdi
mov    $0x8,%esi
call   10f0 <calloc@plt>
mov    %rax,-0x2070(%rbp)
movl   $0x0,-0x2084(%rbp)
movslq -0x2084(%rbp),%rax
cmp    -0x2068(%rbp),%rax
jae    1921 <main+0x641>
mov    -0x18(%rbp),%rax
movslq -0x2084(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x2070(%rbp),%rax
movslq -0x2084(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x2084(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2084(%rbp)
jmp    18d8 <main+0x5f8>
mov    -0x2080(%rbp),%rdx
mov    -0x2070(%rbp),%rax
mov    -0x2068(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x2070(%rbp),%rdx
call   10e0 <execve@plt>
jmp    196a <main+0x68a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   10e0 <execve@plt>
lea    0x706(%rip),%rdi
call   1160 <perror@plt>
jmp    1990 <main+0x6b0>
mov    0x2646(%rip),%rax
mov    (%rax),%edi
lea    0x6fa(%rip),%rsi
call   1110 <fprintf@plt>
jmp    19aa <main+0x6ca>
mov    0x262c(%rip),%rax
mov    (%rax),%edi
lea    0x732(%rip),%rsi
call   1110 <fprintf@plt>
mov    $0x1,%edi
call   1180 <exit@plt>
mov    -0x24(%rbp),%eax
add    $0x2090,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1028,%rsp
mov    %rdx,%r14
mov    %rsi,%r13
mov    %edi,%ebp
cmp    $0x3,%edi
jne    150a <main+0x22a>
mov    0x8(%r13),%rsi
test   %rsi,%rsi
je     150c <main+0x22c>
cmpq   $0x0,0x10(%r13)
je     150c <main+0x22c>
lea    0xcdf(%rip),%rdi
call   1100 <strcmp@plt>
test   %rax,%rax
jne    150c <main+0x22c>
mov    0x10(%r13),%rbx
lea    0xcc9(%rip),%rsi
mov    %rbx,%rdi
call   11d0 <strstr@plt>
test   %rax,%rax
jne    135f <main+0x7f>
lea    0xcc1(%rip),%rsi
mov    %rbx,%rdi
call   11d0 <strstr@plt>
test   %rax,%rax
je     150c <main+0x22c>
mov    0x2c7a(%rip),%rbx
mov    (%rbx),%eax
mov    %eax,0x14(%rsp)
mov    0x2c65(%rip),%rax
mov    (%rax),%edi
call   1090 <htonl@plt>
mov    %eax,0x10(%rsp)
mov    $0x7e4,%edi
call   1080 <htons@plt>
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   10a0 <memset@plt>
mov    (%rbx),%edi
mov    0x2c1a(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   11f0 <socket@plt>
mov    %eax,%r12d
test   %eax,%eax
js     14de <main+0x1fe>
lea    0x8(%rsp),%rsi
mov    %r12d,%edi
mov    $0x10,%edx
call   1190 <connect@plt>
test   %eax,%eax
js     14f7 <main+0x217>
lea    0x1(%r12),%r14d
lea    0x1c(%rsp),%rbp
mov    0x2bd3(%rip),%r13
lea    0x20(%rsp),%r15
jmp    1404 <main+0x124>
nopl   0x0(%rax)
mov    0x2bf9(%rip),%rcx
mov    (%rcx),%edi
mov    %r15,%rsi
mov    %rax,%rdx
call   1040 <write@plt>
mov    %rbp,%rdi
call   1130 <FD_ZERO@plt>
mov    0x0(%r13),%edi
mov    %rbp,%rsi
call   11b0 <FD_SET@plt>
mov    %r12d,%edi
mov    %rbp,%rsi
call   11b0 <FD_SET@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1140 <select@plt>
cmp    $0xffffffff,%eax
je     14b7 <main+0x1d7>
mov    %eax,%ebx
mov    0x0(%r13),%edi
mov    %rbp,%rsi
call   1050 <FD_ISSET@plt>
test   %rax,%rax
je     1482 <main+0x1a2>
mov    0x0(%r13),%edi
mov    %r15,%rsi
mov    $0x1000,%edx
call   10d0 <read@plt>
test   %rax,%rax
jle    1480 <main+0x1a0>
mov    %r12d,%edi
mov    %r15,%rsi
mov    %rax,%rdx
call   1040 <write@plt>
jmp    1482 <main+0x1a2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
je     14bc <main+0x1dc>
mov    %r12d,%edi
mov    %rbp,%rsi
call   1050 <FD_ISSET@plt>
test   %rax,%rax
je     1404 <main+0x124>
mov    %r12d,%edi
mov    %r15,%rsi
mov    $0x1000,%edx
call   10d0 <read@plt>
test   %rax,%rax
jg     13f0 <main+0x110>
jne    1404 <main+0x124>
jmp    14bc <main+0x1dc>
mov    $0xffffffff,%ebx
cmp    $0xffffffff,%r12d
je     14ca <main+0x1ea>
mov    %r12d,%edi
call   10c0 <close@plt>
mov    %ebx,%eax
add    $0x1028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb38(%rip),%rdi
call   1160 <perror@plt>
mov    $0x1,%ebx
cmp    $0xffffffff,%r12d
jne    14c2 <main+0x1e2>
jmp    14ca <main+0x1ea>
lea    0xb35(%rip),%rdi
call   1160 <perror@plt>
mov    $0x1,%ebx
jmp    14c2 <main+0x1e2>
jl     1530 <main+0x250>
mov    0x8(%r13),%rsi
test   %rsi,%rsi
je     1530 <main+0x250>
cmpq   $0x0,0x10(%r13)
je     1530 <main+0x250>
lea    0xadd(%rip),%rdi
call   1100 <strcmp@plt>
mov    $0x1,%r12b
test   %rax,%rax
je     153d <main+0x25d>
mov    %ebp,%edi
mov    %r13,%rsi
call   11a0 <ParseArgs@plt>
xor    %r12d,%r12d
xor    %eax,%eax
call   1070 <getuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   10b0 <geteuid@plt>
cmp    %rax,%rbx
je     1586 <main+0x2a6>
xor    %eax,%eax
call   1070 <getuid@plt>
mov    %rax,%rdi
call   1200 <seteuid@plt>
cmp    $0xffffffff,%eax
je     157a <main+0x29a>
xor    %eax,%eax
call   1120 <getgid@plt>
mov    %eax,%edi
call   11c0 <setegid@plt>
cmp    $0xffffffff,%eax
jne    1586 <main+0x2a6>
lea    0xacb(%rip),%rdi
jmp    1874 <main+0x594>
lea    0xa8a(%rip),%rdi
call   11e0 <HashGet@plt>
test   %rax,%rax
je     1883 <main+0x5a3>
mov    %rax,%r15
mov    0x0(%r13),%rsi
mov    %rax,%rdi
call   1100 <strcmp@plt>
test   %rax,%rax
je     1895 <main+0x5b5>
mov    %r15,0x0(%r13)
test   %r12b,%r12b
je     15e4 <main+0x304>
cmp    $0x3,%ebp
jl     15f2 <main+0x312>
mov    %ebp,%r15d
mov    $0x2,%ebx
xor    %r12d,%r12d
mov    0x0(%r13,%rbx,8),%rdi
call   1060 <strlen@plt>
add    %rax,%r12
add    $0x1,%rbx
cmp    %rbx,%r15
jne    15cc <main+0x2ec>
jmp    15f5 <main+0x315>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
jmp    1868 <main+0x588>
xor    %r12d,%r12d
movslq %ebp,%rbx
lea    (%r12,%rbx,1),%rdi
add    $0x1,%rdi
call   1150 <malloc@plt>
mov    %rax,%r15
lea    (%r12,%rbx,1),%rdi
add    $0x16,%rdi
call   1150 <malloc@plt>
mov    %rax,(%rsp)
movb   $0x0,(%r15)
cmp    $0x3,%ebp
jl     1662 <main+0x382>
mov    0x10(%r13),%rsi
mov    %r15,%rdi
call   1170 <strcat@plt>
cmp    $0x3,%ebp
je     1662 <main+0x382>
mov    %ebp,%ebx
mov    $0x3,%ebp
lea    0xa1e(%rip),%r12
mov    %r15,%rdi
mov    %r12,%rsi
call   1170 <strcat@plt>
mov    0x0(%r13,%rbp,8),%rsi
mov    %r15,%rdi
call   1170 <strcat@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1641 <main+0x361>
mov    %r15,0x10(%r13)
movq   $0x0,0x18(%r13)
lea    0x9ec(%rip),%rsi
mov    (%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1170 <strcat@plt>
cmpq   $0x0,(%r14)
jne    16ac <main+0x3cc>
mov    $0x2,%edi
mov    $0x8,%esi
call   10f0 <calloc@plt>
mov    %rax,%rdx
xor    %r12d,%r12d
jmp    1859 <main+0x579>
mov    $0x1,%al
xor    %ebx,%ebx
xor    %r12d,%r12d
mov    %eax,%ebp
add    $0xfffffffffffffff8,%rbx
cmpq   $0x0,0x8(%r14,%r12,8)
lea    0x1(%r12),%r12
lea    0x1(%rbp),%eax
jne    16b3 <main+0x3d3>
lea    0x2(%r12),%rdi
mov    $0x8,%esi
call   10f0 <calloc@plt>
mov    %rax,%rdx
test   %r12,%r12
jne    16e8 <main+0x408>
xor    %r12d,%r12d
jmp    1859 <main+0x579>
cmp    $0x4,%r12
jb     1704 <main+0x424>
mov    %r14,%rax
sub    %rbx,%rax
cmp    %rax,%rdx
jae    176c <main+0x48c>
mov    %rdx,%rax
sub    %rbx,%rax
cmp    %r14,%rax
jbe    176c <main+0x48c>
xor    %eax,%eax
mov    %rax,%rcx
not    %rcx
add    %r12,%rcx
test   $0x3,%r12b
je     172e <main+0x44e>
movzbl %bpl,%esi
and    $0x3,%esi
mov    (%r14,%rax,8),%rdi
mov    %rdi,(%rdx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rsi
jne    171c <main+0x43c>
cmp    $0x3,%rcx
jb     1859 <main+0x579>
mov    (%r14,%rax,8),%rcx
mov    %rcx,(%rdx,%rax,8)
mov    0x8(%r14,%rax,8),%rcx
mov    %rcx,0x8(%rdx,%rax,8)
mov    0x10(%r14,%rax,8),%rcx
mov    %rcx,0x10(%rdx,%rax,8)
mov    0x18(%r14,%rax,8),%rcx
mov    %rcx,0x18(%rdx,%rax,8)
add    $0x4,%rax
cmp    %rax,%r12
jne    1738 <main+0x458>
jmp    1859 <main+0x579>
mov    %r12,%rax
and    $0xfffffffffffffffc,%rax
lea    -0x4(%rax),%rsi
mov    %rsi,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
cmp    $0xc,%rsi
jae    178c <main+0x4ac>
xor    %esi,%esi
jmp    1805 <main+0x525>
mov    %r12,%rdi
and    $0xfffffffffffffffc,%rdi
add    $0xfffffffffffffffc,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
and    $0xfffffffffffffffc,%rdi
xor    %esi,%esi
movups (%r14,%rsi,8),%xmm0
movups 0x10(%r14,%rsi,8),%xmm1
movups %xmm0,(%rdx,%rsi,8)
movups %xmm1,0x10(%rdx,%rsi,8)
movups 0x20(%r14,%rsi,8),%xmm0
movups 0x30(%r14,%rsi,8),%xmm1
movups %xmm0,0x20(%rdx,%rsi,8)
movups %xmm1,0x30(%rdx,%rsi,8)
movups 0x40(%r14,%rsi,8),%xmm0
movups 0x50(%r14,%rsi,8),%xmm1
movups %xmm0,0x40(%rdx,%rsi,8)
movups %xmm1,0x50(%rdx,%rsi,8)
movups 0x60(%r14,%rsi,8),%xmm0
movups 0x70(%r14,%rsi,8),%xmm1
movups %xmm0,0x60(%rdx,%rsi,8)
movups %xmm1,0x70(%rdx,%rsi,8)
add    $0x10,%rsi
add    $0xfffffffffffffffc,%rdi
jne    17a5 <main+0x4c5>
test   $0x3,%cl
je     1850 <main+0x570>
lea    (%rdx,%rsi,8),%rcx
add    $0x10,%rcx
lea    (%r14,%rsi,8),%rsi
add    $0x10,%rsi
mov    %r12d,%ebx
and    $0xc,%bl
add    $0xfc,%bl
shr    $0x2,%bl
add    $0x1,%bl
movzbl %bl,%edi
and    $0x3,%edi
shl    $0x5,%rdi
xor    %ebx,%ebx
movups -0x10(%rsi,%rbx,1),%xmm0
movups (%rsi,%rbx,1),%xmm1
movups %xmm0,-0x10(%rcx,%rbx,1)
movups %xmm1,(%rcx,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%rdi
jne    1835 <main+0x555>
cmp    %rax,%r12
jne    1706 <main+0x426>
mov    (%rsp),%rax
mov    %rax,(%rdx,%r12,8)
mov    0x0(%r13),%rdi
mov    %r13,%rsi
call   10e0 <execve@plt>
lea    0x803(%rip),%rdi
call   1160 <perror@plt>
mov    $0x1,%edi
call   1180 <exit@plt>
mov    0x273e(%rip),%rax
mov    (%rax),%edi
lea    0x844(%rip),%rsi
jmp    18a5 <main+0x5c5>
mov    0x272c(%rip),%rax
mov    (%rax),%edi
lea    0x7e0(%rip),%rsi
call   1110 <fprintf@plt>
mov    $0x1,%edi
call   1180 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [3 x i8] c"-c\00"
@.str.1 = [12 x i8] c"sftp-server\00"
@.str.2 = [14 x i8] c"MySecureShell\00"
@AF_INET = global i32 0
@INADDR_LOOPBACK = global i32 0
@SOCK_STREAM = global i32 0
@.str.3 = [22 x i8] c"Unable to open socket\00"
@.str.4 = [25 x i8] c"Unable to connect socket\00"
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@.str.5 = [19 x i8] c"revoke root rights\00"
@.str.6 = [6 x i8] c"Shell\00"
@.str.7 = [2 x i8] c" \00"
@.str.8 = [22 x i8] c"SSH_ORIGINAL_COMMAND=\00"
@.str.9 = [14 x i8] c"execute shell\00"
@stderr = global i32 0
@.str.10 = [82 x i8] c"You cannot specify MySecureShell has shell (in the MySecureShell configuration) !\00"
@.str.11 = [27 x i8] c"Shell access is disabled !\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.sockaddr_in
%12 = alloca i32
%13 = alloca i32
%14 = alloca [4096 x i8]
%15 = alloca i64
%16 = alloca [4096 x i8]
%17 = alloca i64
%18 = alloca i8*
%19 = alloca i64
%20 = alloca i8**
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%24 = load i32, i32* %5
%25 = icmp eq i32 %24, 3
br i1 %25, label %26, label %55
26: ; preds = %3
%27 = load i8**, i8*** %6
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = icmp ne i8* %29, null
br i1 %30, label %31, label %55
31: ; preds = %26
%32 = load i8**, i8*** %6
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %55
36: ; preds = %31
%37 = load i8**, i8*** %6
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %39)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %55
42: ; preds = %36
%43 = load i8**, i8*** %6
%44 = getelementptr inbounds i8*, i8** %43, i64 2
%45 = load i8*, i8** %44
%46 = call i32* @strstr(i8* %45, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%47 = icmp ne i32* %46, null
br i1 %47, label %54, label %48
48: ; preds = %42
%49 = load i8**, i8*** %6
%50 = getelementptr inbounds i8*, i8** %49, i64 2
%51 = load i8*, i8** %50
%52 = call i32* @strstr(i8* %51, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%53 = icmp ne i32* %52, null
br i1 %53, label %54, label %55
54: ; preds = %48, %42
store i32 1, i32* %9
br label %80
55: ; preds = %48, %36, %31, %26, %3
%56 = load i32, i32* %5
%57 = icmp sge i32 %56, 3
br i1 %57, label %58, label %75
58: ; preds = %55
%59 = load i8**, i8*** %6
%60 = getelementptr inbounds i8*, i8** %59, i64 1
%61 = load i8*, i8** %60
%62 = icmp ne i8* %61, null
br i1 %62, label %63, label %75
63: ; preds = %58
%64 = load i8**, i8*** %6
%65 = getelementptr inbounds i8*, i8** %64, i64 2
%66 = load i8*, i8** %65
%67 = icmp ne i8* %66, null
br i1 %67, label %68, label %75
68: ; preds = %63
%69 = load i8**, i8*** %6
%70 = getelementptr inbounds i8*, i8** %69, i64 1
%71 = load i8*, i8** %70
%72 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %71)
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %75
74: ; preds = %68
store i32 1, i32* %8
br label %79
75: ; preds = %68, %63, %58, %55
%76 = load i32, i32* %5
%77 = load i8**, i8*** %6
%78 = call i32 @ParseArgs(i32 %76, i8** %77)
br label %79
79: ; preds = %75, %74
br label %80
80: ; preds = %79, %54
%81 = load i32, i32* %9
%82 = icmp eq i32 %81, 1
br i1 %82, label %83, label %172
83: ; preds = %80
store i32 -1, i32* %13
%84 = load i32, i32* @AF_INET
%85 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 3
store i32 %84, i32* %85
%86 = load i32, i32* @INADDR_LOOPBACK
%87 = call i32 @htonl(i32 %86)
%88 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 2
%89 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %88, i32 0, i32 0
store i32 %87, i32* %89
%90 = call i32 @htons(i32 2020)
%91 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
store i32 %90, i32* %91
%92 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%93 = call i32 @memset(i32* %92, i8 signext 0, i32 8)
%94 = load i32, i32* @AF_INET
%95 = load i32, i32* @SOCK_STREAM
%96 = call i32 @socket(i32 %94, i32 %95, i32 0)
store i32 %96, i32* %13
%97 = icmp slt i32 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %83
%99 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %10
br label %165
100: ; preds = %83
%101 = load i32, i32* %13
%102 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%103 = call i32 @connect(i32 %101, %struct.sockaddr* %102, i32 16)
store i32 %103, i32* %10
%104 = icmp slt i32 %103, 0
br i1 %104, label %105, label %107
105: ; preds = %100
%106 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %10
br label %164
107: ; preds = %100
br label %108
108: ; preds = %162, %107
%109 = call i32 @FD_ZERO(i32* %12)
%110 = load i32, i32* @STDIN_FILENO
%111 = call i32 @FD_SET(i32 %110, i32* %12)
%112 = load i32, i32* %13
%113 = call i32 @FD_SET(i32 %112, i32* %12)
%114 = load i32, i32* %13
%115 = add nsw i32 %114, 1
%116 = call i32 @select(i32 %115, i32* %12, i32* null, i32* null, i32* null)
store i32 %116, i32* %10
%117 = load i32, i32* %10
%118 = icmp eq i32 %117, -1
br i1 %118, label %119, label %120
119: ; preds = %108
br label %163
120: ; preds = %108
%121 = load i32, i32* @STDIN_FILENO
%122 = call i64 @FD_ISSET(i32 %121, i32* %12)
%123 = icmp ne i64 %122, 0
br i1 %123, label %124, label %141
124: ; preds = %120
%125 = load i32, i32* @STDIN_FILENO
%126 = bitcast [4096 x i8]* %14 to i8**
%127 = call i64 @read(i32 %125, i8** %126, i32 4096)
store i64 %127, i64* %15
%128 = load i64, i64* %15
%129 = icmp sgt i64 %128, 0
br i1 %129, label %130, label %135
130: ; preds = %124
%131 = load i32, i32* %13
%132 = bitcast [4096 x i8]* %14 to i8**
%133 = load i64, i64* %15
%134 = call i64 @write(i32 %131, i8** %132, i64 %133)
store i64 %134, i64* %15
br label %140
135: ; preds = %124
%136 = load i64, i64* %15
%137 = icmp eq i64 %136, 0
br i1 %137, label %138, label %139
138: ; preds = %135
br label %163
139: ; preds = %135
br label %140
140: ; preds = %139, %130
br label %141
141: ; preds = %140, %120
%142 = load i32, i32* %13
%143 = call i64 @FD_ISSET(i32 %142, i32* %12)
%144 = icmp ne i64 %143, 0
br i1 %144, label %145, label %162
145: ; preds = %141
%146 = load i32, i32* %13
%147 = bitcast [4096 x i8]* %16 to i8**
%148 = call i64 @read(i32 %146, i8** %147, i32 4096)
store i64 %148, i64* %17
%149 = load i64, i64* %17
%150 = icmp sgt i64 %149, 0
br i1 %150, label %151, label %156
151: ; preds = %145
%152 = load i32, i32* @STDOUT_FILENO
%153 = bitcast [4096 x i8]* %16 to i8**
%154 = load i64, i64* %17
%155 = call i64 @write(i32 %152, i8** %153, i64 %154)
store i64 %155, i64* %17
br label %161
156: ; preds = %145
%157 = load i64, i64* %17
%158 = icmp eq i64 %157, 0
br i1 %158, label %159, label %160
159: ; preds = %156
br label %163
160: ; preds = %156
br label %161
161: ; preds = %160, %151
br label %162
162: ; preds = %161, %141
br label %108
163: ; preds = %159, %138, %119
br label %164
164: ; preds = %163, %105
br label %165
165: ; preds = %164, %98
%166 = load i32, i32* %13
%167 = icmp ne i32 %166, -1
br i1 %167, label %168, label %171
168: ; preds = %165
%169 = load i32, i32* %13
%170 = call i32 @close(i32 %169)
br label %171
171: ; preds = %168, %165
br label %334
172: ; preds = %80
%173 = call i64 (...) @getuid()
%174 = call i64 (...) @geteuid()
%175 = icmp ne i64 %173, %174
br i1 %175, label %176, label %188
176: ; preds = %172
%177 = call i64 (...) @getuid()
%178 = call i32 @seteuid(i64 %177)
%179 = icmp eq i32 %178, -1
br i1 %179, label %184, label %180
180: ; preds = %176
%181 = call i32 (...) @getgid()
%182 = call i32 @setegid(i32 %181)
%183 = icmp eq i32 %182, -1
br i1 %183, label %184, label %187
184: ; preds = %180, %176
%185 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%186 = call i32 @exit(i32 1)
unreachable
187: ; preds = %180
br label %188
188: ; preds = %187, %172
%189 = call i8* @HashGet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
store i8* %189, i8** %18
%190 = load i8*, i8** %18
%191 = icmp ne i8* %190, null
br i1 %191, label %192, label %329
192: ; preds = %188
%193 = load i8*, i8** %18
%194 = load i8**, i8*** %6
%195 = getelementptr inbounds i8*, i8** %194, i64 0
%196 = load i8*, i8** %195
%197 = call i64 @strcmp(i8* %193, i8* %196)
%198 = icmp ne i64 %197, 0
br i1 %198, label %199, label %325
199: ; preds = %192
%200 = load i8*, i8** %18
%201 = load i8**, i8*** %6
%202 = getelementptr inbounds i8*, i8** %201, i64 0
store i8* %200, i8** %202
%203 = load i32, i32* %8
%204 = icmp eq i32 %203, 1
br i1 %204, label %205, label %316
205: ; preds = %199
store i64 0, i64* %19
store i32 2, i32* %23
br label %206
206: ; preds = %219, %205
%207 = load i32, i32* %23
%208 = load i32, i32* %5
%209 = icmp slt i32 %207, %208
br i1 %209, label %210, label %222
210: ; preds = %206
%211 = load i8**, i8*** %6
%212 = load i32, i32* %23
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds i8*, i8** %211, i64 %213
%215 = load i8*, i8** %214
%216 = call i64 @strlen(i8* %215)
%217 = load i64, i64* %19
%218 = add i64 %217, %216
store i64 %218, i64* %19
br label %219
219: ; preds = %210
%220 = load i32, i32* %23
%221 = add nsw i32 %220, 1
store i32 %221, i32* %23
br label %206
222: ; preds = %206
%223 = load i64, i64* %19
%224 = load i32, i32* %5
%225 = sext i32 %224 to i64
%226 = add i64 %223, %225
%227 = add i64 %226, 1
%228 = call i8* @malloc(i64 %227)
store i8* %228, i8** %21
%229 = load i64, i64* %19
%230 = load i32, i32* %5
%231 = sext i32 %230 to i64
%232 = add i64 %229, %231
%233 = add i64 %232, 1
%234 = add i64 %233, 21
%235 = call i8* @malloc(i64 %234)
store i8* %235, i8** %22
%236 = load i8*, i8** %21
%237 = getelementptr inbounds i8, i8* %236, i64 0
store i8 0, i8* %237
store i32 2, i32* %23
br label %238
238: ; preds = %256, %222
%239 = load i32, i32* %23
%240 = load i32, i32* %5
%241 = icmp slt i32 %239, %240
br i1 %241, label %242, label %259
242: ; preds = %238
%243 = load i32, i32* %23
%244 = icmp sgt i32 %243, 2
br i1 %244, label %245, label %248
245: ; preds = %242
%246 = load i8*, i8** %21
%247 = call i32 @strcat(i8* %246, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %248
248: ; preds = %245, %242
%249 = load i8*, i8** %21
%250 = load i8**, i8*** %6
%251 = load i32, i32* %23
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds i8*, i8** %250, i64 %252
%254 = load i8*, i8** %253
%255 = call i32 @strcat(i8* %249, i8* %254)
br label %256
256: ; preds = %248
%257 = load i32, i32* %23
%258 = add nsw i32 %257, 1
store i32 %258, i32* %23
br label %238
259: ; preds = %238
%260 = load i8*, i8** %21
%261 = load i8**, i8*** %6
%262 = getelementptr inbounds i8*, i8** %261, i64 2
store i8* %260, i8** %262
%263 = load i8**, i8*** %6
%264 = getelementptr inbounds i8*, i8** %263, i64 3
store i8* null, i8** %264
%265 = load i8*, i8** %22
%266 = call i32 @strcpy(i8* %265, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%267 = load i8*, i8** %22
%268 = load i8*, i8** %21
%269 = call i32 @strcat(i8* %267, i8* %268)
store i64 0, i64* %19
store i32 0, i32* %23
br label %270
270: ; preds = %280, %259
%271 = load i8**, i8*** %7
%272 = load i32, i32* %23
%273 = sext i32 %272 to i64
%274 = getelementptr inbounds i8*, i8** %271, i64 %273
%275 = load i8*, i8** %274
%276 = icmp ne i8* %275, null
br i1 %276, label %277, label %283
277: ; preds = %270
%278 = load i64, i64* %19
%279 = add i64 %278, 1
store i64 %279, i64* %19
br label %280
280: ; preds = %277
%281 = load i32, i32* %23
%282 = add nsw i32 %281, 1
store i32 %282, i32* %23
br label %270
283: ; preds = %270
%284 = load i64, i64* %19
%285 = add i64 %284, 2
%286 = call i8** @calloc(i64 %285, i32 8)
store i8** %286, i8*** %20
store i32 0, i32* %23
br label %287
287: ; preds = %302, %283
%288 = load i32, i32* %23
%289 = sext i32 %288 to i64
%290 = load i64, i64* %19
%291 = icmp ult i64 %289, %290
br i1 %291, label %292, label %305
292: ; preds = %287
%293 = load i8**, i8*** %7
%294 = load i32, i32* %23
%295 = sext i32 %294 to i64
%296 = getelementptr inbounds i8*, i8** %293, i64 %295
%297 = load i8*, i8** %296
%298 = load i8**, i8*** %20
%299 = load i32, i32* %23
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds i8*, i8** %298, i64 %300
store i8* %297, i8** %301
br label %302
302: ; preds = %292
%303 = load i32, i32* %23
%304 = add nsw i32 %303, 1
store i32 %304, i32* %23
br label %287
305: ; preds = %287
%306 = load i8*, i8** %22
%307 = load i8**, i8*** %20
%308 = load i64, i64* %19
%309 = getelementptr inbounds i8*, i8** %307, i64 %308
store i8* %306, i8** %309
%310 = load i8**, i8*** %6
%311 = getelementptr inbounds i8*, i8** %310, i64 0
%312 = load i8*, i8** %311
%313 = load i8**, i8*** %6
%314 = load i8**, i8*** %20
%315 = call i32 @execve(i8* %312, i8** %313, i8** %314)
br label %323
316: ; preds = %199
%317 = load i8**, i8*** %6
%318 = getelementptr inbounds i8*, i8** %317, i64 0
%319 = load i8*, i8** %318
%320 = load i8**, i8*** %6
%321 = load i8**, i8*** %7
%322 = call i32 @execve(i8* %319, i8** %320, i8** %321)
br label %323
323: ; preds = %316, %305
%324 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %328
325: ; preds = %192
%326 = load i32, i32* @stderr
%327 = call i32 @fprintf(i32 %326, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.10, i64 0, i64 0))
br label %328
328: ; preds = %325, %323
br label %332
329: ; preds = %188
%330 = load i32, i32* @stderr
%331 = call i32 @fprintf(i32 %330, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0))
br label %332
332: ; preds = %329, %328
%333 = call i32 @exit(i32 1)
unreachable
334: ; preds = %171
%335 = load i32, i32* %10
ret i32 %335
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [3 x i8] c"-c\00"
@.str.1 = [12 x i8] c"sftp-server\00"
@.str.2 = [14 x i8] c"MySecureShell\00"
@AF_INET = global i32 0
@INADDR_LOOPBACK = global i32 0
@SOCK_STREAM = global i32 0
@.str.3 = [22 x i8] c"Unable to open socket\00"
@.str.4 = [25 x i8] c"Unable to connect socket\00"
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@.str.5 = [19 x i8] c"revoke root rights\00"
@.str.6 = [6 x i8] c"Shell\00"
@.str.7 = [2 x i8] c" \00"
@.str.8 = [22 x i8] c"SSH_ORIGINAL_COMMAND=\00"
@.str.9 = [14 x i8] c"execute shell\00"
@stderr = global i32 0
@.str.10 = [82 x i8] c"You cannot specify MySecureShell has shell (in the MySecureShell configuration) !\00"
@.str.11 = [27 x i8] c"Shell access is disabled !\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [4096 x i8]
%7 = alloca [4096 x i8]
%8 = icmp eq i32 %0, 3
br i1 %8, label %9, label %27
9: ; preds = %3
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %29, label %13
13: ; preds = %9
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = icmp eq i8* %15, null
br i1 %16, label %29, label %17
17: ; preds = %13
%18 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %29
20: ; preds = %17
%21 = load i8*, i8** %14
%22 = tail call i32* @strstr(i8* dereferenceable(1) %21, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %42
24: ; preds = %20
%25 = tail call i32* @strstr(i8* dereferenceable(1) %21, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i32* %25, null
br i1 %26, label %29, label %42
27: ; preds = %3
%28 = icmp sgt i32 %0, 2
br i1 %28, label %29, label %40
29: ; preds = %9, %13, %17, %24, %27
%30 = getelementptr inbounds i8*, i8** %1, i64 1
%31 = load i8*, i8** %30
%32 = icmp eq i8* %31, null
br i1 %32, label %40, label %33
33: ; preds = %29
%34 = getelementptr inbounds i8*, i8** %1, i64 2
%35 = load i8*, i8** %34
%36 = icmp eq i8* %35, null
br i1 %36, label %40, label %37
37: ; preds = %33
%38 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %31)
%39 = icmp eq i64 %38, 0
br i1 %39, label %115, label %40
40: ; preds = %37, %33, %29, %27
%41 = tail call i32 @ParseArgs(i32 %0, i8** %1)
br label %115
42: ; preds = %24, %20
%43 = bitcast %struct.sockaddr_in* %4 to i8*
%44 = bitcast i32* %5 to i8*
%45 = load i32, i32* @AF_INET
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 3
store i32 %45, i32* %46
%47 = load i32, i32* @INADDR_LOOPBACK
%48 = tail call i32 @htonl(i32 %47)
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2, i32 0
store i32 %48, i32* %49
%50 = tail call i32 @htons(i32 2020)
%51 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1
store i32 %50, i32* %51
%52 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
%53 = call i32 @memset(i32* %52, i8 signext 0, i32 8)
%54 = load i32, i32* @AF_INET
%55 = load i32, i32* @SOCK_STREAM
%56 = call i32 @socket(i32 %54, i32 %55, i32 0)
%57 = icmp slt i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %42
%59 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %107
60: ; preds = %42
%61 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%62 = call i32 @connect(i32 %56, %struct.sockaddr* %61, i32 16)
%63 = icmp slt i32 %62, 0
br i1 %63, label %70, label %64
64: ; preds = %60
%65 = add nuw nsw i32 %56, 1
%66 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%67 = bitcast [4096 x i8]* %6 to i8**
%68 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%69 = bitcast [4096 x i8]* %7 to i8**
br label %72
70: ; preds = %60
%71 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %110
72: ; preds = %105, %64
%73 = call i32 @FD_ZERO(i32* %5)
%74 = load i32, i32* @STDIN_FILENO
%75 = call i32 @FD_SET(i32 %74, i32* %5)
%76 = call i32 @FD_SET(i32 %56, i32* %5)
%77 = call i32 @select(i32 %65, i32* %5, i32* null, i32* null, i32* null)
%78 = icmp eq i32 %77, -1
br i1 %78, label %107, label %79
79: ; preds = %72
%80 = load i32, i32* @STDIN_FILENO
%81 = call i64 @FD_ISSET(i32 %80, i32* %5)
%82 = icmp eq i64 %81, 0
br i1 %82, label %93, label %83
83: ; preds = %79
%84 = load i32, i32* @STDIN_FILENO
%85 = call i64 @read(i32 %84, i8** %67, i32 4096)
%86 = icmp sgt i64 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %83
%88 = call i64 @write(i32 %56, i8** %67, i64 %85)
br label %91
89: ; preds = %83
%90 = icmp eq i64 %85, 0
br i1 %90, label %92, label %91
91: ; preds = %87, %89
br label %93
92: ; preds = %89
br label %107
93: ; preds = %91, %79
%94 = call i64 @FD_ISSET(i32 %56, i32* %5)
%95 = icmp eq i64 %94, 0
br i1 %95, label %105, label %96
96: ; preds = %93
%97 = call i64 @read(i32 %56, i8** %69, i32 4096)
%98 = icmp sgt i64 %97, 0
br i1 %98, label %99, label %102
99: ; preds = %96
%100 = load i32, i32* @STDOUT_FILENO
%101 = call i64 @write(i32 %100, i8** %69, i64 %97)
br label %104
102: ; preds = %96
%103 = icmp eq i64 %97, 0
br i1 %103, label %106, label %104
104: ; preds = %99, %102
br label %105
105: ; preds = %104, %93
br label %72
106: ; preds = %102
br label %107
107: ; preds = %72, %106, %92, %58
%108 = phi i32 [ 1, %58 ], [ %77, %92 ], [ %77, %106 ], [ -1, %72 ]
%109 = icmp eq i32 %56, -1
br i1 %109, label %113, label %110
110: ; preds = %70, %107
%111 = phi i32 [ 1, %70 ], [ %108, %107 ]
%112 = call i32 @close(i32 %56)
br label %113
113: ; preds = %110, %107
%114 = phi i32 [ %111, %110 ], [ %108, %107 ]
ret i32 %114
115: ; preds = %40, %37
%116 = phi i1 [ false, %40 ], [ true, %37 ]
%117 = tail call i64 (...) @getuid()
%118 = tail call i64 (...) @geteuid()
%119 = icmp eq i64 %117, %118
br i1 %119, label %131, label %120
120: ; preds = %115
%121 = tail call i64 (...) @getuid()
%122 = tail call i32 @seteuid(i64 %121)
%123 = icmp eq i32 %122, -1
br i1 %123, label %128, label %124
124: ; preds = %120
%125 = tail call i32 (...) @getgid()
%126 = tail call i32 @setegid(i32 %125)
%127 = icmp eq i32 %126, -1
br i1 %127, label %128, label %131
128: ; preds = %124, %120
%129 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%130 = tail call i32 @exit(i32 1)
unreachable
131: ; preds = %124, %115
%132 = tail call i8* @HashGet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%133 = icmp eq i8* %132, null
br i1 %133, label %332, label %134
134: ; preds = %131
%135 = load i8*, i8** %1
%136 = tail call i64 @strcmp(i8* %132, i8* %135)
%137 = icmp eq i64 %136, 0
br i1 %137, label %329, label %138
138: ; preds = %134
store i8* %132, i8** %1
br i1 %116, label %139, label %325
139: ; preds = %138
%140 = icmp sgt i32 %0, 2
br i1 %140, label %141, label %152
141: ; preds = %139
%142 = zext i32 %0 to i64
br label %143
143: ; preds = %141, %143
%144 = phi i64 [ 2, %141 ], [ %150, %143 ]
%145 = phi i64 [ 0, %141 ], [ %149, %143 ]
%146 = getelementptr inbounds i8*, i8** %1, i64 %144
%147 = load i8*, i8** %146
%148 = tail call i64 @strlen(i8* dereferenceable(1) %147)
%149 = add i64 %148, %145
%150 = add nuw nsw i64 %144, 1
%151 = icmp eq i64 %150, %142
br i1 %151, label %152, label %143
152: ; preds = %143, %139
%153 = phi i64 [ 0, %139 ], [ %149, %143 ]
%154 = sext i32 %0 to i64
%155 = add i64 %153, %154
%156 = add i64 %155, 1
%157 = tail call i8* @malloc(i64 %156)
%158 = add i64 %155, 22
%159 = tail call i8* @malloc(i64 %158)
store i8 0, i8* %157
br i1 %140, label %160, label %174
160: ; preds = %152
%161 = zext i32 %0 to i64
%162 = getelementptr inbounds i8*, i8** %1, i64 2
%163 = load i8*, i8** %162
%164 = tail call i32 @strcat(i8* %157, i8* %163)
%165 = icmp eq i32 %0, 3
br i1 %165, label %174, label %166
166: ; preds = %160, %166
%167 = phi i64 [ %172, %166 ], [ 3, %160 ]
%168 = tail call i32 @strcat(i8* %157, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%169 = getelementptr inbounds i8*, i8** %1, i64 %167
%170 = load i8*, i8** %169
%171 = tail call i32 @strcat(i8* %157, i8* %170)
%172 = add nuw nsw i64 %167, 1
%173 = icmp eq i64 %172, %161
br i1 %173, label %174, label %166
174: ; preds = %166, %160, %152
%175 = getelementptr inbounds i8*, i8** %1, i64 2
store i8* %157, i8** %175
%176 = getelementptr inbounds i8*, i8** %1, i64 3
store i8* null, i8** %176
%177 = tail call i32 @strcpy(i8* %159, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%178 = tail call i32 @strcat(i8* %159, i8* %157)
%179 = load i8*, i8** %2
%180 = icmp eq i8* %179, null
br i1 %180, label %181, label %183
181: ; preds = %174
%182 = tail call i8** @calloc(i64 2, i32 8)
br label %319
183: ; preds = %174, %183
%184 = phi i64 [ %185, %183 ], [ 0, %174 ]
%185 = add i64 %184, 1
%186 = getelementptr inbounds i8*, i8** %2, i64 %185
%187 = load i8*, i8** %186
%188 = icmp eq i8* %187, null
br i1 %188, label %189, label %183
189: ; preds = %183
%190 = add i64 %184, 3
%191 = tail call i8** @calloc(i64 %190, i32 8)
%192 = icmp eq i64 %185, 0
br i1 %192, label %319, label %193
193: ; preds = %189
%194 = add i64 %184, 1
%195 = icmp ult i64 %194, 4
br i1 %195, label %282, label %196
196: ; preds = %193
%197 = add i64 %184, 1
%198 = getelementptr i8*, i8** %191, i64 %197
%199 = getelementptr i8*, i8** %2, i64 %197
%200 = icmp ult i8** %191, %199
%201 = icmp ugt i8** %198, %2
%202 = and i1 %200, %201
br i1 %202, label %282, label %203
203: ; preds = %196
%204 = and i64 %194, -4
%205 = add i64 %204, -4
%206 = lshr exact i64 %205, 2
%207 = add nuw nsw i64 %206, 1
%208 = and i64 %207, 3
%209 = icmp ult i64 %205, 12
br i1 %209, label %261, label %210
210: ; preds = %203
%211 = and i64 %207, 9223372036854775804
br label %212
212: ; preds = %212, %210
%213 = phi i64 [ 0, %210 ], [ %258, %212 ]
%214 = phi i64 [ 0, %210 ], [ %259, %212 ]
%215 = getelementptr inbounds i8*, i8** %2, i64 %213
%216 = bitcast i8** %215 to <2 x i8*>*
%217 = load <2 x i8*>, <2 x i8*>* %216
%218 = getelementptr inbounds i8*, i8** %215, i64 2
%219 = bitcast i8** %218 to <2 x i8*>*
%220 = load <2 x i8*>, <2 x i8*>* %219
%221 = getelementptr inbounds i8*, i8** %191, i64 %213
%222 = bitcast i8** %221 to <2 x i8*>*
store <2 x i8*> %217, <2 x i8*>* %222
%223 = getelementptr inbounds i8*, i8** %221, i64 2
%224 = bitcast i8** %223 to <2 x i8*>*
store <2 x i8*> %220, <2 x i8*>* %224
%225 = or i64 %213, 4
%226 = getelementptr inbounds i8*, i8** %2, i64 %225
%227 = bitcast i8** %226 to <2 x i8*>*
%228 = load <2 x i8*>, <2 x i8*>* %227
%229 = getelementptr inbounds i8*, i8** %226, i64 2
%230 = bitcast i8** %229 to <2 x i8*>*
%231 = load <2 x i8*>, <2 x i8*>* %230
%232 = getelementptr inbounds i8*, i8** %191, i64 %225
%233 = bitcast i8** %232 to <2 x i8*>*
store <2 x i8*> %228, <2 x i8*>* %233
%234 = getelementptr inbounds i8*, i8** %232, i64 2
%235 = bitcast i8** %234 to <2 x i8*>*
store <2 x i8*> %231, <2 x i8*>* %235
%236 = or i64 %213, 8
%237 = getelementptr inbounds i8*, i8** %2, i64 %236
%238 = bitcast i8** %237 to <2 x i8*>*
%239 = load <2 x i8*>, <2 x i8*>* %238
%240 = getelementptr inbounds i8*, i8** %237, i64 2
%241 = bitcast i8** %240 to <2 x i8*>*
%242 = load <2 x i8*>, <2 x i8*>* %241
%243 = getelementptr inbounds i8*, i8** %191, i64 %236
%244 = bitcast i8** %243 to <2 x i8*>*
store <2 x i8*> %239, <2 x i8*>* %244
%245 = getelementptr inbounds i8*, i8** %243, i64 2
%246 = bitcast i8** %245 to <2 x i8*>*
store <2 x i8*> %242, <2 x i8*>* %246
%247 = or i64 %213, 12
%248 = getelementptr inbounds i8*, i8** %2, i64 %247
%249 = bitcast i8** %248 to <2 x i8*>*
%250 = load <2 x i8*>, <2 x i8*>* %249
%251 = getelementptr inbounds i8*, i8** %248, i64 2
%252 = bitcast i8** %251 to <2 x i8*>*
%253 = load <2 x i8*>, <2 x i8*>* %252
%254 = getelementptr inbounds i8*, i8** %191, i64 %247
%255 = bitcast i8** %254 to <2 x i8*>*
store <2 x i8*> %250, <2 x i8*>* %255
%256 = getelementptr inbounds i8*, i8** %254, i64 2
%257 = bitcast i8** %256 to <2 x i8*>*
store <2 x i8*> %253, <2 x i8*>* %257
%258 = add nuw i64 %213, 16
%259 = add nuw i64 %214, 4
%260 = icmp eq i64 %259, %211
br i1 %260, label %261, label %212
261: ; preds = %212, %203
%262 = phi i64 [ 0, %203 ], [ %258, %212 ]
%263 = icmp eq i64 %208, 0
br i1 %263, label %280, label %264
264: ; preds = %261, %264
%265 = phi i64 [ %277, %264 ], [ %262, %261 ]
%266 = phi i64 [ %278, %264 ], [ 0, %261 ]
%267 = getelementptr inbounds i8*, i8** %2, i64 %265
%268 = bitcast i8** %267 to <2 x i8*>*
%269 = load <2 x i8*>, <2 x i8*>* %268
%270 = getelementptr inbounds i8*, i8** %267, i64 2
%271 = bitcast i8** %270 to <2 x i8*>*
%272 = load <2 x i8*>, <2 x i8*>* %271
%273 = getelementptr inbounds i8*, i8** %191, i64 %265
%274 = bitcast i8** %273 to <2 x i8*>*
store <2 x i8*> %269, <2 x i8*>* %274
%275 = getelementptr inbounds i8*, i8** %273, i64 2
%276 = bitcast i8** %275 to <2 x i8*>*
store <2 x i8*> %272, <2 x i8*>* %276
%277 = add nuw i64 %265, 4
%278 = add i64 %266, 1
%279 = icmp eq i64 %278, %208
br i1 %279, label %280, label %264
280: ; preds = %264, %261
%281 = icmp eq i64 %194, %204
br i1 %281, label %319, label %282
282: ; preds = %196, %193, %280
%283 = phi i64 [ 0, %196 ], [ 0, %193 ], [ %204, %280 ]
%284 = add i64 %184, 1
%285 = sub i64 %184, %283
%286 = and i64 %284, 3
%287 = icmp eq i64 %286, 0
br i1 %287, label %297, label %288
288: ; preds = %282, %288
%289 = phi i64 [ %294, %288 ], [ %283, %282 ]
%290 = phi i64 [ %295, %288 ], [ 0, %282 ]
%291 = getelementptr inbounds i8*, i8** %2, i64 %289
%292 = load i8*, i8** %291
%293 = getelementptr inbounds i8*, i8** %191, i64 %289
store i8* %292, i8** %293
%294 = add nuw nsw i64 %289, 1
%295 = add i64 %290, 1
%296 = icmp eq i64 %295, %286
br i1 %296, label %297, label %288
297: ; preds = %288, %282
%298 = phi i64 [ %283, %282 ], [ %294, %288 ]
%299 = icmp ult i64 %285, 3
br i1 %299, label %319, label %300
300: ; preds = %297, %300
%301 = phi i64 [ %317, %300 ], [ %298, %297 ]
%302 = getelementptr inbounds i8*, i8** %2, i64 %301
%303 = load i8*, i8** %302
%304 = getelementptr inbounds i8*, i8** %191, i64 %301
store i8* %303, i8** %304
%305 = add nuw nsw i64 %301, 1
%306 = getelementptr inbounds i8*, i8** %2, i64 %305
%307 = load i8*, i8** %306
%308 = getelementptr inbounds i8*, i8** %191, i64 %305
store i8* %307, i8** %308
%309 = add nuw nsw i64 %301, 2
%310 = getelementptr inbounds i8*, i8** %2, i64 %309
%311 = load i8*, i8** %310
%312 = getelementptr inbounds i8*, i8** %191, i64 %309
store i8* %311, i8** %312
%313 = add nuw nsw i64 %301, 3
%314 = getelementptr inbounds i8*, i8** %2, i64 %313
%315 = load i8*, i8** %314
%316 = getelementptr inbounds i8*, i8** %191, i64 %313
store i8* %315, i8** %316
%317 = add nuw nsw i64 %301, 4
%318 = icmp eq i64 %313, %184
br i1 %318, label %319, label %300
319: ; preds = %297, %300, %280, %181, %189
%320 = phi i8** [ %182, %181 ], [ %191, %189 ], [ %191, %280 ], [ %191, %300 ], [ %191, %297 ]
%321 = phi i64 [ 0, %181 ], [ 0, %189 ], [ %185, %280 ], [ %185, %300 ], [ %185, %297 ]
%322 = getelementptr inbounds i8*, i8** %320, i64 %321
store i8* %159, i8** %322
%323 = load i8*, i8** %1
%324 = tail call i32 @execve(i8* %323, i8** %1, i8** %320)
br label %327
325: ; preds = %138
%326 = tail call i32 @execve(i8* %132, i8** %1, i8** %2)
br label %327
327: ; preds = %325, %319
%328 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %335
329: ; preds = %134
%330 = load i32, i32* @stderr
%331 = tail call i32 @fprintf(i32 %330, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.10, i64 0, i64 0))
br label %335
332: ; preds = %131
%333 = load i32, i32* @stderr
%334 = tail call i32 @fprintf(i32 %333, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0))
br label %335
335: ; preds = %327, %329, %332
%336 = tail call i32 @exit(i32 1)
unreachable
}