#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 /*<<< orphan*/ Counting_Numbar_of_Mathing_String(char *, char *,
                                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ Default_Option(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ Grep_dir(char *, char *, char *, char *);
int /*<<< orphan*/ Ignore_case(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ Line_Printing_After_Matching(char *, char *,
                                                int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ Printing_Output_with_Line_Numbar(char *, char *,
                                                    int /*<<< orphan*/ *);
int errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ help();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  char str1[180], search1[10], *home = ".";
  int count1 = 0, count2 = 0, i, j, flag, count = 0, z = 0, y = 0, x,
      File_numbar = 2;
  int option = 6;
  FILE *fp1 = NULL;
  if (argc == 1) {
    usage();
    return 0;
  } else if ((argc == 2) && (strcmp(argv[1], "-h") == 0)) {
    help();
    return 0;
  } else if (argc == 2) {
    printf("mygrep:Enter the file name.\n");
    usage();
    return 0;
  } else if ((argc == 3) && (strncmp(argv[2], "-", 1) != 0))
    option = 100;
  else if ((argc >= 3) && (strncmp(argv[2], "-", 1) != 0))
    option = 6;
  else if (strcmp(argv[2], "-r") == 0)
    option = 7;
  else if (strcmp(argv[2], "-i") == 0)
    option = 5;
  else if (strcmp(argv[2], "-c") == 0)
    option = 1;
  else if (strcmp(argv[2], "-A") == 0)
    option = 3;
  else if (strcmp(argv[2], "-L") == 0)
    option = 2;
  else {
    usage();
    return -1;
  }
  strcpy(search1, argv[1]);
  switch (option) {
  default: {
    if (!(fp1 = fopen(argv[2], "r"))) {
      printf("mygrep : %s", argv[2]);
      perror(" ");
      return errno;
    }
    Default_Option(str1, search1, fp1);
    fclose(fp1);
  } break;
  case 1: {
    File_numbar = 3;
    while (argv[File_numbar] != NULL) {
      if (!(fp1 = fopen(argv[File_numbar], "r"))) {
        printf("Can't open file %s.\n", argv[File_numbar]);
      } else {
        Counting_Numbar_of_Mathing_String(str1, search1, fp1);
        fclose(fp1);
      }
      File_numbar++;
    }
  } break;
  case 2: {
    File_numbar = 3;
    while (argv[File_numbar] != NULL) {
      if (!(fp1 = fopen(argv[File_numbar], "r"))) {
        printf("Can't open file %s.\n", argv[File_numbar]);
      } else {
        Printing_Output_with_Line_Numbar(str1, search1, fp1);
        fclose(fp1);
      }
      File_numbar++;
    }
  } break;
  case 3: {
    File_numbar = 4;
    while (argv[File_numbar] != NULL) {
      if (!(fp1 = fopen(argv[File_numbar], "r"))) {
        printf("Can't open file %s.\n", argv[File_numbar]);
      } else {
        Line_Printing_After_Matching(str1, search1, fp1, argv[3]);
        fclose(fp1);
      }
      File_numbar++;
    }
  } break;
  case 5: {
    File_numbar = 3;
    while (argv[File_numbar] != NULL) {
      if (!(fp1 = fopen(argv[File_numbar], "r"))) {
        printf("Can't open file %s.\n", argv[File_numbar]);
      } else {
        Ignore_case(str1, search1, fp1);
        fclose(fp1);
      }
      File_numbar++;
    }
  } break;
  case 6: {
    while (argv[File_numbar] != NULL) {
      if (!(fp1 = fopen(argv[File_numbar], "r"))) {
        printf("Can't open file %s.\n", argv[File_numbar]);
      } else {
        Default_Option(str1, search1, fp1);
        fclose(fp1);
      }
      File_numbar++;
    }
  } break;
  case 7:
    Grep_dir(str1, search1, home, argv[3]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe0c(%rip),%rax
mov    %rax,-0xe8(%rbp)
movl   $0x0,-0xec(%rbp)
movl   $0x0,-0xf0(%rbp)
movl   $0x0,-0x100(%rbp)
movl   $0x0,-0x104(%rbp)
movl   $0x0,-0x108(%rbp)
movl   $0x2,-0x110(%rbp)
movl   $0x6,-0x114(%rbp)
movq   $0x0,-0x120(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1285 <main+0x95>
mov    $0x0,%al
call   10c0 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    18da <main+0x6ea>
cmpl   $0x2,-0x8(%rbp)
jne    12c0 <main+0xd0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd80(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    12c0 <main+0xd0>
mov    $0x0,%al
call   1100 <help@plt>
movl   $0x0,-0x4(%rbp)
jmp    18da <main+0x6ea>
cmpl   $0x2,-0x8(%rbp)
jne    12eb <main+0xfb>
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   10c0 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    18da <main+0x6ea>
cmpl   $0x3,-0x8(%rbp)
jne    1327 <main+0x137>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd3a(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1327 <main+0x137>
movl   $0x64,-0x114(%rbp)
jmp    1475 <main+0x285>
cmpl   $0x3,-0x8(%rbp)
jl     1363 <main+0x173>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xcfe(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1363 <main+0x173>
movl   $0x6,-0x114(%rbp)
jmp    1470 <main+0x280>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xcce(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1390 <main+0x1a0>
movl   $0x7,-0x114(%rbp)
jmp    146b <main+0x27b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xca4(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    13bd <main+0x1cd>
movl   $0x5,-0x114(%rbp)
jmp    1466 <main+0x276>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc7a(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    13ea <main+0x1fa>
movl   $0x1,-0x114(%rbp)
jmp    1461 <main+0x271>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc50(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1417 <main+0x227>
movl   $0x3,-0x114(%rbp)
jmp    145c <main+0x26c>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc26(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1444 <main+0x254>
movl   $0x2,-0x114(%rbp)
jmp    1457 <main+0x267>
mov    $0x0,%al
call   10c0 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18da <main+0x6ea>
jmp    145c <main+0x26c>
jmp    1461 <main+0x271>
jmp    1466 <main+0x276>
jmp    146b <main+0x27b>
jmp    1470 <main+0x280>
jmp    1475 <main+0x285>
jmp    147a <main+0x28a>
jmp    147f <main+0x28f>
jmp    1484 <main+0x294>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0xda(%rbp),%rdi
call   1040 <strcpy@plt>
mov    -0x114(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x128(%rbp)
sub    $0x6,%eax
ja     14ca <main+0x2da>
mov    -0x128(%rbp),%rax
lea    0xb3f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xb68(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x120(%rbp)
cmp    $0x0,%rax
jne    1522 <main+0x332>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xb51(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xb4f(%rip),%rdi
call   10f0 <perror@plt>
mov    0x2ac8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    18da <main+0x6ea>
lea    -0xd0(%rbp),%rdi
lea    -0xda(%rbp),%rsi
mov    -0x120(%rbp),%rdx
call   10d0 <Default_Option@plt>
mov    -0x120(%rbp),%rdi
call   1070 <fclose@plt>
jmp    18d3 <main+0x6e3>
movl   $0x3,-0x110(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     15f5 <main+0x405>
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xabe(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x120(%rbp)
cmp    $0x0,%rax
jne    15bb <main+0x3cb>
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xaae(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    15e1 <main+0x3f1>
lea    -0xd0(%rbp),%rdi
lea    -0xda(%rbp),%rsi
mov    -0x120(%rbp),%rdx
call   1110 <Counting_Numbar_of_Mathing_String@plt>
mov    -0x120(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x110(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110(%rbp)
jmp    1557 <main+0x367>
jmp    18d3 <main+0x6e3>
movl   $0x3,-0x110(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     16a2 <main+0x4b2>
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xa11(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x120(%rbp)
cmp    $0x0,%rax
jne    1668 <main+0x478>
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xa01(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    168e <main+0x49e>
lea    -0xd0(%rbp),%rdi
lea    -0xda(%rbp),%rsi
mov    -0x120(%rbp),%rdx
call   10b0 <Printing_Output_with_Line_Numbar@plt>
mov    -0x120(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x110(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110(%rbp)
jmp    1604 <main+0x414>
jmp    18d3 <main+0x6e3>
movl   $0x4,-0x110(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1757 <main+0x567>
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0x964(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x120(%rbp)
cmp    $0x0,%rax
jne    1715 <main+0x525>
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0x954(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1743 <main+0x553>
lea    -0xd0(%rbp),%rdi
lea    -0xda(%rbp),%rsi
mov    -0x120(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
call   1090 <Line_Printing_After_Matching@plt>
mov    -0x120(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x110(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110(%rbp)
jmp    16b1 <main+0x4c1>
jmp    18d3 <main+0x6e3>
movl   $0x3,-0x110(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1804 <main+0x614>
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0x8af(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x120(%rbp)
cmp    $0x0,%rax
jne    17ca <main+0x5da>
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0x89f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    17f0 <main+0x600>
lea    -0xd0(%rbp),%rdi
lea    -0xda(%rbp),%rsi
mov    -0x120(%rbp),%rdx
call   1060 <Ignore_case@plt>
mov    -0x120(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x110(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110(%rbp)
jmp    1766 <main+0x576>
jmp    18d3 <main+0x6e3>
jmp    180e <main+0x61e>
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     18ac <main+0x6bc>
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0x807(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x120(%rbp)
cmp    $0x0,%rax
jne    1872 <main+0x682>
mov    -0x10(%rbp),%rax
movslq -0x110(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0x7f7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1898 <main+0x6a8>
lea    -0xd0(%rbp),%rdi
lea    -0xda(%rbp),%rsi
mov    -0x120(%rbp),%rdx
call   10d0 <Default_Option@plt>
mov    -0x120(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x110(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110(%rbp)
jmp    180e <main+0x61e>
jmp    18d3 <main+0x6e3>
lea    -0xd0(%rbp),%rdi
lea    -0xda(%rbp),%rsi
mov    -0xe8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
call   1050 <Grep_dir@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
je     1235 <main+0x35>
cmp    $0x2,%edi
je     1298 <main+0x98>
cmp    $0x1,%edi
je     12bd <main+0xbd>
cmp    $0x3,%edi
jge    12cb <main+0xcb>
jmp    1376 <main+0x176>
mov    0x10(%rbx),%rdi
lea    0xdc3(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12cb <main+0xcb>
mov    0x8(%rbx),%rsi
lea    0x6(%rsp),%rdi
call   1040 <strcpy@plt>
mov    0x10(%rbx),%rdi
lea    0xd9e(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     1651 <main+0x451>
mov    %rax,%rbp
lea    0x10(%rsp),%rdi
lea    0x6(%rsp),%rsi
mov    %rax,%rdx
call   10e0 <Default_Option@plt>
mov    %rbp,%rdi
call   1080 <fclose@plt>
jmp    1431 <main+0x231>
mov    0x8(%rbx),%rdi
lea    0xd5d(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     13fd <main+0x1fd>
lea    0xd7f(%rip),%rdi
call   1050 <puts@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   10d0 <usage@plt>
jmp    1433 <main+0x233>
mov    0x10(%rbx),%rdi
lea    0xd2d(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1376 <main+0x176>
mov    0x8(%rbx),%rsi
lea    0x6(%rsp),%rdi
call   1040 <strcpy@plt>
mov    0x10(%rbx),%rdi
test   %rdi,%rdi
je     1431 <main+0x231>
add    $0x18,%rbx
lea    0xcf7(%rip),%r13
lea    0xd0c(%rip),%r14
lea    0x10(%rsp),%r15
lea    0x6(%rsp),%r12
jmp    1359 <main+0x159>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rax,%rbp
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rax,%rdx
call   10e0 <Default_Option@plt>
mov    %rbp,%rdi
call   1080 <fclose@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
je     1431 <main+0x231>
mov    %r13,%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
jne    1330 <main+0x130>
mov    -0x8(%rbx),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1349 <main+0x149>
mov    0x10(%rbx),%rdi
lea    0xc84(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1408 <main+0x208>
mov    0x10(%rbx),%rdi
lea    0xc72(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1447 <main+0x247>
mov    0x10(%rbx),%rdi
lea    0xc5c(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     14c4 <main+0x2c4>
mov    0x10(%rbx),%rdi
lea    0xc46(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1548 <main+0x348>
mov    0x10(%rbx),%rdi
lea    0xc30(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     15d0 <main+0x3d0>
xor    %eax,%eax
call   10d0 <usage@plt>
mov    $0xffffffff,%ebp
jmp    1433 <main+0x233>
xor    %ebp,%ebp
xor    %eax,%eax
call   1110 <help@plt>
jmp    1433 <main+0x233>
mov    0x8(%rbx),%rsi
lea    0x6(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <strcpy@plt>
mov    0x18(%rbx),%rcx
lea    0xc2d(%rip),%rdx
lea    0x10(%rsp),%rdi
mov    %rbp,%rsi
call   1060 <Grep_dir@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%rbx),%rsi
lea    0x6(%rsp),%rdi
call   1040 <strcpy@plt>
mov    0x18(%rbx),%rdi
test   %rdi,%rdi
je     1431 <main+0x231>
add    $0x20,%rbx
lea    0xb9d(%rip),%r14
lea    0xbb2(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x6(%rsp),%r13
jmp    14a7 <main+0x2a7>
nopl   0x0(%rax)
mov    %rax,%rbp
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rax,%rdx
call   1070 <Ignore_case@plt>
mov    %rbp,%rdi
call   1080 <fclose@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
xor    %ebp,%ebp
test   %rdi,%rdi
je     1433 <main+0x233>
mov    %r14,%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
jne    1480 <main+0x280>
mov    -0x8(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1499 <main+0x299>
mov    0x8(%rbx),%rsi
lea    0x6(%rsp),%rdi
call   1040 <strcpy@plt>
mov    0x18(%rbx),%rdi
test   %rdi,%rdi
je     1431 <main+0x231>
add    $0x20,%rbx
lea    0xb1c(%rip),%r14
lea    0xb31(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x6(%rsp),%r13
jmp    152b <main+0x32b>
nopl   (%rax)
mov    %rax,%rbp
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rax,%rdx
call   1120 <Counting_Numbar_of_Mathing_String@plt>
mov    %rbp,%rdi
call   1080 <fclose@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
xor    %ebp,%ebp
test   %rdi,%rdi
je     1433 <main+0x233>
mov    %r14,%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
jne    1500 <main+0x300>
mov    -0x8(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1519 <main+0x319>
mov    0x8(%rbx),%rsi
lea    0x6(%rsp),%rdi
call   1040 <strcpy@plt>
mov    0x20(%rbx),%rdi
test   %rdi,%rdi
je     1431 <main+0x231>
lea    0x28(%rbx),%r15
lea    0xa98(%rip),%r14
lea    0x10(%rsp),%r12
lea    0x6(%rsp),%r13
jmp    15af <main+0x3af>
nopw   0x0(%rax,%rax,1)
mov    %rax,%rbp
mov    0x18(%rbx),%rcx
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rax,%rdx
call   10a0 <Line_Printing_After_Matching@plt>
mov    %rbp,%rdi
call   1080 <fclose@plt>
mov    (%r15),%rdi
add    $0x8,%r15
xor    %ebp,%ebp
test   %rdi,%rdi
je     1433 <main+0x233>
mov    %r14,%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
jne    1580 <main+0x380>
mov    -0x8(%r15),%rsi
lea    0xa5b(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    159d <main+0x39d>
mov    0x8(%rbx),%rsi
lea    0x6(%rsp),%rdi
call   1040 <strcpy@plt>
mov    0x18(%rbx),%rdi
test   %rdi,%rdi
je     1431 <main+0x231>
add    $0x20,%rbx
lea    0xa10(%rip),%r14
lea    0xa25(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x6(%rsp),%r13
jmp    1634 <main+0x434>
mov    %rax,%rbp
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rax,%rdx
call   10c0 <Printing_Output_with_Line_Numbar@plt>
mov    %rbp,%rdi
call   1080 <fclose@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
xor    %ebp,%ebp
test   %rdi,%rdi
je     1433 <main+0x233>
mov    %r14,%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
jne    1609 <main+0x409>
mov    -0x8(%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1622 <main+0x422>
mov    0x10(%rbx),%rsi
lea    0x9b8(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x9b6(%rip),%rdi
call   1100 <perror@plt>
mov    0x296a(%rip),%rax
mov    (%rax),%ebp
jmp    1433 <main+0x233>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [29 x i8] c"mygrep:Enter the file name.\0A\00"
@.str.3 = [2 x i8] c"-\00"
@.str.4 = [3 x i8] c"-r\00"
@.str.5 = [3 x i8] c"-i\00"
@.str.6 = [3 x i8] c"-c\00"
@.str.7 = [3 x i8] c"-A\00"
@.str.8 = [3 x i8] c"-L\00"
@.str.9 = [2 x i8] c"r\00"
@.str.10 = [12 x i8] c"mygrep : %s\00"
@.str.11 = [2 x i8] c" \00"
@errno = global i32 0
@.str.12 = [21 x i8] c"Can't open file %s.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [180 x i8]
%7 = alloca [10 x i8]
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 2, i32* %18
store i32 6, i32* %19
store i32* null, i32** %20
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %25
23: ; preds = %2
%24 = call i32 (...) @usage()
store i32 0, i32* %3
br label %317
25: ; preds = %2
%26 = load i32, i32* %4
%27 = icmp eq i32 %26, 2
br i1 %27, label %28, label %36
28: ; preds = %25
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %28
%35 = call i32 (...) @help()
store i32 0, i32* %3
br label %317
36: ; preds = %28, %25
%37 = load i32, i32* %4
%38 = icmp eq i32 %37, 2
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%41 = call i32 (...) @usage()
store i32 0, i32* %3
br label %317
42: ; preds = %36
%43 = load i32, i32* %4
%44 = icmp eq i32 %43, 3
br i1 %44, label %45, label %52
45: ; preds = %42
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 2
%48 = load i8*, i8** %47
%49 = call i64 @strncmp(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %45
store i32 100, i32* %19
br label %105
52: ; preds = %45, %42
%53 = load i32, i32* %4
%54 = icmp sge i32 %53, 3
br i1 %54, label %55, label %62
55: ; preds = %52
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 2
%58 = load i8*, i8** %57
%59 = call i64 @strncmp(i8* %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%60 = icmp ne i64 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %55
store i32 6, i32* %19
br label %104
62: ; preds = %55, %52
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 2
%65 = load i8*, i8** %64
%66 = call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %69
68: ; preds = %62
store i32 7, i32* %19
br label %103
69: ; preds = %62
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 2
%72 = load i8*, i8** %71
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %76
75: ; preds = %69
store i32 5, i32* %19
br label %102
76: ; preds = %69
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i64 2
%79 = load i8*, i8** %78
%80 = call i64 @strcmp(i8* %79, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %83
82: ; preds = %76
store i32 1, i32* %19
br label %101
83: ; preds = %76
%84 = load i8**, i8*** %5
%85 = getelementptr inbounds i8*, i8** %84, i64 2
%86 = load i8*, i8** %85
%87 = call i64 @strcmp(i8* %86, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %90
89: ; preds = %83
store i32 3, i32* %19
br label %100
90: ; preds = %83
%91 = load i8**, i8*** %5
%92 = getelementptr inbounds i8*, i8** %91, i64 2
%93 = load i8*, i8** %92
%94 = call i64 @strcmp(i8* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
br i1 %95, label %96, label %97
96: ; preds = %90
store i32 2, i32* %19
br label %99
97: ; preds = %90
%98 = call i32 (...) @usage()
store i32 -1, i32* %3
br label %317
99: ; preds = %96
br label %100
100: ; preds = %99, %89
br label %101
101: ; preds = %100, %82
br label %102
102: ; preds = %101, %75
br label %103
103: ; preds = %102, %68
br label %104
104: ; preds = %103, %61
br label %105
105: ; preds = %104, %51
br label %106
106: ; preds = %105
br label %107
107: ; preds = %106
br label %108
108: ; preds = %107
%109 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%110 = load i8**, i8*** %5
%111 = getelementptr inbounds i8*, i8** %110, i64 1
%112 = load i8*, i8** %111
%113 = call i32 @strcpy(i8* %109, i8* %112)
%114 = load i32, i32* %19
switch i32 %114, label %115 [
i32 1, label %135
i32 2, label %169
i32 3, label %203
i32 5, label %240
i32 6, label %274
i32 7, label %308
]
115: ; preds = %108
%116 = load i8**, i8*** %5
%117 = getelementptr inbounds i8*, i8** %116, i64 2
%118 = load i8*, i8** %117
%119 = call i32* @fopen(i8* %118, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %119, i32** %20
%120 = icmp ne i32* %119, null
br i1 %120, label %128, label %121
121: ; preds = %115
%122 = load i8**, i8*** %5
%123 = getelementptr inbounds i8*, i8** %122, i64 2
%124 = load i8*, i8** %123
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %124)
%126 = call i32 @perror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%127 = load i32, i32* @errno
store i32 %127, i32* %3
br label %317
128: ; preds = %115
%129 = getelementptr inbounds [180 x i8], [180 x i8]* %6, i64 0, i64 0
%130 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%131 = load i32*, i32** %20
%132 = call i32 @Default_Option(i8* %129, i8* %130, i32* %131)
%133 = load i32*, i32** %20
%134 = call i32 @fclose(i32* %133)
br label %316
135: ; preds = %108
store i32 3, i32* %18
br label %136
136: ; preds = %165, %135
%137 = load i8**, i8*** %5
%138 = load i32, i32* %18
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8*, i8** %137, i64 %139
%141 = load i8*, i8** %140
%142 = icmp ne i8* %141, null
br i1 %142, label %143, label %168
143: ; preds = %136
%144 = load i8**, i8*** %5
%145 = load i32, i32* %18
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i8*, i8** %144, i64 %146
%148 = load i8*, i8** %147
%149 = call i32* @fopen(i8* %148, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %149, i32** %20
%150 = icmp ne i32* %149, null
br i1 %150, label %158, label %151
151: ; preds = %143
%152 = load i8**, i8*** %5
%153 = load i32, i32* %18
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i8*, i8** %152, i64 %154
%156 = load i8*, i8** %155
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %156)
br label %165
158: ; preds = %143
%159 = getelementptr inbounds [180 x i8], [180 x i8]* %6, i64 0, i64 0
%160 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%161 = load i32*, i32** %20
%162 = call i32 @Counting_Numbar_of_Mathing_String(i8* %159, i8* %160, i32* %161)
%163 = load i32*, i32** %20
%164 = call i32 @fclose(i32* %163)
br label %165
165: ; preds = %158, %151
%166 = load i32, i32* %18
%167 = add nsw i32 %166, 1
store i32 %167, i32* %18
br label %136
168: ; preds = %136
br label %316
169: ; preds = %108
store i32 3, i32* %18
br label %170
170: ; preds = %199, %169
%171 = load i8**, i8*** %5
%172 = load i32, i32* %18
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i8*, i8** %171, i64 %173
%175 = load i8*, i8** %174
%176 = icmp ne i8* %175, null
br i1 %176, label %177, label %202
177: ; preds = %170
%178 = load i8**, i8*** %5
%179 = load i32, i32* %18
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds i8*, i8** %178, i64 %180
%182 = load i8*, i8** %181
%183 = call i32* @fopen(i8* %182, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %183, i32** %20
%184 = icmp ne i32* %183, null
br i1 %184, label %192, label %185
185: ; preds = %177
%186 = load i8**, i8*** %5
%187 = load i32, i32* %18
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds i8*, i8** %186, i64 %188
%190 = load i8*, i8** %189
%191 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %190)
br label %199
192: ; preds = %177
%193 = getelementptr inbounds [180 x i8], [180 x i8]* %6, i64 0, i64 0
%194 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%195 = load i32*, i32** %20
%196 = call i32 @Printing_Output_with_Line_Numbar(i8* %193, i8* %194, i32* %195)
%197 = load i32*, i32** %20
%198 = call i32 @fclose(i32* %197)
br label %199
199: ; preds = %192, %185
%200 = load i32, i32* %18
%201 = add nsw i32 %200, 1
store i32 %201, i32* %18
br label %170
202: ; preds = %170
br label %316
203: ; preds = %108
store i32 4, i32* %18
br label %204
204: ; preds = %236, %203
%205 = load i8**, i8*** %5
%206 = load i32, i32* %18
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds i8*, i8** %205, i64 %207
%209 = load i8*, i8** %208
%210 = icmp ne i8* %209, null
br i1 %210, label %211, label %239
211: ; preds = %204
%212 = load i8**, i8*** %5
%213 = load i32, i32* %18
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds i8*, i8** %212, i64 %214
%216 = load i8*, i8** %215
%217 = call i32* @fopen(i8* %216, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %217, i32** %20
%218 = icmp ne i32* %217, null
br i1 %218, label %226, label %219
219: ; preds = %211
%220 = load i8**, i8*** %5
%221 = load i32, i32* %18
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds i8*, i8** %220, i64 %222
%224 = load i8*, i8** %223
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %224)
br label %236
226: ; preds = %211
%227 = getelementptr inbounds [180 x i8], [180 x i8]* %6, i64 0, i64 0
%228 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%229 = load i32*, i32** %20
%230 = load i8**, i8*** %5
%231 = getelementptr inbounds i8*, i8** %230, i64 3
%232 = load i8*, i8** %231
%233 = call i32 @Line_Printing_After_Matching(i8* %227, i8* %228, i32* %229, i8* %232)
%234 = load i32*, i32** %20
%235 = call i32 @fclose(i32* %234)
br label %236
236: ; preds = %226, %219
%237 = load i32, i32* %18
%238 = add nsw i32 %237, 1
store i32 %238, i32* %18
br label %204
239: ; preds = %204
br label %316
240: ; preds = %108
store i32 3, i32* %18
br label %241
241: ; preds = %270, %240
%242 = load i8**, i8*** %5
%243 = load i32, i32* %18
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds i8*, i8** %242, i64 %244
%246 = load i8*, i8** %245
%247 = icmp ne i8* %246, null
br i1 %247, label %248, label %273
248: ; preds = %241
%249 = load i8**, i8*** %5
%250 = load i32, i32* %18
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds i8*, i8** %249, i64 %251
%253 = load i8*, i8** %252
%254 = call i32* @fopen(i8* %253, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %254, i32** %20
%255 = icmp ne i32* %254, null
br i1 %255, label %263, label %256
256: ; preds = %248
%257 = load i8**, i8*** %5
%258 = load i32, i32* %18
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds i8*, i8** %257, i64 %259
%261 = load i8*, i8** %260
%262 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %261)
br label %270
263: ; preds = %248
%264 = getelementptr inbounds [180 x i8], [180 x i8]* %6, i64 0, i64 0
%265 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%266 = load i32*, i32** %20
%267 = call i32 @Ignore_case(i8* %264, i8* %265, i32* %266)
%268 = load i32*, i32** %20
%269 = call i32 @fclose(i32* %268)
br label %270
270: ; preds = %263, %256
%271 = load i32, i32* %18
%272 = add nsw i32 %271, 1
store i32 %272, i32* %18
br label %241
273: ; preds = %241
br label %316
274: ; preds = %108
br label %275
275: ; preds = %304, %274
%276 = load i8**, i8*** %5
%277 = load i32, i32* %18
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds i8*, i8** %276, i64 %278
%280 = load i8*, i8** %279
%281 = icmp ne i8* %280, null
br i1 %281, label %282, label %307
282: ; preds = %275
%283 = load i8**, i8*** %5
%284 = load i32, i32* %18
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds i8*, i8** %283, i64 %285
%287 = load i8*, i8** %286
%288 = call i32* @fopen(i8* %287, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %288, i32** %20
%289 = icmp ne i32* %288, null
br i1 %289, label %297, label %290
290: ; preds = %282
%291 = load i8**, i8*** %5
%292 = load i32, i32* %18
%293 = sext i32 %292 to i64
%294 = getelementptr inbounds i8*, i8** %291, i64 %293
%295 = load i8*, i8** %294
%296 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %295)
br label %304
297: ; preds = %282
%298 = getelementptr inbounds [180 x i8], [180 x i8]* %6, i64 0, i64 0
%299 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%300 = load i32*, i32** %20
%301 = call i32 @Default_Option(i8* %298, i8* %299, i32* %300)
%302 = load i32*, i32** %20
%303 = call i32 @fclose(i32* %302)
br label %304
304: ; preds = %297, %290
%305 = load i32, i32* %18
%306 = add nsw i32 %305, 1
store i32 %306, i32* %18
br label %275
307: ; preds = %275
br label %316
308: ; preds = %108
%309 = getelementptr inbounds [180 x i8], [180 x i8]* %6, i64 0, i64 0
%310 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%311 = load i8*, i8** %8
%312 = load i8**, i8*** %5
%313 = getelementptr inbounds i8*, i8** %312, i64 3
%314 = load i8*, i8** %313
%315 = call i32 @Grep_dir(i8* %309, i8* %310, i8* %311, i8* %314)
br label %316
316: ; preds = %308, %307, %273, %239, %202, %168, %128
store i32 0, i32* %3
br label %317
317: ; preds = %316, %121, %97, %39, %34, %23
%318 = load i32, i32* %3
ret i32 %318
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.3 = [2 x i8] c"-\00"
@.str.4 = [3 x i8] c"-r\00"
@.str.5 = [3 x i8] c"-i\00"
@.str.6 = [3 x i8] c"-c\00"
@.str.7 = [3 x i8] c"-A\00"
@.str.8 = [3 x i8] c"-L\00"
@.str.9 = [2 x i8] c"r\00"
@.str.10 = [12 x i8] c"mygrep : %s\00"
@.str.11 = [2 x i8] c" \00"
@errno = global i32 0
@.str.12 = [21 x i8] c"Can't open file %s.\0A\00"
@str = [28 x i8] c"mygrep:Enter the file name.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [180 x i8]
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [180 x i8], [180 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
switch i32 %0, label %24 [
i32 1, label %7
i32 2, label %9
i32 3, label %19
]
7: ; preds = %2
%8 = tail call i32 (...) @usage()
br label %200
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 (...) @help()
br label %200
16: ; preds = %9
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%18 = tail call i32 (...) @usage()
br label %200
19: ; preds = %2
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = tail call i64 @strncmp(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%23 = icmp eq i64 %22, 0
br i1 %23, label %26, label %98
24: ; preds = %2
%25 = icmp sgt i32 %0, 2
br i1 %25, label %26, label %31
26: ; preds = %19, %24
%27 = getelementptr inbounds i8*, i8** %1, i64 2
%28 = load i8*, i8** %27
%29 = tail call i64 @strncmp(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %61
31: ; preds = %26, %24
%32 = getelementptr inbounds i8*, i8** %1, i64 2
%33 = load i8*, i8** %32
%34 = tail call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %43
36: ; preds = %31
%37 = getelementptr inbounds i8*, i8** %1, i64 1
%38 = load i8*, i8** %37
%39 = call i32 @strcpy(i8* %6, i8* %38)
%40 = getelementptr inbounds i8*, i8** %1, i64 3
%41 = load i8*, i8** %40
%42 = call i32 @Grep_dir(i8* %5, i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %41)
br label %200
43: ; preds = %31
%44 = load i8*, i8** %32
%45 = tail call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %68, label %47
47: ; preds = %43
%48 = load i8*, i8** %32
%49 = tail call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %91, label %51
51: ; preds = %47
%52 = load i8*, i8** %32
%53 = tail call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %75, label %55
55: ; preds = %51
%56 = load i8*, i8** %32
%57 = tail call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %84, label %59
59: ; preds = %55
%60 = tail call i32 (...) @usage()
br label %200
61: ; preds = %26
%62 = getelementptr inbounds i8*, i8** %1, i64 1
%63 = load i8*, i8** %62
%64 = call i32 @strcpy(i8* %6, i8* %63)
%65 = getelementptr inbounds i8*, i8** %1, i64 2
%66 = load i8*, i8** %65
%67 = icmp eq i8* %66, null
br i1 %67, label %200, label %183
68: ; preds = %43
%69 = getelementptr inbounds i8*, i8** %1, i64 1
%70 = load i8*, i8** %69
%71 = call i32 @strcpy(i8* %6, i8* %70)
%72 = getelementptr inbounds i8*, i8** %1, i64 3
%73 = load i8*, i8** %72
%74 = icmp eq i8* %73, null
br i1 %74, label %200, label %166
75: ; preds = %51
%76 = getelementptr inbounds i8*, i8** %1, i64 1
%77 = load i8*, i8** %76
%78 = call i32 @strcpy(i8* %6, i8* %77)
%79 = getelementptr inbounds i8*, i8** %1, i64 4
%80 = load i8*, i8** %79
%81 = icmp eq i8* %80, null
br i1 %81, label %200, label %82
82: ; preds = %75
%83 = getelementptr inbounds i8*, i8** %1, i64 3
br label %148
84: ; preds = %55
%85 = getelementptr inbounds i8*, i8** %1, i64 1
%86 = load i8*, i8** %85
%87 = call i32 @strcpy(i8* %6, i8* %86)
%88 = getelementptr inbounds i8*, i8** %1, i64 3
%89 = load i8*, i8** %88
%90 = icmp eq i8* %89, null
br i1 %90, label %200, label %131
91: ; preds = %47
%92 = getelementptr inbounds i8*, i8** %1, i64 1
%93 = load i8*, i8** %92
%94 = call i32 @strcpy(i8* %6, i8* %93)
%95 = getelementptr inbounds i8*, i8** %1, i64 3
%96 = load i8*, i8** %95
%97 = icmp eq i8* %96, null
br i1 %97, label %200, label %114
98: ; preds = %19
%99 = getelementptr inbounds i8*, i8** %1, i64 1
%100 = load i8*, i8** %99
%101 = call i32 @strcpy(i8* %6, i8* %100)
%102 = getelementptr inbounds i8*, i8** %1, i64 2
%103 = load i8*, i8** %102
%104 = call i32* @fopen(i8* %103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%105 = icmp eq i32* %104, null
br i1 %105, label %106, label %111
106: ; preds = %98
%107 = load i8*, i8** %102
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %107)
%109 = call i32 @perror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%110 = load i32, i32* @errno
br label %200
111: ; preds = %98
%112 = call i32 @Default_Option(i8* %5, i8* %6, i32* %104)
%113 = call i32 @fclose(i32* %104)
br label %200
114: ; preds = %91, %126
%115 = phi i64 [ %127, %126 ], [ 3, %91 ]
%116 = phi i8* [ %129, %126 ], [ %96, %91 ]
%117 = phi i8** [ %128, %126 ], [ %95, %91 ]
%118 = call i32* @fopen(i8* %116, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%119 = icmp eq i32* %118, null
br i1 %119, label %120, label %123
120: ; preds = %114
%121 = load i8*, i8** %117
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %121)
br label %126
123: ; preds = %114
%124 = call i32 @Counting_Numbar_of_Mathing_String(i8* %5, i8* %6, i32* %118)
%125 = call i32 @fclose(i32* %118)
br label %126
126: ; preds = %123, %120
%127 = add nuw i64 %115, 1
%128 = getelementptr inbounds i8*, i8** %1, i64 %127
%129 = load i8*, i8** %128
%130 = icmp eq i8* %129, null
br i1 %130, label %200, label %114
131: ; preds = %84, %143
%132 = phi i64 [ %144, %143 ], [ 3, %84 ]
%133 = phi i8* [ %146, %143 ], [ %89, %84 ]
%134 = phi i8** [ %145, %143 ], [ %88, %84 ]
%135 = call i32* @fopen(i8* %133, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%136 = icmp eq i32* %135, null
br i1 %136, label %137, label %140
137: ; preds = %131
%138 = load i8*, i8** %134
%139 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %138)
br label %143
140: ; preds = %131
%141 = call i32 @Printing_Output_with_Line_Numbar(i8* %5, i8* %6, i32* %135)
%142 = call i32 @fclose(i32* %135)
br label %143
143: ; preds = %140, %137
%144 = add nuw i64 %132, 1
%145 = getelementptr inbounds i8*, i8** %1, i64 %144
%146 = load i8*, i8** %145
%147 = icmp eq i8* %146, null
br i1 %147, label %200, label %131
148: ; preds = %82, %161
%149 = phi i64 [ 4, %82 ], [ %162, %161 ]
%150 = phi i8* [ %80, %82 ], [ %164, %161 ]
%151 = phi i8** [ %79, %82 ], [ %163, %161 ]
%152 = call i32* @fopen(i8* %150, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%153 = icmp eq i32* %152, null
br i1 %153, label %154, label %157
154: ; preds = %148
%155 = load i8*, i8** %151
%156 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %155)
br label %161
157: ; preds = %148
%158 = load i8*, i8** %83
%159 = call i32 @Line_Printing_After_Matching(i8* %5, i8* %6, i32* %152, i8* %158)
%160 = call i32 @fclose(i32* %152)
br label %161
161: ; preds = %157, %154
%162 = add nuw i64 %149, 1
%163 = getelementptr inbounds i8*, i8** %1, i64 %162
%164 = load i8*, i8** %163
%165 = icmp eq i8* %164, null
br i1 %165, label %200, label %148
166: ; preds = %68, %178
%167 = phi i64 [ %179, %178 ], [ 3, %68 ]
%168 = phi i8* [ %181, %178 ], [ %73, %68 ]
%169 = phi i8** [ %180, %178 ], [ %72, %68 ]
%170 = call i32* @fopen(i8* %168, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%171 = icmp eq i32* %170, null
br i1 %171, label %172, label %175
172: ; preds = %166
%173 = load i8*, i8** %169
%174 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %173)
br label %178
175: ; preds = %166
%176 = call i32 @Ignore_case(i8* %5, i8* %6, i32* %170)
%177 = call i32 @fclose(i32* %170)
br label %178
178: ; preds = %175, %172
%179 = add nuw i64 %167, 1
%180 = getelementptr inbounds i8*, i8** %1, i64 %179
%181 = load i8*, i8** %180
%182 = icmp eq i8* %181, null
br i1 %182, label %200, label %166
183: ; preds = %61, %195
%184 = phi i64 [ %196, %195 ], [ 2, %61 ]
%185 = phi i8* [ %198, %195 ], [ %66, %61 ]
%186 = phi i8** [ %197, %195 ], [ %65, %61 ]
%187 = call i32* @fopen(i8* %185, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%188 = icmp eq i32* %187, null
br i1 %188, label %189, label %192
189: ; preds = %183
%190 = load i8*, i8** %186
%191 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %190)
br label %195
192: ; preds = %183
%193 = call i32 @Default_Option(i8* %5, i8* %6, i32* %187)
%194 = call i32 @fclose(i32* %187)
br label %195
195: ; preds = %192, %189
%196 = add nuw i64 %184, 1
%197 = getelementptr inbounds i8*, i8** %1, i64 %196
%198 = load i8*, i8** %197
%199 = icmp eq i8* %198, null
br i1 %199, label %200, label %183
200: ; preds = %195, %143, %161, %126, %178, %61, %68, %75, %84, %91, %111, %36, %106, %59, %16, %14, %7
%201 = phi i32 [ 0, %7 ], [ 0, %14 ], [ 0, %16 ], [ %110, %106 ], [ -1, %59 ], [ 0, %36 ], [ 0, %111 ], [ 0, %91 ], [ 0, %84 ], [ 0, %75 ], [ 0, %68 ], [ 0, %61 ], [ 0, %178 ], [ 0, %126 ], [ 0, %161 ], [ 0, %143 ], [ 0, %195 ]
ret i32 %201
}