#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 */
scalar_t__ checkChar(char *, int);
int find(char *, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *);
int strlen(char *);
void commandFind(char *data, char *param1, char *param2, int *wordNumber) {
  int dataLenght = 0;
  if (param1 == NULL && param2 == NULL && data != NULL) {
    dataLenght = strlen(data);
    if (checkChar(data, dataLenght)) {
      if ((find(data, dataLenght)) == true)
        printf("YES\n");
      else
        printf("NO\n");
    } else {
      printf("ignored\n");
    }
  } else {
    printf("ignored\n");
  }
  if (data != NULL) {
    free(data);
    data = NULL;
  }
}


x86 assembly (clang, -O0):
<commandFind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11fa <commandFind+0xaa>
cmpq   $0x0,-0x18(%rbp)
jne    11fa <commandFind+0xaa>
cmpq   $0x0,-0x8(%rbp)
je     11fa <commandFind+0xaa>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1070 <checkChar@plt>
cmp    $0x0,%rax
je     11e9 <commandFind+0x99>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1060 <find@plt>
cmp    $0x1,%eax
jne    11d8 <commandFind+0x88>
lea    0xe32(%rip),%rdi
call   1050 <printf@plt>
jmp    11e4 <commandFind+0x94>
lea    0xe26(%rip),%rdi
call   1050 <printf@plt>
jmp    11f5 <commandFind+0xa5>
lea    0xe19(%rip),%rdi
call   1050 <printf@plt>
jmp    1206 <commandFind+0xb6>
lea    0xe08(%rip),%rdi
call   1050 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1222 <commandFind+0xd2>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commandFind>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xea2(%rip),%r14
test   %rdi,%rdi
je     11a5 <commandFind+0x55>
test   %rsi,%rsi
jne    11a5 <commandFind+0x55>
test   %rdx,%rdx
jne    11a5 <commandFind+0x55>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1070 <checkChar@plt>
test   %rax,%rax
je     11a5 <commandFind+0x55>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1060 <find@plt>
cmp    $0x1,%eax
lea    0xe71(%rip),%rax
lea    0xe67(%rip),%r14
cmove  %rax,%r14
mov    %r14,%rdi
call   1040 <puts@plt>
test   %rbx,%rbx
je     11be <commandFind+0x6e>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"YES\0A\00"
@.str.1 = [4 x i8] c"NO\0A\00"
@.str.2 = [9 x i8] c"ignored\0A\00"
define void @commandFind(i8* %0, i8* %1, i8* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
store i32 0, i32* %9
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %38
12: ; preds = %4
%13 = load i8*, i8** %7
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %38
15: ; preds = %12
%16 = load i8*, i8** %5
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %38
18: ; preds = %15
%19 = load i8*, i8** %5
%20 = call i32 @strlen(i8* %19)
store i32 %20, i32* %9
%21 = load i8*, i8** %5
%22 = load i32, i32* %9
%23 = call i64 @checkChar(i8* %21, i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %35
25: ; preds = %18
%26 = load i8*, i8** %5
%27 = load i32, i32* %9
%28 = call i32 @find(i8* %26, i32 %27)
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %34
32: ; preds = %25
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %32, %30
br label %37
35: ; preds = %18
%36 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %35, %34
br label %40
38: ; preds = %15, %12, %4
%39 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38, %37
%41 = load i8*, i8** %5
%42 = icmp ne i8* %41, null
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load i8*, i8** %5
%45 = call i32 @free(i8* %44)
store i8* null, i8** %5
br label %46
46: ; preds = %43, %40
ret void
}

LLVM IR (-O2):
@str.3 = [8 x i8] c"ignored\00"
@str.4 = [3 x i8] c"NO\00"
@str.5 = [4 x i8] c"YES\00"
define void @commandFind(i8* %0, i8* readnone %1, i8* readnone %2, i32* nocapture readnone %3) {
%5 = icmp eq i8* %1, null
%6 = icmp eq i8* %2, null
%7 = and i1 %5, %6
%8 = icmp ne i8* %0, null
%9 = and i1 %8, %7
br i1 %9, label %10, label %18
10: ; preds = %4
%11 = tail call i32 @strlen(i8* %0)
%12 = tail call i64 @checkChar(i8* %0, i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = tail call i32 @find(i8* %0, i32 %11)
%16 = icmp eq i32 %15, 1
%17 = select i1 %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0)
br label %18
18: ; preds = %4, %10, %14
%19 = phi i8* [ %17, %14 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0), %10 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0), %4 ]
%20 = tail call i32 @puts(i8* dereferenceable(1) %19)
br i1 %8, label %21, label %23
21: ; preds = %18
%22 = tail call i32 @free(i8* %0)
br label %23
23: ; preds = %21, %18
ret void
}