#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 */
struct timespec {
  int dummy;
};
struct mq_attr {
  int mq_maxmsg;
  int mq_msgsize;
};
typedef scalar_t__ ssize_t;
typedef scalar_t__ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int EEXIST;
int EINVAL;
int ENAMETOOLONG;
int ENOENT;
int ETIMEDOUT;
int O_CREAT;
int O_EXCL;
int O_RDWR;
int /*<<< orphan*/ add_timespec(struct timespec *, int);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ consumer(int /*<<< orphan*/ *);
int errno;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ mq_close(scalar_t__);
scalar_t__ mq_open(char *, int, int, struct mq_attr *);
int mq_timedreceive(scalar_t__, char *, int, unsigned int *, struct timespec *);
int mq_timedsend(scalar_t__, char *, int, unsigned int, struct timespec *);
scalar_t__ mq_unlink(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int);
scalar_t__ start_producer();
int /*<<< orphan*/ stdout;
int mqueue_test(void) {
  int err;
  mqd_t mqdes;
  int i;
  char msg[32];
  unsigned prio;
  struct timespec timeout;
  struct mq_attr attr;
  printf("Test mq_open() ENOENT...");
  errno = 0;
  mqdes = mq_open("/app/some_queue", O_RDWR, 0666, &attr);
  if (errno != ENOENT) {
    printf("Should have failed with ENOENT not %d\n", errno);
    return -1;
  }
  printf("passed\n");
  printf("Test mq_open() ENAMETOOLONG...");
  errno = 0;
  attr.mq_maxmsg = 0;
  attr.mq_msgsize = 32;
  mq_open("012345678901234567890123456789012345678901234567890",
          O_CREAT | O_EXCL | O_RDWR, 0666, &attr);
  if (errno != ENAMETOOLONG) {
    printf("Should have failed with ENAMETOOLONG not %d\n", errno);
    return -1;
  }
  printf("passed\n");
  printf("Test mq_open() EINVAL...");
  errno = 0;
  attr.mq_maxmsg = 0;
  attr.mq_msgsize = 0;
  mq_open("queue1", O_CREAT | O_EXCL | O_RDWR, 0666, &attr);
  if (errno != EINVAL) {
    printf("Should have failed with EINVAL not %d\n", errno);
    return -1;
  }
  attr.mq_maxmsg = 10;
  attr.mq_msgsize = 0;
  mq_open("queue1", O_CREAT | O_EXCL | O_RDWR, 0666, &attr);
  if (errno != EINVAL) {
    printf("Should have failed with EINVAL not %d\n", errno);
    return -1;
  }
  attr.mq_maxmsg = 0;
  attr.mq_msgsize = 10;
  mq_open("queue1", O_CREAT | O_EXCL | O_RDWR, 0666, &attr);
  if (errno != EINVAL) {
    printf("Should have failed with EINVAL not %d\n", errno);
    return -1;
  }
  attr.mq_maxmsg = -5;
  attr.mq_msgsize = 10;
  mq_open("queue1", O_CREAT | O_EXCL | O_RDWR, 0666, &attr);
  if (errno != EINVAL) {
    printf("Should have failed with EINVAL not %d\n", errno);
    return -1;
  }
  attr.mq_maxmsg = 10;
  attr.mq_msgsize = -5;
  mq_open("queue1", O_CREAT | O_EXCL | O_RDWR, 0666, &attr);
  if (errno != EINVAL) {
    printf("Should have failed with EINVAL not %d\n", errno);
    return -1;
  }
  printf("passed\n");
  attr.mq_maxmsg = 8;
  attr.mq_msgsize = 32;
  printf("Test mq_open() O_CREAT...");
  errno = 0;
  mqdes = mq_open("queue1", O_CREAT | O_EXCL | O_RDWR, 0666, &attr);
  if (mqdes == (ssize_t)-1) {
    fflush(stdout);
    perror("failed");
    return -1;
  }
  printf("passed\n");
  printf("Test mq_open() EEXIST...");
  errno = 0;
  mq_open("queue1", O_CREAT | O_EXCL | O_RDWR, 0666, &attr);
  if (errno != EEXIST) {
    printf("Should have failed with EEXIST not %d\n", errno);
    return -1;
  }
  printf("passed\n");
  i = 0;
  do {
    sprintf(msg, "message:%d", i);
    prio = i;
    clock_gettime(CLOCK_REALTIME, &timeout);
    add_timespec(&timeout, 100 * 1000 * 1000);
    err = mq_timedsend(mqdes, msg, 32, prio, &timeout);
    if (err > 0) {
      printf("Sent:%s\n", msg);
    } else {
      printf("Send Failed %d\n", errno);
      if (errno != ETIMEDOUT) {
        printf("TEST FAILED!!!!!\n");
      }
    }
    i++;
  } while (err > 0);
  errno = 0;
  do {
    clock_gettime(CLOCK_REALTIME, &timeout);
    add_timespec(&timeout, 100 * 1000 * 1000);
    err = mq_timedreceive(mqdes, msg, 32, &prio, &timeout);
    if (err > 0) {
      printf("Recv:%s\n", msg);
    } else {
      printf("Receive Error: %d\n", errno);
      errno = 0;
    }
  } while (err > 0);
  if (start_producer() == 0) {
    consumer(NULL);
  } else {
    printf("Failed to start consumer\n");
  }
  printf("Test mq_close()...");
  if (mq_close(mqdes) < 0) {
    fflush(stdout);
    perror("failed");
    return -1;
  }
  printf("passed\n");
  printf("Test mq_unlink()...");
  if (mq_unlink("queue1") < 0) {
    fflush(stdout);
    perror("failed");
    return -1;
  }
  printf("passed\n");
  printf("Test mq_unlink() ENOENT...");
  errno = 0;
  mq_unlink("queue1");
  if (errno != ENOENT) {
    printf("Should have failed with ENOENT not %d\n", errno);
    return -1;
  }
  printf("passed\n");
  printf("Test mq_unlink() ENAMETOOLONG...");
  errno = 0;
  mq_unlink("012345678901234567890123456789012345678901234567890");
  if (errno != ENAMETOOLONG) {
    printf("Should have failed with ENAMETOOLONG not %d\n", errno);
    return -1;
  }
  printf("passed\n");
  printf("All Tests Passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<mqueue_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2dd3(%rip),%rax
movl   $0x0,(%rax)
mov    0x2de6(%rip),%rax
mov    (%rax),%esi
lea    0xe16(%rip),%rdi
mov    $0x1b6,%edx
lea    -0x50(%rbp),%rcx
call   1080 <mq_open@plt>
mov    %rax,-0x10(%rbp)
mov    0x2da4(%rip),%rax
mov    (%rax),%eax
mov    0x2d63(%rip),%rcx
cmp    (%rcx),%eax
je     1250 <mqueue_test+0x80>
mov    0x2d8c(%rip),%rax
mov    (%rax),%esi
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2d4d(%rip),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x50(%rbp)
movl   $0x20,-0x4c(%rbp)
mov    0x2d6a(%rip),%rax
mov    (%rax),%esi
mov    0x2d31(%rip),%rax
or     (%rax),%esi
mov    0x2d40(%rip),%rax
or     (%rax),%esi
lea    0xdce(%rip),%rdi
mov    $0x1b6,%edx
lea    -0x50(%rbp),%rcx
call   1080 <mq_open@plt>
mov    0x2d02(%rip),%rax
mov    (%rax),%eax
mov    0x2cd1(%rip),%rcx
cmp    (%rcx),%eax
je     12f2 <mqueue_test+0x122>
mov    0x2cea(%rip),%rax
mov    (%rax),%esi
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdd1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2cab(%rip),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x50(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    0x2cc8(%rip),%rax
mov    (%rax),%esi
mov    0x2c8f(%rip),%rax
or     (%rax),%esi
mov    0x2c9e(%rip),%rax
or     (%rax),%esi
lea    0xda6(%rip),%rdi
mov    $0x1b6,%edx
lea    -0x50(%rbp),%rcx
call   1080 <mq_open@plt>
mov    0x2c60(%rip),%rax
mov    (%rax),%eax
mov    0x2c47(%rip),%rcx
cmp    (%rcx),%eax
je     1394 <mqueue_test+0x1c4>
mov    0x2c48(%rip),%rax
mov    (%rax),%esi
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
movl   $0xa,-0x50(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    0x2c4f(%rip),%rax
mov    (%rax),%esi
mov    0x2c16(%rip),%rax
or     (%rax),%esi
mov    0x2c25(%rip),%rax
or     (%rax),%esi
lea    0xd2d(%rip),%rdi
mov    $0x1b6,%edx
lea    -0x50(%rbp),%rcx
call   1080 <mq_open@plt>
mov    0x2be7(%rip),%rax
mov    (%rax),%eax
mov    0x2bce(%rip),%rcx
cmp    (%rcx),%eax
je     140d <mqueue_test+0x23d>
mov    0x2bcf(%rip),%rax
mov    (%rax),%esi
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
movl   $0x0,-0x50(%rbp)
movl   $0xa,-0x4c(%rbp)
mov    0x2bd6(%rip),%rax
mov    (%rax),%esi
mov    0x2b9d(%rip),%rax
or     (%rax),%esi
mov    0x2bac(%rip),%rax
or     (%rax),%esi
lea    0xcb4(%rip),%rdi
mov    $0x1b6,%edx
lea    -0x50(%rbp),%rcx
call   1080 <mq_open@plt>
mov    0x2b6e(%rip),%rax
mov    (%rax),%eax
mov    0x2b55(%rip),%rcx
cmp    (%rcx),%eax
je     1486 <mqueue_test+0x2b6>
mov    0x2b56(%rip),%rax
mov    (%rax),%esi
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
movl   $0xfffffffb,-0x50(%rbp)
movl   $0xa,-0x4c(%rbp)
mov    0x2b5d(%rip),%rax
mov    (%rax),%esi
mov    0x2b24(%rip),%rax
or     (%rax),%esi
mov    0x2b33(%rip),%rax
or     (%rax),%esi
lea    0xc3b(%rip),%rdi
mov    $0x1b6,%edx
lea    -0x50(%rbp),%rcx
call   1080 <mq_open@plt>
mov    0x2af5(%rip),%rax
mov    (%rax),%eax
mov    0x2adc(%rip),%rcx
cmp    (%rcx),%eax
je     14ff <mqueue_test+0x32f>
mov    0x2add(%rip),%rax
mov    (%rax),%esi
lea    0xc0c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
movl   $0xa,-0x50(%rbp)
movl   $0xfffffffb,-0x4c(%rbp)
mov    0x2ae4(%rip),%rax
mov    (%rax),%esi
mov    0x2aab(%rip),%rax
or     (%rax),%esi
mov    0x2aba(%rip),%rax
or     (%rax),%esi
lea    0xbc2(%rip),%rdi
mov    $0x1b6,%edx
lea    -0x50(%rbp),%rcx
call   1080 <mq_open@plt>
mov    0x2a7c(%rip),%rax
mov    (%rax),%eax
mov    0x2a63(%rip),%rcx
cmp    (%rcx),%eax
je     1578 <mqueue_test+0x3a8>
mov    0x2a64(%rip),%rax
mov    (%rax),%esi
lea    0xb93(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
lea    0xad1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x8,-0x50(%rbp)
movl   $0x20,-0x4c(%rbp)
lea    0xb84(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2a17(%rip),%rax
movl   $0x0,(%rax)
mov    0x2a42(%rip),%rax
mov    (%rax),%esi
mov    0x2a09(%rip),%rax
or     (%rax),%esi
mov    0x2a18(%rip),%rax
or     (%rax),%esi
lea    0xb20(%rip),%rdi
mov    $0x1b6,%edx
lea    -0x50(%rbp),%rcx
call   1080 <mq_open@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1614 <mqueue_test+0x444>
mov    0x29b3(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
lea    0xb36(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
lea    0xa35(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb17(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2989(%rip),%rax
movl   $0x0,(%rax)
mov    0x29b4(%rip),%rax
mov    (%rax),%esi
mov    0x297b(%rip),%rax
or     (%rax),%esi
mov    0x298a(%rip),%rax
or     (%rax),%esi
lea    0xa92(%rip),%rdi
mov    $0x1b6,%edx
lea    -0x50(%rbp),%rcx
call   1080 <mq_open@plt>
mov    0x294c(%rip),%rax
mov    (%rax),%eax
mov    0x2953(%rip),%rcx
cmp    (%rcx),%eax
je     16a8 <mqueue_test+0x4d8>
mov    0x2934(%rip),%rax
mov    (%rax),%esi
lea    0xac4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
lea    0x9a1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xab5(%rip),%rsi
call   10e0 <sprintf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    0x28c3(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1030 <clock_gettime@plt>
lea    -0x48(%rbp),%rdi
mov    $0x5f5e100,%esi
call   10a0 <add_timespec@plt>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x44(%rbp),%ecx
mov    $0x20,%edx
lea    -0x48(%rbp),%r8
call   1050 <mq_timedsend@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1733 <mqueue_test+0x563>
lea    -0x40(%rbp),%rsi
lea    0xa64(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1775 <mqueue_test+0x5a5>
mov    0x2886(%rip),%rax
mov    (%rax),%esi
lea    0xa51(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x286f(%rip),%rax
mov    (%rax),%eax
mov    0x285e(%rip),%rcx
cmp    (%rcx),%eax
je     1770 <mqueue_test+0x5a0>
lea    0xa3b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1775 <mqueue_test+0x5a5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     16bd <mqueue_test+0x4ed>
mov    0x2831(%rip),%rax
movl   $0x0,(%rax)
mov    0x2804(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1030 <clock_gettime@plt>
lea    -0x48(%rbp),%rdi
mov    $0x5f5e100,%esi
call   10a0 <add_timespec@plt>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x20,%edx
lea    -0x44(%rbp),%rcx
lea    -0x48(%rbp),%r8
call   1040 <mq_timedreceive@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    17f3 <mqueue_test+0x623>
lea    -0x40(%rbp),%rsi
lea    0x9cf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1817 <mqueue_test+0x647>
mov    0x27c6(%rip),%rax
mov    (%rax),%esi
lea    0x9bc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x27af(%rip),%rax
movl   $0x0,(%rax)
jmp    181c <mqueue_test+0x64c>
cmpl   $0x0,-0x8(%rbp)
jg     1795 <mqueue_test+0x5c5>
mov    $0x0,%al
call   10b0 <start_producer@plt>
cmp    $0x0,%rax
jne    1845 <mqueue_test+0x675>
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <consumer@plt>
jmp    1853 <mqueue_test+0x683>
lea    0x986(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x992(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <mq_close@plt>
cmp    $0x0,%rax
jge    189a <mqueue_test+0x6ca>
mov    0x272d(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
lea    0x8b0(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
lea    0x7af(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x950(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x834(%rip),%rdi
call   10f0 <mq_unlink@plt>
cmp    $0x0,%rax
jge    18f2 <mqueue_test+0x722>
mov    0x26d5(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
lea    0x858(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
lea    0x757(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x90c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x26ab(%rip),%rax
movl   $0x0,(%rax)
lea    0x7cf(%rip),%rdi
call   10f0 <mq_unlink@plt>
mov    0x2692(%rip),%rax
mov    (%rax),%eax
mov    0x2651(%rip),%rcx
cmp    (%rcx),%eax
je     1962 <mqueue_test+0x792>
mov    0x267a(%rip),%rax
mov    (%rax),%esi
lea    0x6da(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
lea    0x6e7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x8b7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x263b(%rip),%rax
movl   $0x0,(%rax)
lea    0x6e5(%rip),%rdi
call   10f0 <mq_unlink@plt>
mov    0x2622(%rip),%rax
mov    (%rax),%eax
mov    0x25f1(%rip),%rcx
cmp    (%rcx),%eax
je     19d2 <mqueue_test+0x802>
mov    0x260a(%rip),%rax
mov    (%rax),%esi
lea    0x6ec(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    19f5 <mqueue_test+0x825>
lea    0x677(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x868(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mqueue_test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xe0b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2dbd(%rip),%r14
movl   $0x0,(%r14)
mov    0x2dcf(%rip),%rbx
mov    (%rbx),%esi
lea    0xdff(%rip),%rdi
mov    %rsp,%rcx
mov    $0x1b6,%edx
call   1090 <mq_open@plt>
mov    (%r14),%esi
mov    0x2d57(%rip),%r15
cmp    (%r15),%esi
jne    16f3 <mqueue_test+0x513>
lea    0xff3(%rip),%rdi
call   1030 <puts@plt>
lea    0xe03(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x0,(%r14)
movabs $0x2000000000,%rax
mov    %rax,(%rsp)
mov    0x2d88(%rip),%r12
mov    0x2d51(%rip),%rbp
mov    0x0(%rbp),%esi
or     (%r12),%esi
or     (%rbx),%esi
lea    0xde8(%rip),%rdi
mov    %rsp,%rcx
mov    $0x1b6,%edx
call   1090 <mq_open@plt>
mov    (%r14),%esi
mov    0x2cfa(%rip),%rax
cmp    (%rax),%esi
jne    16fc <mqueue_test+0x51c>
lea    0xf87(%rip),%rdi
call   1030 <puts@plt>
lea    0xe17(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x0,(%r14)
movq   $0x0,(%rsp)
mov    0x0(%rbp),%esi
or     (%r12),%esi
or     (%rbx),%esi
lea    0xe0a(%rip),%rdi
mov    %rsp,%rcx
mov    $0x1b6,%edx
call   1090 <mq_open@plt>
mov    (%r14),%esi
mov    0x2cba(%rip),%r13
cmp    0x0(%r13),%esi
jne    14fd <mqueue_test+0x31d>
movq   $0xa,(%rsp)
mov    0x0(%rbp),%esi
or     (%r12),%esi
or     (%rbx),%esi
lea    0xdd1(%rip),%rdi
mov    %rsp,%rcx
mov    $0x1b6,%edx
call   1090 <mq_open@plt>
mov    (%r14),%esi
cmp    0x0(%r13),%esi
jne    14fd <mqueue_test+0x31d>
movabs $0xa00000000,%rax
mov    %rax,(%rsp)
mov    0x0(%rbp),%esi
or     (%r12),%esi
or     (%rbx),%esi
lea    0xd99(%rip),%rdi
mov    %rsp,%rcx
mov    $0x1b6,%edx
call   1090 <mq_open@plt>
mov    (%r14),%esi
cmp    0x0(%r13),%esi
jne    14fd <mqueue_test+0x31d>
movabs $0xafffffffb,%rax
mov    %rax,(%rsp)
mov    0x0(%rbp),%esi
or     (%r12),%esi
or     (%rbx),%esi
lea    0xd61(%rip),%rdi
mov    %rsp,%rcx
mov    $0x1b6,%edx
call   1090 <mq_open@plt>
mov    (%r14),%esi
cmp    0x0(%r13),%esi
jne    14fd <mqueue_test+0x31d>
movabs $0xfffffffb0000000a,%rax
ff ff ff
mov    %rax,(%rsp)
mov    0x0(%rbp),%esi
or     (%r12),%esi
or     (%rbx),%esi
lea    0xd29(%rip),%rdi
mov    %rsp,%rcx
mov    $0x1b6,%edx
call   1090 <mq_open@plt>
mov    (%r14),%esi
cmp    0x0(%r13),%esi
jne    14fd <mqueue_test+0x31d>
lea    0xe53(%rip),%rdi
call   1030 <puts@plt>
movabs $0x2000000008,%rax
mov    %rax,(%rsp)
lea    0xd1c(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x0,(%r14)
mov    0x0(%rbp),%esi
or     (%r12),%esi
or     (%rbx),%esi
lea    0xcd0(%rip),%rdi
mov    %rsp,%rcx
mov    $0x1b6,%edx
call   1090 <mq_open@plt>
cmp    $0xffffffffffffffff,%rax
je     1720 <mqueue_test+0x540>
mov    %rax,%r13
lea    0xdfa(%rip),%rdi
call   1030 <puts@plt>
lea    0xcf2(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x0,(%r14)
mov    0x0(%rbp),%esi
or     (%r12),%esi
or     (%rbx),%esi
lea    0xc85(%rip),%rdi
mov    %rsp,%rcx
mov    $0x1b6,%edx
call   1090 <mq_open@plt>
mov    (%r14),%esi
mov    0x2b55(%rip),%rax
cmp    (%rax),%esi
jne    1509 <mqueue_test+0x329>
lea    0xdaa(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%rbx
xor    %ebp,%ebp
mov    %r12,%rdi
lea    0xcd3(%rip),%rsi
mov    %ebp,%edx
call   10f0 <sprintf@plt>
mov    %ebp,0xc(%rsp)
mov    0x2ae9(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <clock_gettime@plt>
mov    %rbx,%rdi
mov    $0x5f5e100,%esi
call   10b0 <add_timespec@plt>
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x20,%edx
mov    %ebp,%ecx
mov    %rbx,%r8
call   1060 <mq_timedsend@plt>
test   %eax,%eax
jle    1515 <mqueue_test+0x335>
lea    0xc95(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%ebp
jmp    149b <mqueue_test+0x2bb>
lea    0xbec(%rip),%rdi
jmp    1703 <mqueue_test+0x523>
lea    0xc41(%rip),%rdi
jmp    1703 <mqueue_test+0x523>
mov    (%r14),%esi
lea    0xc6d(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r14),%eax
mov    0x2a88(%rip),%rcx
cmp    (%rcx),%eax
je     1540 <mqueue_test+0x360>
lea    0xd11(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,(%r14)
mov    0x2a52(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <clock_gettime@plt>
mov    %rbx,%rdi
mov    $0x5f5e100,%esi
call   10b0 <add_timespec@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
mov    %r13,%rdi
mov    $0x20,%edx
mov    %rbx,%r8
call   1050 <mq_timedreceive@plt>
test   %eax,%eax
jle    15e0 <mqueue_test+0x400>
lea    0x10(%rsp),%rbp
lea    0x8(%rsp),%rbx
lea    0xc(%rsp),%r12
lea    0xbfe(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x29f1(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <clock_gettime@plt>
mov    %rbx,%rdi
mov    $0x5f5e100,%esi
call   10b0 <add_timespec@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    $0x20,%edx
mov    %r12,%rcx
mov    %rbx,%r8
call   1050 <mq_timedreceive@plt>
test   %eax,%eax
jg     1597 <mqueue_test+0x3b7>
mov    (%r14),%esi
lea    0xbbb(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x0,(%r14)
xor    %eax,%eax
call   10c0 <start_producer@plt>
test   %rax,%rax
je     1612 <mqueue_test+0x432>
lea    0xc10(%rip),%rdi
call   1030 <puts@plt>
jmp    1619 <mqueue_test+0x439>
xor    %edi,%edi
call   10d0 <consumer@plt>
lea    0xb98(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13,%rdi
call   1080 <mq_close@plt>
test   %rax,%rax
js     1720 <mqueue_test+0x540>
lea    0xbf5(%rip),%rdi
call   1030 <puts@plt>
lea    0xb80(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xa90(%rip),%rdi
call   1100 <mq_unlink@plt>
test   %rax,%rax
js     1720 <mqueue_test+0x540>
lea    0xbc6(%rip),%rdi
call   1030 <puts@plt>
lea    0xb65(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x0,(%r14)
lea    0xa5a(%rip),%rdi
call   1100 <mq_unlink@plt>
mov    (%r14),%esi
cmp    (%r15),%esi
jne    16f3 <mqueue_test+0x513>
lea    0xb91(%rip),%rdi
call   1030 <puts@plt>
lea    0xb4b(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x0,(%r14)
lea    0x9a9(%rip),%rdi
call   1100 <mq_unlink@plt>
mov    (%r14),%esi
mov    0x28c3(%rip),%rax
cmp    (%rax),%esi
jne    16fc <mqueue_test+0x51c>
lea    0xb54(%rip),%rdi
call   1030 <puts@plt>
lea    0xb4f(%rip),%rdi
call   1030 <puts@plt>
jmp    170f <mqueue_test+0x52f>
lea    0x92f(%rip),%rdi
jmp    1703 <mqueue_test+0x523>
lea    0x9a0(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2881(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
lea    0x9fc(%rip),%rdi
call   10e0 <perror@plt>
jmp    170a <mqueue_test+0x52a>

LLVM IR (-O0):
%struct.timespec = type { i32 }
%struct.mq_attr = type { i32, i32 }
@.str = [25 x i8] c"Test mq_open() ENOENT...\00"
@errno = global i32 0
@.str.1 = [16 x i8] c"/app/some_queue\00"
@O_RDWR = global i32 0
@ENOENT = global i32 0
@.str.2 = [39 x i8] c"Should have failed with ENOENT not %d\0A\00"
@.str.3 = [8 x i8] c"passed\0A\00"
@.str.4 = [31 x i8] c"Test mq_open() ENAMETOOLONG...\00"
@.str.5 = [52 x i8] c"012345678901234567890123456789012345678901234567890\00"
@O_CREAT = global i32 0
@O_EXCL = global i32 0
@ENAMETOOLONG = global i32 0
@.str.6 = [45 x i8] c"Should have failed with ENAMETOOLONG not %d\0A\00"
@.str.7 = [25 x i8] c"Test mq_open() EINVAL...\00"
@.str.8 = [7 x i8] c"queue1\00"
@EINVAL = global i32 0
@.str.9 = [39 x i8] c"Should have failed with EINVAL not %d\0A\00"
@.str.10 = [26 x i8] c"Test mq_open() O_CREAT...\00"
@stdout = global i32 0
@.str.11 = [7 x i8] c"failed\00"
@.str.12 = [25 x i8] c"Test mq_open() EEXIST...\00"
@EEXIST = global i32 0
@.str.13 = [39 x i8] c"Should have failed with EEXIST not %d\0A\00"
@.str.14 = [11 x i8] c"message:%d\00"
@CLOCK_REALTIME = global i32 0
@.str.15 = [9 x i8] c"Sent:%s\0A\00"
@.str.16 = [16 x i8] c"Send Failed %d\0A\00"
@ETIMEDOUT = global i32 0
@.str.17 = [18 x i8] c"TEST FAILED!!!!!\0A\00"
@.str.18 = [9 x i8] c"Recv:%s\0A\00"
@.str.19 = [19 x i8] c"Receive Error: %d\0A\00"
@.str.20 = [26 x i8] c"Failed to start consumer\0A\00"
@.str.21 = [19 x i8] c"Test mq_close()...\00"
@.str.22 = [20 x i8] c"Test mq_unlink()...\00"
@.str.23 = [27 x i8] c"Test mq_unlink() ENOENT...\00"
@.str.24 = [33 x i8] c"Test mq_unlink() ENAMETOOLONG...\00"
@.str.25 = [18 x i8] c"All Tests Passed\0A\00"
define i32 @mqueue_test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
%5 = alloca [32 x i8]
%6 = alloca i32
%7 = alloca %struct.timespec
%8 = alloca %struct.mq_attr
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* @errno
%10 = load i32, i32* @O_RDWR
%11 = call i64 @mq_open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 438, %struct.mq_attr* %8)
store i64 %11, i64* %3
%12 = load i32, i32* @errno
%13 = load i32, i32* @ENOENT
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = load i32, i32* @errno
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %16)
store i32 -1, i32* %1
br label %246
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* @errno
%21 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 0
store i32 0, i32* %21
%22 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 1
store i32 32, i32* %22
%23 = load i32, i32* @O_CREAT
%24 = load i32, i32* @O_EXCL
%25 = or i32 %23, %24
%26 = load i32, i32* @O_RDWR
%27 = or i32 %25, %26
%28 = call i64 @mq_open(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i32 %27, i32 438, %struct.mq_attr* %8)
%29 = load i32, i32* @errno
%30 = load i32, i32* @ENAMETOOLONG
%31 = icmp ne i32 %29, %30
br i1 %31, label %32, label %35
32: ; preds = %18
%33 = load i32, i32* @errno
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i32 %33)
store i32 -1, i32* %1
br label %246
35: ; preds = %18
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* @errno
%38 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 0
store i32 0, i32* %38
%39 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 1
store i32 0, i32* %39
%40 = load i32, i32* @O_CREAT
%41 = load i32, i32* @O_EXCL
%42 = or i32 %40, %41
%43 = load i32, i32* @O_RDWR
%44 = or i32 %42, %43
%45 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %44, i32 438, %struct.mq_attr* %8)
%46 = load i32, i32* @errno
%47 = load i32, i32* @EINVAL
%48 = icmp ne i32 %46, %47
br i1 %48, label %49, label %52
49: ; preds = %35
%50 = load i32, i32* @errno
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %50)
store i32 -1, i32* %1
br label %246
52: ; preds = %35
%53 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 0
store i32 10, i32* %53
%54 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 1
store i32 0, i32* %54
%55 = load i32, i32* @O_CREAT
%56 = load i32, i32* @O_EXCL
%57 = or i32 %55, %56
%58 = load i32, i32* @O_RDWR
%59 = or i32 %57, %58
%60 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %59, i32 438, %struct.mq_attr* %8)
%61 = load i32, i32* @errno
%62 = load i32, i32* @EINVAL
%63 = icmp ne i32 %61, %62
br i1 %63, label %64, label %67
64: ; preds = %52
%65 = load i32, i32* @errno
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %65)
store i32 -1, i32* %1
br label %246
67: ; preds = %52
%68 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 0
store i32 0, i32* %68
%69 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 1
store i32 10, i32* %69
%70 = load i32, i32* @O_CREAT
%71 = load i32, i32* @O_EXCL
%72 = or i32 %70, %71
%73 = load i32, i32* @O_RDWR
%74 = or i32 %72, %73
%75 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %74, i32 438, %struct.mq_attr* %8)
%76 = load i32, i32* @errno
%77 = load i32, i32* @EINVAL
%78 = icmp ne i32 %76, %77
br i1 %78, label %79, label %82
79: ; preds = %67
%80 = load i32, i32* @errno
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %80)
store i32 -1, i32* %1
br label %246
82: ; preds = %67
%83 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 0
store i32 -5, i32* %83
%84 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 1
store i32 10, i32* %84
%85 = load i32, i32* @O_CREAT
%86 = load i32, i32* @O_EXCL
%87 = or i32 %85, %86
%88 = load i32, i32* @O_RDWR
%89 = or i32 %87, %88
%90 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %89, i32 438, %struct.mq_attr* %8)
%91 = load i32, i32* @errno
%92 = load i32, i32* @EINVAL
%93 = icmp ne i32 %91, %92
br i1 %93, label %94, label %97
94: ; preds = %82
%95 = load i32, i32* @errno
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %95)
store i32 -1, i32* %1
br label %246
97: ; preds = %82
%98 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 0
store i32 10, i32* %98
%99 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 1
store i32 -5, i32* %99
%100 = load i32, i32* @O_CREAT
%101 = load i32, i32* @O_EXCL
%102 = or i32 %100, %101
%103 = load i32, i32* @O_RDWR
%104 = or i32 %102, %103
%105 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %104, i32 438, %struct.mq_attr* %8)
%106 = load i32, i32* @errno
%107 = load i32, i32* @EINVAL
%108 = icmp ne i32 %106, %107
br i1 %108, label %109, label %112
109: ; preds = %97
%110 = load i32, i32* @errno
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %110)
store i32 -1, i32* %1
br label %246
112: ; preds = %97
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%114 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 0
store i32 8, i32* %114
%115 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 1
store i32 32, i32* %115
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* @errno
%117 = load i32, i32* @O_CREAT
%118 = load i32, i32* @O_EXCL
%119 = or i32 %117, %118
%120 = load i32, i32* @O_RDWR
%121 = or i32 %119, %120
%122 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %121, i32 438, %struct.mq_attr* %8)
store i64 %122, i64* %3
%123 = load i64, i64* %3
%124 = icmp eq i64 %123, -1
br i1 %124, label %125, label %129
125: ; preds = %112
%126 = load i32, i32* @stdout
%127 = call i32 @fflush(i32 %126)
%128 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
store i32 -1, i32* %1
br label %246
129: ; preds = %112
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0))
store i32 0, i32* @errno
%132 = load i32, i32* @O_CREAT
%133 = load i32, i32* @O_EXCL
%134 = or i32 %132, %133
%135 = load i32, i32* @O_RDWR
%136 = or i32 %134, %135
%137 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %136, i32 438, %struct.mq_attr* %8)
%138 = load i32, i32* @errno
%139 = load i32, i32* @EEXIST
%140 = icmp ne i32 %138, %139
br i1 %140, label %141, label %144
141: ; preds = %129
%142 = load i32, i32* @errno
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0), i32 %142)
store i32 -1, i32* %1
br label %246
144: ; preds = %129
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
br label %146
146: ; preds = %175, %144
%147 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%148 = load i32, i32* %4
%149 = call i32 @sprintf(i8* %147, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 %148)
%150 = load i32, i32* %4
store i32 %150, i32* %6
%151 = load i32, i32* @CLOCK_REALTIME
%152 = call i32 @clock_gettime(i32 %151, %struct.timespec* %7)
%153 = call i32 @add_timespec(%struct.timespec* %7, i32 100000000)
%154 = load i64, i64* %3
%155 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%156 = load i32, i32* %6
%157 = call i32 @mq_timedsend(i64 %154, i8* %155, i32 32, i32 %156, %struct.timespec* %7)
store i32 %157, i32* %2
%158 = load i32, i32* %2
%159 = icmp sgt i32 %158, 0
br i1 %159, label %160, label %163
160: ; preds = %146
%161 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* %161)
br label %172
163: ; preds = %146
%164 = load i32, i32* @errno
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i32 %164)
%166 = load i32, i32* @errno
%167 = load i32, i32* @ETIMEDOUT
%168 = icmp ne i32 %166, %167
br i1 %168, label %169, label %171
169: ; preds = %163
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
br label %171
171: ; preds = %169, %163
br label %172
172: ; preds = %171, %160
%173 = load i32, i32* %4
%174 = add nsw i32 %173, 1
store i32 %174, i32* %4
br label %175
175: ; preds = %172
%176 = load i32, i32* %2
%177 = icmp sgt i32 %176, 0
br i1 %177, label %146, label %178
178: ; preds = %175
store i32 0, i32* @errno
br label %179
179: ; preds = %195, %178
%180 = load i32, i32* @CLOCK_REALTIME
%181 = call i32 @clock_gettime(i32 %180, %struct.timespec* %7)
%182 = call i32 @add_timespec(%struct.timespec* %7, i32 100000000)
%183 = load i64, i64* %3
%184 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%185 = call i32 @mq_timedreceive(i64 %183, i8* %184, i32 32, i32* %6, %struct.timespec* %7)
store i32 %185, i32* %2
%186 = load i32, i32* %2
%187 = icmp sgt i32 %186, 0
br i1 %187, label %188, label %191
188: ; preds = %179
%189 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0), i8* %189)
br label %194
191: ; preds = %179
%192 = load i32, i32* @errno
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0), i32 %192)
store i32 0, i32* @errno
br label %194
194: ; preds = %191, %188
br label %195
195: ; preds = %194
%196 = load i32, i32* %2
%197 = icmp sgt i32 %196, 0
br i1 %197, label %179, label %198
198: ; preds = %195
%199 = call i64 (...) @start_producer()
%200 = icmp eq i64 %199, 0
br i1 %200, label %201, label %203
201: ; preds = %198
%202 = call i32 @consumer(i32* null)
br label %205
203: ; preds = %198
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.20, i64 0, i64 0))
br label %205
205: ; preds = %203, %201
%206 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0))
%207 = load i64, i64* %3
%208 = call i64 @mq_close(i64 %207)
%209 = icmp slt i64 %208, 0
br i1 %209, label %210, label %214
210: ; preds = %205
%211 = load i32, i32* @stdout
%212 = call i32 @fflush(i32 %211)
%213 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
store i32 -1, i32* %1
br label %246
214: ; preds = %205
%215 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%216 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0))
%217 = call i64 @mq_unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%218 = icmp slt i64 %217, 0
br i1 %218, label %219, label %223
219: ; preds = %214
%220 = load i32, i32* @stdout
%221 = call i32 @fflush(i32 %220)
%222 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
store i32 -1, i32* %1
br label %246
223: ; preds = %214
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.23, i64 0, i64 0))
store i32 0, i32* @errno
%226 = call i64 @mq_unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%227 = load i32, i32* @errno
%228 = load i32, i32* @ENOENT
%229 = icmp ne i32 %227, %228
br i1 %229, label %230, label %233
230: ; preds = %223
%231 = load i32, i32* @errno
%232 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %231)
store i32 -1, i32* %1
br label %246
233: ; preds = %223
%234 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%235 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.24, i64 0, i64 0))
store i32 0, i32* @errno
%236 = call i64 @mq_unlink(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%237 = load i32, i32* @errno
%238 = load i32, i32* @ENAMETOOLONG
%239 = icmp ne i32 %237, %238
br i1 %239, label %240, label %243
240: ; preds = %233
%241 = load i32, i32* @errno
%242 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i32 %241)
store i32 -1, i32* %1
br label %246
243: ; preds = %233
%244 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%245 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.25, i64 0, i64 0))
store i32 0, i32* %1
br label %246
246: ; preds = %243, %240, %230, %219, %210, %141, %125, %109, %94, %79, %64, %49, %32, %15
%247 = load i32, i32* %1
ret i32 %247
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
%struct.mq_attr = type { i32, i32 }
@.str = [25 x i8] c"Test mq_open() ENOENT...\00"
@errno = global i32 0
@.str.1 = [16 x i8] c"/app/some_queue\00"
@O_RDWR = global i32 0
@ENOENT = global i32 0
@.str.2 = [39 x i8] c"Should have failed with ENOENT not %d\0A\00"
@.str.4 = [31 x i8] c"Test mq_open() ENAMETOOLONG...\00"
@.str.5 = [52 x i8] c"012345678901234567890123456789012345678901234567890\00"
@O_CREAT = global i32 0
@O_EXCL = global i32 0
@ENAMETOOLONG = global i32 0
@.str.6 = [45 x i8] c"Should have failed with ENAMETOOLONG not %d\0A\00"
@.str.7 = [25 x i8] c"Test mq_open() EINVAL...\00"
@.str.8 = [7 x i8] c"queue1\00"
@EINVAL = global i32 0
@.str.9 = [39 x i8] c"Should have failed with EINVAL not %d\0A\00"
@.str.10 = [26 x i8] c"Test mq_open() O_CREAT...\00"
@stdout = global i32 0
@.str.11 = [7 x i8] c"failed\00"
@.str.12 = [25 x i8] c"Test mq_open() EEXIST...\00"
@EEXIST = global i32 0
@.str.13 = [39 x i8] c"Should have failed with EEXIST not %d\0A\00"
@.str.14 = [11 x i8] c"message:%d\00"
@CLOCK_REALTIME = global i32 0
@.str.15 = [9 x i8] c"Sent:%s\0A\00"
@.str.16 = [16 x i8] c"Send Failed %d\0A\00"
@ETIMEDOUT = global i32 0
@.str.18 = [9 x i8] c"Recv:%s\0A\00"
@.str.19 = [19 x i8] c"Receive Error: %d\0A\00"
@.str.21 = [19 x i8] c"Test mq_close()...\00"
@.str.22 = [20 x i8] c"Test mq_unlink()...\00"
@.str.23 = [27 x i8] c"Test mq_unlink() ENOENT...\00"
@.str.24 = [33 x i8] c"Test mq_unlink() ENAMETOOLONG...\00"
@str.30 = [25 x i8] c"Failed to start consumer\00"
@str.34 = [7 x i8] c"passed\00"
@str.35 = [17 x i8] c"All Tests Passed\00"
@str.36 = [17 x i8] c"TEST FAILED!!!!!\00"
define i32 @mqueue_test() {
%1 = alloca [32 x i8]
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca %struct.mq_attr
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%6 = bitcast i32* %2 to i8*
%7 = bitcast %struct.timespec* %3 to i8*
%8 = bitcast %struct.mq_attr* %4 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* @errno
%10 = load i32, i32* @O_RDWR
%11 = call i64 @mq_open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 438, %struct.mq_attr* %4)
%12 = load i32, i32* @errno
%13 = load i32, i32* @ENOENT
%14 = icmp eq i32 %12, %13
br i1 %14, label %17, label %15
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %12)
br label %204
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.34, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* @errno
%20 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %4, i64 0, i32 0
store i32 0, i32* %20
%21 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %4, i64 0, i32 1
store i32 32, i32* %21
%22 = load i32, i32* @O_CREAT
%23 = load i32, i32* @O_EXCL
%24 = or i32 %23, %22
%25 = load i32, i32* @O_RDWR
%26 = or i32 %24, %25
%27 = call i64 @mq_open(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i32 %26, i32 438, %struct.mq_attr* %4)
%28 = load i32, i32* @errno
%29 = load i32, i32* @ENAMETOOLONG
%30 = icmp eq i32 %28, %29
br i1 %30, label %33, label %31
31: ; preds = %17
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i32 %28)
br label %204
33: ; preds = %17
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.34, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* @errno
store i32 0, i32* %20
store i32 0, i32* %21
%36 = load i32, i32* @O_CREAT
%37 = load i32, i32* @O_EXCL
%38 = or i32 %37, %36
%39 = load i32, i32* @O_RDWR
%40 = or i32 %38, %39
%41 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %40, i32 438, %struct.mq_attr* %4)
%42 = load i32, i32* @errno
%43 = load i32, i32* @EINVAL
%44 = icmp eq i32 %42, %43
br i1 %44, label %47, label %45
45: ; preds = %33
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %42)
br label %204
47: ; preds = %33
store i32 10, i32* %20
store i32 0, i32* %21
%48 = load i32, i32* @O_CREAT
%49 = load i32, i32* @O_EXCL
%50 = or i32 %49, %48
%51 = load i32, i32* @O_RDWR
%52 = or i32 %50, %51
%53 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %52, i32 438, %struct.mq_attr* %4)
%54 = load i32, i32* @errno
%55 = load i32, i32* @EINVAL
%56 = icmp eq i32 %54, %55
br i1 %56, label %59, label %57
57: ; preds = %47
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %54)
br label %204
59: ; preds = %47
store i32 0, i32* %20
store i32 10, i32* %21
%60 = load i32, i32* @O_CREAT
%61 = load i32, i32* @O_EXCL
%62 = or i32 %61, %60
%63 = load i32, i32* @O_RDWR
%64 = or i32 %62, %63
%65 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %64, i32 438, %struct.mq_attr* %4)
%66 = load i32, i32* @errno
%67 = load i32, i32* @EINVAL
%68 = icmp eq i32 %66, %67
br i1 %68, label %71, label %69
69: ; preds = %59
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %66)
br label %204
71: ; preds = %59
store i32 -5, i32* %20
store i32 10, i32* %21
%72 = load i32, i32* @O_CREAT
%73 = load i32, i32* @O_EXCL
%74 = or i32 %73, %72
%75 = load i32, i32* @O_RDWR
%76 = or i32 %74, %75
%77 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %76, i32 438, %struct.mq_attr* %4)
%78 = load i32, i32* @errno
%79 = load i32, i32* @EINVAL
%80 = icmp eq i32 %78, %79
br i1 %80, label %83, label %81
81: ; preds = %71
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %78)
br label %204
83: ; preds = %71
store i32 10, i32* %20
store i32 -5, i32* %21
%84 = load i32, i32* @O_CREAT
%85 = load i32, i32* @O_EXCL
%86 = or i32 %85, %84
%87 = load i32, i32* @O_RDWR
%88 = or i32 %86, %87
%89 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %88, i32 438, %struct.mq_attr* %4)
%90 = load i32, i32* @errno
%91 = load i32, i32* @EINVAL
%92 = icmp eq i32 %90, %91
br i1 %92, label %95, label %93
93: ; preds = %83
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %90)
br label %204
95: ; preds = %83
%96 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.34, i64 0, i64 0))
store i32 8, i32* %20
store i32 32, i32* %21
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* @errno
%98 = load i32, i32* @O_CREAT
%99 = load i32, i32* @O_EXCL
%100 = or i32 %99, %98
%101 = load i32, i32* @O_RDWR
%102 = or i32 %100, %101
%103 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %102, i32 438, %struct.mq_attr* %4)
%104 = icmp eq i64 %103, -1
br i1 %104, label %105, label %109
105: ; preds = %95
%106 = load i32, i32* @stdout
%107 = call i32 @fflush(i32 %106)
%108 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %204
109: ; preds = %95
%110 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.34, i64 0, i64 0))
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0))
store i32 0, i32* @errno
%112 = load i32, i32* @O_CREAT
%113 = load i32, i32* @O_EXCL
%114 = or i32 %113, %112
%115 = load i32, i32* @O_RDWR
%116 = or i32 %114, %115
%117 = call i64 @mq_open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %116, i32 438, %struct.mq_attr* %4)
%118 = load i32, i32* @errno
%119 = load i32, i32* @EEXIST
%120 = icmp eq i32 %118, %119
br i1 %120, label %123, label %121
121: ; preds = %109
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0), i32 %118)
br label %204
123: ; preds = %109
%124 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.34, i64 0, i64 0))
br label %125
125: ; preds = %141, %123
%126 = phi i32 [ 0, %123 ], [ %143, %141 ]
%127 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 %126)
store i32 %126, i32* %2
%128 = load i32, i32* @CLOCK_REALTIME
%129 = call i32 @clock_gettime(i32 %128, %struct.timespec* %3)
%130 = call i32 @add_timespec(%struct.timespec* %3, i32 100000000)
%131 = call i32 @mq_timedsend(i64 %103, i8* %5, i32 32, i32 %126, %struct.timespec* %3)
%132 = icmp sgt i32 %131, 0
br i1 %132, label %141, label %133
133: ; preds = %125
%134 = load i32, i32* @errno
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i32 %134)
%136 = load i32, i32* @errno
%137 = load i32, i32* @ETIMEDOUT
%138 = icmp eq i32 %136, %137
br i1 %138, label %144, label %139
139: ; preds = %133
%140 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.36, i64 0, i64 0))
br label %144
141: ; preds = %125
%142 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* %5)
%143 = add nuw nsw i32 %126, 1
br label %125
144: ; preds = %133, %139
store i32 0, i32* @errno
%145 = load i32, i32* @CLOCK_REALTIME
%146 = call i32 @clock_gettime(i32 %145, %struct.timespec* %3)
%147 = call i32 @add_timespec(%struct.timespec* %3, i32 100000000)
%148 = call i32 @mq_timedreceive(i64 %103, i8* %5, i32 32, i32* %2, %struct.timespec* %3)
%149 = icmp sgt i32 %148, 0
br i1 %149, label %150, label %157
150: ; preds = %144, %150
%151 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0), i8* %5)
%152 = load i32, i32* @CLOCK_REALTIME
%153 = call i32 @clock_gettime(i32 %152, %struct.timespec* %3)
%154 = call i32 @add_timespec(%struct.timespec* %3, i32 100000000)
%155 = call i32 @mq_timedreceive(i64 %103, i8* %5, i32 32, i32* %2, %struct.timespec* %3)
%156 = icmp sgt i32 %155, 0
br i1 %156, label %150, label %157
157: ; preds = %150, %144
%158 = load i32, i32* @errno
%159 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0), i32 %158)
store i32 0, i32* @errno
%160 = call i64 (...) @start_producer()
%161 = icmp eq i64 %160, 0
br i1 %161, label %162, label %164
162: ; preds = %157
%163 = call i32 @consumer(i32* null)
br label %166
164: ; preds = %157
%165 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.30, i64 0, i64 0))
br label %166
166: ; preds = %164, %162
%167 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0))
%168 = call i64 @mq_close(i64 %103)
%169 = icmp slt i64 %168, 0
br i1 %169, label %170, label %174
170: ; preds = %166
%171 = load i32, i32* @stdout
%172 = call i32 @fflush(i32 %171)
%173 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %204
174: ; preds = %166
%175 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.34, i64 0, i64 0))
%176 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0))
%177 = call i64 @mq_unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%178 = icmp slt i64 %177, 0
br i1 %178, label %179, label %183
179: ; preds = %174
%180 = load i32, i32* @stdout
%181 = call i32 @fflush(i32 %180)
%182 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %204
183: ; preds = %174
%184 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.34, i64 0, i64 0))
%185 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.23, i64 0, i64 0))
store i32 0, i32* @errno
%186 = call i64 @mq_unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%187 = load i32, i32* @errno
%188 = load i32, i32* @ENOENT
%189 = icmp eq i32 %187, %188
br i1 %189, label %192, label %190
190: ; preds = %183
%191 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %187)
br label %204
192: ; preds = %183
%193 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.34, i64 0, i64 0))
%194 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.24, i64 0, i64 0))
store i32 0, i32* @errno
%195 = call i64 @mq_unlink(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%196 = load i32, i32* @errno
%197 = load i32, i32* @ENAMETOOLONG
%198 = icmp eq i32 %196, %197
br i1 %198, label %201, label %199
199: ; preds = %192
%200 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i32 %196)
br label %204
201: ; preds = %192
%202 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.34, i64 0, i64 0))
%203 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.35, i64 0, i64 0))
br label %204
204: ; preds = %201, %199, %190, %179, %170, %121, %105, %93, %81, %69, %57, %45, %31, %15
%205 = phi i32 [ -1, %15 ], [ -1, %31 ], [ -1, %45 ], [ -1, %57 ], [ -1, %69 ], [ -1, %81 ], [ -1, %93 ], [ -1, %105 ], [ -1, %121 ], [ -1, %170 ], [ -1, %179 ], [ -1, %190 ], [ -1, %199 ], [ 0, %201 ]
ret i32 %205
}