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

/* Forward declarations */
typedef struct TYPE_7__ TYPE_3__;
typedef struct TYPE_6__ TYPE_2__;
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  scalar_t__ *sival_ptr;
};
struct sigevent {
  TYPE_1__ sigev_value;
  int /*<<< orphan*/ sigev_signo;
  int /*<<< orphan*/ sigev_notify;
};
struct mq_attr {
  int /*<<< orphan*/ mq_msgsize;
};
typedef scalar_t__ ssize_t;
typedef int /*<<< orphan*/ sigset_t;
struct TYPE_6__ {
  long sival_ptr;
};
struct TYPE_7__ {
  long si_signo;
  TYPE_2__ si_value;
  scalar_t__ si_uid;
  scalar_t__ si_pid;
};
typedef TYPE_3__ siginfo_t;
typedef scalar_t__ mqd_t;

/* Variables and functions */
int O_NONBLOCK;
int O_RDONLY;
int /*<<< orphan*/ SIGEV_SIGNAL;
int /*<<< orphan*/ SIGRTMIN;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ exit(int);
void *malloc(int /*<<< orphan*/);
int mq_getattr(scalar_t__, struct mq_attr *);
int mq_notify(scalar_t__, struct sigevent *);
scalar_t__ mq_open(char *, int);
scalar_t__ mq_receive(scalar_t__, void *, int /*<<< orphan*/,
                      int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int sigwaitinfo(int /*<<< orphan*/ *, TYPE_3__ *);
int main(int argc, char *argv[]) {
  struct sigevent sev;
  mqd_t mqd;
  struct mq_attr attr;
  void *buffer;
  ssize_t numRead;
  sigset_t blockMask;
  siginfo_t si;
  mqd = mq_open("/mymq", O_RDONLY | O_NONBLOCK);
  if (mqd == (mqd_t)-1) {
    perror("mq_open");
    exit(1);
  }
  if (mq_getattr(mqd, &attr) == -1) {
    perror("mq_getattr");
    exit(1);
  }
  buffer = malloc(attr.mq_msgsize);
  if (buffer == NULL) {
    perror("malloc");
    exit(1);
  }
  sigemptyset(&blockMask);
  sigaddset(&blockMask, SIGRTMIN);
  if (sigprocmask(SIG_BLOCK, &blockMask, NULL) == -1) {
    perror("sigprocmask");
    exit(1);
  }
  sev.sigev_notify = SIGEV_SIGNAL;
  sev.sigev_signo = SIGRTMIN;
  sev.sigev_value.sival_ptr = &mqd;
  if (mq_notify(mqd, &sev) == -1) {
    perror("mq_notify");
    exit(1);
  }
  for (;;) {
    printf(" Invoking sigwaitinfo \n");
    if (sigwaitinfo(&blockMask, &si) == -1)
      perror("sigwaitinfo");
    printf("Accepted signal:\n");
    printf("        si_signo   = %d\n", si.si_signo);
    printf("        si_pid     = %ld\n", (long)si.si_pid);
    printf("        si_uid     = %ld\n", (long)si.si_uid);
    printf("        *sival_ptr = %p\n\n", si.si_value.sival_ptr);
    while ((numRead = mq_receive(mqd, buffer, attr.mq_msgsize, NULL)) >= 0)
      printf("Read %ld bytes\n", (long)numRead);
    if (mq_notify(mqd, &sev) == -1)
      perror("mq_notify");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e03(%rip),%rax
mov    (%rax),%esi
mov    0x2e02(%rip),%rax
or     (%rax),%esi
lea    0xe11(%rip),%rdi
call   1060 <mq_open@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0xffffffffffffffff,-0x28(%rbp)
jne    1219 <main+0x59>
lea    0xdfc(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   10e0 <mq_getattr@plt>
cmp    $0xffffffff,%eax
jne    1245 <main+0x85>
lea    0xdd8(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x30(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1272 <main+0xb2>
lea    0xdb6(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    -0x44(%rbp),%rdi
call   1050 <sigemptyset@plt>
mov    0x2d46(%rip),%rax
mov    (%rax),%esi
lea    -0x44(%rbp),%rdi
call   10d0 <sigaddset@plt>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
lea    -0x44(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
cmp    $0xffffffff,%eax
jne    12c2 <main+0x102>
lea    0xd6d(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x2d0f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2cf3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   10b0 <mq_notify@plt>
cmp    $0xffffffff,%eax
jne    130e <main+0x14e>
lea    0xd2d(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
jmp    1313 <main+0x153>
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x44(%rbp),%rdi
lea    -0x68(%rbp),%rsi
call   1070 <sigwaitinfo@plt>
cmp    $0xffffffff,%eax
jne    1343 <main+0x183>
lea    0xd10(%rip),%rdi
call   10a0 <perror@plt>
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x68(%rbp),%rsi
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rsi
lea    0xd17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x58(%rbp),%rsi
lea    0xd1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x60(%rbp),%rsi
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1090 <mq_receive@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jl     13d2 <main+0x212>
mov    -0x40(%rbp),%rsi
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1399 <main+0x1d9>
mov    -0x28(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   10b0 <mq_notify@plt>
cmp    $0xffffffff,%eax
jne    13f4 <main+0x234>
lea    0xc3d(%rip),%rdi
call   10a0 <perror@plt>
jmp    1313 <main+0x153>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    0x2dfb(%rip),%rax
mov    0x2dfc(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xe09(%rip),%rdi
call   1070 <mq_open@plt>
mov    %rax,0x8(%rsp)
cmp    $0xffffffffffffffff,%rax
je     13a7 <main+0x1d7>
mov    %rax,%rbp
mov    %rsp,%rsi
mov    %rax,%rdi
call   10f0 <mq_getattr@plt>
cmp    $0xffffffff,%eax
je     13b0 <main+0x1e0>
mov    (%rsp),%edi
call   1090 <malloc@plt>
test   %rax,%rax
je     13b9 <main+0x1e9>
mov    %rax,%rbx
lea    0x14(%rsp),%r14
mov    %r14,%rdi
call   1060 <sigemptyset@plt>
mov    0x2d7e(%rip),%r15
mov    (%r15),%esi
mov    %r14,%rdi
call   10e0 <sigaddset@plt>
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
cmp    $0xffffffff,%eax
je     13c2 <main+0x1f2>
mov    0x2d60(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x24(%rsp)
mov    (%r15),%eax
mov    %eax,0x20(%rsp)
lea    0x8(%rsp),%rax
mov    %rax,0x18(%rsp)
lea    0x18(%rsp),%rsi
mov    %rbp,%rdi
call   10c0 <mq_notify@plt>
cmp    $0xffffffff,%eax
je     13cb <main+0x1fb>
lea    0xdaf(%rip),%r14
lea    0xdc2(%rip),%r15
lea    0xdd5(%rip),%r12
lea    0xde8(%rip),%rbp
lea    0x18(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
lea    0xde2(%rip),%rdi
call   1040 <puts@plt>
lea    0x14(%rsp),%rdi
lea    0x28(%rsp),%rsi
call   1080 <sigwaitinfo@plt>
cmp    $0xffffffff,%eax
jne    12fc <main+0x12c>
lea    0xd3f(%rip),%rdi
call   10b0 <perror@plt>
lea    0xdcd(%rip),%rdi
call   1040 <puts@plt>
mov    0x28(%rsp),%rsi
lea    0xd2e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x40(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x38(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x30(%rsp),%rsi
mov    %r12,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%rdi
mov    (%rsp),%edx
mov    %rbx,%rsi
xor    %ecx,%ecx
call   10a0 <mq_receive@plt>
test   %rax,%rax
js     1380 <main+0x1b0>
mov    %rbp,%rdi
mov    %rax,%rsi
jmp    1350 <main+0x180>
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%rsp),%rdi
mov    %r13,%rsi
call   10c0 <mq_notify@plt>
cmp    $0xffffffff,%eax
jne    12d0 <main+0x100>
lea    0xc8f(%rip),%rdi
call   10b0 <perror@plt>
jmp    12d0 <main+0x100>
lea    0xc58(%rip),%rdi
jmp    13d2 <main+0x202>
lea    0xc57(%rip),%rdi
jmp    13d2 <main+0x202>
lea    0xc59(%rip),%rdi
jmp    13d2 <main+0x202>
lea    0xc57(%rip),%rdi
jmp    13d2 <main+0x202>
lea    0xc5a(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.sigevent = type { %struct.TYPE_5__, i32, i32 }
%struct.TYPE_5__ = type { i64* }
%struct.mq_attr = type { i32 }
%struct.TYPE_7__ = type { i64, %struct.TYPE_6__, i64, i64 }
%struct.TYPE_6__ = type { i64 }
@.str = [6 x i8] c"/mymq\00"
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
@.str.1 = [8 x i8] c"mq_open\00"
@.str.2 = [11 x i8] c"mq_getattr\00"
@.str.3 = [7 x i8] c"malloc\00"
@SIGRTMIN = global i32 0
@SIG_BLOCK = global i32 0
@.str.4 = [12 x i8] c"sigprocmask\00"
@SIGEV_SIGNAL = global i32 0
@.str.5 = [10 x i8] c"mq_notify\00"
@.str.6 = [24 x i8] c" Invoking sigwaitinfo \0A\00"
@.str.7 = [12 x i8] c"sigwaitinfo\00"
@.str.8 = [18 x i8] c"Accepted signal:\0A\00"
@.str.9 = [25 x i8] c" si_signo = %d\0A\00"
@.str.10 = [26 x i8] c" si_pid = %ld\0A\00"
@.str.11 = [26 x i8] c" si_uid = %ld\0A\00"
@.str.12 = [26 x i8] c" *sival_ptr = %p\0A\0A\00"
@.str.13 = [16 x i8] c"Read %ld bytes\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sigevent
%7 = alloca i64
%8 = alloca %struct.mq_attr
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca %struct.TYPE_7__
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* @O_RDONLY
%14 = load i32, i32* @O_NONBLOCK
%15 = or i32 %13, %14
%16 = call i64 @mq_open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %15)
store i64 %16, i64* %7
%17 = load i64, i64* %7
%18 = icmp eq i64 %17, -1
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %2
%23 = load i64, i64* %7
%24 = call i32 @mq_getattr(i64 %23, %struct.mq_attr* %8)
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %22
%30 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 0
%31 = load i32, i32* %30
%32 = call i8* @malloc(i32 %31)
store i8* %32, i8** %9
%33 = load i8*, i8** %9
%34 = icmp eq i8* %33, null
br i1 %34, label %35, label %38
35: ; preds = %29
%36 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %29
%39 = call i32 @sigemptyset(i32* %11)
%40 = load i32, i32* @SIGRTMIN
%41 = call i32 @sigaddset(i32* %11, i32 %40)
%42 = load i32, i32* @SIG_BLOCK
%43 = call i32 @sigprocmask(i32 %42, i32* %11, i32* null)
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %48
45: ; preds = %38
%46 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %38
%49 = load i32, i32* @SIGEV_SIGNAL
%50 = getelementptr inbounds %struct.sigevent, %struct.sigevent* %6, i32 0, i32 2
store i32 %49, i32* %50
%51 = load i32, i32* @SIGRTMIN
%52 = getelementptr inbounds %struct.sigevent, %struct.sigevent* %6, i32 0, i32 1
store i32 %51, i32* %52
%53 = getelementptr inbounds %struct.sigevent, %struct.sigevent* %6, i32 0, i32 0
%54 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %53, i32 0, i32 0
store i64* %7, i64** %54
%55 = load i64, i64* %7
%56 = call i32 @mq_notify(i64 %55, %struct.sigevent* %6)
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %61
58: ; preds = %48
%59 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %48
br label %62
62: ; preds = %99, %61
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%64 = call i32 @sigwaitinfo(i32* %11, %struct.TYPE_7__* %12)
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %68
66: ; preds = %62
%67 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
br label %68
68: ; preds = %66, %62
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%70 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %12, i32 0, i32 0
%71 = load i64, i64* %70
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i64 %71)
%73 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %12, i32 0, i32 3
%74 = load i64, i64* %73
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i64 %74)
%76 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %12, i32 0, i32 2
%77 = load i64, i64* %76
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i64 %77)
%79 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %12, i32 0, i32 1
%80 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %79, i32 0, i32 0
%81 = load i64, i64* %80
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i64 %81)
br label %83
83: ; preds = %90, %68
%84 = load i64, i64* %7
%85 = load i8*, i8** %9
%86 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %8, i32 0, i32 0
%87 = load i32, i32* %86
%88 = call i64 @mq_receive(i64 %84, i8* %85, i32 %87, i32* null)
store i64 %88, i64* %10
%89 = icmp sge i64 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %83
%91 = load i64, i64* %10
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i64 %91)
br label %83
93: ; preds = %83
%94 = load i64, i64* %7
%95 = call i32 @mq_notify(i64 %94, %struct.sigevent* %6)
%96 = icmp eq i32 %95, -1
br i1 %96, label %97, label %99
97: ; preds = %93
%98 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %99
99: ; preds = %97, %93
br label %62
}

LLVM IR (-O2):
%struct.sigevent = type { %struct.TYPE_5__, i32, i32 }
%struct.TYPE_5__ = type { i64* }
%struct.mq_attr = type { i32 }
%struct.TYPE_7__ = type { i64, %struct.TYPE_6__, i64, i64 }
%struct.TYPE_6__ = type { i64 }
@.str = [6 x i8] c"/mymq\00"
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
@.str.1 = [8 x i8] c"mq_open\00"
@.str.2 = [11 x i8] c"mq_getattr\00"
@.str.3 = [7 x i8] c"malloc\00"
@SIGRTMIN = global i32 0
@SIG_BLOCK = global i32 0
@.str.4 = [12 x i8] c"sigprocmask\00"
@SIGEV_SIGNAL = global i32 0
@.str.5 = [10 x i8] c"mq_notify\00"
@.str.7 = [12 x i8] c"sigwaitinfo\00"
@.str.9 = [25 x i8] c" si_signo = %d\0A\00"
@.str.10 = [26 x i8] c" si_pid = %ld\0A\00"
@.str.11 = [26 x i8] c" si_uid = %ld\0A\00"
@.str.12 = [26 x i8] c" *sival_ptr = %p\0A\0A\00"
@.str.13 = [16 x i8] c"Read %ld bytes\0A\00"
@str = [23 x i8] c" Invoking sigwaitinfo \00"
@str.14 = [17 x i8] c"Accepted signal:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.sigevent
%4 = alloca i64
%5 = alloca %struct.mq_attr
%6 = alloca i32
%7 = alloca %struct.TYPE_7__
%8 = bitcast %struct.sigevent* %3 to i8*
%9 = bitcast i64* %4 to i8*
%10 = bitcast %struct.mq_attr* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = bitcast %struct.TYPE_7__* %7 to i8*
%13 = load i32, i32* @O_RDONLY
%14 = load i32, i32* @O_NONBLOCK
%15 = or i32 %14, %13
%16 = tail call i64 @mq_open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %15)
store i64 %16, i64* %4
%17 = icmp eq i64 %16, -1
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = call i32 @mq_getattr(i64 %16, %struct.mq_attr* %5)
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %21
%28 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %5, i64 0, i32 0
%29 = load i32, i32* %28
%30 = call i8* @malloc(i32 %29)
%31 = icmp eq i8* %30, null
br i1 %31, label %32, label %35
32: ; preds = %27
%33 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %27
%36 = call i32 @sigemptyset(i32* %6)
%37 = load i32, i32* @SIGRTMIN
%38 = call i32 @sigaddset(i32* %6, i32 %37)
%39 = load i32, i32* @SIG_BLOCK
%40 = call i32 @sigprocmask(i32 %39, i32* %6, i32* null)
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %45
42: ; preds = %35
%43 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%44 = call i32 @exit(i32 1)
unreachable
45: ; preds = %35
%46 = load i32, i32* @SIGEV_SIGNAL
%47 = getelementptr inbounds %struct.sigevent, %struct.sigevent* %3, i64 0, i32 2
store i32 %46, i32* %47
%48 = load i32, i32* @SIGRTMIN
%49 = getelementptr inbounds %struct.sigevent, %struct.sigevent* %3, i64 0, i32 1
store i32 %48, i32* %49
%50 = getelementptr inbounds %struct.sigevent, %struct.sigevent* %3, i64 0, i32 0, i32 0
store i64* %4, i64** %50
%51 = call i32 @mq_notify(i64 %16, %struct.sigevent* %3)
%52 = icmp eq i32 %51, -1
br i1 %52, label %58, label %53
53: ; preds = %45
%54 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %7, i64 0, i32 0
%55 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %7, i64 0, i32 3
%56 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %7, i64 0, i32 2
%57 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %7, i64 0, i32 1, i32 0
br label %61
58: ; preds = %45
%59 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %94, %53
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%63 = call i32 @sigwaitinfo(i32* %6, %struct.TYPE_7__* %7)
%64 = icmp eq i32 %63, -1
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
br label %67
67: ; preds = %65, %61
%68 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%69 = load i64, i64* %54
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i64 %69)
%71 = load i64, i64* %55
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i64 %71)
%73 = load i64, i64* %56
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i64 %73)
%75 = load i64, i64* %57
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i64 %75)
%77 = load i64, i64* %4
%78 = load i32, i32* %28
%79 = call i64 @mq_receive(i64 %77, i8* %30, i32 %78, i32* null)
%80 = icmp sgt i64 %79, -1
br i1 %80, label %81, label %88
81: ; preds = %67, %81
%82 = phi i64 [ %86, %81 ], [ %79, %67 ]
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i64 %82)
%84 = load i64, i64* %4
%85 = load i32, i32* %28
%86 = call i64 @mq_receive(i64 %84, i8* %30, i32 %85, i32* null)
%87 = icmp sgt i64 %86, -1
br i1 %87, label %81, label %88
88: ; preds = %81, %67
%89 = load i64, i64* %4
%90 = call i32 @mq_notify(i64 %89, %struct.sigevent* %3)
%91 = icmp eq i32 %90, -1
br i1 %91, label %92, label %94
92: ; preds = %88
%93 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %94
94: ; preds = %92, %88
br label %61
}