#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 shmid_ds {
  scalar_t__ shm_ctime;
  scalar_t__ shm_dtime;
  scalar_t__ shm_atime;
  scalar_t__ shm_nattch;
  scalar_t__ shm_lpid;
  scalar_t__ shm_cpid;
  scalar_t__ shm_segsz;
  TYPE_1__ shm_perm;
};

/* Variables and functions */
scalar_t__ EINVAL;
int /*<<< orphan*/ IPC_PRIVATE;
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ IPC_STAT;
int /*<<< orphan*/ SHM_INFO;
int /*<<< orphan*/ SHM_STAT;
scalar_t__ errno;
int /*<<< orphan*/ printf(char *, ...);
int shmctl(int, int /*<<< orphan*/, struct shmid_ds *);
int shmget(int /*<<< orphan*/, int, int);
int main(void) {
  int rc, id;
  struct shmid_ds ds;
  id = shmget(IPC_PRIVATE, 1, 0600);
  if (id < 0)
    return 77;
  printf("shmget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id);
  if (shmctl(id, IPC_STAT, &ds))
    goto fail;
  printf("shmctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{shm_perm=\\{uid=%u, gid=%u, "
         "mode=%#o, key=%u, cuid=%u, cgid=%u\\}, shm_segsz=%u, shm_cpid=%u, "
         "shm_lpid=%u, shm_nattch=%u, shm_atime=%u, shm_dtime=%u, "
         "shm_ctime=%u\\}\\) += 0\n",
         id, (unsigned)ds.shm_perm.uid, (unsigned)ds.shm_perm.gid,
         (unsigned)ds.shm_perm.mode, (unsigned)ds.shm_perm.__key,
         (unsigned)ds.shm_perm.cuid, (unsigned)ds.shm_perm.cgid,
         (unsigned)ds.shm_segsz, (unsigned)ds.shm_cpid, (unsigned)ds.shm_lpid,
         (unsigned)ds.shm_nattch, (unsigned)ds.shm_atime,
         (unsigned)ds.shm_dtime, (unsigned)ds.shm_ctime);
  int max = shmctl(0, SHM_INFO, &ds);
  if (max < 0)
    goto fail;
  printf("shmctl\\(0, (IPC_64\\|)?SHM_INFO, %p\\) += %d\n", &ds, max);
  rc = shmctl(id, SHM_STAT, &ds);
  if (rc != id) {
    if (-1 != rc || EINVAL != errno)
      goto fail;
    printf("shmctl\\(%d, (IPC_64\\|)?SHM_STAT, %p\\) += -1 EINVAL \\(Invalid "
           "argument\\)\n",
           id, &ds);
  } else {
    printf("shmctl\\(%d, (IPC_64\\|)?SHM_STAT, %p\\) += %d\n", id, &ds, id);
  }
  rc = 0;
done:
  if (shmctl(id, IPC_RMID, NULL) < 0)
    return 1;
  printf("shmctl\\(%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    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
mov    $0x180,%edx
call   1050 <shmget@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    117c <main+0x4c>
movl   $0x4d,-0x2c(%rbp)
jmp    1386 <main+0x256>
mov    -0x34(%rbp),%esi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%edi
mov    0x2e39(%rip),%rax
mov    (%rax),%esi
lea    -0xa0(%rbp),%rdx
call   1040 <shmctl@plt>
cmp    $0x0,%eax
je     11b3 <main+0x83>
jmp    137a <main+0x24a>
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    0xe05(%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   1030 <printf@plt>
mov    0x2d8a(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0xa0(%rbp),%rdx
call   1040 <shmctl@plt>
mov    %eax,-0xa4(%rbp)
cmpl   $0x0,-0xa4(%rbp)
jge    1286 <main+0x156>
jmp    137a <main+0x24a>
mov    -0xa4(%rbp),%edx
lea    0xe61(%rip),%rdi
lea    -0xa0(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%edi
mov    0x2d1d(%rip),%rax
mov    (%rax),%esi
lea    -0xa0(%rbp),%rdx
call   1040 <shmctl@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x34(%rbp),%eax
je     1312 <main+0x1e2>
mov    $0xffffffff,%eax
cmp    -0x30(%rbp),%eax
jne    12f0 <main+0x1c0>
mov    0x2cd3(%rip),%rax
mov    (%rax),%rax
mov    0x2cd9(%rip),%rcx
cmp    (%rcx),%rax
je     12f5 <main+0x1c5>
jmp    137a <main+0x24a>
mov    -0x34(%rbp),%esi
lea    0xe21(%rip),%rdi
lea    -0xa0(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    132d <main+0x1fd>
mov    -0x34(%rbp),%esi
mov    -0x34(%rbp),%ecx
lea    0xe4a(%rip),%rdi
lea    -0xa0(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x34(%rbp),%edi
mov    0x2c7a(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <shmctl@plt>
cmp    $0x0,%eax
jge    135e <main+0x22e>
movl   $0x1,-0x2c(%rbp)
jmp    1386 <main+0x256>
mov    -0x34(%rbp),%esi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1386 <main+0x256>
movl   $0x1,-0x30(%rbp)
jmp    1334 <main+0x204>
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    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%ebx
mov    $0x1,%esi
mov    $0x180,%edx
call   1050 <shmget@plt>
test   %eax,%eax
js     11bc <main+0x8c>
mov    %eax,%ebp
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rdx
mov    %ebp,%edi
call   1040 <shmctl@plt>
test   %eax,%eax
je     11c6 <main+0x96>
mov    0x2e24(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
xor    %edx,%edx
call   1040 <shmctl@plt>
test   %eax,%eax
js     12ae <main+0x17e>
lea    0xfe8(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    12b3 <main+0x183>
mov    $0x4d,%ebx
jmp    12b3 <main+0x183>
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),%r15d
mov    0x40(%rsp),%r12d
mov    0x38(%rsp),%r13d
mov    0x30(%rsp),%r10d
mov    0x20(%rsp),%r11d
mov    0x28(%rsp),%r14d
sub    $0x8,%rsp
lea    0xe07(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
push   %r11
push   %r14
push   %r10
push   %r13
push   %r12
push   %r15
push   0x40(%rsp)
push   0x50(%rsp)
push   0x60(%rsp)
call   1030 <printf@plt>
add    $0x50,%rsp
mov    0x2d9d(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rdx
xor    %edi,%edi
call   1040 <shmctl@plt>
test   %eax,%eax
js     118d <main+0x5d>
lea    0xe8c(%rip),%rdi
lea    0x20(%rsp),%r14
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
mov    %r14,%rdx
call   1040 <shmctl@plt>
cmp    %ebp,%eax
jne    12c7 <main+0x197>
lea    0xed2(%rip),%rdi
lea    0x20(%rsp),%rdx
mov    %ebp,%esi
mov    %ebp,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %ebx,%ebx
jmp    118d <main+0x5d>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0xffffffff,%eax
jne    118d <main+0x5d>
mov    0x2cd9(%rip),%rax
mov    (%rax),%rax
mov    0x2cdf(%rip),%rcx
cmp    (%rcx),%rax
jne    118d <main+0x5d>
lea    0xe2f(%rip),%rdi
xor    %ebx,%ebx
lea    0x20(%rsp),%rdx
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    118d <main+0x5d>

LLVM IR (-O0):
%struct.shmid_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 = [38 x i8] c"shmget\\(IPC_PRIVATE, 1, 0600\\) += %d\0A\00"
@IPC_STAT = global i32 0
@.str.1 = [206 x i8] c"shmctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{shm_perm=\\{uid=%u, gid=%u, mode=%#o, key=%u, cuid=%u, cgid=%u\\}, shm_segsz=%u, shm_cpid=%u, shm_lpid=%u, shm_nattch=%u, shm_atime=%u, shm_dtime=%u, shm_ctime=%u\\}\\) += 0\0A\00"
@SHM_INFO = global i32 0
@.str.2 = [44 x i8] c"shmctl\\(0, (IPC_64\\|)?SHM_INFO, %p\\) += %d\0A\00"
@SHM_STAT = global i32 0
@EINVAL = global i64 0
@errno = global i64 0
@.str.3 = [73 x i8] c"shmctl\\(%d, (IPC_64\\|)?SHM_STAT, %p\\) += -1 EINVAL \\(Invalid argument\\)\0A\00"
@.str.4 = [45 x i8] c"shmctl\\(%d, (IPC_64\\|)?SHM_STAT, %p\\) += %d\0A\00"
@IPC_RMID = global i32 0
@.str.5 = [46 x i8] c"shmctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.shmid_ds
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* @IPC_PRIVATE
%7 = call i32 @shmget(i32 %6, i32 1, 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 ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %3
%15 = load i32, i32* @IPC_STAT
%16 = call i32 @shmctl(i32 %14, i32 %15, %struct.shmid_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.shmid_ds, %struct.shmid_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.shmid_ds, %struct.shmid_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.shmid_ds, %struct.shmid_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.shmid_ds, %struct.shmid_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.shmid_ds, %struct.shmid_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.shmid_ds, %struct.shmid_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.shmid_ds, %struct.shmid_ds* %4, i32 0, i32 6
%46 = load i64, i64* %45
%47 = trunc i64 %46 to i32
%48 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %4, i32 0, i32 5
%49 = load i64, i64* %48
%50 = trunc i64 %49 to i32
%51 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %4, i32 0, i32 4
%52 = load i64, i64* %51
%53 = trunc i64 %52 to i32
%54 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %4, i32 0, i32 3
%55 = load i64, i64* %54
%56 = trunc i64 %55 to i32
%57 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %4, i32 0, i32 2
%58 = load i64, i64* %57
%59 = trunc i64 %58 to i32
%60 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %4, i32 0, i32 1
%61 = load i64, i64* %60
%62 = trunc i64 %61 to i32
%63 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_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 ([206 x i8], [206 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* @SHM_INFO
%68 = call i32 @shmctl(i32 0, i32 %67, %struct.shmid_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.shmid_ds* %4, i32 %73)
%75 = load i32, i32* %3
%76 = load i32, i32* @SHM_STAT
%77 = call i32 @shmctl(i32 %75, i32 %76, %struct.shmid_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.shmid_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.shmid_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 @shmctl(i32 %98, i32 %99, %struct.shmid_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.shmid_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 = [38 x i8] c"shmget\\(IPC_PRIVATE, 1, 0600\\) += %d\0A\00"
@IPC_STAT = global i32 0
@.str.1 = [206 x i8] c"shmctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{shm_perm=\\{uid=%u, gid=%u, mode=%#o, key=%u, cuid=%u, cgid=%u\\}, shm_segsz=%u, shm_cpid=%u, shm_lpid=%u, shm_nattch=%u, shm_atime=%u, shm_dtime=%u, shm_ctime=%u\\}\\) += 0\0A\00"
@SHM_INFO = global i32 0
@.str.2 = [44 x i8] c"shmctl\\(0, (IPC_64\\|)?SHM_INFO, %p\\) += %d\0A\00"
@SHM_STAT = global i32 0
@EINVAL = global i64 0
@errno = global i64 0
@.str.3 = [73 x i8] c"shmctl\\(%d, (IPC_64\\|)?SHM_STAT, %p\\) += -1 EINVAL \\(Invalid argument\\)\0A\00"
@.str.4 = [45 x i8] c"shmctl\\(%d, (IPC_64\\|)?SHM_STAT, %p\\) += %d\0A\00"
@IPC_RMID = global i32 0
@.str.5 = [46 x i8] c"shmctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\0A\00"
define i32 @main() {
%1 = alloca %struct.shmid_ds
%2 = bitcast %struct.shmid_ds* %1 to i8*
%3 = load i32, i32* @IPC_PRIVATE
%4 = tail call i32 @shmget(i32 %3, i32 1, 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 ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = load i32, i32* @IPC_STAT
%9 = call i32 @shmctl(i32 %4, i32 %8, %struct.shmid_ds* %1)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %70
11: ; preds = %6
%12 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 7, i32 5
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 7, i32 4
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 7, i32 3
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
%21 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 7, i32 2
%22 = load i64, i64* %21
%23 = trunc i64 %22 to i32
%24 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 7, i32 1
%25 = load i64, i64* %24
%26 = trunc i64 %25 to i32
%27 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 7, i32 0
%28 = load i64, i64* %27
%29 = trunc i64 %28 to i32
%30 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 6
%31 = load i64, i64* %30
%32 = trunc i64 %31 to i32
%33 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 5
%34 = load i64, i64* %33
%35 = trunc i64 %34 to i32
%36 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 4
%37 = load i64, i64* %36
%38 = trunc i64 %37 to i32
%39 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 3
%40 = load i64, i64* %39
%41 = trunc i64 %40 to i32
%42 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 2
%43 = load i64, i64* %42
%44 = trunc i64 %43 to i32
%45 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %1, i64 0, i32 1
%46 = load i64, i64* %45
%47 = trunc i64 %46 to i32
%48 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_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 ([206 x i8], [206 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* @SHM_INFO
%53 = call i32 @shmctl(i32 0, i32 %52, %struct.shmid_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.shmid_ds* %1, i32 %53)
%57 = load i32, i32* @SHM_STAT
%58 = call i32 @shmctl(i32 %4, i32 %57, %struct.shmid_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.shmid_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.shmid_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 @shmctl(i32 %4, i32 %72, %struct.shmid_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
}