#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*/ cleanArray(int *);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *);
void commandClear(char *data, char *param1, char *param2, int *wordNumber,
                  int *wordNumberArray) {
  if (param1 == NULL && param2 == NULL && data == NULL) {
    cleanArray(wordNumberArray);
    clear();
    (*wordNumber) = 0;
    printf("cleared\n");
  } else
    printf("ignored\n");
  if (data != NULL) {
    free(data);
    data = NULL;
  }
}


x86 assembly (clang, -O0):
<commandClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11a8 <commandClear+0x68>
cmpq   $0x0,-0x18(%rbp)
jne    11a8 <commandClear+0x68>
cmpq   $0x0,-0x8(%rbp)
jne    11a8 <commandClear+0x68>
mov    -0x28(%rbp),%rdi
call   1050 <cleanArray@plt>
mov    $0x0,%al
call   1060 <clear@plt>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
jmp    11b4 <commandClear+0x74>
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     11d0 <commandClear+0x90>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commandClear>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb2(%rip),%rdi
test   %rbx,%rbx
jne    117d <commandClear+0x3d>
test   %rsi,%rsi
jne    117d <commandClear+0x3d>
test   %rdx,%rdx
jne    117d <commandClear+0x3d>
mov    %rcx,%r14
mov    %r8,%rdi
call   1050 <cleanArray@plt>
xor    %eax,%eax
call   1060 <clear@plt>
movl   $0x0,(%r14)
lea    0xe8b(%rip),%rdi
call   1040 <puts@plt>
test   %rbx,%rbx
je     1196 <commandClear+0x56>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"cleared\0A\00"
@.str.1 = [9 x i8] c"ignored\0A\00"
define void @commandClear(i8* %0, i8* %1, i8* %2, i32* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i8*, i8** %7
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %25
13: ; preds = %5
%14 = load i8*, i8** %8
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i8*, i8** %6
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %25
19: ; preds = %16
%20 = load i32*, i32** %10
%21 = call i32 @cleanArray(i32* %20)
%22 = call i32 (...) @clear()
%23 = load i32*, i32** %9
store i32 0, i32* %23
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %27
25: ; preds = %16, %13, %5
%26 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %25, %19
%28 = load i8*, i8** %6
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load i8*, i8** %6
%32 = call i32 @free(i8* %31)
store i8* null, i8** %6
br label %33
33: ; preds = %30, %27
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"ignored\00"
@str.2 = [8 x i8] c"cleared\00"
define void @commandClear(i8* %0, i8* readnone %1, i8* readnone %2, i32* nocapture writeonly %3, i32* %4) {
%6 = icmp eq i8* %1, null
%7 = icmp eq i8* %2, null
%8 = and i1 %6, %7
%9 = icmp eq i8* %0, null
%10 = and i1 %9, %8
br i1 %10, label %11, label %14
11: ; preds = %5
%12 = tail call i32 @cleanArray(i32* %4)
%13 = tail call i32 (...) @clear()
store i32 0, i32* %3
br label %14
14: ; preds = %5, %11
%15 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0), %11 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0), %5 ]
%16 = tail call i32 @puts(i8* dereferenceable(1) %15)
br i1 %9, label %19, label %17
17: ; preds = %14
%18 = tail call i32 @free(i8* %0)
br label %19
19: ; preds = %17, %14
ret void
}