#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 */
char EOF;
scalar_t__ ERANGE;
int EXIT_FAILURE;
int EXIT_SUCCESS;
float atof(char *);
int atoi(char *);
scalar_t__ atol(char *);
scalar_t__ errno;
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
float strtof(char *, int /*<<< orphan*/ *);
int processArguments(int argc, char **argv, bool *runThresholdP, bool *runCropP,
                     bool *runResizeP, bool *displayInfoP, char **inFileNameP,
                     char **outFileNameP, float *thresholdP, int *cropWidthP,
                     int *cropHeightP, int *cropStartP, float *scalingP,
                     char **resTypeP) {
  if (argc == 1) {
    fprintf(stderr, "Usage: %s [OPTIONS ...] [input.bmp]\n", argv[0]);
    fprintf(stderr, "Try %s -h for more detailed help.\n", argv[0]);
    return EXIT_FAILURE;
  }
  *(inFileNameP) = argv[argc - 1];
  for (int i = 1; i < argc; i++) {
    if (strcmp(argv[i], "-t") == 0) {
      if (i + 1 < argc) {
        *(runThresholdP) = true;
        errno = 0;
        *(thresholdP) = strtof(argv[++i], NULL);
        if (errno == ERANGE) {
          fprintf(stderr, "Threshold value out of range.\n");
          return EXIT_FAILURE;
        }
      } else {
        fprintf(stderr, "No value for threshold provided.\n");
        return EXIT_FAILURE;
      }
    } else if (strcmp(argv[i], "-o") == 0) {
      if (i + 1 < argc) {
        *(outFileNameP) = argv[++i];
      } else {
        fprintf(stderr, "No output file name provided.\n");
        return EXIT_FAILURE;
      }
    } else if (strcmp(argv[i], "-c") == 0) {
      if (i + 2 < argc) {
        *(runCropP) = true;
        errno = 0;
        *(cropWidthP) = (int)atol(argv[++i]);
        if (errno == ERANGE) {
          fprintf(stderr, "Crop width value out of range.\n");
          return EXIT_FAILURE;
        }
        errno = 0;
        *(cropHeightP) = (int)atol(argv[++i]);
        if (errno == ERANGE) {
          fprintf(stderr, "Crop height value out of range.\n");
          return EXIT_FAILURE;
        }
      } else {
        fprintf(stderr,
                "Complete values for crop height & width not provided.\n");
        return EXIT_FAILURE;
      }
    } else if (strcmp(argv[i], "-s") == 0) {
      if (i + 2 < argc) {
        errno = 0;
        *(cropStartP) = atoi(argv[++i]);
        if (errno == ERANGE) {
          fprintf(stderr, "Crop height value out of range.\n");
          return EXIT_FAILURE;
        }
        errno = 0;
        *(cropStartP + 1) = atoi(argv[++i]);
        if (errno == ERANGE) {
          fprintf(stderr, "Crop height value out of range.\n");
          return EXIT_FAILURE;
        }
      } else {
        fprintf(stderr,
                "Complete values for crop start position not provided.\n");
        return EXIT_FAILURE;
      }
    } else if (strcmp(argv[i], "-r") == 0) {
      if (i + 2 < argc) {
        *(runResizeP) = true;
        *(scalingP) = atof(argv[++i]);
        *(resTypeP) = argv[++i];
      } else {
        fprintf(stderr, "Resize scaling or type not specified.\n");
        return EXIT_FAILURE;
      }
    } else if (strcmp(argv[i], "-q") == 0) {
      *(displayInfoP) = false;
    } else if (strcmp(argv[i], "-h") == 0) {
      FILE *helpFile = fopen("help", "r");
      if (helpFile == NULL) {
        fprintf(stderr, "Unable to access help data.\n");
        return EXIT_FAILURE;
      }
      char fileChunk;
      while ((fileChunk = fgetc(helpFile)) != EOF) {
        fputc(fileChunk, stderr);
      }
      return EXIT_FAILURE;
    }
  }
  if (*(runThresholdP)) {
    if (*(thresholdP) == (-1.0)) {
      fprintf(stderr, "No threshold value provided.\n");
      return EXIT_FAILURE;
    }
  }
  if (*(runCropP)) {
    if ((*(cropWidthP) == (-1)) || (*(cropHeightP) == (-1))) {
      fprintf(stderr, "Crop dimensions not provided.\n");
      return EXIT_FAILURE;
    }
  }
  if (*(runResizeP)) {
    if (*(scalingP) == (-1.0)) {
      fprintf(stderr, "Scaling factor not specified.\n");
      return EXIT_FAILURE;
    }
    if (strcmp(*(resTypeP), "") == 0) {
      fprintf(stderr, "Resize type not specified.\n");
      return EXIT_FAILURE;
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<processArguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1226 <processArguments+0x96>
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe18(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2dd2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe1f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2da4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    180d <processArguments+0x67d>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdec(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1333 <processArguments+0x1a3>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    1306 <processArguments+0x176>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    0x2d35(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x34(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtof@plt>
mov    0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    0x2d02(%rip),%rax
mov    (%rax),%rax
mov    0x2d10(%rip),%rcx
cmp    (%rcx),%rax
jne    1301 <processArguments+0x171>
mov    0x2cf0(%rip),%rax
mov    (%rax),%edi
lea    0xd6a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2cc9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    132e <processArguments+0x19e>
mov    0x2cc3(%rip),%rax
mov    (%rax),%edi
lea    0xd5c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2c9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    17fa <processArguments+0x66a>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd4e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13b1 <processArguments+0x221>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    1384 <processArguments+0x1f4>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x34(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    13ac <processArguments+0x21c>
mov    0x2c45(%rip),%rax
mov    (%rax),%edi
lea    0xd03(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2c1e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    17f5 <processArguments+0x665>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcf2(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1500 <processArguments+0x370>
mov    -0x34(%rbp),%eax
add    $0x2,%eax
cmp    -0x8(%rbp),%eax
jge    14d3 <processArguments+0x343>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    0x2bd5(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x34(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1090 <atol@plt>
mov    %eax,%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2ba6(%rip),%rax
mov    (%rax),%rax
mov    0x2bb4(%rip),%rcx
cmp    (%rcx),%rax
jne    145d <processArguments+0x2cd>
mov    0x2b94(%rip),%rax
mov    (%rax),%edi
lea    0xc74(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2b6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
mov    0x2b64(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x34(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1090 <atol@plt>
mov    %eax,%ecx
mov    0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2b35(%rip),%rax
mov    (%rax),%rax
mov    0x2b43(%rip),%rcx
cmp    (%rcx),%rax
jne    14ce <processArguments+0x33e>
mov    0x2b23(%rip),%rax
mov    (%rax),%edi
lea    0xc23(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2afc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    14fb <processArguments+0x36b>
mov    0x2af6(%rip),%rax
mov    (%rax),%edi
lea    0xc17(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2acf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    17f0 <processArguments+0x660>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc1e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1646 <processArguments+0x4b6>
mov    -0x34(%rbp),%eax
add    $0x2,%eax
cmp    -0x8(%rbp),%eax
jge    1619 <processArguments+0x489>
mov    0x2a90(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x34(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10b0 <atoi@plt>
mov    %eax,%ecx
mov    0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2a61(%rip),%rax
mov    (%rax),%rax
mov    0x2a6f(%rip),%rcx
cmp    (%rcx),%rax
jne    15a2 <processArguments+0x412>
mov    0x2a4f(%rip),%rax
mov    (%rax),%edi
lea    0xb4f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2a28(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
mov    0x2a1f(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x34(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10b0 <atoi@plt>
mov    %eax,%ecx
mov    0x38(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    0x29ef(%rip),%rax
mov    (%rax),%rax
mov    0x29fd(%rip),%rcx
cmp    (%rcx),%rax
jne    1614 <processArguments+0x484>
mov    0x29dd(%rip),%rax
mov    (%rax),%edi
lea    0xadd(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x29b6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    1641 <processArguments+0x4b1>
mov    0x29b0(%rip),%rax
mov    (%rax),%edi
lea    0xb0b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2989(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    17eb <processArguments+0x65b>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb12(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    16ef <processArguments+0x55f>
mov    -0x34(%rbp),%eax
add    $0x2,%eax
cmp    -0x8(%rbp),%eax
jge    16c2 <processArguments+0x532>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x34(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atof@plt>
mov    0x40(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x34(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rcx
mov    0x48(%rbp),%rax
mov    %rcx,(%rax)
jmp    16ea <processArguments+0x55a>
mov    0x2907(%rip),%rax
mov    (%rax),%edi
lea    0xa9c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x28e0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    17e6 <processArguments+0x656>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xa93(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1720 <processArguments+0x590>
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
jmp    17e1 <processArguments+0x651>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xa65(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    17dc <processArguments+0x64c>
lea    0xa52(%rip),%rdi
lea    0xa1c(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    178c <processArguments+0x5fc>
mov    0x2865(%rip),%rax
mov    (%rax),%edi
lea    0xa2c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x283e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    1791 <processArguments+0x601>
mov    -0x40(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x41(%rbp)
movsbl %al,%eax
mov    0x2841(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     17cb <processArguments+0x63b>
mov    -0x41(%rbp),%al
mov    0x2814(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1060 <fputc@plt>
jmp    1791 <processArguments+0x601>
mov    0x27ee(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    17e1 <processArguments+0x651>
jmp    17e6 <processArguments+0x656>
jmp    17eb <processArguments+0x65b>
jmp    17f0 <processArguments+0x660>
jmp    17f5 <processArguments+0x665>
jmp    17fa <processArguments+0x66a>
jmp    17ff <processArguments+0x66f>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1245 <processArguments+0xb5>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     186b <processArguments+0x6db>
mov    0x20(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x7d2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1866 <processArguments+0x6d6>
jp     1866 <processArguments+0x6d6>
mov    0x278b(%rip),%rax
mov    (%rax),%edi
lea    0x96f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2764(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    186b <processArguments+0x6db>
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
je     18bf <processArguments+0x72f>
mov    0x28(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1892 <processArguments+0x702>
mov    0x30(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    18ba <processArguments+0x72a>
mov    0x2737(%rip),%rax
mov    (%rax),%edi
lea    0x939(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2710(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    18bf <processArguments+0x72f>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
je     1962 <processArguments+0x7d2>
mov    0x40(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x720(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1918 <processArguments+0x788>
jp     1918 <processArguments+0x788>
mov    0x26d9(%rip),%rax
mov    (%rax),%edi
lea    0x8fa(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x26b2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
mov    0x48(%rbp),%rax
mov    (%rax),%rdi
lea    0x896(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    195d <processArguments+0x7cd>
mov    0x2694(%rip),%rax
mov    (%rax),%edi
lea    0x8d4(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x266d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    196e <processArguments+0x7de>
jmp    1962 <processArguments+0x7d2>
mov    0x264f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processArguments>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
jne    11da <processArguments+0x4a>
mov    0x2e23(%rip),%rbp
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xe4a(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xe5b(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    165a <processArguments+0x4ca>
mov    %edi,%ebp
mov    %rdx,0x18(%rsp)
mov    %r9,0x20(%rsp)
mov    %rcx,0x10(%rsp)
mov    %r8,0x8(%rsp)
mov    0x60(%rsp),%rax
movslq %edi,%rcx
mov    -0x8(%rbx,%rcx,8),%rcx
mov    %rcx,(%rax)
jle    146b <processArguments+0x2db>
mov    0x88(%rsp),%r15
mov    $0x1,%r14d
mov    0x2dad(%rip),%r13
jmp    123d <processArguments+0xad>
mov    0x20(%rsp),%rax
movl   $0x0,(%rax)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    %ebp,%r14d
jge    146b <processArguments+0x2db>
movslq %r14d,%r12
mov    (%rbx,%r12,8),%rdi
lea    0xe01(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1300 <processArguments+0x170>
mov    (%rbx,%r12,8),%rdi
lea    0xe2c(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1350 <processArguments+0x1c0>
mov    (%rbx,%r12,8),%rdi
lea    0xe35(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1371 <processArguments+0x1e1>
mov    (%rbx,%r12,8),%rdi
lea    0xe97(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     13d6 <processArguments+0x246>
mov    (%rbx,%r12,8),%rdi
lea    0xeb8(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1426 <processArguments+0x296>
mov    (%rbx,%r12,8),%rdi
lea    0xec9(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     121d <processArguments+0x8d>
mov    (%rbx,%r12,8),%rdi
lea    0xeb3(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    1230 <processArguments+0xa0>
jmp    15da <processArguments+0x44a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r14d
cmp    %ebp,%r14d
jge    1515 <processArguments+0x385>
mov    0x18(%rsp),%rax
movl   $0x1,(%rax)
movq   $0x0,0x0(%r13)
movslq %r14d,%rax
mov    (%rbx,%rax,8),%rdi
xor    %esi,%esi
call   1040 <strtof@plt>
mov    0x70(%rsp),%rax
movss  %xmm0,(%rax)
mov    0x0(%r13),%rax
mov    0x2c9e(%rip),%rcx
cmp    (%rcx),%rax
jne    1230 <processArguments+0xa0>
jmp    152a <processArguments+0x39a>
add    $0x1,%r14d
cmp    %ebp,%r14d
jge    1574 <processArguments+0x3e4>
movslq %r14d,%rax
mov    (%rbx,%rax,8),%rax
mov    0x68(%rsp),%rcx
mov    %rax,(%rcx)
jmp    1230 <processArguments+0xa0>
add    $0x2,%r14d
cmp    %ebp,%r14d
jge    1589 <processArguments+0x3f9>
mov    0x10(%rsp),%rax
movl   $0x1,(%rax)
movq   $0x0,0x0(%r13)
mov    0x8(%rbx,%r12,8),%rdi
call   1090 <atol@plt>
mov    0x78(%rsp),%rcx
mov    %eax,(%rcx)
mov    0x2c37(%rip),%rax
cmpq   $0x0,(%rax)
je     159e <processArguments+0x40e>
movq   $0x0,0x0(%r13)
movslq %r14d,%rax
mov    (%rbx,%rax,8),%rdi
call   1090 <atol@plt>
mov    0x80(%rsp),%rcx
mov    %eax,(%rcx)
jmp    1230 <processArguments+0xa0>
add    $0x2,%r14d
cmp    %ebp,%r14d
jge    15b3 <processArguments+0x423>
movq   $0x0,0x0(%r13)
mov    0x8(%rbx,%r12,8),%rdi
call   10b0 <atoi@plt>
mov    %eax,(%r15)
mov    0x2be1(%rip),%rax
cmpq   $0x0,(%rax)
je     15c8 <processArguments+0x438>
movq   $0x0,0x0(%r13)
movslq %r14d,%rax
mov    (%rbx,%rax,8),%rdi
call   10b0 <atoi@plt>
mov    %eax,0x4(%r15)
jmp    1230 <processArguments+0xa0>
add    $0x2,%r14d
cmp    %ebp,%r14d
jge    1631 <processArguments+0x4a1>
mov    0x8(%rsp),%rax
movl   $0x1,(%rax)
mov    0x8(%rbx,%r12,8),%rdi
call   1030 <atof@plt>
mov    0x90(%rsp),%rax
movss  %xmm0,(%rax)
movslq %r14d,%rax
mov    (%rbx,%rax,8),%rax
mov    0x98(%rsp),%rcx
mov    %rax,(%rcx)
jmp    1230 <processArguments+0xa0>
mov    0x18(%rsp),%rax
cmpl   $0x0,(%rax)
je     149e <processArguments+0x30e>
mov    0x70(%rsp),%rax
movss  (%rax),%xmm0
ucomiss 0xb7b(%rip),%xmm0
jne    149e <processArguments+0x30e>
jp     149e <processArguments+0x30e>
mov    0x2b40(%rip),%rax
mov    (%rax),%edi
lea    0xd20(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
mov    0x10(%rsp),%rax
cmpl   $0x0,(%rax)
je     14bf <processArguments+0x32f>
mov    0x78(%rsp),%rax
cmpl   $0xffffffff,(%rax)
je     1500 <processArguments+0x370>
mov    0x80(%rsp),%rax
cmpl   $0xffffffff,(%rax)
je     1500 <processArguments+0x370>
mov    0x2af2(%rip),%rbp
mov    0x8(%rsp),%rax
cmpl   $0x0,(%rax)
je     1661 <processArguments+0x4d1>
mov    0x90(%rsp),%rax
movss  (%rax),%xmm0
ucomiss 0xb19(%rip),%xmm0
jne    153f <processArguments+0x3af>
jp     153f <processArguments+0x3af>
mov    0x2ade(%rip),%rax
mov    (%rax),%edi
lea    0xcfb(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
mov    0x2ac9(%rip),%rax
mov    (%rax),%edi
lea    0xcc7(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
mov    0x2ab4(%rip),%rax
mov    (%rax),%edi
lea    0xb49(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
mov    0x2a9f(%rip),%rax
mov    (%rax),%edi
lea    0xb15(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
mov    0x98(%rsp),%rax
mov    (%rax),%rdi
lea    0xc67(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    1661 <processArguments+0x4d1>
mov    0x2a6a(%rip),%rax
mov    (%rax),%edi
lea    0xca6(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
mov    0x2a55(%rip),%rax
mov    (%rax),%edi
lea    0xb0f(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
mov    0x2a40(%rip),%rax
mov    (%rax),%edi
lea    0xb5d(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
mov    0x2a2b(%rip),%rax
mov    (%rax),%edi
lea    0xb07(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
mov    0x2a16(%rip),%rax
mov    (%rax),%edi
lea    0xb6d(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
mov    0x2a01(%rip),%rax
mov    (%rax),%edi
lea    0xafd(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
lea    0xbb6(%rip),%rdi
lea    0xb80(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1643 <processArguments+0x4b3>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <fgetc@plt>
mov    0x29e4(%rip),%r14
mov    0x29b5(%rip),%rbp
cmp    (%r14),%al
je     1661 <processArguments+0x4d1>
mov    0x29b9(%rip),%r15
mov    (%r15),%esi
movsbl %al,%edi
call   1060 <fputc@plt>
mov    %rbx,%rdi
call   1050 <fgetc@plt>
cmp    (%r14),%al
jne    1617 <processArguments+0x487>
jmp    1661 <processArguments+0x4d1>
mov    0x2998(%rip),%rax
mov    (%rax),%edi
lea    0xb29(%rip),%rsi
jmp    1653 <processArguments+0x4c3>
mov    0x2986(%rip),%rax
mov    (%rax),%edi
lea    0xb49(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x295f(%rip),%rbp
mov    0x0(%rbp),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s [OPTIONS ...] [input.bmp]\0A\00"
@.str.1 = [35 x i8] c"Try %s -h for more detailed help.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"-t\00"
@errno = global i64 0
@ERANGE = global i64 0
@.str.3 = [31 x i8] c"Threshold value out of range.\0A\00"
@.str.4 = [34 x i8] c"No value for threshold provided.\0A\00"
@.str.5 = [3 x i8] c"-o\00"
@.str.6 = [31 x i8] c"No output file name provided.\0A\00"
@.str.7 = [3 x i8] c"-c\00"
@.str.8 = [32 x i8] c"Crop width value out of range.\0A\00"
@.str.9 = [33 x i8] c"Crop height value out of range.\0A\00"
@.str.10 = [55 x i8] c"Complete values for crop height & width not provided.\0A\00"
@.str.11 = [3 x i8] c"-s\00"
@.str.12 = [55 x i8] c"Complete values for crop start position not provided.\0A\00"
@.str.13 = [3 x i8] c"-r\00"
@.str.14 = [39 x i8] c"Resize scaling or type not specified.\0A\00"
@.str.15 = [3 x i8] c"-q\00"
@.str.16 = [3 x i8] c"-h\00"
@.str.17 = [5 x i8] c"help\00"
@.str.18 = [2 x i8] c"r\00"
@.str.19 = [29 x i8] c"Unable to access help data.\0A\00"
@EOF = global i8 0
@.str.20 = [30 x i8] c"No threshold value provided.\0A\00"
@.str.21 = [31 x i8] c"Crop dimensions not provided.\0A\00"
@.str.22 = [31 x i8] c"Scaling factor not specified.\0A\00"
@.str.23 = [1 x i8] zeroinitializer
@.str.24 = [28 x i8] c"Resize type not specified.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @processArguments(i32 %0, i8** %1, i32* %2, i32* %3, i32* %4, i32* %5, i8** %6, i8** %7, float* %8, i32* %9, i32* %10, i32* %11, float* %12, i8** %13) {
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8**
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca i8**
%23 = alloca i8**
%24 = alloca float*
%25 = alloca i32*
%26 = alloca i32*
%27 = alloca i32*
%28 = alloca float*
%29 = alloca i8**
%30 = alloca i32
%31 = alloca i32*
%32 = alloca i8
store i32 %0, i32* %16
store i8** %1, i8*** %17
store i32* %2, i32** %18
store i32* %3, i32** %19
store i32* %4, i32** %20
store i32* %5, i32** %21
store i8** %6, i8*** %22
store i8** %7, i8*** %23
store float* %8, float** %24
store i32* %9, i32** %25
store i32* %10, i32** %26
store i32* %11, i32** %27
store float* %12, float** %28
store i8** %13, i8*** %29
%33 = load i32, i32* %16
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %47
35: ; preds = %14
%36 = load i32, i32* @stderr
%37 = load i8**, i8*** %17
%38 = getelementptr inbounds i8*, i8** %37, i64 0
%39 = load i8*, i8** %38
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %39)
%41 = load i32, i32* @stderr
%42 = load i8**, i8*** %17
%43 = getelementptr inbounds i8*, i8** %42, i64 0
%44 = load i8*, i8** %43
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %44)
%46 = load i32, i32* @EXIT_FAILURE
store i32 %46, i32* %15
br label %368
47: ; preds = %14
%48 = load i8**, i8*** %17
%49 = load i32, i32* %16
%50 = sub nsw i32 %49, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %48, i64 %51
%53 = load i8*, i8** %52
%54 = load i8**, i8*** %22
store i8* %53, i8** %54
store i32 1, i32* %30
br label %55
55: ; preds = %309, %47
%56 = load i32, i32* %30
%57 = load i32, i32* %16
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %312
59: ; preds = %55
%60 = load i8**, i8*** %17
%61 = load i32, i32* %30
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8*, i8** %60, i64 %62
%64 = load i8*, i8** %63
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %95
67: ; preds = %59
%68 = load i32, i32* %30
%69 = add nsw i32 %68, 1
%70 = load i32, i32* %16
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %90
72: ; preds = %67
%73 = load i32*, i32** %18
store i32 1, i32* %73
store i64 0, i64* @errno
%74 = load i8**, i8*** %17
%75 = load i32, i32* %30
%76 = add nsw i32 %75, 1
store i32 %76, i32* %30
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8*, i8** %74, i64 %77
%79 = load i8*, i8** %78
%80 = call float @strtof(i8* %79, i32* null)
%81 = load float*, float** %24
store float %80, float* %81
%82 = load i64, i64* @errno
%83 = load i64, i64* @ERANGE
%84 = icmp eq i64 %82, %83
br i1 %84, label %85, label %89
85: ; preds = %72
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%88 = load i32, i32* @EXIT_FAILURE
store i32 %88, i32* %15
br label %368
89: ; preds = %72
br label %94
90: ; preds = %67
%91 = load i32, i32* @stderr
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%93 = load i32, i32* @EXIT_FAILURE
store i32 %93, i32* %15
br label %368
94: ; preds = %89
br label %308
95: ; preds = %59
%96 = load i8**, i8*** %17
%97 = load i32, i32* %30
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8*, i8** %96, i64 %98
%100 = load i8*, i8** %99
%101 = call i64 @strcmp(i8* %100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %121
103: ; preds = %95
%104 = load i32, i32* %30
%105 = add nsw i32 %104, 1
%106 = load i32, i32* %16
%107 = icmp slt i32 %105, %106
br i1 %107, label %108, label %116
108: ; preds = %103
%109 = load i8**, i8*** %17
%110 = load i32, i32* %30
%111 = add nsw i32 %110, 1
store i32 %111, i32* %30
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8*, i8** %109, i64 %112
%114 = load i8*, i8** %113
%115 = load i8**, i8*** %23
store i8* %114, i8** %115
br label %120
116: ; preds = %103
%117 = load i32, i32* @stderr
%118 = call i32 (i32, i8*, ...) @fprintf(i32 %117, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%119 = load i32, i32* @EXIT_FAILURE
store i32 %119, i32* %15
br label %368
120: ; preds = %108
br label %307
121: ; preds = %95
%122 = load i8**, i8*** %17
%123 = load i32, i32* %30
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i8*, i8** %122, i64 %124
%126 = load i8*, i8** %125
%127 = call i64 @strcmp(i8* %126, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%128 = icmp eq i64 %127, 0
br i1 %128, label %129, label %175
129: ; preds = %121
%130 = load i32, i32* %30
%131 = add nsw i32 %130, 2
%132 = load i32, i32* %16
%133 = icmp slt i32 %131, %132
br i1 %133, label %134, label %170
134: ; preds = %129
%135 = load i32*, i32** %19
store i32 1, i32* %135
store i64 0, i64* @errno
%136 = load i8**, i8*** %17
%137 = load i32, i32* %30
%138 = add nsw i32 %137, 1
store i32 %138, i32* %30
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8*, i8** %136, i64 %139
%141 = load i8*, i8** %140
%142 = call i64 @atol(i8* %141)
%143 = trunc i64 %142 to i32
%144 = load i32*, i32** %25
store i32 %143, i32* %144
%145 = load i64, i64* @errno
%146 = load i64, i64* @ERANGE
%147 = icmp eq i64 %145, %146
br i1 %147, label %148, label %152
148: ; preds = %134
%149 = load i32, i32* @stderr
%150 = call i32 (i32, i8*, ...) @fprintf(i32 %149, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
%151 = load i32, i32* @EXIT_FAILURE
store i32 %151, i32* %15
br label %368
152: ; preds = %134
store i64 0, i64* @errno
%153 = load i8**, i8*** %17
%154 = load i32, i32* %30
%155 = add nsw i32 %154, 1
store i32 %155, i32* %30
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds i8*, i8** %153, i64 %156
%158 = load i8*, i8** %157
%159 = call i64 @atol(i8* %158)
%160 = trunc i64 %159 to i32
%161 = load i32*, i32** %26
store i32 %160, i32* %161
%162 = load i64, i64* @errno
%163 = load i64, i64* @ERANGE
%164 = icmp eq i64 %162, %163
br i1 %164, label %165, label %169
165: ; preds = %152
%166 = load i32, i32* @stderr
%167 = call i32 (i32, i8*, ...) @fprintf(i32 %166, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%168 = load i32, i32* @EXIT_FAILURE
store i32 %168, i32* %15
br label %368
169: ; preds = %152
br label %174
170: ; preds = %129
%171 = load i32, i32* @stderr
%172 = call i32 (i32, i8*, ...) @fprintf(i32 %171, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0))
%173 = load i32, i32* @EXIT_FAILURE
store i32 %173, i32* %15
br label %368
174: ; preds = %169
br label %306
175: ; preds = %121
%176 = load i8**, i8*** %17
%177 = load i32, i32* %30
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i8*, i8** %176, i64 %178
%180 = load i8*, i8** %179
%181 = call i64 @strcmp(i8* %180, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%182 = icmp eq i64 %181, 0
br i1 %182, label %183, label %227
183: ; preds = %175
%184 = load i32, i32* %30
%185 = add nsw i32 %184, 2
%186 = load i32, i32* %16
%187 = icmp slt i32 %185, %186
br i1 %187, label %188, label %222
188: ; preds = %183
store i64 0, i64* @errno
%189 = load i8**, i8*** %17
%190 = load i32, i32* %30
%191 = add nsw i32 %190, 1
store i32 %191, i32* %30
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds i8*, i8** %189, i64 %192
%194 = load i8*, i8** %193
%195 = call i32 @atoi(i8* %194)
%196 = load i32*, i32** %27
store i32 %195, i32* %196
%197 = load i64, i64* @errno
%198 = load i64, i64* @ERANGE
%199 = icmp eq i64 %197, %198
br i1 %199, label %200, label %204
200: ; preds = %188
%201 = load i32, i32* @stderr
%202 = call i32 (i32, i8*, ...) @fprintf(i32 %201, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%203 = load i32, i32* @EXIT_FAILURE
store i32 %203, i32* %15
br label %368
204: ; preds = %188
store i64 0, i64* @errno
%205 = load i8**, i8*** %17
%206 = load i32, i32* %30
%207 = add nsw i32 %206, 1
store i32 %207, i32* %30
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds i8*, i8** %205, i64 %208
%210 = load i8*, i8** %209
%211 = call i32 @atoi(i8* %210)
%212 = load i32*, i32** %27
%213 = getelementptr inbounds i32, i32* %212, i64 1
store i32 %211, i32* %213
%214 = load i64, i64* @errno
%215 = load i64, i64* @ERANGE
%216 = icmp eq i64 %214, %215
br i1 %216, label %217, label %221
217: ; preds = %204
%218 = load i32, i32* @stderr
%219 = call i32 (i32, i8*, ...) @fprintf(i32 %218, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%220 = load i32, i32* @EXIT_FAILURE
store i32 %220, i32* %15
br label %368
221: ; preds = %204
br label %226
222: ; preds = %183
%223 = load i32, i32* @stderr
%224 = call i32 (i32, i8*, ...) @fprintf(i32 %223, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.12, i64 0, i64 0))
%225 = load i32, i32* @EXIT_FAILURE
store i32 %225, i32* %15
br label %368
226: ; preds = %221
br label %305
227: ; preds = %175
%228 = load i8**, i8*** %17
%229 = load i32, i32* %30
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds i8*, i8** %228, i64 %230
%232 = load i8*, i8** %231
%233 = call i64 @strcmp(i8* %232, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%234 = icmp eq i64 %233, 0
br i1 %234, label %235, label %262
235: ; preds = %227
%236 = load i32, i32* %30
%237 = add nsw i32 %236, 2
%238 = load i32, i32* %16
%239 = icmp slt i32 %237, %238
br i1 %239, label %240, label %257
240: ; preds = %235
%241 = load i32*, i32** %20
store i32 1, i32* %241
%242 = load i8**, i8*** %17
%243 = load i32, i32* %30
%244 = add nsw i32 %243, 1
store i32 %244, i32* %30
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds i8*, i8** %242, i64 %245
%247 = load i8*, i8** %246
%248 = call float @atof(i8* %247)
%249 = load float*, float** %28
store float %248, float* %249
%250 = load i8**, i8*** %17
%251 = load i32, i32* %30
%252 = add nsw i32 %251, 1
store i32 %252, i32* %30
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds i8*, i8** %250, i64 %253
%255 = load i8*, i8** %254
%256 = load i8**, i8*** %29
store i8* %255, i8** %256
br label %261
257: ; preds = %235
%258 = load i32, i32* @stderr
%259 = call i32 (i32, i8*, ...) @fprintf(i32 %258, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.14, i64 0, i64 0))
%260 = load i32, i32* @EXIT_FAILURE
store i32 %260, i32* %15
br label %368
261: ; preds = %240
br label %304
262: ; preds = %227
%263 = load i8**, i8*** %17
%264 = load i32, i32* %30
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds i8*, i8** %263, i64 %265
%267 = load i8*, i8** %266
%268 = call i64 @strcmp(i8* %267, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%269 = icmp eq i64 %268, 0
br i1 %269, label %270, label %272
270: ; preds = %262
%271 = load i32*, i32** %21
store i32 0, i32* %271
br label %303
272: ; preds = %262
%273 = load i8**, i8*** %17
%274 = load i32, i32* %30
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds i8*, i8** %273, i64 %275
%277 = load i8*, i8** %276
%278 = call i64 @strcmp(i8* %277, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%279 = icmp eq i64 %278, 0
br i1 %279, label %280, label %302
280: ; preds = %272
%281 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
store i32* %281, i32** %31
%282 = load i32*, i32** %31
%283 = icmp eq i32* %282, null
br i1 %283, label %284, label %288
284: ; preds = %280
%285 = load i32, i32* @stderr
%286 = call i32 (i32, i8*, ...) @fprintf(i32 %285, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.19, i64 0, i64 0))
%287 = load i32, i32* @EXIT_FAILURE
store i32 %287, i32* %15
br label %368
288: ; preds = %280
br label %289
289: ; preds = %296, %288
%290 = load i32*, i32** %31
%291 = call signext i8 @fgetc(i32* %290)
store i8 %291, i8* %32
%292 = sext i8 %291 to i32
%293 = load i8, i8* @EOF
%294 = sext i8 %293 to i32
%295 = icmp ne i32 %292, %294
br i1 %295, label %296, label %300
296: ; preds = %289
%297 = load i8, i8* %32
%298 = load i32, i32* @stderr
%299 = call i32 @fputc(i8 signext %297, i32 %298)
br label %289
300: ; preds = %289
%301 = load i32, i32* @EXIT_FAILURE
store i32 %301, i32* %15
br label %368
302: ; preds = %272
br label %303
303: ; preds = %302, %270
br label %304
304: ; preds = %303, %261
br label %305
305: ; preds = %304, %226
br label %306
306: ; preds = %305, %174
br label %307
307: ; preds = %306, %120
br label %308
308: ; preds = %307, %94
br label %309
309: ; preds = %308
%310 = load i32, i32* %30
%311 = add nsw i32 %310, 1
store i32 %311, i32* %30
br label %55
312: ; preds = %55
%313 = load i32*, i32** %18
%314 = load i32, i32* %313
%315 = icmp ne i32 %314, 0
br i1 %315, label %316, label %326
316: ; preds = %312
%317 = load float*, float** %24
%318 = load float, float* %317
%319 = fpext float %318 to double
%320 = fcmp oeq double %319, -1.000000e+00
br i1 %320, label %321, label %325
321: ; preds = %316
%322 = load i32, i32* @stderr
%323 = call i32 (i32, i8*, ...) @fprintf(i32 %322, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.20, i64 0, i64 0))
%324 = load i32, i32* @EXIT_FAILURE
store i32 %324, i32* %15
br label %368
325: ; preds = %316
br label %326
326: ; preds = %325, %312
%327 = load i32*, i32** %19
%328 = load i32, i32* %327
%329 = icmp ne i32 %328, 0
br i1 %329, label %330, label %343
330: ; preds = %326
%331 = load i32*, i32** %25
%332 = load i32, i32* %331
%333 = icmp eq i32 %332, -1
br i1 %333, label %338, label %334
334: ; preds = %330
%335 = load i32*, i32** %26
%336 = load i32, i32* %335
%337 = icmp eq i32 %336, -1
br i1 %337, label %338, label %342
338: ; preds = %334, %330
%339 = load i32, i32* @stderr
%340 = call i32 (i32, i8*, ...) @fprintf(i32 %339, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.21, i64 0, i64 0))
%341 = load i32, i32* @EXIT_FAILURE
store i32 %341, i32* %15
br label %368
342: ; preds = %334
br label %343
343: ; preds = %342, %326
%344 = load i32*, i32** %20
%345 = load i32, i32* %344
%346 = icmp ne i32 %345, 0
br i1 %346, label %347, label %366
347: ; preds = %343
%348 = load float*, float** %28
%349 = load float, float* %348
%350 = fpext float %349 to double
%351 = fcmp oeq double %350, -1.000000e+00
br i1 %351, label %352, label %356
352: ; preds = %347
%353 = load i32, i32* @stderr
%354 = call i32 (i32, i8*, ...) @fprintf(i32 %353, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.22, i64 0, i64 0))
%355 = load i32, i32* @EXIT_FAILURE
store i32 %355, i32* %15
br label %368
356: ; preds = %347
%357 = load i8**, i8*** %29
%358 = load i8*, i8** %357
%359 = call i64 @strcmp(i8* %358, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.23, i64 0, i64 0))
%360 = icmp eq i64 %359, 0
br i1 %360, label %361, label %365
361: ; preds = %356
%362 = load i32, i32* @stderr
%363 = call i32 (i32, i8*, ...) @fprintf(i32 %362, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.24, i64 0, i64 0))
%364 = load i32, i32* @EXIT_FAILURE
store i32 %364, i32* %15
br label %368
365: ; preds = %356
br label %366
366: ; preds = %365, %343
%367 = load i32, i32* @EXIT_SUCCESS
store i32 %367, i32* %15
br label %368
368: ; preds = %366, %361, %352, %338, %321, %300, %284, %257, %222, %217, %200, %170, %165, %148, %116, %90, %85, %35
%369 = load i32, i32* %15
ret i32 %369
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s [OPTIONS ...] [input.bmp]\0A\00"
@.str.1 = [35 x i8] c"Try %s -h for more detailed help.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"-t\00"
@errno = global i64 0
@ERANGE = global i64 0
@.str.3 = [31 x i8] c"Threshold value out of range.\0A\00"
@.str.4 = [34 x i8] c"No value for threshold provided.\0A\00"
@.str.5 = [3 x i8] c"-o\00"
@.str.6 = [31 x i8] c"No output file name provided.\0A\00"
@.str.7 = [3 x i8] c"-c\00"
@.str.8 = [32 x i8] c"Crop width value out of range.\0A\00"
@.str.9 = [33 x i8] c"Crop height value out of range.\0A\00"
@.str.10 = [55 x i8] c"Complete values for crop height & width not provided.\0A\00"
@.str.11 = [3 x i8] c"-s\00"
@.str.12 = [55 x i8] c"Complete values for crop start position not provided.\0A\00"
@.str.13 = [3 x i8] c"-r\00"
@.str.14 = [39 x i8] c"Resize scaling or type not specified.\0A\00"
@.str.15 = [3 x i8] c"-q\00"
@.str.16 = [3 x i8] c"-h\00"
@.str.17 = [5 x i8] c"help\00"
@.str.18 = [2 x i8] c"r\00"
@.str.19 = [29 x i8] c"Unable to access help data.\0A\00"
@EOF = global i8 0
@.str.20 = [30 x i8] c"No threshold value provided.\0A\00"
@.str.21 = [31 x i8] c"Crop dimensions not provided.\0A\00"
@.str.22 = [31 x i8] c"Scaling factor not specified.\0A\00"
@.str.23 = [1 x i8] zeroinitializer
@.str.24 = [28 x i8] c"Resize type not specified.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @processArguments(i32 %0, i8** nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture writeonly %5, i8** nocapture writeonly %6, i8** nocapture writeonly %7, float* nocapture %8, i32* nocapture %9, i32* nocapture %10, i32* nocapture writeonly %11, float* nocapture %12, i8** nocapture %13) {
%15 = icmp eq i32 %0, 1
br i1 %15, label %16, label %23
16: ; preds = %14
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %1
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %1
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %21)
br label %209
23: ; preds = %14
%24 = add nsw i32 %0, -1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %1, i64 %25
%27 = load i8*, i8** %26
store i8* %27, i8** %6
%28 = icmp sgt i32 %0, 1
br i1 %28, label %29, label %172
29: ; preds = %23
%30 = getelementptr inbounds i32, i32* %11, i64 1
br label %31
31: ; preds = %29, %168
%32 = phi i32 [ 1, %29 ], [ %170, %168 ]
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %1, i64 %33
%35 = load i8*, i8** %34
%36 = tail call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %55
38: ; preds = %31
%39 = add nsw i32 %32, 1
%40 = icmp slt i32 %39, %0
br i1 %40, label %41, label %52
41: ; preds = %38
store i32 1, i32* %2
store i64 0, i64* @errno
%42 = sext i32 %39 to i64
%43 = getelementptr inbounds i8*, i8** %1, i64 %42
%44 = load i8*, i8** %43
%45 = tail call float @strtof(i8* nocapture %44, i32* null)
store float %45, float* %8
%46 = load i64, i64* @errno
%47 = load i64, i64* @ERANGE
%48 = icmp eq i64 %46, %47
br i1 %48, label %49, label %168
49: ; preds = %41
%50 = load i32, i32* @stderr
%51 = tail call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %209
52: ; preds = %38
%53 = load i32, i32* @stderr
%54 = tail call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
br label %209
55: ; preds = %31
%56 = load i8*, i8** %34
%57 = tail call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %69
59: ; preds = %55
%60 = add nsw i32 %32, 1
%61 = icmp slt i32 %60, %0
br i1 %61, label %62, label %66
62: ; preds = %59
%63 = sext i32 %60 to i64
%64 = getelementptr inbounds i8*, i8** %1, i64 %63
%65 = load i8*, i8** %64
store i8* %65, i8** %7
br label %168
66: ; preds = %59
%67 = load i32, i32* @stderr
%68 = tail call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
br label %209
69: ; preds = %55
%70 = load i8*, i8** %34
%71 = tail call i64 @strcmp(i8* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %97
73: ; preds = %69
%74 = add nsw i32 %32, 2
%75 = icmp slt i32 %74, %0
br i1 %75, label %76, label %94
76: ; preds = %73
store i32 1, i32* %3
store i64 0, i64* @errno
%77 = add nsw i32 %32, 1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8*, i8** %1, i64 %78
%80 = load i8*, i8** %79
%81 = tail call i64 @atol(i8* %80)
%82 = trunc i64 %81 to i32
store i32 %82, i32* %9
%83 = load i64, i64* @ERANGE
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %76
%86 = load i32, i32* @stderr
%87 = tail call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
br label %209
88: ; preds = %76
store i64 0, i64* @errno
%89 = sext i32 %74 to i64
%90 = getelementptr inbounds i8*, i8** %1, i64 %89
%91 = load i8*, i8** %90
%92 = tail call i64 @atol(i8* %91)
%93 = trunc i64 %92 to i32
store i32 %93, i32* %10
br label %168
94: ; preds = %73
%95 = load i32, i32* @stderr
%96 = tail call i32 (i32, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0))
br label %209
97: ; preds = %69
%98 = load i8*, i8** %34
%99 = tail call i64 @strcmp(i8* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %123
101: ; preds = %97
%102 = add nsw i32 %32, 2
%103 = icmp slt i32 %102, %0
br i1 %103, label %104, label %120
104: ; preds = %101
store i64 0, i64* @errno
%105 = add nsw i32 %32, 1
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8*, i8** %1, i64 %106
%108 = load i8*, i8** %107
%109 = tail call i32 @atoi(i8* %108)
store i32 %109, i32* %11
%110 = load i64, i64* @ERANGE
%111 = icmp eq i64 %110, 0
br i1 %111, label %112, label %115
112: ; preds = %104
%113 = load i32, i32* @stderr
%114 = tail call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
br label %209
115: ; preds = %104
store i64 0, i64* @errno
%116 = sext i32 %102 to i64
%117 = getelementptr inbounds i8*, i8** %1, i64 %116
%118 = load i8*, i8** %117
%119 = tail call i32 @atoi(i8* %118)
store i32 %119, i32* %30
br label %168
120: ; preds = %101
%121 = load i32, i32* @stderr
%122 = tail call i32 (i32, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.12, i64 0, i64 0))
br label %209
123: ; preds = %97
%124 = load i8*, i8** %34
%125 = tail call i64 @strcmp(i8* %124, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%126 = icmp eq i64 %125, 0
br i1 %126, label %127, label %142
127: ; preds = %123
%128 = add nsw i32 %32, 2
%129 = icmp slt i32 %128, %0
br i1 %129, label %130, label %139
130: ; preds = %127
store i32 1, i32* %4
%131 = add nsw i32 %32, 1
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8*, i8** %1, i64 %132
%134 = load i8*, i8** %133
%135 = tail call float @atof(i8* %134)
store float %135, float* %12
%136 = sext i32 %128 to i64
%137 = getelementptr inbounds i8*, i8** %1, i64 %136
%138 = load i8*, i8** %137
store i8* %138, i8** %13
br label %168
139: ; preds = %127
%140 = load i32, i32* @stderr
%141 = tail call i32 (i32, i8*, ...) @fprintf(i32 %140, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.14, i64 0, i64 0))
br label %209
142: ; preds = %123
%143 = load i8*, i8** %34
%144 = tail call i64 @strcmp(i8* %143, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%145 = icmp eq i64 %144, 0
br i1 %145, label %146, label %147
146: ; preds = %142
store i32 0, i32* %5
br label %168
147: ; preds = %142
%148 = load i8*, i8** %34
%149 = tail call i64 @strcmp(i8* %148, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%150 = icmp eq i64 %149, 0
br i1 %150, label %151, label %168
151: ; preds = %147
%152 = tail call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%153 = icmp eq i32* %152, null
br i1 %153, label %158, label %154
154: ; preds = %151
%155 = tail call signext i8 @fgetc(i32* %152)
%156 = load i8, i8* @EOF
%157 = icmp eq i8 %155, %156
br i1 %157, label %209, label %161
158: ; preds = %151
%159 = load i32, i32* @stderr
%160 = tail call i32 (i32, i8*, ...) @fprintf(i32 %159, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.19, i64 0, i64 0))
br label %209
161: ; preds = %154, %161
%162 = phi i8 [ %165, %161 ], [ %155, %154 ]
%163 = load i32, i32* @stderr
%164 = tail call i32 @fputc(i8 signext %162, i32 %163)
%165 = tail call signext i8 @fgetc(i32* %152)
%166 = load i8, i8* @EOF
%167 = icmp eq i8 %165, %166
br i1 %167, label %209, label %161
168: ; preds = %115, %88, %41, %130, %147, %146, %62
%169 = phi i32 [ %39, %41 ], [ %60, %62 ], [ %74, %88 ], [ %102, %115 ], [ %128, %130 ], [ %32, %146 ], [ %32, %147 ]
%170 = add nsw i32 %169, 1
%171 = icmp slt i32 %170, %0
br i1 %171, label %31, label %172
172: ; preds = %168, %23
%173 = load i32, i32* %2
%174 = icmp eq i32 %173, 0
br i1 %174, label %181, label %175
175: ; preds = %172
%176 = load float, float* %8
%177 = fcmp oeq float %176, -1.000000e+00
br i1 %177, label %178, label %181
178: ; preds = %175
%179 = load i32, i32* @stderr
%180 = tail call i32 (i32, i8*, ...) @fprintf(i32 %179, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.20, i64 0, i64 0))
br label %209
181: ; preds = %175, %172
%182 = load i32, i32* %3
%183 = icmp eq i32 %182, 0
br i1 %183, label %193, label %184
184: ; preds = %181
%185 = load i32, i32* %9
%186 = icmp eq i32 %185, -1
br i1 %186, label %190, label %187
187: ; preds = %184
%188 = load i32, i32* %10
%189 = icmp eq i32 %188, -1
br i1 %189, label %190, label %193
190: ; preds = %187, %184
%191 = load i32, i32* @stderr
%192 = tail call i32 (i32, i8*, ...) @fprintf(i32 %191, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.21, i64 0, i64 0))
br label %209
193: ; preds = %187, %181
%194 = load i32, i32* %4
%195 = icmp eq i32 %194, 0
br i1 %195, label %209, label %196
196: ; preds = %193
%197 = load float, float* %12
%198 = fcmp oeq float %197, -1.000000e+00
br i1 %198, label %199, label %202
199: ; preds = %196
%200 = load i32, i32* @stderr
%201 = tail call i32 (i32, i8*, ...) @fprintf(i32 %200, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.22, i64 0, i64 0))
br label %209
202: ; preds = %196
%203 = load i8*, i8** %13
%204 = tail call i64 @strcmp(i8* %203, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.23, i64 0, i64 0))
%205 = icmp eq i64 %204, 0
br i1 %205, label %206, label %209
206: ; preds = %202
%207 = load i32, i32* @stderr
%208 = tail call i32 (i32, i8*, ...) @fprintf(i32 %207, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.24, i64 0, i64 0))
br label %209
209: ; preds = %161, %154, %193, %202, %158, %139, %120, %112, %94, %85, %66, %52, %49, %206, %199, %190, %178, %16
%210 = phi i32* [ @EXIT_FAILURE, %16 ], [ @EXIT_FAILURE, %178 ], [ @EXIT_FAILURE, %190 ], [ @EXIT_FAILURE, %199 ], [ @EXIT_FAILURE, %206 ], [ @EXIT_FAILURE, %139 ], [ @EXIT_FAILURE, %120 ], [ @EXIT_FAILURE, %112 ], [ @EXIT_FAILURE, %94 ], [ @EXIT_FAILURE, %85 ], [ @EXIT_FAILURE, %66 ], [ @EXIT_FAILURE, %52 ], [ @EXIT_FAILURE, %49 ], [ @EXIT_FAILURE, %158 ], [ @EXIT_SUCCESS, %202 ], [ @EXIT_SUCCESS, %193 ], [ @EXIT_FAILURE, %154 ], [ @EXIT_FAILURE, %161 ]
%211 = load i32, i32* %210
ret i32 %211
}