#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*/ currTime();
int efDestroy(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ getpid();
int parseId(char *);
int /*<<< orphan*/ pexit(char *);
int /*<<< orphan*/ printf(char *, long, int /*<<< orphan*/, int);
int /*<<< orphan*/ stderr;
void deleteEventFlag(char *id) {
  int semId;
  semId = parseId(id);
  if (semId == -1) {
    fprintf(stderr, "Invalid event flag identifier: %s\n", id);
    return;
  }
  if (efDestroy(semId) == -1)
    pexit("efDestroy");
  printf("[%ld][%s] %d: destroyed\n", (long)getpid(), currTime(), semId);
}


x86 assembly (clang, -O0):
<deleteEventFlag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <parseId@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    11b0 <deleteEventFlag+0x40>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe5a(%rip),%rsi
call   1080 <fprintf@plt>
jmp    11f4 <deleteEventFlag+0x84>
mov    -0xc(%rbp),%edi
call   1070 <efDestroy@plt>
cmp    $0xffffffff,%eax
jne    11cd <deleteEventFlag+0x5d>
lea    0xe5b(%rip),%rdi
call   1090 <pexit@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <currTime@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    -0xc(%rbp),%ecx
lea    0xe3e(%rip),%rdi
call   1060 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteEventFlag>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <parseId@plt>
cmp    $0xffffffff,%eax
je     11c4 <deleteEventFlag+0x54>
mov    %eax,%ebp
mov    %eax,%edi
call   1070 <efDestroy@plt>
cmp    $0xffffffff,%eax
jne    119a <deleteEventFlag+0x2a>
lea    0xe8e(%rip),%rdi
call   1090 <pexit@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <currTime@plt>
lea    0xe7b(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <printf@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
lea    0xe2c(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1080 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Invalid event flag identifier: %s\0A\00"
@.str.1 = [10 x i8] c"efDestroy\00"
@.str.2 = [25 x i8] c"[%ld][%s] %d: destroyed\0A\00"
define void @deleteEventFlag(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @parseId(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %23
12: ; preds = %1
%13 = load i32, i32* %3
%14 = call i32 @efDestroy(i32 %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @pexit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %12
%19 = call i64 (...) @getpid()
%20 = call i32 (...) @currTime()
%21 = load i32, i32* %3
%22 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i64 %19, i32 %20, i32 %21)
br label %23
23: ; preds = %18, %8
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Invalid event flag identifier: %s\0A\00"
@.str.1 = [10 x i8] c"efDestroy\00"
@.str.2 = [25 x i8] c"[%ld][%s] %d: destroyed\0A\00"
define void @deleteEventFlag(i8* %0) {
%2 = tail call i32 @parseId(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %16
7: ; preds = %1
%8 = tail call i32 @efDestroy(i32 %2)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @pexit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = tail call i64 (...) @getpid()
%14 = tail call i32 (...) @currTime()
%15 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i64 %13, i32 %14, i32 %2)
br label %16
16: ; preds = %12, %4
ret void
}