#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 shmid_ds {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IPC_STAT;
int /*<<< orphan*/ printf(char *);
int shmctl(int, int /*<<< orphan*/, struct shmid_ds *);
void PrintfShmidDs(int shmid, int key) {
  if (shmid == 0 || shmid < -1)
    return;
  struct shmid_ds shmds;
  int ret = shmctl(shmid, IPC_STAT, &shmds);
  if (ret == 0) {
    ;
    ;
    ;
    ;
    ;
    ;
    ;
  } else {
    printf("[WARING]:shmctl(  ) call failed\n");
  }
}


x86 assembly (clang, -O0):
<PrintfShmidDs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <PrintfShmidDs+0x22>
cmpl   $0xffffffff,-0x4(%rbp)
jge    1147 <PrintfShmidDs+0x27>
jmp    117a <PrintfShmidDs+0x5a>
mov    -0x4(%rbp),%edi
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1040 <shmctl@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    116e <PrintfShmidDs+0x4e>
jmp    117a <PrintfShmidDs+0x5a>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintfShmidDs>:
test   %edi,%edi
je     114f <PrintfShmidDs+0x2f>
cmp    $0xffffffff,%edi
jl     114f <PrintfShmidDs+0x2f>
push   %rax
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1040 <shmctl@plt>
test   %eax,%eax
je     114b <PrintfShmidDs+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
%struct.shmid_ds = type { i32 }
@IPC_STAT = global i32 0
@.str = [33 x i8] c"[WARING]:shmctl( ) call failed\0A\00"
define void @PrintfShmidDs(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.shmid_ds
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %9, %2
br label %22
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* @IPC_STAT
%16 = call i32 @shmctl(i32 %14, i32 %15, %struct.shmid_ds* %5)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %13
br label %22
20: ; preds = %13
%21 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %12, %20, %19
ret void
}

LLVM IR (-O2):
%struct.shmid_ds = type { i32 }
@IPC_STAT = global i32 0
@str = [32 x i8] c"[WARING]:shmctl( ) call failed\00"
define void @PrintfShmidDs(i32 %0, i32 %1) {
%3 = alloca %struct.shmid_ds
%4 = icmp eq i32 %0, 0
%5 = icmp slt i32 %0, -1
%6 = or i1 %4, %5
br i1 %6, label %15, label %7
7: ; preds = %2
%8 = bitcast %struct.shmid_ds* %3 to i8*
%9 = load i32, i32* @IPC_STAT
%10 = call i32 @shmctl(i32 %0, i32 %9, %struct.shmid_ds* %3)
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %7
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %7, %12
br label %15
15: ; preds = %2, %14
ret void
}