#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int check_pattern(char *);
int /*<<< orphan*/ delete_data(char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  char *command, *file, *option, *pattern;
  FILE *fileptr1;
  char str[200];
  int argno = argc;
  if (argno < 3) {
    printf("\nArguement Error..Please Check\n");
    exit(0);
  }
  switch (argno) {
  case 3: {
    pattern = argv[argno - 2];
    file = argv[argno - 1];
    int ptcheck = check_pattern(pattern);
    if (ptcheck == 1) {
      delete_data(pattern, file);
    }
    break;
  }
  default: {
    break;
  }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x104(%rbp)
cmpl   $0x3,-0x104(%rbp)
jge    1182 <main+0x42>
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x104(%rbp),%eax
sub    $0x3,%eax
jne    11f4 <main+0xb4>
jmp    1196 <main+0x56>
mov    -0x10(%rbp),%rax
mov    -0x104(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x104(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <check_pattern@plt>
mov    %eax,-0x108(%rbp)
cmpl   $0x1,-0x108(%rbp)
jne    11ef <main+0xaf>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <delete_data@plt>
jmp    11f9 <main+0xb9>
jmp    11f9 <main+0xb9>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jle    1178 <main+0x38>
cmp    $0x3,%edi
jne    116e <main+0x2e>
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%r14
mov    %rbx,%rdi
call   1040 <check_pattern@plt>
cmp    $0x1,%eax
jne    116e <main+0x2e>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <delete_data@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0AArguement Error..Please Check\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca [200 x i8]
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
store i32 %14, i32* %12
%15 = load i32, i32* %12
%16 = icmp slt i32 %15, 3
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %2
%21 = load i32, i32* %12
switch i32 %21, label %44 [
i32 3, label %22
]
22: ; preds = %20
%23 = load i8**, i8*** %5
%24 = load i32, i32* %12
%25 = sub nsw i32 %24, 2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %23, i64 %26
%28 = load i8*, i8** %27
store i8* %28, i8** %9
%29 = load i8**, i8*** %5
%30 = load i32, i32* %12
%31 = sub nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %29, i64 %32
%34 = load i8*, i8** %33
store i8* %34, i8** %7
%35 = load i8*, i8** %9
%36 = call i32 @check_pattern(i8* %35)
store i32 %36, i32* %13
%37 = load i32, i32* %13
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %43
39: ; preds = %22
%40 = load i8*, i8** %9
%41 = load i8*, i8** %7
%42 = call i32 @delete_data(i8* %40, i8* %41)
br label %43
43: ; preds = %39, %22
br label %45
44: ; preds = %20
br label %45
45: ; preds = %44, %43
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"\0AArguement Error..Please Check\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = icmp eq i32 %0, 3
br i1 %8, label %9, label %18
9: ; preds = %7
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @check_pattern(i8* %11)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = tail call i32 @delete_data(i8* %11, i8* %13)
br label %18
18: ; preds = %9, %16, %7
ret i32 0
}