#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
scalar_t__ atoi(char *);
int /*<<< orphan*/ close(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fread(unsigned char *, int, unsigned long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
unsigned long ftell(int /*<<< orphan*/ *);
unsigned char *malloc(unsigned long);
int /*<<< orphan*/ maxshiftm_hd(unsigned char *, unsigned int, unsigned char *,
                                unsigned int, unsigned int, unsigned int *,
                                unsigned int *, unsigned int *);
int /*<<< orphan*/ maxshiftm_hd_ls(unsigned char *, unsigned int,
                                   unsigned char *, unsigned int, unsigned int,
                                   unsigned int *, unsigned int *,
                                   unsigned int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(unsigned char *, char *);
unsigned int strlen(unsigned char *);
int main(int argc, char **argv) {
  unsigned char *info = "The valid options for MaxShiftM are:\n"
                        "-m\tRequired. The mode (hd, hdls)\n"
                        "-t\tRequired. The text to search through\n"
                        "-f\tOptional. File for -t if -t won't do\n"
                        "-p\tRequired. The pattern you are searching for\n"
                        "-l\tOptional. File for -p if -p won't do\n"
                        "-h\tRequired. Length of factor, e.g. 9\n";
  unsigned char *mode = "";
  unsigned char *t = "";
  unsigned char *p = "";
  unsigned int h = 0;
  FILE *ft, *fp;
  unsigned int i;
  for (i = 1; i < argc; i++) {
    if ('-' == (int)argv[i][0]) {
      switch ((int)argv[i][1]) {
      case 'm':
        mode = argv[i + 1];
        break;
      case 't':
        t = argv[i + 1];
        break;
      case 'f':
        if ((ft = fopen(argv[i + 1], "r")) == NULL) {
          fprintf(stderr, "Input file f could not be opened!\n");
          return (EXIT_FAILURE);
        } else {
          fseek(ft, 0, SEEK_END);
          unsigned long length = ftell(ft);
          fseek(ft, 0, SEEK_SET);
          t = malloc(length);
          if (t) {
            fread(t, 1, length, ft);
          }
          close(ft);
        }
        break;
      case 'p':
        p = argv[i + 1];
        break;
      case 'l':
        if ((fp = fopen(argv[i + 1], "r")) == NULL) {
          fprintf(stderr, "Input file l could not be opened!\n");
          return (EXIT_FAILURE);
        } else {
          fseek(fp, 0, SEEK_END);
          unsigned long length = ftell(fp);
          fseek(fp, 0, SEEK_SET);
          p = malloc(length);
          if (p) {
            fread(p, 1, length, fp);
          }
          close(fp);
        }
        break;
      case 'h':
        h = (unsigned int)atoi(argv[i + 1]);
        break;
      default:
        fprintf(stderr, "Invalid option '-%c' supplied!\n", argv[i][1]);
        printf("%s", info);
        return (EXIT_FAILURE);
      }
    }
  }
  unsigned int n = strlen(t);
  unsigned int m = strlen(p);
  if (strlen(mode) == 0 || n == 0 || m == 0) {
    fprintf(stderr, "Command line options missing!\n");
    printf("%s", info);
    return (EXIT_FAILURE);
  }
  if (h == 0 || (h > m && h > n)) {
    fprintf(stderr, "Factor length cannot be empty or longer than the strings "
                    "being searched!\n");
    return (EXIT_FAILURE);
  }
  unsigned int ii = 0, jj = 0, ee = 0;
  if (strcmp(mode, "hd") == 0) {
    maxshiftm_hd(p, m, t, n, h, &ii, &jj, &ee);
  } else if (strcmp(mode, "hdls") == 0) {
    maxshiftm_hd_ls(p, m, t, n, h, &ii, &jj, &ee);
  } else {
    fprintf(stderr, "Invalid mode '%s' supplied!\n", mode);
    printf("%s", info);
    return (EXIT_FAILURE);
  }
  printf("e: %u, i: %u, j: %u\n", ee, ii, jj);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe4c(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0x1028(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0x101d(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0x1012(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    14ce <main+0x2fe>
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%ecx
mov    $0x2d,%eax
cmp    %ecx,%eax
jne    14bb <main+0x2eb>
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
add    $0xffffff9a,%eax
mov    %eax,%ecx
mov    %rcx,-0x80(%rbp)
sub    $0xe,%eax
ja     146d <main+0x29d>
mov    -0x80(%rbp),%rax
lea    0xd8a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
jmp    14b6 <main+0x2e6>
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
jmp    14b6 <main+0x2e6>
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,8),%rdi
lea    0xe88(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    1303 <main+0x133>
mov    0x2cf6(%rip),%rax
mov    (%rax),%edi
lea    0xe67(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2ccf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16a1 <main+0x4d1>
mov    -0x40(%rbp),%rdi
mov    0x2cda(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x40(%rbp),%rdi
call   1090 <ftell@plt>
mov    %rax,-0x58(%rbp)
mov    -0x40(%rbp),%rdi
mov    0x2ca1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x58(%rbp),%rdi
call   10a0 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1366 <main+0x196>
mov    -0x28(%rbp),%rdi
mov    -0x58(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x40(%rbp),%rdi
call   1060 <close@plt>
jmp    14b6 <main+0x2e6>
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
jmp    14b6 <main+0x2e6>
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,8),%rdi
lea    0xdac(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jne    13df <main+0x20f>
mov    0x2c1a(%rip),%rax
mov    (%rax),%edi
lea    0xdae(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2bf3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16a1 <main+0x4d1>
mov    -0x48(%rbp),%rdi
mov    0x2bfe(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x48(%rbp),%rdi
call   1090 <ftell@plt>
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%rdi
mov    0x2bc5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x60(%rbp),%rdi
call   10a0 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1442 <main+0x272>
mov    -0x30(%rbp),%rdi
mov    -0x60(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x48(%rbp),%rdi
call   1060 <close@plt>
jmp    14b6 <main+0x2e6>
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,8),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x34(%rbp)
jmp    14b6 <main+0x2e6>
mov    0x2b64(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%edx
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rsi
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2b1c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16a1 <main+0x4d1>
jmp    14bb <main+0x2eb>
jmp    14c0 <main+0x2f0>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1223 <main+0x53>
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x64(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x68(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%eax
je     150c <main+0x33c>
cmpl   $0x0,-0x64(%rbp)
je     150c <main+0x33c>
cmpl   $0x0,-0x68(%rbp)
jne    1546 <main+0x376>
mov    0x2ac5(%rip),%rax
mov    (%rax),%edi
lea    0xc9f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rsi
lea    0xc8a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2a8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16a1 <main+0x4d1>
cmpl   $0x0,-0x34(%rbp)
je     1568 <main+0x398>
mov    -0x34(%rbp),%eax
cmp    -0x68(%rbp),%eax
jbe    1590 <main+0x3c0>
mov    -0x34(%rbp),%eax
cmp    -0x64(%rbp),%eax
jbe    1590 <main+0x3c0>
mov    0x2a69(%rip),%rax
mov    (%rax),%edi
lea    0xc62(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2a42(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16a1 <main+0x4d1>
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc74(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    15f0 <main+0x420>
mov    -0x30(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    -0x64(%rbp),%ecx
mov    -0x34(%rbp),%r8d
lea    -0x6c(%rbp),%r9
lea    -0x70(%rbp),%r10
lea    -0x74(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10d0 <maxshiftm_hd@plt>
jmp    167e <main+0x4ae>
mov    -0x20(%rbp),%rdi
lea    0xc2c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    163b <main+0x46b>
mov    -0x30(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    -0x64(%rbp),%ecx
mov    -0x34(%rbp),%r8d
lea    -0x6c(%rbp),%r9
lea    -0x70(%rbp),%r10
lea    -0x74(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10c0 <maxshiftm_hd_ls@plt>
jmp    1679 <main+0x4a9>
mov    0x2996(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xbdd(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rsi
lea    0xb57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2959(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    16a1 <main+0x4d1>
jmp    167e <main+0x4ae>
mov    -0x74(%rbp),%esi
mov    -0x6c(%rbp),%edx
mov    -0x70(%rbp),%ecx
lea    0xbbb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2924(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
cmp    $0x2,%edi
jb     13c8 <main+0x1e8>
mov    %rsi,%rbx
mov    %edi,%r15d
xor    %eax,%eax
mov    %rax,0x28(%rsp)
lea    0xf01(%rip),%rax
mov    $0x1,%r12d
lea    0xde8(%rip),%rbp
mov    %rax,0x18(%rsp)
mov    %rax,0x30(%rsp)
mov    %rax,0x20(%rsp)
jmp    124d <main+0x6d>
mov    0x8(%rbx,%r12,8),%rax
mov    %rax,0x30(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r12
cmp    %r15,%r12
je     13e5 <main+0x205>
mov    (%rbx,%r12,8),%rax
cmpb   $0x2d,(%rax)
jne    1240 <main+0x60>
movsbl 0x1(%rax),%edx
lea    -0x66(%rdx),%eax
cmp    $0xe,%eax
ja     1510 <main+0x330>
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
mov    0x8(%rbx,%r12,8),%rdi
lea    0xdc0(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     152c <main+0x34c>
mov    %rax,%rbp
mov    0x2d54(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %rbp,%rdi
call   10a0 <ftell@plt>
mov    %rax,%r14
mov    0x2d1e(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %r14,%rdi
call   10b0 <malloc@plt>
mov    %rax,%r13
test   %rax,%rax
je     12e1 <main+0x101>
mov    %r13,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %rbp,%rcx
call   1040 <fread@plt>
mov    %r13,0x18(%rsp)
add    $0x1,%r12
mov    %rbp,%rdi
call   1070 <close@plt>
lea    0xd07(%rip),%rbp
jmp    1244 <main+0x64>
mov    0x8(%rbx,%r12,8),%rdi
add    $0x1,%r12
call   1100 <atoi@plt>
mov    %rax,0x28(%rsp)
jmp    1244 <main+0x64>
mov    0x8(%rbx,%r12,8),%rdi
lea    0xd1a(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     1541 <main+0x361>
mov    %rax,%rbp
mov    %r15,%r13
mov    0x2cab(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %rbp,%rdi
call   10a0 <ftell@plt>
mov    %rax,%r14
mov    0x2c75(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %r14,%rdi
call   10b0 <malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     138a <main+0x1aa>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %rbp,%rcx
call   1040 <fread@plt>
mov    %r15,0x20(%rsp)
add    $0x1,%r12
mov    %rbp,%rdi
call   1070 <close@plt>
mov    %r13,%r15
lea    0xc5b(%rip),%rbp
jmp    1244 <main+0x64>
mov    0x8(%rbx,%r12,8),%rax
mov    %rax,0x20(%rsp)
jmp    1240 <main+0x60>
mov    0x8(%rbx,%r12,8),%rax
mov    %rax,0x18(%rsp)
jmp    1240 <main+0x60>
lea    0xd3d(%rip),%rcx
xor    %eax,%eax
mov    %rax,0x28(%rsp)
mov    %rcx,0x18(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rcx,0x30(%rsp)
mov    0x18(%rsp),%r12
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,%r15d
mov    0x20(%rsp),%r13
mov    %r13,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
je     144b <main+0x26b>
test   %r15d,%r15d
je     144b <main+0x26b>
test   %ebp,%ebp
je     144b <main+0x26b>
mov    0x28(%rsp),%r14
test   %r14d,%r14d
je     1432 <main+0x252>
cmp    %ebp,%r14d
jbe    1486 <main+0x2a6>
cmp    %r15d,%r14d
jbe    1486 <main+0x2a6>
mov    0x2b9f(%rip),%rax
mov    (%rax),%edi
lea    0xc81(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    146e <main+0x28e>
mov    0x2b86(%rip),%rax
mov    (%rax),%edi
lea    0xc49(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xcde(%rip),%rdi
call   1030 <puts@plt>
mov    0x2b53(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xc68(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     14e9 <main+0x309>
lea    0xc57(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1556 <main+0x376>
mov    0x2b07(%rip),%rax
mov    (%rax),%edi
lea    0xc3b(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1462 <main+0x282>
lea    0xc(%rsp),%rax
lea    0x10(%rsp),%r10
lea    0x14(%rsp),%r9
mov    %r13,%rdi
mov    %ebp,%esi
mov    %r12,%rdx
mov    %r15d,%ecx
mov    %r14d,%r8d
push   %rax
push   %r10
call   10e0 <maxshiftm_hd@plt>
jmp    157b <main+0x39b>
mov    0x2ac1(%rip),%rax
mov    (%rax),%edi
lea    0xb64(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1462 <main+0x282>
mov    0x2aa5(%rip),%rax
mov    (%rax),%edi
lea    0xb02(%rip),%rsi
jmp    1442 <main+0x262>
mov    0x2a90(%rip),%rax
mov    (%rax),%edi
lea    0xb10(%rip),%rsi
jmp    1442 <main+0x262>
lea    0xc(%rsp),%rax
lea    0x10(%rsp),%r10
lea    0x14(%rsp),%r9
mov    %r13,%rdi
mov    %ebp,%esi
mov    %r12,%rdx
mov    %r15d,%ecx
mov    %r14d,%r8d
push   %rax
push   %r10
call   10d0 <maxshiftm_hd_ls@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
lea    0xba0(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2a20(%rip),%rax
jmp    1475 <main+0x295>

LLVM IR (-O0):
@.str = [276 x i8] c"The valid options for MaxShiftM are:\0A-m\09Required. The mode (hd, hdls)\0A-t\09Required. The text to search through\0A-f\09Optional. File for -t if -t won't do\0A-p\09Required. The pattern you are searching for\0A-l\09Optional. File for -p if -p won't do\0A-h\09Required. Length of factor, e.g. 9\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.3 = [35 x i8] c"Input file f could not be opened!\0A\00"
@EXIT_FAILURE = global i32 0
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.4 = [35 x i8] c"Input file l could not be opened!\0A\00"
@.str.5 = [32 x i8] c"Invalid option '-%c' supplied!\0A\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [31 x i8] c"Command line options missing!\0A\00"
@.str.8 = [74 x i8] c"Factor length cannot be empty or longer than the strings being searched!\0A\00"
@.str.9 = [3 x i8] c"hd\00"
@.str.10 = [5 x i8] c"hdls\00"
@.str.11 = [29 x i8] c"Invalid mode '%s' supplied!\0A\00"
@.str.12 = [21 x i8] c"e: %u, i: %u, j: %u\0A\00"
@EXIT_SUCCESS = global i32 0
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 i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i64
%15 = alloca i64
%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 ([276 x i8], [276 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %9
store i32 0, i32* %10
store i32 1, i32* %13
br label %21
21: ; preds = %160, %2
%22 = load i32, i32* %13
%23 = load i32, i32* %4
%24 = icmp ult i32 %22, %23
br i1 %24, label %25, label %163
25: ; preds = %21
%26 = load i8**, i8*** %5
%27 = load i32, i32* %13
%28 = zext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = getelementptr inbounds i8, i8* %30, i64 0
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 45, %33
br i1 %34, label %35, label %159
35: ; preds = %25
%36 = load i8**, i8*** %5
%37 = load i32, i32* %13
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %36, i64 %38
%40 = load i8*, i8** %39
%41 = getelementptr inbounds i8, i8* %40, i64 1
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
switch i32 %43, label %144 [
i32 109, label %44
i32 116, label %51
i32 102, label %58
i32 112, label %93
i32 108, label %100
i32 104, label %135
]
44: ; preds = %35
%45 = load i8**, i8*** %5
%46 = load i32, i32* %13
%47 = add i32 %46, 1
%48 = zext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %45, i64 %48
%50 = load i8*, i8** %49
store i8* %50, i8** %7
br label %158
51: ; preds = %35
%52 = load i8**, i8*** %5
%53 = load i32, i32* %13
%54 = add i32 %53, 1
%55 = zext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %52, i64 %55
%57 = load i8*, i8** %56
store i8* %57, i8** %8
br label %158
58: ; preds = %35
%59 = load i8**, i8*** %5
%60 = load i32, i32* %13
%61 = add i32 %60, 1
%62 = zext i32 %61 to i64
%63 = getelementptr inbounds i8*, i8** %59, i64 %62
%64 = load i8*, i8** %63
%65 = call i32* @fopen(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %65, i32** %11
%66 = icmp eq i32* %65, null
br i1 %66, label %67, label %71
67: ; preds = %58
%68 = load i32, i32* @stderr
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%70 = load i32, i32* @EXIT_FAILURE
store i32 %70, i32* %3
br label %234
71: ; preds = %58
%72 = load i32*, i32** %11
%73 = load i32, i32* @SEEK_END
%74 = call i32 @fseek(i32* %72, i32 0, i32 %73)
%75 = load i32*, i32** %11
%76 = call i64 @ftell(i32* %75)
store i64 %76, i64* %14
%77 = load i32*, i32** %11
%78 = load i32, i32* @SEEK_SET
%79 = call i32 @fseek(i32* %77, i32 0, i32 %78)
%80 = load i64, i64* %14
%81 = call i8* @malloc(i64 %80)
store i8* %81, i8** %8
%82 = load i8*, i8** %8
%83 = icmp ne i8* %82, null
br i1 %83, label %84, label %89
84: ; preds = %71
%85 = load i8*, i8** %8
%86 = load i64, i64* %14
%87 = load i32*, i32** %11
%88 = call i32 @fread(i8* %85, i32 1, i64 %86, i32* %87)
br label %89
89: ; preds = %84, %71
%90 = load i32*, i32** %11
%91 = call i32 @close(i32* %90)
br label %92
92: ; preds = %89
br label %158
93: ; preds = %35
%94 = load i8**, i8*** %5
%95 = load i32, i32* %13
%96 = add i32 %95, 1
%97 = zext i32 %96 to i64
%98 = getelementptr inbounds i8*, i8** %94, i64 %97
%99 = load i8*, i8** %98
store i8* %99, i8** %9
br label %158
100: ; preds = %35
%101 = load i8**, i8*** %5
%102 = load i32, i32* %13
%103 = add i32 %102, 1
%104 = zext i32 %103 to i64
%105 = getelementptr inbounds i8*, i8** %101, i64 %104
%106 = load i8*, i8** %105
%107 = call i32* @fopen(i8* %106, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %107, i32** %12
%108 = icmp eq i32* %107, null
br i1 %108, label %109, label %113
109: ; preds = %100
%110 = load i32, i32* @stderr
%111 = call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%112 = load i32, i32* @EXIT_FAILURE
store i32 %112, i32* %3
br label %234
113: ; preds = %100
%114 = load i32*, i32** %12
%115 = load i32, i32* @SEEK_END
%116 = call i32 @fseek(i32* %114, i32 0, i32 %115)
%117 = load i32*, i32** %12
%118 = call i64 @ftell(i32* %117)
store i64 %118, i64* %15
%119 = load i32*, i32** %12
%120 = load i32, i32* @SEEK_SET
%121 = call i32 @fseek(i32* %119, i32 0, i32 %120)
%122 = load i64, i64* %15
%123 = call i8* @malloc(i64 %122)
store i8* %123, i8** %9
%124 = load i8*, i8** %9
%125 = icmp ne i8* %124, null
br i1 %125, label %126, label %131
126: ; preds = %113
%127 = load i8*, i8** %9
%128 = load i64, i64* %15
%129 = load i32*, i32** %12
%130 = call i32 @fread(i8* %127, i32 1, i64 %128, i32* %129)
br label %131
131: ; preds = %126, %113
%132 = load i32*, i32** %12
%133 = call i32 @close(i32* %132)
br label %134
134: ; preds = %131
br label %158
135: ; preds = %35
%136 = load i8**, i8*** %5
%137 = load i32, i32* %13
%138 = add i32 %137, 1
%139 = zext i32 %138 to i64
%140 = getelementptr inbounds i8*, i8** %136, i64 %139
%141 = load i8*, i8** %140
%142 = call i64 @atoi(i8* %141)
%143 = trunc i64 %142 to i32
store i32 %143, i32* %10
br label %158
144: ; preds = %35
%145 = load i32, i32* @stderr
%146 = load i8**, i8*** %5
%147 = load i32, i32* %13
%148 = zext i32 %147 to i64
%149 = getelementptr inbounds i8*, i8** %146, i64 %148
%150 = load i8*, i8** %149
%151 = getelementptr inbounds i8, i8* %150, i64 1
%152 = load i8, i8* %151
%153 = sext i8 %152 to i32
%154 = call i32 (i32, i8*, ...) @fprintf(i32 %145, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %153)
%155 = load i8*, i8** %6
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %155)
%157 = load i32, i32* @EXIT_FAILURE
store i32 %157, i32* %3
br label %234
158: ; preds = %135, %134, %93, %92, %51, %44
br label %159
159: ; preds = %158, %25
br label %160
160: ; preds = %159
%161 = load i32, i32* %13
%162 = add i32 %161, 1
store i32 %162, i32* %13
br label %21
163: ; preds = %21
%164 = load i8*, i8** %8
%165 = call i32 @strlen(i8* %164)
store i32 %165, i32* %16
%166 = load i8*, i8** %9
%167 = call i32 @strlen(i8* %166)
store i32 %167, i32* %17
%168 = load i8*, i8** %7
%169 = call i32 @strlen(i8* %168)
%170 = icmp eq i32 %169, 0
br i1 %170, label %177, label %171
171: ; preds = %163
%172 = load i32, i32* %16
%173 = icmp eq i32 %172, 0
br i1 %173, label %177, label %174
174: ; preds = %171
%175 = load i32, i32* %17
%176 = icmp eq i32 %175, 0
br i1 %176, label %177, label %183
177: ; preds = %174, %171, %163
%178 = load i32, i32* @stderr
%179 = call i32 (i32, i8*, ...) @fprintf(i32 %178, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
%180 = load i8*, i8** %6
%181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %180)
%182 = load i32, i32* @EXIT_FAILURE
store i32 %182, i32* %3
br label %234
183: ; preds = %174
%184 = load i32, i32* %10
%185 = icmp eq i32 %184, 0
br i1 %185, label %194, label %186
186: ; preds = %183
%187 = load i32, i32* %10
%188 = load i32, i32* %17
%189 = icmp ugt i32 %187, %188
br i1 %189, label %190, label %198
190: ; preds = %186
%191 = load i32, i32* %10
%192 = load i32, i32* %16
%193 = icmp ugt i32 %191, %192
br i1 %193, label %194, label %198
194: ; preds = %190, %183
%195 = load i32, i32* @stderr
%196 = call i32 (i32, i8*, ...) @fprintf(i32 %195, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.8, i64 0, i64 0))
%197 = load i32, i32* @EXIT_FAILURE
store i32 %197, i32* %3
br label %234
198: ; preds = %190, %186
store i32 0, i32* %18
store i32 0, i32* %19
store i32 0, i32* %20
%199 = load i8*, i8** %7
%200 = call i64 @strcmp(i8* %199, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%201 = icmp eq i64 %200, 0
br i1 %201, label %202, label %209
202: ; preds = %198
%203 = load i8*, i8** %9
%204 = load i32, i32* %17
%205 = load i8*, i8** %8
%206 = load i32, i32* %16
%207 = load i32, i32* %10
%208 = call i32 @maxshiftm_hd(i8* %203, i32 %204, i8* %205, i32 %206, i32 %207, i32* %18, i32* %19, i32* %20)
br label %228
209: ; preds = %198
%210 = load i8*, i8** %7
%211 = call i64 @strcmp(i8* %210, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%212 = icmp eq i64 %211, 0
br i1 %212, label %213, label %220
213: ; preds = %209
%214 = load i8*, i8** %9
%215 = load i32, i32* %17
%216 = load i8*, i8** %8
%217 = load i32, i32* %16
%218 = load i32, i32* %10
%219 = call i32 @maxshiftm_hd_ls(i8* %214, i32 %215, i8* %216, i32 %217, i32 %218, i32* %18, i32* %19, i32* %20)
br label %227
220: ; preds = %209
%221 = load i32, i32* @stderr
%222 = load i8*, i8** %7
%223 = call i32 (i32, i8*, ...) @fprintf(i32 %221, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* %222)
%224 = load i8*, i8** %6
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %224)
%226 = load i32, i32* @EXIT_FAILURE
store i32 %226, i32* %3
br label %234
227: ; preds = %213
br label %228
228: ; preds = %227, %202
%229 = load i32, i32* %20
%230 = load i32, i32* %18
%231 = load i32, i32* %19
%232 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i32 %229, i32 %230, i32 %231)
%233 = load i32, i32* @EXIT_SUCCESS
store i32 %233, i32* %3
br label %234
234: ; preds = %228, %220, %194, %177, %144, %109, %67
%235 = load i32, i32* %3
ret i32 %235
}

LLVM IR (-O2):
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.3 = [35 x i8] c"Input file f could not be opened!\0A\00"
@EXIT_FAILURE = global i32 0
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.4 = [35 x i8] c"Input file l could not be opened!\0A\00"
@.str.5 = [32 x i8] c"Invalid option '-%c' supplied!\0A\00"
@.str.7 = [31 x i8] c"Command line options missing!\0A\00"
@.str.8 = [74 x i8] c"Factor length cannot be empty or longer than the strings being searched!\0A\00"
@.str.9 = [3 x i8] c"hd\00"
@.str.10 = [5 x i8] c"hdls\00"
@.str.11 = [29 x i8] c"Invalid mode '%s' supplied!\0A\00"
@.str.12 = [21 x i8] c"e: %u, i: %u, j: %u\0A\00"
@EXIT_SUCCESS = global i32 0
@str.14 = [275 x i8] c"The valid options for MaxShiftM are:\0A-m\09Required. The mode (hd, hdls)\0A-t\09Required. The text to search through\0A-f\09Optional. File for -t if -t won't do\0A-p\09Required. The pattern you are searching for\0A-l\09Optional. File for -p if -p won't do\0A-h\09Required. Length of factor, e.g. 9\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = icmp ugt i32 %0, 1
br i1 %6, label %7, label %100
7: ; preds = %2
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %7, %93
%10 = phi i64 [ 1, %7 ], [ %94, %93 ]
%11 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %7 ], [ %98, %93 ]
%12 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %7 ], [ %97, %93 ]
%13 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %7 ], [ %96, %93 ]
%14 = phi i32 [ 0, %7 ], [ %95, %93 ]
%15 = getelementptr inbounds i8*, i8** %1, i64 %10
%16 = load i8*, i8** %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 45
br i1 %18, label %21, label %19
19: ; preds = %9
%20 = add nuw nsw i64 %10, 1
br label %93
21: ; preds = %9
%22 = getelementptr inbounds i8, i8* %16, i64 1
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
switch i32 %24, label %87 [
i32 109, label %25
i32 116, label %29
i32 102, label %33
i32 112, label %55
i32 108, label %59
i32 104, label %81
]
25: ; preds = %21
%26 = add nuw nsw i64 %10, 1
%27 = getelementptr inbounds i8*, i8** %1, i64 %26
%28 = load i8*, i8** %27
br label %93
29: ; preds = %21
%30 = add nuw nsw i64 %10, 1
%31 = getelementptr inbounds i8*, i8** %1, i64 %30
%32 = load i8*, i8** %31
br label %93
33: ; preds = %21
%34 = add nuw nsw i64 %10, 1
%35 = getelementptr inbounds i8*, i8** %1, i64 %34
%36 = load i8*, i8** %35
%37 = tail call i32* @fopen(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %43
39: ; preds = %33
%40 = load i32, i32* @stderr
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%42 = load i32, i32* @EXIT_FAILURE
br label %153
43: ; preds = %33
%44 = load i32, i32* @SEEK_END
%45 = tail call i32 @fseek(i32* %37, i32 0, i32 %44)
%46 = tail call i64 @ftell(i32* %37)
%47 = load i32, i32* @SEEK_SET
%48 = tail call i32 @fseek(i32* %37, i32 0, i32 %47)
%49 = tail call i8* @malloc(i64 %46)
%50 = icmp eq i8* %49, null
br i1 %50, label %53, label %51
51: ; preds = %43
%52 = tail call i32 @fread(i8* %49, i32 1, i64 %46, i32* %37)
br label %53
53: ; preds = %51, %43
%54 = tail call i32 @close(i32* %37)
br label %93
55: ; preds = %21
%56 = add nuw nsw i64 %10, 1
%57 = getelementptr inbounds i8*, i8** %1, i64 %56
%58 = load i8*, i8** %57
br label %93
59: ; preds = %21
%60 = add nuw nsw i64 %10, 1
%61 = getelementptr inbounds i8*, i8** %1, i64 %60
%62 = load i8*, i8** %61
%63 = tail call i32* @fopen(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%64 = icmp eq i32* %63, null
br i1 %64, label %65, label %69
65: ; preds = %59
%66 = load i32, i32* @stderr
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%68 = load i32, i32* @EXIT_FAILURE
br label %153
69: ; preds = %59
%70 = load i32, i32* @SEEK_END
%71 = tail call i32 @fseek(i32* %63, i32 0, i32 %70)
%72 = tail call i64 @ftell(i32* %63)
%73 = load i32, i32* @SEEK_SET
%74 = tail call i32 @fseek(i32* %63, i32 0, i32 %73)
%75 = tail call i8* @malloc(i64 %72)
%76 = icmp eq i8* %75, null
br i1 %76, label %79, label %77
77: ; preds = %69
%78 = tail call i32 @fread(i8* %75, i32 1, i64 %72, i32* %63)
br label %79
79: ; preds = %77, %69
%80 = tail call i32 @close(i32* %63)
br label %93
81: ; preds = %21
%82 = add nuw nsw i64 %10, 1
%83 = getelementptr inbounds i8*, i8** %1, i64 %82
%84 = load i8*, i8** %83
%85 = tail call i64 @atoi(i8* %84)
%86 = trunc i64 %85 to i32
br label %93
87: ; preds = %21
%88 = sext i8 %23 to i32
%89 = load i32, i32* @stderr
%90 = tail call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %88)
%91 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([275 x i8], [275 x i8]* @str.14, i64 0, i64 0))
%92 = load i32, i32* @EXIT_FAILURE
br label %153
93: ; preds = %19, %81, %79, %55, %53, %29, %25
%94 = phi i64 [ %20, %19 ], [ %82, %81 ], [ %60, %79 ], [ %56, %55 ], [ %34, %53 ], [ %30, %29 ], [ %26, %25 ]
%95 = phi i32 [ %14, %19 ], [ %86, %81 ], [ %14, %79 ], [ %14, %55 ], [ %14, %53 ], [ %14, %29 ], [ %14, %25 ]
%96 = phi i8* [ %13, %19 ], [ %13, %81 ], [ %75, %79 ], [ %58, %55 ], [ %13, %53 ], [ %13, %29 ], [ %13, %25 ]
%97 = phi i8* [ %12, %19 ], [ %12, %81 ], [ %12, %79 ], [ %12, %55 ], [ %49, %53 ], [ %32, %29 ], [ %12, %25 ]
%98 = phi i8* [ %11, %19 ], [ %11, %81 ], [ %11, %79 ], [ %11, %55 ], [ %11, %53 ], [ %11, %29 ], [ %28, %25 ]
%99 = icmp eq i64 %94, %8
br i1 %99, label %100, label %9
100: ; preds = %93, %2
%101 = phi i32 [ 0, %2 ], [ %95, %93 ]
%102 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %96, %93 ]
%103 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %97, %93 ]
%104 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %98, %93 ]
%105 = tail call i32 @strlen(i8* %103)
%106 = tail call i32 @strlen(i8* %102)
%107 = tail call i32 @strlen(i8* %104)
%108 = icmp eq i32 %107, 0
%109 = icmp eq i32 %105, 0
%110 = select i1 %108, i1 true, i1 %109
%111 = icmp eq i32 %106, 0
%112 = select i1 %110, i1 true, i1 %111
br i1 %112, label %113, label %118
113: ; preds = %100
%114 = load i32, i32* @stderr
%115 = tail call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
%116 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([275 x i8], [275 x i8]* @str.14, i64 0, i64 0))
%117 = load i32, i32* @EXIT_FAILURE
br label %153
118: ; preds = %100
%119 = icmp eq i32 %101, 0
br i1 %119, label %124, label %120
120: ; preds = %118
%121 = icmp ugt i32 %101, %106
%122 = icmp ugt i32 %101, %105
%123 = select i1 %121, i1 %122, i1 false
br i1 %123, label %124, label %128
124: ; preds = %120, %118
%125 = load i32, i32* @stderr
%126 = tail call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.8, i64 0, i64 0))
%127 = load i32, i32* @EXIT_FAILURE
br label %153
128: ; preds = %120
%129 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%130 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%131 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%132 = tail call i64 @strcmp(i8* %104, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%133 = icmp eq i64 %132, 0
br i1 %133, label %134, label %136
134: ; preds = %128
%135 = call i32 @maxshiftm_hd(i8* %102, i32 %106, i8* %103, i32 %105, i32 %101, i32* %3, i32* %4, i32* %5)
br label %145
136: ; preds = %128
%137 = tail call i64 @strcmp(i8* %104, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%138 = icmp eq i64 %137, 0
br i1 %138, label %139, label %141
139: ; preds = %136
%140 = call i32 @maxshiftm_hd_ls(i8* %102, i32 %106, i8* %103, i32 %105, i32 %101, i32* %3, i32* %4, i32* %5)
br label %145
141: ; preds = %136
%142 = load i32, i32* @stderr
%143 = tail call i32 (i32, i8*, ...) @fprintf(i32 %142, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* %104)
%144 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([275 x i8], [275 x i8]* @str.14, i64 0, i64 0))
br label %150
145: ; preds = %139, %134
%146 = load i32, i32* %5
%147 = load i32, i32* %3
%148 = load i32, i32* %4
%149 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i32 %146, i32 %147, i32 %148)
br label %150
150: ; preds = %145, %141
%151 = phi i32* [ @EXIT_SUCCESS, %145 ], [ @EXIT_FAILURE, %141 ]
%152 = load i32, i32* %151
br label %153
153: ; preds = %113, %124, %150, %87, %65, %39
%154 = phi i32 [ %92, %87 ], [ %68, %65 ], [ %42, %39 ], [ %117, %113 ], [ %127, %124 ], [ %152, %150 ]
ret i32 %154
}