#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 */

/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int msgctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stderr;
void deleteQueueWithId(int queue_id) {
  printf("Deletando fila de mensagem com o id: %d\n", queue_id);
  if (msgctl(queue_id, IPC_RMID, NULL) == -1) {
    fprintf(stderr, "Impossivel remover a fila com id: %d\n", queue_id);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<deleteQueueWithId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <msgctl@plt>
cmp    $0xffffffff,%eax
jne    119a <deleteQueueWithId+0x5a>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteQueueWithId>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %edx,%edx
call   1050 <msgctl@plt>
cmp    $0xffffffff,%eax
je     116a <deleteQueueWithId+0x2a>
pop    %rbx
ret
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Deletando fila de mensagem com o id: %d\0A\00"
@IPC_RMID = global i32 0
@stderr = global i32 0
@.str.1 = [38 x i8] c"Impossivel remover a fila com id: %d\0A\00"
define void @deleteQueueWithId(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* @IPC_RMID
%7 = call i32 @msgctl(i32 %5, i32 %6, i32* null)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i32, i32* %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Deletando fila de mensagem com o id: %d\0A\00"
@IPC_RMID = global i32 0
@stderr = global i32 0
@.str.1 = [38 x i8] c"Impossivel remover a fila com id: %d\0A\00"
define void @deleteQueueWithId(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @IPC_RMID
%4 = tail call i32 @msgctl(i32 %0, i32 %3, i32* null)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}