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

/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ cgid;
  scalar_t__ cuid;
  scalar_t__ __key;
  scalar_t__ mode;
  scalar_t__ gid;
  scalar_t__ uid;
};
struct msqid_ds {
  scalar_t__ msg_lrpid;
  scalar_t__ msg_lspid;
  scalar_t__ msg_qbytes;
  scalar_t__ msg_qnum;
  scalar_t__ msg_ctime;
  scalar_t__ msg_rtime;
  scalar_t__ msg_stime;
  TYPE_1__ msg_perm;
};

/* Variables and functions */
scalar_t__ EINVAL;
int /*<<< orphan*/ IPC_PRIVATE;
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ IPC_STAT;
int /*<<< orphan*/ MSG_INFO;
int /*<<< orphan*/ MSG_STAT;
scalar_t__ errno;
int msgctl(int, int /*<<< orphan*/, struct msqid_ds *);
int msgget(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int rc, id;
  struct msqid_ds ds;
  id = msgget(IPC_PRIVATE, 0600);
  if (id < 0)
    return 77;
  printf("msgget\\(IPC_PRIVATE, 0600\\) += %d\n", id);
  if (msgctl(id, IPC_STAT, &ds))
    goto fail;
  printf("msgctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{msg_perm=\\{uid=%u, gid=%u, "
         "mode=%#o, key=%u, cuid=%u, cgid=%u\\}, msg_stime=%u, msg_rtime=%u, "
         "msg_ctime=%u, msg_qnum=%u, msg_qbytes=%u, msg_lspid=%u, "
         "msg_lrpid=%u\\}\\) += 0\n",
         id, (unsigned)ds.msg_perm.uid, (unsigned)ds.msg_perm.gid,
         (unsigned)ds.msg_perm.mode, (unsigned)ds.msg_perm.__key,
         (unsigned)ds.msg_perm.cuid, (unsigned)ds.msg_perm.cgid,
         (unsigned)ds.msg_stime, (unsigned)ds.msg_rtime, (unsigned)ds.msg_ctime,
         (unsigned)ds.msg_qnum, (unsigned)ds.msg_qbytes, (unsigned)ds.msg_lspid,
         (unsigned)ds.msg_lrpid);
  int max = msgctl(0, MSG_INFO, &ds);
  if (max < 0)
    goto fail;
  printf("msgctl\\(0, (IPC_64\\|)?MSG_INFO, %p\\) += %d\n", &ds, max);
  rc = msgctl(id, MSG_STAT, &ds);
  if (rc != id) {
    if (-1 != rc || EINVAL != errno)
      goto fail;
    printf("msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += -1 EINVAL \\(Invalid "
           "argument\\)\n",
           id, &ds);
  } else {
    printf("msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += %d\n", id, &ds, id);
  }
  rc = 0;
done:
  if (msgctl(id, IPC_RMID, NULL) < 0)
    return 1;
  printf("msgctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\n", id);
  return rc;
fail:
  rc = 1;
  goto done;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
movl   $0x0,-0x2c(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    $0x180,%esi
call   1030 <msgget@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    1177 <main+0x47>
movl   $0x4d,-0x2c(%rbp)
jmp    1381 <main+0x251>
mov    -0x34(%rbp),%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%edi
mov    0x2e36(%rip),%rax
mov    (%rax),%esi
lea    -0xa0(%rbp),%rdx
call   1050 <msgctl@plt>
cmp    $0x0,%eax
je     11ae <main+0x7e>
jmp    1375 <main+0x245>
mov    -0x34(%rbp),%esi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    -0x48(%rbp),%rax
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
mov    %eax,%r8d
mov    -0x58(%rbp),%rax
mov    %eax,%r9d
mov    -0x60(%rbp),%rax
mov    -0x68(%rbp),%rdi
mov    %edi,%r13d
mov    -0x70(%rbp),%rdi
mov    %edi,%r12d
mov    -0x78(%rbp),%rdi
mov    %edi,%r15d
mov    -0x80(%rbp),%rdi
mov    %edi,%r14d
mov    -0x88(%rbp),%rdi
mov    %edi,%ebx
mov    -0x90(%rbp),%rdi
mov    %edi,%r11d
mov    -0x98(%rbp),%rdi
mov    %edi,%r10d
mov    -0xa0(%rbp),%rdi
mov    %edi,-0xa8(%rbp)
lea    0xe07(%rip),%rdi
mov    %eax,(%rsp)
mov    -0xa8(%rbp),%eax
mov    %r13d,0x8(%rsp)
mov    %r12d,0x10(%rsp)
mov    %r15d,0x18(%rsp)
mov    %r14d,0x20(%rsp)
mov    %ebx,0x28(%rsp)
mov    %r11d,0x30(%rsp)
mov    %r10d,0x38(%rsp)
mov    %eax,0x40(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0xa0(%rbp),%rdx
call   1050 <msgctl@plt>
mov    %eax,-0xa4(%rbp)
cmpl   $0x0,-0xa4(%rbp)
jge    1281 <main+0x151>
jmp    1375 <main+0x245>
mov    -0xa4(%rbp),%edx
lea    0xe64(%rip),%rdi
lea    -0xa0(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%edi
mov    0x2d4a(%rip),%rax
mov    (%rax),%esi
lea    -0xa0(%rbp),%rdx
call   1050 <msgctl@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x34(%rbp),%eax
je     130d <main+0x1dd>
mov    $0xffffffff,%eax
cmp    -0x30(%rbp),%eax
jne    12eb <main+0x1bb>
mov    0x2cd8(%rip),%rax
mov    (%rax),%rax
mov    0x2cde(%rip),%rcx
cmp    (%rcx),%rax
je     12f0 <main+0x1c0>
jmp    1375 <main+0x245>
mov    -0x34(%rbp),%esi
lea    0xe24(%rip),%rdi
lea    -0xa0(%rbp),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1328 <main+0x1f8>
mov    -0x34(%rbp),%esi
mov    -0x34(%rbp),%ecx
lea    0xe4d(%rip),%rdi
lea    -0xa0(%rbp),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x34(%rbp),%edi
mov    0x2c7f(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <msgctl@plt>
cmp    $0x0,%eax
jge    1359 <main+0x229>
movl   $0x1,-0x2c(%rbp)
jmp    1381 <main+0x251>
mov    -0x34(%rbp),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1381 <main+0x251>
movl   $0x1,-0x30(%rbp)
jmp    132f <main+0x1ff>
mov    -0x2c(%rbp),%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    $0x180,%esi
call   1030 <msgget@plt>
test   %eax,%eax
js     11b9 <main+0x89>
mov    %eax,%ebx
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rdx
mov    %ebx,%edi
call   1050 <msgctl@plt>
mov    $0x1,%r15d
mov    $0x1,%ebp
test   %eax,%eax
je     11d4 <main+0xa4>
mov    0x2e23(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %edx,%edx
call   1050 <msgctl@plt>
test   %eax,%eax
js     11bf <main+0x8f>
lea    0xfe9(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%r15d
jmp    11bf <main+0x8f>
mov    $0x4d,%r15d
mov    %r15d,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x80(%rsp),%edx
mov    0x78(%rsp),%ecx
mov    0x70(%rsp),%r8d
mov    0x68(%rsp),%r9d
mov    0x60(%rsp),%eax
mov    %rax,0x18(%rsp)
mov    0x58(%rsp),%eax
mov    %rax,0x10(%rsp)
mov    0x50(%rsp),%eax
mov    %rax,0x8(%rsp)
mov    0x48(%rsp),%r12d
mov    0x40(%rsp),%r13d
mov    0x38(%rsp),%ebp
mov    0x30(%rsp),%r10d
mov    0x20(%rsp),%r11d
mov    0x28(%rsp),%r14d
sub    $0x8,%rsp
lea    0xdf7(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
push   %r11
push   %r14
push   %r10
push   %rbp
push   %r13
push   %r12
push   0x40(%rsp)
push   0x50(%rsp)
push   0x60(%rsp)
call   1040 <printf@plt>
add    $0x50,%rsp
mov    0x2d89(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rdx
xor    %edi,%edi
call   1050 <msgctl@plt>
mov    $0x1,%ebp
test   %eax,%eax
js     118e <main+0x5e>
lea    0xe79(%rip),%rdi
xor    %ebp,%ebp
lea    0x20(%rsp),%r14
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
mov    %r14,%rdx
call   1050 <msgctl@plt>
cmp    %ebx,%eax
jne    12bf <main+0x18f>
lea    0xebd(%rip),%rdi
lea    0x20(%rsp),%rdx
mov    %ebx,%esi
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118e <main+0x5e>
mov    $0x1,%ebp
cmp    $0xffffffff,%eax
jne    118e <main+0x5e>
mov    0x2cdc(%rip),%rax
mov    (%rax),%rax
mov    0x2ce2(%rip),%rcx
mov    $0x1,%ebp
cmp    (%rcx),%rax
jne    118e <main+0x5e>
lea    0xe2b(%rip),%rdi
xor    %ebp,%ebp
lea    0x20(%rsp),%rdx
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118e <main+0x5e>

LLVM IR (-O0):
%struct.msqid_ds = type { i64, i64, i64, i64, i64, i64, i64, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64, i64, i64, i64, i64 }
@IPC_PRIVATE = global i32 0
@.str = [35 x i8] c"msgget\\(IPC_PRIVATE, 0600\\) += %d\0A\00"
@IPC_STAT = global i32 0
@.str.1 = [207 x i8] c"msgctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{msg_perm=\\{uid=%u, gid=%u, mode=%#o, key=%u, cuid=%u, cgid=%u\\}, msg_stime=%u, msg_rtime=%u, msg_ctime=%u, msg_qnum=%u, msg_qbytes=%u, msg_lspid=%u, msg_lrpid=%u\\}\\) += 0\0A\00"
@MSG_INFO = global i32 0
@.str.2 = [44 x i8] c"msgctl\\(0, (IPC_64\\|)?MSG_INFO, %p\\) += %d\0A\00"
@MSG_STAT = global i32 0
@EINVAL = global i64 0
@errno = global i64 0
@.str.3 = [73 x i8] c"msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += -1 EINVAL \\(Invalid argument\\)\0A\00"
@.str.4 = [45 x i8] c"msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += %d\0A\00"
@IPC_RMID = global i32 0
@.str.5 = [46 x i8] c"msgctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.msqid_ds
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* @IPC_PRIVATE
%7 = call i32 @msgget(i32 %6, i32 384)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 77, i32* %1
br label %108
11: ; preds = %0
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %3
%15 = load i32, i32* @IPC_STAT
%16 = call i32 @msgctl(i32 %14, i32 %15, %struct.msqid_ds* %4)
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %11
br label %107
19: ; preds = %11
%20 = load i32, i32* %3
%21 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 7
%22 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %21, i32 0, i32 5
%23 = load i64, i64* %22
%24 = trunc i64 %23 to i32
%25 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 7
%26 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %25, i32 0, i32 4
%27 = load i64, i64* %26
%28 = trunc i64 %27 to i32
%29 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 7
%30 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %29, i32 0, i32 3
%31 = load i64, i64* %30
%32 = trunc i64 %31 to i32
%33 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 7
%34 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %33, i32 0, i32 2
%35 = load i64, i64* %34
%36 = trunc i64 %35 to i32
%37 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 7
%38 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %37, i32 0, i32 1
%39 = load i64, i64* %38
%40 = trunc i64 %39 to i32
%41 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 7
%42 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %41, i32 0, i32 0
%43 = load i64, i64* %42
%44 = trunc i64 %43 to i32
%45 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 6
%46 = load i64, i64* %45
%47 = trunc i64 %46 to i32
%48 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 5
%49 = load i64, i64* %48
%50 = trunc i64 %49 to i32
%51 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 4
%52 = load i64, i64* %51
%53 = trunc i64 %52 to i32
%54 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 3
%55 = load i64, i64* %54
%56 = trunc i64 %55 to i32
%57 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 2
%58 = load i64, i64* %57
%59 = trunc i64 %58 to i32
%60 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 1
%61 = load i64, i64* %60
%62 = trunc i64 %61 to i32
%63 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %4, i32 0, i32 0
%64 = load i64, i64* %63
%65 = trunc i64 %64 to i32
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %24, i32 %28, i32 %32, i32 %36, i32 %40, i32 %44, i32 %47, i32 %50, i32 %53, i32 %56, i32 %59, i32 %62, i32 %65)
%67 = load i32, i32* @MSG_INFO
%68 = call i32 @msgctl(i32 0, i32 %67, %struct.msqid_ds* %4)
store i32 %68, i32* %5
%69 = load i32, i32* %5
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %19
br label %107
72: ; preds = %19
%73 = load i32, i32* %5
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), %struct.msqid_ds* %4, i32 %73)
%75 = load i32, i32* %3
%76 = load i32, i32* @MSG_STAT
%77 = call i32 @msgctl(i32 %75, i32 %76, %struct.msqid_ds* %4)
store i32 %77, i32* %2
%78 = load i32, i32* %2
%79 = load i32, i32* %3
%80 = icmp ne i32 %78, %79
br i1 %80, label %81, label %92
81: ; preds = %72
%82 = load i32, i32* %2
%83 = icmp ne i32 -1, %82
br i1 %83, label %88, label %84
84: ; preds = %81
%85 = load i64, i64* @EINVAL
%86 = load i64, i64* @errno
%87 = icmp ne i64 %85, %86
br i1 %87, label %88, label %89
88: ; preds = %84, %81
br label %107
89: ; preds = %84
%90 = load i32, i32* %3
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.3, i64 0, i64 0), i32 %90, %struct.msqid_ds* %4)
br label %96
92: ; preds = %72
%93 = load i32, i32* %3
%94 = load i32, i32* %3
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %93, %struct.msqid_ds* %4, i32 %94)
br label %96
96: ; preds = %92, %89
store i32 0, i32* %2
br label %97
97: ; preds = %107, %96
%98 = load i32, i32* %3
%99 = load i32, i32* @IPC_RMID
%100 = call i32 @msgctl(i32 %98, i32 %99, %struct.msqid_ds* null)
%101 = icmp slt i32 %100, 0
br i1 %101, label %102, label %103
102: ; preds = %97
store i32 1, i32* %1
br label %108
103: ; preds = %97
%104 = load i32, i32* %3
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 %104)
%106 = load i32, i32* %2
store i32 %106, i32* %1
br label %108
107: ; preds = %88, %71, %18
store i32 1, i32* %2
br label %97
108: ; preds = %103, %102, %10
%109 = load i32, i32* %1
ret i32 %109
}

LLVM IR (-O2):
%struct.msqid_ds = type { i64, i64, i64, i64, i64, i64, i64, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64, i64, i64, i64, i64 }
@IPC_PRIVATE = global i32 0
@.str = [35 x i8] c"msgget\\(IPC_PRIVATE, 0600\\) += %d\0A\00"
@IPC_STAT = global i32 0
@.str.1 = [207 x i8] c"msgctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{msg_perm=\\{uid=%u, gid=%u, mode=%#o, key=%u, cuid=%u, cgid=%u\\}, msg_stime=%u, msg_rtime=%u, msg_ctime=%u, msg_qnum=%u, msg_qbytes=%u, msg_lspid=%u, msg_lrpid=%u\\}\\) += 0\0A\00"
@MSG_INFO = global i32 0
@.str.2 = [44 x i8] c"msgctl\\(0, (IPC_64\\|)?MSG_INFO, %p\\) += %d\0A\00"
@MSG_STAT = global i32 0
@EINVAL = global i64 0
@errno = global i64 0
@.str.3 = [73 x i8] c"msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += -1 EINVAL \\(Invalid argument\\)\0A\00"
@.str.4 = [45 x i8] c"msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += %d\0A\00"
@IPC_RMID = global i32 0
@.str.5 = [46 x i8] c"msgctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\0A\00"
define i32 @main() {
%1 = alloca %struct.msqid_ds
%2 = bitcast %struct.msqid_ds* %1 to i8*
%3 = load i32, i32* @IPC_PRIVATE
%4 = tail call i32 @msgget(i32 %3, i32 384)
%5 = icmp slt i32 %4, 0
br i1 %5, label %77, label %6
6: ; preds = %0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = load i32, i32* @IPC_STAT
%9 = call i32 @msgctl(i32 %4, i32 %8, %struct.msqid_ds* %1)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %70
11: ; preds = %6
%12 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 7, i32 5
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 7, i32 4
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 7, i32 3
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
%21 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 7, i32 2
%22 = load i64, i64* %21
%23 = trunc i64 %22 to i32
%24 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 7, i32 1
%25 = load i64, i64* %24
%26 = trunc i64 %25 to i32
%27 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 7, i32 0
%28 = load i64, i64* %27
%29 = trunc i64 %28 to i32
%30 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 6
%31 = load i64, i64* %30
%32 = trunc i64 %31 to i32
%33 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 5
%34 = load i64, i64* %33
%35 = trunc i64 %34 to i32
%36 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 4
%37 = load i64, i64* %36
%38 = trunc i64 %37 to i32
%39 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 3
%40 = load i64, i64* %39
%41 = trunc i64 %40 to i32
%42 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 2
%43 = load i64, i64* %42
%44 = trunc i64 %43 to i32
%45 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 1
%46 = load i64, i64* %45
%47 = trunc i64 %46 to i32
%48 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %1, i64 0, i32 0
%49 = load i64, i64* %48
%50 = trunc i64 %49 to i32
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([207 x i8], [207 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %14, i32 %17, i32 %20, i32 %23, i32 %26, i32 %29, i32 %32, i32 %35, i32 %38, i32 %41, i32 %44, i32 %47, i32 %50)
%52 = load i32, i32* @MSG_INFO
%53 = call i32 @msgctl(i32 0, i32 %52, %struct.msqid_ds* %1)
%54 = icmp slt i32 %53, 0
br i1 %54, label %70, label %55
55: ; preds = %11
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), %struct.msqid_ds* %1, i32 %53)
%57 = load i32, i32* @MSG_STAT
%58 = call i32 @msgctl(i32 %4, i32 %57, %struct.msqid_ds* %1)
%59 = icmp eq i32 %58, %4
br i1 %59, label %68, label %60
60: ; preds = %55
%61 = icmp eq i32 %58, -1
br i1 %61, label %62, label %70
62: ; preds = %60
%63 = load i64, i64* @EINVAL
%64 = load i64, i64* @errno
%65 = icmp eq i64 %63, %64
br i1 %65, label %66, label %70
66: ; preds = %62
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.3, i64 0, i64 0), i32 %4, %struct.msqid_ds* %1)
br label %70
68: ; preds = %55
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %4, %struct.msqid_ds* %1, i32 %4)
br label %70
70: ; preds = %6, %11, %62, %60, %66, %68
%71 = phi i32 [ 0, %68 ], [ 0, %66 ], [ 1, %60 ], [ 1, %62 ], [ 1, %11 ], [ 1, %6 ]
%72 = load i32, i32* @IPC_RMID
%73 = call i32 @msgctl(i32 %4, i32 %72, %struct.msqid_ds* null)
%74 = icmp slt i32 %73, 0
br i1 %74, label %77, label %75
75: ; preds = %70
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 %4)
br label %77
77: ; preds = %70, %0, %75
%78 = phi i32 [ %71, %75 ], [ 77, %0 ], [ 1, %70 ]
ret i32 %78
}