#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 convertCharToInt(char *);
scalar_t__ delete (char *, int);
int /*<<< orphan*/ free(char *);
char *getWordByNumber(int, int *, char **);
int /*<<< orphan*/ printf(char *, ...);
void commandDelete(char *data, char *param1, char *param2, int *wordNumber,
                   int *wordNumberArray, char **wordArray) {
  int number = convertCharToInt(data);
  char *wordFromArray;
  if (data != NULL) {
    free(data);
    data = NULL;
  }
  if (param1 == NULL && param2 == NULL) {
    if (number >= 0) {
      wordFromArray = getWordByNumber(number, wordNumberArray, wordArray);
      if (wordFromArray != NULL) {
        if (delete (wordFromArray, number)) {
          printf("deleted: %d\n", number);
        } else {
          printf("ignored\n");
        }
      } else {
        printf("ignored\n");
      }
    } else
      printf("ignored\n");
  } else
    printf("ignored\n");
}


x86 assembly (clang, -O0):
<commandDelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <convertCharToInt@plt>
mov    %eax,-0x34(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1198 <commandDelete+0x48>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    123c <commandDelete+0xec>
cmpq   $0x0,-0x18(%rbp)
jne    123c <commandDelete+0xec>
cmpl   $0x0,-0x34(%rbp)
jl     1229 <commandDelete+0xd9>
mov    -0x34(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1050 <getWordByNumber@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1216 <commandDelete+0xc6>
mov    -0x40(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1060 <delete@plt>
cmp    $0x0,%rax
je     1203 <commandDelete+0xb3>
mov    -0x34(%rbp),%esi
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1211 <commandDelete+0xc1>
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1224 <commandDelete+0xd4>
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1237 <commandDelete+0xe7>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    124a <commandDelete+0xfa>
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commandDelete>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rdx,%r13
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1080 <convertCharToInt@plt>
mov    %eax,%r12d
test   %rbx,%rbx
je     118f <commandDelete+0x2f>
mov    %rbx,%rdi
call   1030 <free@plt>
or     %r13,%rbp
jne    11db <commandDelete+0x7b>
test   %r12d,%r12d
js     11db <commandDelete+0x7b>
mov    %r12d,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1060 <getWordByNumber@plt>
test   %rax,%rax
je     11db <commandDelete+0x7b>
mov    %rax,%rdi
mov    %r12d,%esi
call   1070 <delete@plt>
test   %rax,%rax
je     11db <commandDelete+0x7b>
lea    0xe3d(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>
lea    0xe2b(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"deleted: %d\0A\00"
@.str.1 = [9 x i8] c"ignored\0A\00"
define void @commandDelete(i8* %0, i8* %1, i8* %2, i32* %3, i32* %4, i8** %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i8**
%13 = alloca i32
%14 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i8** %5, i8*** %12
%15 = load i8*, i8** %7
%16 = call i32 @convertCharToInt(i8* %15)
store i32 %16, i32* %13
%17 = load i8*, i8** %7
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %6
%20 = load i8*, i8** %7
%21 = call i32 @free(i8* %20)
store i8* null, i8** %7
br label %22
22: ; preds = %19, %6
%23 = load i8*, i8** %8
%24 = icmp eq i8* %23, null
br i1 %24, label %25, label %55
25: ; preds = %22
%26 = load i8*, i8** %9
%27 = icmp eq i8* %26, null
br i1 %27, label %28, label %55
28: ; preds = %25
%29 = load i32, i32* %13
%30 = icmp sge i32 %29, 0
br i1 %30, label %31, label %52
31: ; preds = %28
%32 = load i32, i32* %13
%33 = load i32*, i32** %11
%34 = load i8**, i8*** %12
%35 = call i8* @getWordByNumber(i32 %32, i32* %33, i8** %34)
store i8* %35, i8** %14
%36 = load i8*, i8** %14
%37 = icmp ne i8* %36, null
br i1 %37, label %38, label %49
38: ; preds = %31
%39 = load i8*, i8** %14
%40 = load i32, i32* %13
%41 = call i64 @delete(i8* %39, i32 %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %38
%44 = load i32, i32* %13
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %44)
br label %48
46: ; preds = %38
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %48
48: ; preds = %46, %43
br label %51
49: ; preds = %31
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %51
51: ; preds = %49, %48
br label %54
52: ; preds = %28
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %54
54: ; preds = %52, %51
br label %57
55: ; preds = %25, %22
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %57
57: ; preds = %55, %54
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"deleted: %d\0A\00"
@str.4 = [8 x i8] c"ignored\00"
define void @commandDelete(i8* %0, i8* readnone %1, i8* readnone %2, i32* nocapture readnone %3, i32* %4, i8** %5) {
%7 = tail call i32 @convertCharToInt(i8* %0)
%8 = icmp eq i8* %0, null
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @free(i8* %0)
br label %11
11: ; preds = %9, %6
%12 = icmp eq i8* %1, null
%13 = icmp eq i8* %2, null
%14 = and i1 %12, %13
br i1 %14, label %15, label %31
15: ; preds = %11
%16 = icmp sgt i32 %7, -1
br i1 %16, label %17, label %29
17: ; preds = %15
%18 = tail call i8* @getWordByNumber(i32 %7, i32* %4, i8** %5)
%19 = icmp eq i8* %18, null
br i1 %19, label %27, label %20
20: ; preds = %17
%21 = tail call i64 @delete(i8* %18, i32 %7)
%22 = icmp eq i64 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %33
25: ; preds = %20
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0))
br label %33
27: ; preds = %17
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0))
br label %33
29: ; preds = %15
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0))
br label %33
31: ; preds = %11
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0))
br label %33
33: ; preds = %29, %23, %25, %27, %31
ret void
}