#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int atoi(char *);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ ftok(char *, int);
int getpid();
scalar_t__ malloc(int);
scalar_t__ shmat(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ shmdt(int *);
int shmget(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ sprintf(char *, char *, int, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
scalar_t__ waitpid(int, int *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int i;
  char *buf;
  if (argc == 3) {
    int size_x, size_y;
    size_x = atoi(argv[1]);
    size_y = atoi(argv[2]);
    buf = (char *)malloc(sizeof(char) * 100);
    for (i = 0; i < size_x; ++i) {
      if (fork() == 0) {
        sprintf(buf, "%d", i);
        char *n_argv[7] = {argv[0], argv[1], argv[2], buf, "x", "child", NULL};
        execvp(argv[0], n_argv);
      } else
        continue;
    }
    for (i = 0; i < size_y; ++i) {
      if (fork() == 0) {
        sprintf(buf, "%d", i);
        char *n_argv[7] = {argv[0], argv[1], argv[2], buf, "y", "child", NULL};
        execvp(argv[0], n_argv);
      } else
        continue;
    }
    int status;
    while (waitpid(-1, &status, 0) > 0)
      ;
    exit(0);
  } else {
    buf = (char *)malloc(sizeof(char) * 100);
    key_t key_m_x, key_m_y, key_m_o;
    key_m_x = ftok("./main", 1337);
    key_m_y = ftok("./main", 1338);
    key_m_o = ftok("./main", 1339);
    int myval, myindex, size_x, size_y, size_o, shmid_merge_x, shmid_merge_y,
        shmid_merge_o;
    int *shm_merge_x, *shm_merge_y, *shm_merge_o;
    size_x = atoi(argv[1]);
    size_y = atoi(argv[2]);
    size_o = size_x + size_y;
    myindex = atoi(argv[3]);
    shmid_merge_x = shmget(key_m_x, sizeof(int) * size_x, 0666);
    shm_merge_x = (int *)shmat(shmid_merge_x, NULL, 0);
    shmid_merge_y = shmget(key_m_y, sizeof(int) * size_y, 0666);
    shm_merge_y = (int *)shmat(shmid_merge_y, NULL, 0);
    shmid_merge_o =
        shmget(key_m_o, (sizeof(int) * size_x + sizeof(int) * size_y), 0666);
    shm_merge_o = (int *)shmat(shmid_merge_o, NULL, 0);
    if (strcmp(argv[4], "x")) {
      myval = shm_merge_x[myindex];
      sprintf(buf, "      $$$ MERGE (%d): handling x[%d] = %d\n", getpid(),
              myindex, myval);
      write(STDOUT_FILENO, buf, strlen(buf));
      i = 0;
      while (shm_merge_y[i] < myval && i < size_y)
        ++i;
      if (i == 0) {
        sprintf(buf,
                "      $$$ MERGE (%d): x[%d] = %d is found to be smaller than "
                "y[0] = %d.\n",
                getpid(), myindex, myval, shm_merge_y[0]);
        write(STDOUT_FILENO, buf, strlen(buf));
      } else if (i == size_y) {
        sprintf(buf,
                "      $$$ MERGE (%d): x[%d] = %d is found to be larger than "
                "y[%d] = %d.\n",
                getpid(), myindex, myval, i, shm_merge_y[0]);
        write(STDOUT_FILENO, buf, strlen(buf));
      } else {
        sprintf(buf,
                "      $$$ MERGE (%d): x[%d] = %d is found to be between y[%d] "
                "= %d and y=[%d] and %d\n",
                getpid(), myindex, myval, i, shm_merge_y[i], i + 1,
                shm_merge_y[i + 1]);
        write(STDOUT_FILENO, buf, strlen(buf));
      }
      sprintf(buf,
              "      $$$ MERGE (%d): writing x[%d] = %d into index %d of the "
              "output array\n",
              getpid(), myindex, myval, i + myindex);
      write(STDOUT_FILENO, buf, strlen(buf));
      shm_merge_o[i + myindex] = myval;
      shmdt(shm_merge_x);
      shmdt(shm_merge_y);
      shmdt(shm_merge_o);
      exit(0);
    } else if (strcmp(argv[4], "y")) {
      myval = shm_merge_y[myindex];
      sprintf(buf, "      $$$ MERGE (%d): handling y[%d] = %d\n", getpid(),
              myindex, myval);
      write(STDOUT_FILENO, buf, strlen(buf));
      i = 0;
      while (shm_merge_x[i] < myval && i < size_x)
        ++i;
      if (i == 0) {
        sprintf(buf,
                "      $$$ MERGE (%d): y[%d] = %d is found to be smaller than "
                "x[0] = %d.\n",
                getpid(), myindex, myval, shm_merge_x[0]);
        write(STDOUT_FILENO, buf, strlen(buf));
      } else if (i == size_x) {
        sprintf(buf,
                "      $$$ MERGE (%d): y[%d] = %d is found to be larger than "
                "x[%d] = %d.\n",
                getpid(), myindex, myval, i, shm_merge_x[0]);
        write(STDOUT_FILENO, buf, strlen(buf));
      } else {
        sprintf(buf,
                "      $$$ MERGE (%d): y[%d] = %d is found to be between x[%d] "
                "= %d and x = [%d] and %d\n",
                getpid(), myindex, myval, i, shm_merge_x[i], i + 1,
                shm_merge_x[i + 1]);
        write(STDOUT_FILENO, buf, strlen(buf));
      }
      sprintf(buf,
              "      $$$ MERGE (%d): writing y[%d] = %d into index %d of the "
              "output array\n",
              getpid(), myindex, myval, i + myindex);
      write(STDOUT_FILENO, buf, strlen(buf));
      shm_merge_o[i + myindex] = myval;
      shmdt(shm_merge_x);
      shmdt(shm_merge_y);
      shmdt(shm_merge_o);
      exit(0);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    13d5 <main+0x1e5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    $0x64,%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12e9 <main+0xf9>
mov    $0x0,%al
call   1110 <fork@plt>
cmp    $0x0,%rax
jne    12d1 <main+0xe1>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xd94(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    0xd5e(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xd55(%rip),%rax
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0x60(%rbp),%rsi
call   10c0 <execvp@plt>
jmp    12d6 <main+0xe6>
jmp    12db <main+0xeb>
jmp    12db <main+0xeb>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1241 <main+0x51>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    13a7 <main+0x1b7>
mov    $0x0,%al
call   1110 <fork@plt>
cmp    $0x0,%rax
jne    138f <main+0x19f>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xce5(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x98(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x90(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x88(%rbp)
lea    0xcab(%rip),%rax
mov    %rax,-0x80(%rbp)
lea    0xc9a(%rip),%rax
mov    %rax,-0x78(%rbp)
movq   $0x0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0xa0(%rbp),%rsi
call   10c0 <execvp@plt>
jmp    1394 <main+0x1a4>
jmp    1399 <main+0x1a9>
jmp    1399 <main+0x1a9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12f0 <main+0x100>
jmp    13ac <main+0x1bc>
mov    $0xffffffff,%edi
lea    -0xa4(%rbp),%rsi
xor    %edx,%edx
call   1090 <waitpid@plt>
cmp    $0x0,%rax
jle    13ce <main+0x1de>
jmp    13ac <main+0x1bc>
xor    %edi,%edi
call   10f0 <exit@plt>
mov    $0x64,%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
lea    0xc23(%rip),%rdi
mov    $0x539,%esi
call   1100 <ftok@plt>
mov    %eax,-0xa8(%rbp)
lea    0xc0c(%rip),%rdi
mov    $0x53a,%esi
call   1100 <ftok@plt>
mov    %eax,-0xac(%rbp)
lea    0xbf5(%rip),%rdi
mov    $0x53b,%esi
call   1100 <ftok@plt>
mov    %eax,-0xb0(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0xbc(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0xc0(%rbp)
mov    -0xbc(%rbp),%eax
add    -0xc0(%rbp),%eax
mov    %eax,-0xc4(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0xb8(%rbp)
mov    -0xa8(%rbp),%edi
movslq -0xbc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
mov    $0x1b6,%edx
call   10b0 <shmget@plt>
mov    %eax,-0xc8(%rbp)
mov    -0xc8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10a0 <shmat@plt>
mov    %rax,-0xd8(%rbp)
mov    -0xac(%rbp),%edi
movslq -0xc0(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
mov    $0x1b6,%edx
call   10b0 <shmget@plt>
mov    %eax,-0xcc(%rbp)
mov    -0xcc(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10a0 <shmat@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xb0(%rbp),%edi
movslq -0xbc(%rbp),%rax
shl    $0x2,%rax
movslq -0xc0(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %eax,%esi
mov    $0x1b6,%edx
call   10b0 <shmget@plt>
mov    %eax,-0xd0(%rbp)
mov    -0xd0(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10a0 <shmat@plt>
mov    %rax,-0xe8(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xac2(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     18b3 <main+0x6c3>
mov    -0xd8(%rbp),%rax
movslq -0xb8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x100(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x100(%rbp),%rdi
mov    %eax,%edx
mov    -0xb8(%rbp),%ecx
mov    -0xb4(%rbp),%r8d
lea    0xa7e(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    0x2a4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xf4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0xf4(%rbp),%edi
mov    -0xf0(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
movl   $0x0,-0x14(%rbp)
mov    -0xe0(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
xor    %eax,%eax
cmp    -0xb4(%rbp),%ecx
mov    %al,-0x101(%rbp)
jge    160f <main+0x41f>
mov    -0x14(%rbp),%eax
cmp    -0xc0(%rbp),%eax
setl   %al
mov    %al,-0x101(%rbp)
mov    -0x101(%rbp),%al
test   $0x1,%al
jne    1622 <main+0x432>
jmp    1630 <main+0x440>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    15db <main+0x3eb>
cmpl   $0x0,-0x14(%rbp)
jne    16b6 <main+0x4c6>
mov    -0x20(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x120(%rbp),%rdi
mov    %eax,%edx
mov    -0xb8(%rbp),%ecx
mov    -0xb4(%rbp),%r8d
mov    -0xe0(%rbp),%rax
mov    (%rax),%r9d
lea    0x9cc(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    0x296f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x114(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x110(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x114(%rbp),%edi
mov    -0x110(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
jmp    17f4 <main+0x604>
mov    -0x14(%rbp),%eax
cmp    -0xc0(%rbp),%eax
jne    1747 <main+0x557>
mov    -0x20(%rbp),%rax
mov    %rax,-0x138(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x138(%rbp),%rdi
mov    %eax,%edx
mov    -0xb8(%rbp),%ecx
mov    -0xb4(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0xe0(%rbp),%rax
mov    (%rax),%eax
lea    0x987(%rip),%rsi
mov    %eax,(%rsp)
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    0x28de(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x12c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x12c(%rbp),%edi
mov    -0x128(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
jmp    17ef <main+0x5ff>
mov    -0x20(%rbp),%rax
mov    %rax,-0x150(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x150(%rbp),%rdi
mov    %eax,%edx
mov    -0xb8(%rbp),%ecx
mov    -0xb4(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0xe0(%rbp),%rax
movslq -0x14(%rbp),%rsi
mov    (%rax,%rsi,4),%r11d
mov    -0x14(%rbp),%r10d
add    $0x1,%r10d
mov    -0xe0(%rbp),%rax
mov    -0x14(%rbp),%esi
add    $0x1,%esi
movslq %esi,%rsi
mov    (%rax,%rsi,4),%eax
lea    0x92d(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    0x2831(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x144(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x140(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x144(%rbp),%edi
mov    -0x140(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
jmp    17f4 <main+0x604>
mov    -0x20(%rbp),%rax
mov    %rax,-0x168(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x168(%rbp),%rdi
mov    %eax,%edx
mov    -0xb8(%rbp),%ecx
mov    -0xb4(%rbp),%r8d
mov    -0x14(%rbp),%r9d
add    -0xb8(%rbp),%r9d
lea    0x8f9(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    0x27b4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x15c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x158(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x15c(%rbp),%edi
mov    -0x158(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    -0xb4(%rbp),%edx
mov    -0xe8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0xb8(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xd8(%rbp),%rdi
call   1030 <shmdt@plt>
mov    -0xe0(%rbp),%rdi
call   1030 <shmdt@plt>
mov    -0xe8(%rbp),%rdi
call   1030 <shmdt@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0x749(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1c34 <main+0xa44>
mov    -0xe0(%rbp),%rax
movslq -0xb8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x180(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x180(%rbp),%rdi
mov    %eax,%edx
mov    -0xb8(%rbp),%ecx
mov    -0xb4(%rbp),%r8d
lea    0x85c(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    0x26cb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x174(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x170(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x174(%rbp),%edi
mov    -0x170(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
movl   $0x0,-0x14(%rbp)
mov    -0xd8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
xor    %eax,%eax
cmp    -0xb4(%rbp),%ecx
mov    %al,-0x181(%rbp)
jge    1990 <main+0x7a0>
mov    -0x14(%rbp),%eax
cmp    -0xbc(%rbp),%eax
setl   %al
mov    %al,-0x181(%rbp)
mov    -0x181(%rbp),%al
test   $0x1,%al
jne    19a3 <main+0x7b3>
jmp    19b1 <main+0x7c1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    195c <main+0x76c>
cmpl   $0x0,-0x14(%rbp)
jne    1a37 <main+0x847>
mov    -0x20(%rbp),%rax
mov    %rax,-0x1a0(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x1a0(%rbp),%rdi
mov    %eax,%edx
mov    -0xb8(%rbp),%ecx
mov    -0xb4(%rbp),%r8d
mov    -0xd8(%rbp),%rax
mov    (%rax),%r9d
lea    0x7aa(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    0x25ee(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x194(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x190(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x194(%rbp),%edi
mov    -0x190(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
jmp    1b75 <main+0x985>
mov    -0x14(%rbp),%eax
cmp    -0xbc(%rbp),%eax
jne    1ac8 <main+0x8d8>
mov    -0x20(%rbp),%rax
mov    %rax,-0x1b8(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x1b8(%rbp),%rdi
mov    %eax,%edx
mov    -0xb8(%rbp),%ecx
mov    -0xb4(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0xd8(%rbp),%rax
mov    (%rax),%eax
lea    0x765(%rip),%rsi
mov    %eax,(%rsp)
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    0x255d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1ac(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x1a8(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x1ac(%rbp),%edi
mov    -0x1a8(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
jmp    1b70 <main+0x980>
mov    -0x20(%rbp),%rax
mov    %rax,-0x1d0(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x1d0(%rbp),%rdi
mov    %eax,%edx
mov    -0xb8(%rbp),%ecx
mov    -0xb4(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0xd8(%rbp),%rax
movslq -0x14(%rbp),%rsi
mov    (%rax,%rsi,4),%r11d
mov    -0x14(%rbp),%r10d
add    $0x1,%r10d
mov    -0xd8(%rbp),%rax
mov    -0x14(%rbp),%esi
add    $0x1,%esi
movslq %esi,%rsi
mov    (%rax,%rsi,4),%eax
lea    0x70b(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    0x24b0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x1c0(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x1c4(%rbp),%edi
mov    -0x1c0(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
jmp    1b75 <main+0x985>
mov    -0x20(%rbp),%rax
mov    %rax,-0x1e8(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x1e8(%rbp),%rdi
mov    %eax,%edx
mov    -0xb8(%rbp),%ecx
mov    -0xb4(%rbp),%r8d
mov    -0x14(%rbp),%r9d
add    -0xb8(%rbp),%r9d
lea    0x6d9(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    0x2433(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1dc(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x1d8(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x1dc(%rbp),%edi
mov    -0x1d8(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    -0xb4(%rbp),%edx
mov    -0xe8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0xb8(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xd8(%rbp),%rdi
call   1030 <shmdt@plt>
mov    -0xe0(%rbp),%rdi
call   1030 <shmdt@plt>
mov    -0xe8(%rbp),%rdi
call   1030 <shmdt@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
jmp    1c39 <main+0xa49>
jmp    1c3e <main+0xa4e>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%r15
cmp    $0x3,%edi
je     1326 <main+0x136>
mov    $0x64,%edi
call   1080 <malloc@plt>
mov    %rax,0x8(%rsp)
lea    0xded(%rip),%rbx
mov    %rbx,%rdi
mov    $0x539,%esi
call   1100 <ftok@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x53a,%esi
call   1100 <ftok@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
mov    $0x53b,%esi
call   1100 <ftok@plt>
mov    %eax,0x18(%rsp)
mov    0x8(%r15),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ebx
mov    0x10(%r15),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r12d
mov    0x18(%r15),%rdi
call   10d0 <atoi@plt>
mov    %eax,0x4(%rsp)
mov    %rbx,0x20(%rsp)
lea    0x0(,%rbx,4),%r14d
mov    %ebp,%edi
mov    %r14d,%esi
mov    $0x1b6,%edx
call   10b0 <shmget@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10a0 <shmat@plt>
mov    %rax,0x10(%rsp)
lea    0x0(,%r12,4),%esi
mov    %r13d,%edi
mov    $0x1b6,%edx
call   10b0 <shmget@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10a0 <shmat@plt>
mov    %rax,%r13
lea    (%r14,%r12,4),%esi
mov    0x18(%rsp),%edi
mov    $0x1b6,%edx
call   10b0 <shmget@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10a0 <shmat@plt>
mov    %rax,%rbx
mov    0x20(%r15),%rdi
lea    0xd15(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    13cf <main+0x1df>
mov    0x20(%r15),%rdi
lea    0xd04(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    152b <main+0x33b>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%r15),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%r15),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r14d
mov    $0x64,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
test   %ebp,%ebp
jle    1489 <main+0x299>
lea    0x30(%rsp),%rbx
xor    %r12d,%r12d
jmp    136d <main+0x17d>
nopl   0x0(%rax)
add    $0x1,%r12d
cmp    %r12d,%ebp
je     1489 <main+0x299>
xor    %eax,%eax
call   1110 <fork@plt>
test   %rax,%rax
jne    1360 <main+0x170>
mov    %r13,%rdi
lea    0xc7d(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    (%r15),%rdi
mov    %rdi,0x30(%rsp)
movups 0x8(%r15),%xmm0
movups %xmm0,0x38(%rsp)
mov    %r13,0x48(%rsp)
lea    0xc58(%rip),%rax
mov    %rax,0x50(%rsp)
lea    0xc4e(%rip),%rax
mov    %rax,0x58(%rsp)
movq   $0x0,0x60(%rsp)
mov    %rbx,%rsi
call   10c0 <execvp@plt>
jmp    1360 <main+0x170>
mov    %rbx,0x18(%rsp)
mov    %r12d,%eax
mov    %rax,0x20(%rsp)
movslq %r12d,%rbp
mov    0x4(%rsp),%r14d
movslq %r14d,%rax
mov    0x10(%rsp),%rcx
mov    (%rcx,%rax,4),%r15d
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xc14(%rip),%rsi
mov    0x8(%rsp),%r12
mov    %r12,%rdi
mov    %eax,%edx
mov    %r14d,%ecx
mov    %r15d,%r8d
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    0x2bd2(%rip),%rax
mov    (%rax),%r14d
mov    %r12,%rdi
call   1060 <strlen@plt>
mov    %r14d,%edi
mov    %r12,%rsi
mov    %eax,%edx
call   1040 <write@plt>
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%rbx),%r14
cmp    %r15d,0x0(%r13,%rbx,4)
jge    1453 <main+0x263>
cmp    %rbp,%rbx
mov    %r14,%rbx
jl     1440 <main+0x250>
cmp    $0x1,%r14d
jne    15e8 <main+0x3f8>
xor    %eax,%eax
call   1050 <getpid@plt>
mov    0x0(%r13),%r9d
lea    0xbd0(%rip),%rsi
mov    0x8(%rsp),%rdi
mov    %eax,%edx
mov    0x4(%rsp),%ecx
mov    %r15d,%r8d
xor    %eax,%eax
call   10e0 <sprintf@plt>
jmp    16b9 <main+0x4c9>
test   %r14d,%r14d
jle    1502 <main+0x312>
lea    0xb70(%rip),%rbp
lea    0x30(%rsp),%r12
xor    %ebx,%ebx
jmp    14a8 <main+0x2b8>
xchg   %ax,%ax
add    $0x1,%ebx
cmp    %ebx,%r14d
je     1502 <main+0x312>
xor    %eax,%eax
call   1110 <fork@plt>
test   %rax,%rax
jne    14a0 <main+0x2b0>
mov    %r13,%rdi
lea    0xb42(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    (%r15),%rdi
mov    %rdi,0x30(%rsp)
movups 0x8(%r15),%xmm0
movups %xmm0,0x38(%rsp)
mov    %r13,0x48(%rsp)
lea    0xb26(%rip),%rax
mov    %rax,0x50(%rsp)
mov    %rbp,0x58(%rsp)
movq   $0x0,0x60(%rsp)
mov    %r12,%rsi
call   10c0 <execvp@plt>
jmp    14a0 <main+0x2b0>
lea    0x30(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    $0xffffffff,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1090 <waitpid@plt>
test   %rax,%rax
jg     1510 <main+0x320>
xor    %edi,%edi
call   10f0 <exit@plt>
mov    %rbx,0x18(%rsp)
mov    0x20(%rsp),%rax
mov    %eax,%ecx
mov    %rcx,0x28(%rsp)
movslq %eax,%rbp
mov    0x4(%rsp),%r14d
movslq %r14d,%rax
mov    0x0(%r13,%rax,4),%r12d
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xc17(%rip),%rsi
mov    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %eax,%edx
mov    %r14d,%ecx
mov    %r12d,%r8d
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    0x2a76(%rip),%rax
mov    (%rax),%r14d
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    %r14d,%edi
mov    %r15,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    0x10(%rsp),%rax
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%r14
cmp    %r12d,(%rax,%rbx,4)
jge    15b2 <main+0x3c2>
cmp    %rbp,%rbx
mov    %r14,%rbx
jl     15a0 <main+0x3b0>
cmp    $0x1,%r14d
jne    1634 <main+0x444>
xor    %eax,%eax
call   1050 <getpid@plt>
mov    0x10(%rsp),%rcx
mov    (%rcx),%r9d
lea    0xbd0(%rip),%rsi
mov    0x8(%rsp),%rdi
mov    %eax,%edx
mov    0x4(%rsp),%ecx
mov    %r12d,%r8d
xor    %eax,%eax
call   10e0 <sprintf@plt>
jmp    1771 <main+0x581>
mov    0x20(%rsp),%rax
lea    0x1(%rax),%rbx
xor    %eax,%eax
call   1050 <getpid@plt>
cmp    %r14d,%ebx
jne    1683 <main+0x493>
mov    0x0(%r13),%ebp
sub    $0x8,%rsp
lea    0xa78(%rip),%rsi
mov    0x10(%rsp),%rdi
mov    %eax,%edx
mov    0xc(%rsp),%ecx
mov    %r15d,%r8d
mov    0x28(%rsp),%r9
xor    %eax,%eax
push   %rbp
call   10e0 <sprintf@plt>
add    $0x10,%rsp
jmp    16b9 <main+0x4c9>
mov    0x28(%rsp),%rax
lea    0x1(%rax),%rbx
xor    %eax,%eax
call   1050 <getpid@plt>
mov    %eax,%edx
cmp    %r14d,%ebx
jne    1739 <main+0x549>
mov    0x10(%rsp),%rax
mov    (%rax),%ebp
sub    $0x8,%rsp
lea    0xb86(%rip),%rsi
mov    0x10(%rsp),%rdi
mov    0xc(%rsp),%ecx
mov    %r12d,%r8d
mov    0x30(%rsp),%r9
xor    %eax,%eax
push   %rbp
call   10e0 <sprintf@plt>
add    $0x10,%rsp
jmp    1771 <main+0x581>
lea    -0x1(%r14),%r9
mov    -0x4(%r13,%r14,4),%ebp
mov    0x0(%r13,%r14,4),%ebx
sub    $0x8,%rsp
lea    0xa35(%rip),%rsi
mov    0x10(%rsp),%rdi
mov    %eax,%edx
mov    0xc(%rsp),%ecx
mov    %r15d,%r8d
xor    %eax,%eax
push   %rbx
push   %r14
push   %rbp
call   10e0 <sprintf@plt>
add    $0x20,%rsp
mov    0x2930(%rip),%rax
mov    (%rax),%ebx
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,%r12d
add    $0xffffffff,%r12d
add    %r14,%r12
lea    0xa30(%rip),%rsi
mov    %rbp,%rdi
mov    %eax,%edx
mov    %r15d,%r8d
mov    %r12d,%r9d
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    0x28e0(%rip),%rax
mov    (%rax),%r14d
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1040 <write@plt>
movslq %r12d,%rax
mov    0x18(%rsp),%rbx
mov    %r15d,(%rbx,%rax,4)
jmp    17e9 <main+0x5f9>
lea    -0x1(%r14),%r9
mov    0x10(%rsp),%rax
mov    -0x4(%rax,%r14,4),%ebp
mov    (%rax,%r14,4),%ebx
sub    $0x8,%rsp
lea    0xada(%rip),%rsi
mov    0x10(%rsp),%rdi
mov    0xc(%rsp),%ecx
mov    %r12d,%r8d
xor    %eax,%eax
push   %rbx
push   %r14
push   %rbp
call   10e0 <sprintf@plt>
add    $0x20,%rsp
mov    0x2878(%rip),%rbp
mov    0x0(%rbp),%r15d
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,%r15d
add    $0xffffffff,%r15d
add    %r14,%r15
lea    0xad6(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
mov    %r12d,%r8d
mov    %r15d,%r9d
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    0x0(%rbp),%r14d
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
movslq %r15d,%rax
mov    0x18(%rsp),%rbx
mov    %r12d,(%rbx,%rax,4)
mov    0x10(%rsp),%rdi
call   1030 <shmdt@plt>
mov    %r13,%rdi
call   1030 <shmdt@plt>
mov    %rbx,%rdi
call   1030 <shmdt@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"x\00"
@.str.2 = [6 x i8] c"child\00"
@.str.3 = [2 x i8] c"y\00"
@.str.4 = [7 x i8] c"./main\00"
@.str.5 = [43 x i8] c" $$$ MERGE (%d): handling x[%d] = %d\0A\00"
@STDOUT_FILENO = global i32 0
@.str.6 = [73 x i8] c" $$$ MERGE (%d): x[%d] = %d is found to be smaller than y[0] = %d.\0A\00"
@.str.7 = [73 x i8] c" $$$ MERGE (%d): x[%d] = %d is found to be larger than y[%d] = %d.\0A\00"
@.str.8 = [86 x i8] c" $$$ MERGE (%d): x[%d] = %d is found to be between y[%d] = %d and y=[%d] and %d\0A\00"
@.str.9 = [76 x i8] c" $$$ MERGE (%d): writing x[%d] = %d into index %d of the output array\0A\00"
@.str.10 = [43 x i8] c" $$$ MERGE (%d): handling y[%d] = %d\0A\00"
@.str.11 = [73 x i8] c" $$$ MERGE (%d): y[%d] = %d is found to be smaller than x[0] = %d.\0A\00"
@.str.12 = [73 x i8] c" $$$ MERGE (%d): y[%d] = %d is found to be larger than x[%d] = %d.\0A\00"
@.str.13 = [88 x i8] c" $$$ MERGE (%d): y[%d] = %d is found to be between x[%d] = %d and x = [%d] and %d\0A\00"
@.str.14 = [76 x i8] c" $$$ MERGE (%d): writing y[%d] = %d into index %d of the output array\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [7 x i8*]
%10 = alloca [7 x i8*]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32*
%24 = alloca i32*
%25 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 3
br i1 %27, label %28, label %123
28: ; preds = %2
%29 = load i8**, i8*** %4
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 @atoi(i8* %31)
store i32 %32, i32* %7
%33 = load i8**, i8*** %4
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %8
%37 = call i64 @malloc(i32 100)
%38 = inttoptr i64 %37 to i8*
store i8* %38, i8** %6
store i32 0, i32* %5
br label %39
39: ; preds = %74, %28
%40 = load i32, i32* %5
%41 = load i32, i32* %7
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %77
43: ; preds = %39
%44 = call i64 (...) @fork()
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %72
46: ; preds = %43
%47 = load i8*, i8** %6
%48 = load i32, i32* %5
%49 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %48)
%50 = getelementptr inbounds [7 x i8*], [7 x i8*]* %9, i64 0, i64 0
%51 = load i8**, i8*** %4
%52 = getelementptr inbounds i8*, i8** %51, i64 0
%53 = load i8*, i8** %52
store i8* %53, i8** %50
%54 = getelementptr inbounds i8*, i8** %50, i64 1
%55 = load i8**, i8*** %4
%56 = getelementptr inbounds i8*, i8** %55, i64 1
%57 = load i8*, i8** %56
store i8* %57, i8** %54
%58 = getelementptr inbounds i8*, i8** %54, i64 1
%59 = load i8**, i8*** %4
%60 = getelementptr inbounds i8*, i8** %59, i64 2
%61 = load i8*, i8** %60
store i8* %61, i8** %58
%62 = getelementptr inbounds i8*, i8** %58, i64 1
%63 = load i8*, i8** %6
store i8* %63, i8** %62
%64 = getelementptr inbounds i8*, i8** %62, i64 1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %64
%65 = getelementptr inbounds i8*, i8** %64, i64 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %65
%66 = getelementptr inbounds i8*, i8** %65, i64 1
store i8* null, i8** %66
%67 = load i8**, i8*** %4
%68 = getelementptr inbounds i8*, i8** %67, i64 0
%69 = load i8*, i8** %68
%70 = getelementptr inbounds [7 x i8*], [7 x i8*]* %9, i64 0, i64 0
%71 = call i32 @execvp(i8* %69, i8** %70)
br label %73
72: ; preds = %43
br label %74
73: ; preds = %46
br label %74
74: ; preds = %73, %72
%75 = load i32, i32* %5
%76 = add nsw i32 %75, 1
store i32 %76, i32* %5
br label %39
77: ; preds = %39
store i32 0, i32* %5
br label %78
78: ; preds = %113, %77
%79 = load i32, i32* %5
%80 = load i32, i32* %8
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %116
82: ; preds = %78
%83 = call i64 (...) @fork()
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %111
85: ; preds = %82
%86 = load i8*, i8** %6
%87 = load i32, i32* %5
%88 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %86, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %87)
%89 = getelementptr inbounds [7 x i8*], [7 x i8*]* %10, i64 0, i64 0
%90 = load i8**, i8*** %4
%91 = getelementptr inbounds i8*, i8** %90, i64 0
%92 = load i8*, i8** %91
store i8* %92, i8** %89
%93 = getelementptr inbounds i8*, i8** %89, i64 1
%94 = load i8**, i8*** %4
%95 = getelementptr inbounds i8*, i8** %94, i64 1
%96 = load i8*, i8** %95
store i8* %96, i8** %93
%97 = getelementptr inbounds i8*, i8** %93, i64 1
%98 = load i8**, i8*** %4
%99 = getelementptr inbounds i8*, i8** %98, i64 2
%100 = load i8*, i8** %99
store i8* %100, i8** %97
%101 = getelementptr inbounds i8*, i8** %97, i64 1
%102 = load i8*, i8** %6
store i8* %102, i8** %101
%103 = getelementptr inbounds i8*, i8** %101, i64 1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %103
%104 = getelementptr inbounds i8*, i8** %103, i64 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %104
%105 = getelementptr inbounds i8*, i8** %104, i64 1
store i8* null, i8** %105
%106 = load i8**, i8*** %4
%107 = getelementptr inbounds i8*, i8** %106, i64 0
%108 = load i8*, i8** %107
%109 = getelementptr inbounds [7 x i8*], [7 x i8*]* %10, i64 0, i64 0
%110 = call i32 @execvp(i8* %108, i8** %109)
br label %112
111: ; preds = %82
br label %113
112: ; preds = %85
br label %113
113: ; preds = %112, %111
%114 = load i32, i32* %5
%115 = add nsw i32 %114, 1
store i32 %115, i32* %5
br label %78
116: ; preds = %78
br label %117
117: ; preds = %120, %116
%118 = call i64 @waitpid(i32 -1, i32* %11, i32 0)
%119 = icmp sgt i64 %118, 0
br i1 %119, label %120, label %121
120: ; preds = %117
br label %117
121: ; preds = %117
%122 = call i32 @exit(i32 0)
unreachable
123: ; preds = %2
%124 = call i64 @malloc(i32 100)
%125 = inttoptr i64 %124 to i8*
store i8* %125, i8** %6
%126 = call i32 @ftok(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1337)
store i32 %126, i32* %12
%127 = call i32 @ftok(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1338)
store i32 %127, i32* %13
%128 = call i32 @ftok(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1339)
store i32 %128, i32* %14
%129 = load i8**, i8*** %4
%130 = getelementptr inbounds i8*, i8** %129, i64 1
%131 = load i8*, i8** %130
%132 = call i32 @atoi(i8* %131)
store i32 %132, i32* %17
%133 = load i8**, i8*** %4
%134 = getelementptr inbounds i8*, i8** %133, i64 2
%135 = load i8*, i8** %134
%136 = call i32 @atoi(i8* %135)
store i32 %136, i32* %18
%137 = load i32, i32* %17
%138 = load i32, i32* %18
%139 = add nsw i32 %137, %138
store i32 %139, i32* %19
%140 = load i8**, i8*** %4
%141 = getelementptr inbounds i8*, i8** %140, i64 3
%142 = load i8*, i8** %141
%143 = call i32 @atoi(i8* %142)
store i32 %143, i32* %16
%144 = load i32, i32* %12
%145 = load i32, i32* %17
%146 = sext i32 %145 to i64
%147 = mul i64 4, %146
%148 = trunc i64 %147 to i32
%149 = call i32 @shmget(i32 %144, i32 %148, i32 438)
store i32 %149, i32* %20
%150 = load i32, i32* %20
%151 = call i64 @shmat(i32 %150, i32* null, i32 0)
%152 = inttoptr i64 %151 to i32*
store i32* %152, i32** %23
%153 = load i32, i32* %13
%154 = load i32, i32* %18
%155 = sext i32 %154 to i64
%156 = mul i64 4, %155
%157 = trunc i64 %156 to i32
%158 = call i32 @shmget(i32 %153, i32 %157, i32 438)
store i32 %158, i32* %21
%159 = load i32, i32* %21
%160 = call i64 @shmat(i32 %159, i32* null, i32 0)
%161 = inttoptr i64 %160 to i32*
store i32* %161, i32** %24
%162 = load i32, i32* %14
%163 = load i32, i32* %17
%164 = sext i32 %163 to i64
%165 = mul i64 4, %164
%166 = load i32, i32* %18
%167 = sext i32 %166 to i64
%168 = mul i64 4, %167
%169 = add i64 %165, %168
%170 = trunc i64 %169 to i32
%171 = call i32 @shmget(i32 %162, i32 %170, i32 438)
store i32 %171, i32* %22
%172 = load i32, i32* %22
%173 = call i64 @shmat(i32 %172, i32* null, i32 0)
%174 = inttoptr i64 %173 to i32*
store i32* %174, i32** %25
%175 = load i8**, i8*** %4
%176 = getelementptr inbounds i8*, i8** %175, i64 4
%177 = load i8*, i8** %176
%178 = call i64 @strcmp(i8* %177, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%179 = icmp ne i64 %178, 0
br i1 %179, label %180, label %303
180: ; preds = %123
%181 = load i32*, i32** %23
%182 = load i32, i32* %16
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds i32, i32* %181, i64 %183
%185 = load i32, i32* %184
store i32 %185, i32* %15
%186 = load i8*, i8** %6
%187 = call i32 (...) @getpid()
%188 = load i32, i32* %16
%189 = load i32, i32* %15
%190 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %186, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %187, i32 %188, i32 %189)
%191 = load i32, i32* @STDOUT_FILENO
%192 = load i8*, i8** %6
%193 = load i8*, i8** %6
%194 = call i32 @strlen(i8* %193)
%195 = call i32 @write(i32 %191, i8* %192, i32 %194)
store i32 0, i32* %5
br label %196
196: ; preds = %210, %180
%197 = load i32*, i32** %24
%198 = load i32, i32* %5
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds i32, i32* %197, i64 %199
%201 = load i32, i32* %200
%202 = load i32, i32* %15
%203 = icmp slt i32 %201, %202
br i1 %203, label %204, label %208
204: ; preds = %196
%205 = load i32, i32* %5
%206 = load i32, i32* %18
%207 = icmp slt i32 %205, %206
br label %208
208: ; preds = %204, %196
%209 = phi i1 [ false, %196 ], [ %207, %204 ]
br i1 %209, label %210, label %213
210: ; preds = %208
%211 = load i32, i32* %5
%212 = add nsw i32 %211, 1
store i32 %212, i32* %5
br label %196
213: ; preds = %208
%214 = load i32, i32* %5
%215 = icmp eq i32 %214, 0
br i1 %215, label %216, label %230
216: ; preds = %213
%217 = load i8*, i8** %6
%218 = call i32 (...) @getpid()
%219 = load i32, i32* %16
%220 = load i32, i32* %15
%221 = load i32*, i32** %24
%222 = getelementptr inbounds i32, i32* %221, i64 0
%223 = load i32, i32* %222
%224 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %217, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.6, i64 0, i64 0), i32 %218, i32 %219, i32 %220, i32 %223)
%225 = load i32, i32* @STDOUT_FILENO
%226 = load i8*, i8** %6
%227 = load i8*, i8** %6
%228 = call i32 @strlen(i8* %227)
%229 = call i32 @write(i32 %225, i8* %226, i32 %228)
br label %275
230: ; preds = %213
%231 = load i32, i32* %5
%232 = load i32, i32* %18
%233 = icmp eq i32 %231, %232
br i1 %233, label %234, label %249
234: ; preds = %230
%235 = load i8*, i8** %6
%236 = call i32 (...) @getpid()
%237 = load i32, i32* %16
%238 = load i32, i32* %15
%239 = load i32, i32* %5
%240 = load i32*, i32** %24
%241 = getelementptr inbounds i32, i32* %240, i64 0
%242 = load i32, i32* %241
%243 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %235, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.7, i64 0, i64 0), i32 %236, i32 %237, i32 %238, i32 %239, i32 %242)
%244 = load i32, i32* @STDOUT_FILENO
%245 = load i8*, i8** %6
%246 = load i8*, i8** %6
%247 = call i32 @strlen(i8* %246)
%248 = call i32 @write(i32 %244, i8* %245, i32 %247)
br label %274
249: ; preds = %230
%250 = load i8*, i8** %6
%251 = call i32 (...) @getpid()
%252 = load i32, i32* %16
%253 = load i32, i32* %15
%254 = load i32, i32* %5
%255 = load i32*, i32** %24
%256 = load i32, i32* %5
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds i32, i32* %255, i64 %257
%259 = load i32, i32* %258
%260 = load i32, i32* %5
%261 = add nsw i32 %260, 1
%262 = load i32*, i32** %24
%263 = load i32, i32* %5
%264 = add nsw i32 %263, 1
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds i32, i32* %262, i64 %265
%267 = load i32, i32* %266
%268 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %250, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.8, i64 0, i64 0), i32 %251, i32 %252, i32 %253, i32 %254, i32 %259, i32 %261, i32 %267)
%269 = load i32, i32* @STDOUT_FILENO
%270 = load i8*, i8** %6
%271 = load i8*, i8** %6
%272 = call i32 @strlen(i8* %271)
%273 = call i32 @write(i32 %269, i8* %270, i32 %272)
br label %274
274: ; preds = %249, %234
br label %275
275: ; preds = %274, %216
%276 = load i8*, i8** %6
%277 = call i32 (...) @getpid()
%278 = load i32, i32* %16
%279 = load i32, i32* %15
%280 = load i32, i32* %5
%281 = load i32, i32* %16
%282 = add nsw i32 %280, %281
%283 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %276, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.9, i64 0, i64 0), i32 %277, i32 %278, i32 %279, i32 %282)
%284 = load i32, i32* @STDOUT_FILENO
%285 = load i8*, i8** %6
%286 = load i8*, i8** %6
%287 = call i32 @strlen(i8* %286)
%288 = call i32 @write(i32 %284, i8* %285, i32 %287)
%289 = load i32, i32* %15
%290 = load i32*, i32** %25
%291 = load i32, i32* %5
%292 = load i32, i32* %16
%293 = add nsw i32 %291, %292
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds i32, i32* %290, i64 %294
store i32 %289, i32* %295
%296 = load i32*, i32** %23
%297 = call i32 @shmdt(i32* %296)
%298 = load i32*, i32** %24
%299 = call i32 @shmdt(i32* %298)
%300 = load i32*, i32** %25
%301 = call i32 @shmdt(i32* %300)
%302 = call i32 @exit(i32 0)
unreachable
303: ; preds = %123
%304 = load i8**, i8*** %4
%305 = getelementptr inbounds i8*, i8** %304, i64 4
%306 = load i8*, i8** %305
%307 = call i64 @strcmp(i8* %306, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%308 = icmp ne i64 %307, 0
br i1 %308, label %309, label %432
309: ; preds = %303
%310 = load i32*, i32** %24
%311 = load i32, i32* %16
%312 = sext i32 %311 to i64
%313 = getelementptr inbounds i32, i32* %310, i64 %312
%314 = load i32, i32* %313
store i32 %314, i32* %15
%315 = load i8*, i8** %6
%316 = call i32 (...) @getpid()
%317 = load i32, i32* %16
%318 = load i32, i32* %15
%319 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %315, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i32 %316, i32 %317, i32 %318)
%320 = load i32, i32* @STDOUT_FILENO
%321 = load i8*, i8** %6
%322 = load i8*, i8** %6
%323 = call i32 @strlen(i8* %322)
%324 = call i32 @write(i32 %320, i8* %321, i32 %323)
store i32 0, i32* %5
br label %325
325: ; preds = %339, %309
%326 = load i32*, i32** %23
%327 = load i32, i32* %5
%328 = sext i32 %327 to i64
%329 = getelementptr inbounds i32, i32* %326, i64 %328
%330 = load i32, i32* %329
%331 = load i32, i32* %15
%332 = icmp slt i32 %330, %331
br i1 %332, label %333, label %337
333: ; preds = %325
%334 = load i32, i32* %5
%335 = load i32, i32* %17
%336 = icmp slt i32 %334, %335
br label %337
337: ; preds = %333, %325
%338 = phi i1 [ false, %325 ], [ %336, %333 ]
br i1 %338, label %339, label %342
339: ; preds = %337
%340 = load i32, i32* %5
%341 = add nsw i32 %340, 1
store i32 %341, i32* %5
br label %325
342: ; preds = %337
%343 = load i32, i32* %5
%344 = icmp eq i32 %343, 0
br i1 %344, label %345, label %359
345: ; preds = %342
%346 = load i8*, i8** %6
%347 = call i32 (...) @getpid()
%348 = load i32, i32* %16
%349 = load i32, i32* %15
%350 = load i32*, i32** %23
%351 = getelementptr inbounds i32, i32* %350, i64 0
%352 = load i32, i32* %351
%353 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %346, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.11, i64 0, i64 0), i32 %347, i32 %348, i32 %349, i32 %352)
%354 = load i32, i32* @STDOUT_FILENO
%355 = load i8*, i8** %6
%356 = load i8*, i8** %6
%357 = call i32 @strlen(i8* %356)
%358 = call i32 @write(i32 %354, i8* %355, i32 %357)
br label %404
359: ; preds = %342
%360 = load i32, i32* %5
%361 = load i32, i32* %17
%362 = icmp eq i32 %360, %361
br i1 %362, label %363, label %378
363: ; preds = %359
%364 = load i8*, i8** %6
%365 = call i32 (...) @getpid()
%366 = load i32, i32* %16
%367 = load i32, i32* %15
%368 = load i32, i32* %5
%369 = load i32*, i32** %23
%370 = getelementptr inbounds i32, i32* %369, i64 0
%371 = load i32, i32* %370
%372 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %364, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.12, i64 0, i64 0), i32 %365, i32 %366, i32 %367, i32 %368, i32 %371)
%373 = load i32, i32* @STDOUT_FILENO
%374 = load i8*, i8** %6
%375 = load i8*, i8** %6
%376 = call i32 @strlen(i8* %375)
%377 = call i32 @write(i32 %373, i8* %374, i32 %376)
br label %403
378: ; preds = %359
%379 = load i8*, i8** %6
%380 = call i32 (...) @getpid()
%381 = load i32, i32* %16
%382 = load i32, i32* %15
%383 = load i32, i32* %5
%384 = load i32*, i32** %23
%385 = load i32, i32* %5
%386 = sext i32 %385 to i64
%387 = getelementptr inbounds i32, i32* %384, i64 %386
%388 = load i32, i32* %387
%389 = load i32, i32* %5
%390 = add nsw i32 %389, 1
%391 = load i32*, i32** %23
%392 = load i32, i32* %5
%393 = add nsw i32 %392, 1
%394 = sext i32 %393 to i64
%395 = getelementptr inbounds i32, i32* %391, i64 %394
%396 = load i32, i32* %395
%397 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %379, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.13, i64 0, i64 0), i32 %380, i32 %381, i32 %382, i32 %383, i32 %388, i32 %390, i32 %396)
%398 = load i32, i32* @STDOUT_FILENO
%399 = load i8*, i8** %6
%400 = load i8*, i8** %6
%401 = call i32 @strlen(i8* %400)
%402 = call i32 @write(i32 %398, i8* %399, i32 %401)
br label %403
403: ; preds = %378, %363
br label %404
404: ; preds = %403, %345
%405 = load i8*, i8** %6
%406 = call i32 (...) @getpid()
%407 = load i32, i32* %16
%408 = load i32, i32* %15
%409 = load i32, i32* %5
%410 = load i32, i32* %16
%411 = add nsw i32 %409, %410
%412 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %405, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.14, i64 0, i64 0), i32 %406, i32 %407, i32 %408, i32 %411)
%413 = load i32, i32* @STDOUT_FILENO
%414 = load i8*, i8** %6
%415 = load i8*, i8** %6
%416 = call i32 @strlen(i8* %415)
%417 = call i32 @write(i32 %413, i8* %414, i32 %416)
%418 = load i32, i32* %15
%419 = load i32*, i32** %25
%420 = load i32, i32* %5
%421 = load i32, i32* %16
%422 = add nsw i32 %420, %421
%423 = sext i32 %422 to i64
%424 = getelementptr inbounds i32, i32* %419, i64 %423
store i32 %418, i32* %424
%425 = load i32*, i32** %23
%426 = call i32 @shmdt(i32* %425)
%427 = load i32*, i32** %24
%428 = call i32 @shmdt(i32* %427)
%429 = load i32*, i32** %25
%430 = call i32 @shmdt(i32* %429)
%431 = call i32 @exit(i32 0)
unreachable
432: ; preds = %303
br label %433
433: ; preds = %432
br label %434
434: ; preds = %433
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"x\00"
@.str.2 = [6 x i8] c"child\00"
@.str.3 = [2 x i8] c"y\00"
@.str.4 = [7 x i8] c"./main\00"
@.str.5 = [43 x i8] c" $$$ MERGE (%d): handling x[%d] = %d\0A\00"
@STDOUT_FILENO = global i32 0
@.str.6 = [73 x i8] c" $$$ MERGE (%d): x[%d] = %d is found to be smaller than y[0] = %d.\0A\00"
@.str.7 = [73 x i8] c" $$$ MERGE (%d): x[%d] = %d is found to be larger than y[%d] = %d.\0A\00"
@.str.8 = [86 x i8] c" $$$ MERGE (%d): x[%d] = %d is found to be between y[%d] = %d and y=[%d] and %d\0A\00"
@.str.9 = [76 x i8] c" $$$ MERGE (%d): writing x[%d] = %d into index %d of the output array\0A\00"
@.str.10 = [43 x i8] c" $$$ MERGE (%d): handling y[%d] = %d\0A\00"
@.str.11 = [73 x i8] c" $$$ MERGE (%d): y[%d] = %d is found to be smaller than x[0] = %d.\0A\00"
@.str.12 = [73 x i8] c" $$$ MERGE (%d): y[%d] = %d is found to be larger than x[%d] = %d.\0A\00"
@.str.13 = [88 x i8] c" $$$ MERGE (%d): y[%d] = %d is found to be between x[%d] = %d and x = [%d] and %d\0A\00"
@.str.14 = [76 x i8] c" $$$ MERGE (%d): writing y[%d] = %d into index %d of the output array\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [7 x i8*]
%4 = alloca [7 x i8*]
%5 = alloca i32
%6 = icmp eq i32 %0, 3
br i1 %6, label %7, label %70
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = tail call i64 @malloc(i32 100)
%15 = inttoptr i64 %14 to i8*
%16 = icmp sgt i32 %10, 0
br i1 %16, label %17, label %27
17: ; preds = %7
%18 = bitcast [7 x i8*]* %3 to i8*
%19 = getelementptr inbounds [7 x i8*], [7 x i8*]* %3, i64 0, i64 0
%20 = getelementptr inbounds [7 x i8*], [7 x i8*]* %3, i64 0, i64 1
%21 = getelementptr inbounds [7 x i8*], [7 x i8*]* %3, i64 0, i64 3
%22 = getelementptr inbounds [7 x i8*], [7 x i8*]* %3, i64 0, i64 4
%23 = getelementptr inbounds [7 x i8*], [7 x i8*]* %3, i64 0, i64 5
%24 = getelementptr inbounds [7 x i8*], [7 x i8*]* %3, i64 0, i64 6
%25 = bitcast i8** %8 to <2 x i8*>*
%26 = bitcast i8** %20 to <2 x i8*>*
br label %39
27: ; preds = %48, %7
%28 = icmp sgt i32 %13, 0
br i1 %28, label %29, label %63
29: ; preds = %27
%30 = bitcast [7 x i8*]* %4 to i8*
%31 = getelementptr inbounds [7 x i8*], [7 x i8*]* %4, i64 0, i64 0
%32 = getelementptr inbounds [7 x i8*], [7 x i8*]* %4, i64 0, i64 1
%33 = getelementptr inbounds [7 x i8*], [7 x i8*]* %4, i64 0, i64 3
%34 = getelementptr inbounds [7 x i8*], [7 x i8*]* %4, i64 0, i64 4
%35 = getelementptr inbounds [7 x i8*], [7 x i8*]* %4, i64 0, i64 5
%36 = getelementptr inbounds [7 x i8*], [7 x i8*]* %4, i64 0, i64 6
%37 = bitcast i8** %8 to <2 x i8*>*
%38 = bitcast i8** %32 to <2 x i8*>*
br label %51
39: ; preds = %17, %48
%40 = phi i32 [ 0, %17 ], [ %49, %48 ]
%41 = call i64 (...) @fork()
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %48
43: ; preds = %39
%44 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %15, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %40)
%45 = load i8*, i8** %1
store i8* %45, i8** %19
%46 = load <2 x i8*>, <2 x i8*>* %25
store <2 x i8*> %46, <2 x i8*>* %26
store i8* %15, i8** %21
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %22
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %23
store i8* null, i8** %24
%47 = call i32 @execvp(i8* %45, i8** %19)
br label %48
48: ; preds = %39, %43
%49 = add nuw nsw i32 %40, 1
%50 = icmp eq i32 %49, %10
br i1 %50, label %27, label %39
51: ; preds = %29, %60
%52 = phi i32 [ 0, %29 ], [ %61, %60 ]
%53 = call i64 (...) @fork()
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %60
55: ; preds = %51
%56 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %15, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %52)
%57 = load i8*, i8** %1
store i8* %57, i8** %31
%58 = load <2 x i8*>, <2 x i8*>* %37
store <2 x i8*> %58, <2 x i8*>* %38
store i8* %15, i8** %33
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %34
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %35
store i8* null, i8** %36
%59 = call i32 @execvp(i8* %57, i8** %31)
br label %60
60: ; preds = %51, %55
%61 = add nuw nsw i32 %52, 1
%62 = icmp eq i32 %61, %13
br i1 %62, label %63, label %51
63: ; preds = %60, %27
%64 = bitcast i32* %5 to i8*
br label %65
65: ; preds = %65, %63
%66 = call i64 @waitpid(i32 -1, i32* %5, i32 0)
%67 = icmp sgt i64 %66, 0
br i1 %67, label %65, label %68
68: ; preds = %65
%69 = call i32 @exit(i32 0)
unreachable
70: ; preds = %2
%71 = tail call i64 @malloc(i32 100)
%72 = inttoptr i64 %71 to i8*
%73 = tail call i32 @ftok(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1337)
%74 = tail call i32 @ftok(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1338)
%75 = tail call i32 @ftok(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1339)
%76 = getelementptr inbounds i8*, i8** %1, i64 1
%77 = load i8*, i8** %76
%78 = tail call i32 @atoi(i8* %77)
%79 = getelementptr inbounds i8*, i8** %1, i64 2
%80 = load i8*, i8** %79
%81 = tail call i32 @atoi(i8* %80)
%82 = getelementptr inbounds i8*, i8** %1, i64 3
%83 = load i8*, i8** %82
%84 = tail call i32 @atoi(i8* %83)
%85 = sext i32 %78 to i64
%86 = shl nsw i64 %85, 2
%87 = trunc i64 %86 to i32
%88 = tail call i32 @shmget(i32 %73, i32 %87, i32 438)
%89 = tail call i64 @shmat(i32 %88, i32* null, i32 0)
%90 = inttoptr i64 %89 to i32*
%91 = sext i32 %81 to i64
%92 = shl nsw i64 %91, 2
%93 = trunc i64 %92 to i32
%94 = tail call i32 @shmget(i32 %74, i32 %93, i32 438)
%95 = tail call i64 @shmat(i32 %94, i32* null, i32 0)
%96 = inttoptr i64 %95 to i32*
%97 = add nsw i64 %92, %86
%98 = trunc i64 %97 to i32
%99 = tail call i32 @shmget(i32 %75, i32 %98, i32 438)
%100 = tail call i64 @shmat(i32 %99, i32* null, i32 0)
%101 = inttoptr i64 %100 to i32*
%102 = getelementptr inbounds i8*, i8** %1, i64 4
%103 = load i8*, i8** %102
%104 = tail call i64 @strcmp(i8* %103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%105 = icmp eq i64 %104, 0
br i1 %105, label %161, label %106
106: ; preds = %70
%107 = sext i32 %84 to i64
%108 = getelementptr inbounds i32, i32* %90, i64 %107
%109 = load i32, i32* %108
%110 = tail call i32 (...) @getpid()
%111 = tail call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %72, i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %110, i32 %84, i32 %109)
%112 = load i32, i32* @STDOUT_FILENO
%113 = tail call i32 @strlen(i8* %72)
%114 = tail call i32 @write(i32 %112, i8* %72, i32 %113)
br label %115
115: ; preds = %115, %106
%116 = phi i64 [ %122, %115 ], [ 0, %106 ]
%117 = getelementptr inbounds i32, i32* %96, i64 %116
%118 = load i32, i32* %117
%119 = icmp slt i32 %118, %109
%120 = icmp slt i64 %116, %91
%121 = select i1 %119, i1 %120, i1 false
%122 = add nuw nsw i64 %116, 1
br i1 %121, label %115, label %123
123: ; preds = %115
%124 = trunc i64 %116 to i32
%125 = and i64 %116, 4294967295
%126 = getelementptr inbounds i32, i32* %96, i64 %125
%127 = icmp eq i32 %124, 0
br i1 %127, label %128, label %132
128: ; preds = %123
%129 = tail call i32 (...) @getpid()
%130 = load i32, i32* %96
%131 = tail call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %72, i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.6, i64 0, i64 0), i32 %129, i32 %84, i32 %109, i32 %130)
br label %145
132: ; preds = %123
%133 = icmp eq i32 %81, %124
%134 = tail call i32 (...) @getpid()
br i1 %133, label %135, label %138
135: ; preds = %132
%136 = load i32, i32* %96
%137 = tail call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %72, i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.7, i64 0, i64 0), i32 %134, i32 %84, i32 %109, i32 %81, i32 %136)
br label %145
138: ; preds = %132
%139 = load i32, i32* %126
%140 = add nuw nsw i32 %124, 1
%141 = zext i32 %140 to i64
%142 = getelementptr inbounds i32, i32* %96, i64 %141
%143 = load i32, i32* %142
%144 = tail call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %72, i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @.str.8, i64 0, i64 0), i32 %134, i32 %84, i32 %109, i32 %124, i32 %139, i32 %140, i32 %143)
br label %145
145: ; preds = %135, %138, %128
%146 = load i32, i32* @STDOUT_FILENO
%147 = tail call i32 @strlen(i8* %72)
%148 = tail call i32 @write(i32 %146, i8* %72, i32 %147)
%149 = tail call i32 (...) @getpid()
%150 = add nsw i32 %84, %124
%151 = tail call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %72, i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.9, i64 0, i64 0), i32 %149, i32 %84, i32 %109, i32 %150)
%152 = load i32, i32* @STDOUT_FILENO
%153 = tail call i32 @strlen(i8* %72)
%154 = tail call i32 @write(i32 %152, i8* %72, i32 %153)
%155 = sext i32 %150 to i64
%156 = getelementptr inbounds i32, i32* %101, i64 %155
store i32 %109, i32* %156
%157 = tail call i32 @shmdt(i32* %90)
%158 = tail call i32 @shmdt(i32* %96)
%159 = tail call i32 @shmdt(i32* %101)
%160 = tail call i32 @exit(i32 0)
unreachable
161: ; preds = %70
%162 = load i8*, i8** %102
%163 = tail call i64 @strcmp(i8* %162, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%164 = icmp eq i64 %163, 0
br i1 %164, label %220, label %165
165: ; preds = %161
%166 = sext i32 %84 to i64
%167 = getelementptr inbounds i32, i32* %96, i64 %166
%168 = load i32, i32* %167
%169 = tail call i32 (...) @getpid()
%170 = tail call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %72, i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), i32 %169, i32 %84, i32 %168)
%171 = load i32, i32* @STDOUT_FILENO
%172 = tail call i32 @strlen(i8* %72)
%173 = tail call i32 @write(i32 %171, i8* %72, i32 %172)
br label %174
174: ; preds = %174, %165
%175 = phi i64 [ %181, %174 ], [ 0, %165 ]
%176 = getelementptr inbounds i32, i32* %90, i64 %175
%177 = load i32, i32* %176
%178 = icmp slt i32 %177, %168
%179 = icmp slt i64 %175, %85
%180 = select i1 %178, i1 %179, i1 false
%181 = add nuw nsw i64 %175, 1
br i1 %180, label %174, label %182
182: ; preds = %174
%183 = trunc i64 %175 to i32
%184 = and i64 %175, 4294967295
%185 = getelementptr inbounds i32, i32* %90, i64 %184
%186 = icmp eq i32 %183, 0
br i1 %186, label %187, label %191
187: ; preds = %182
%188 = tail call i32 (...) @getpid()
%189 = load i32, i32* %90
%190 = tail call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %72, i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.11, i64 0, i64 0), i32 %188, i32 %84, i32 %168, i32 %189)
br label %204
191: ; preds = %182
%192 = icmp eq i32 %78, %183
%193 = tail call i32 (...) @getpid()
br i1 %192, label %194, label %197
194: ; preds = %191
%195 = load i32, i32* %90
%196 = tail call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %72, i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.12, i64 0, i64 0), i32 %193, i32 %84, i32 %168, i32 %78, i32 %195)
br label %204
197: ; preds = %191
%198 = load i32, i32* %185
%199 = add nuw nsw i32 %183, 1
%200 = zext i32 %199 to i64
%201 = getelementptr inbounds i32, i32* %90, i64 %200
%202 = load i32, i32* %201
%203 = tail call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %72, i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str.13, i64 0, i64 0), i32 %193, i32 %84, i32 %168, i32 %183, i32 %198, i32 %199, i32 %202)
br label %204
204: ; preds = %194, %197, %187
%205 = load i32, i32* @STDOUT_FILENO
%206 = tail call i32 @strlen(i8* %72)
%207 = tail call i32 @write(i32 %205, i8* %72, i32 %206)
%208 = tail call i32 (...) @getpid()
%209 = add nsw i32 %84, %183
%210 = tail call i32 (i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) %72, i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.14, i64 0, i64 0), i32 %208, i32 %84, i32 %168, i32 %209)
%211 = load i32, i32* @STDOUT_FILENO
%212 = tail call i32 @strlen(i8* %72)
%213 = tail call i32 @write(i32 %211, i8* %72, i32 %212)
%214 = sext i32 %209 to i64
%215 = getelementptr inbounds i32, i32* %101, i64 %214
store i32 %168, i32* %215
%216 = tail call i32 @shmdt(i32* %90)
%217 = tail call i32 @shmdt(i32* %96)
%218 = tail call i32 @shmdt(i32* %101)
%219 = tail call i32 @exit(i32 0)
unreachable
220: ; preds = %161
ret i32 0
}