#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ isdigit(char);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char **argv) {
  int i;
  char sn[11];
  char assy[3];
  char rev[3];
  if ((argc != 8) || ((argc != 8) && strcmp(argv[1], "?"))) {
    printf("Usage:\n");
    printf("    Decodes one line from the eSeries \"show version\" CLI command "
           "output.\n");
    printf("    Determines if the LM-10 is a CR card or not, and if it is a "
           "SEL fixed card or not.\n");
    printf("    Also gets the sn and does some sanity checks.\n");
    printf("    Example input:\n");
    printf("        selCrChecker-v1.exe 0      LM-10     4307327561   "
           "4500009501     A05      1024       1.5\n");
    printf("    Example output:\n");
    printf("        sn4307327561 noCr noSelFix\n");
    printf("    Explanation:\n");
    printf("        For    CR cards (4500009501),  A12 or greater is a SEL "
           "fixed card.\n");
    printf("        For nonCR cards (4500009504),  A02 or greater is a SEL "
           "fixed card.\n");
    printf("            ^^^                   ^     ^\n");
    printf("    (refer to KA38052 and KA36085)\n");
    printf("    Written by Jonathan Natale for Juniper Networks on "
           "11-Feb-2011.\n");
    return (1);
  }
  for (i = 1; i <= 7; i++) {
    if (strlen(argv[i]) > 10) {
      printf("Sorry, %s is too long (should be less then 11 chars).\n",
             argv[i]);
      printf("Please try again.  Exiting ...\n");
      return (2);
    }
  }
  if (strlen(argv[1]) > 2) {
    printf("Sorry, %s is too long (should be less then 3 chars).\n", argv[1]);
    printf("Please try again.  Exiting ...\n");
    return (3);
  }
  if (atoi(argv[1]) > 16 || atoi(argv[1]) < 0) {
    printf(
        "Sorry, %s is out of range (should be between 0 and 16, inclusive).\n",
        argv[1]);
    printf("Please try again.  Exiting ...\n");
    return (4);
  }
  if (strcmp(argv[2], "LM-10")) {
    printf("Sorry, %s is wrong type (should be \"LM-10\").\n", argv[2]);
    printf("Please try again.  Exiting ...\n");
    return (5);
  }
  if (strlen(argv[3]) != 10) {
    printf("Sorry, %s is the wrong number of digits (should be 10).\n",
           argv[3]);
    printf("Please try again.  Exiting ...\n");
    return (6);
  }
  for (i = 0; i < 10; i++) {
    if (!isdigit(argv[3][i])) {
      printf("Sorry, %s is invalid (should be decimal).\n", argv[3]);
      printf("Please try again.  Exiting ...\n");
      return (7);
    }
  }
  if (strcmp(argv[4], "4500009501") && strcmp(argv[4], "4500009504")) {
    printf("Sorry, %s is invalid (should either \"4500009501\" or "
           "\"4500009504\").\n",
           argv[4]);
    printf("Please try again.  Exiting ...\n");
    return (8);
  }
  if (strlen(argv[5]) != 3) {
    printf("Sorry, %s is the wrong number of digits (should be 3).\n", argv[5]);
    printf("Please try again.  Exiting ...\n");
    return (9);
  }
  if (argv[5][0] != 'A') {
    printf("Sorry, %s is wrong (should start with an A).\n", argv[5]);
    printf("Please try again.  Exiting ...\n");
    return (10);
  }
  for (i = 1; i < 3; i++) {
    if (!isdigit(argv[5][i])) {
      printf("Sorry, %s is invalid (should have 2 trailing decimal digits).\n",
             argv[5]);
      printf("Please try again.  Exiting ...\n");
      return (11);
    }
  }
  strcpy(sn, argv[3]);
  assy[0] = argv[4][8];
  assy[1] = argv[4][9];
  assy[2] = '\0';
  rev[0] = argv[5][1];
  rev[1] = argv[5][2];
  rev[2] = '\0';
  if (!strcmp(assy, "01")) {
    if (atoi(rev) < 12) {
      printf("%s noCr noSelFix\n", sn);
    } else {
      printf("%s noCr selFix\n", sn);
    }
  }
  if (!strcmp(assy, "04")) {
    if (atoi(rev) < 2) {
      printf("%s cr noSelFix\n", sn);
    } else {
      printf("%s cr selFix\n", sn);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x8,-0x8(%rbp)
jne    11a8 <main+0x48>
cmpl   $0x8,-0x8(%rbp)
je     1278 <main+0x118>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe67(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1278 <main+0x118>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf52(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf59(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf6f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf73(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xfb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xfef(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x100c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x1022(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1706 <main+0x5a6>
movl   $0x1,-0x14(%rbp)
cmpl   $0x7,-0x14(%rbp)
jg     12ea <main+0x18a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
cmp    $0xa,%eax
jle    12d7 <main+0x177>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0x1016(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x103f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1706 <main+0x5a6>
jmp    12dc <main+0x17c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    127f <main+0x11f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <strlen@plt>
cmp    $0x2,%eax
jle    1330 <main+0x1d0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0x1014(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xfe6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x3,-0x4(%rbp)
jmp    1706 <main+0x5a6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
cmp    $0x10,%eax
jg     135c <main+0x1fc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
cmp    $0x0,%eax
jge    138c <main+0x22c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xfee(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf8a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x4,-0x4(%rbp)
jmp    1706 <main+0x5a6>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0x1002(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     13da <main+0x27a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xfea(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf3c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x5,-0x4(%rbp)
jmp    1706 <main+0x5a6>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <strlen@plt>
cmp    $0xa,%eax
je     1420 <main+0x2c0>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xfd2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x6,-0x4(%rbp)
jmp    1706 <main+0x5a6>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1492 <main+0x332>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    147f <main+0x31f>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xfac(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x7,-0x4(%rbp)
jmp    1706 <main+0x5a6>
jmp    1484 <main+0x324>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1427 <main+0x2c7>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xf94(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     14fe <main+0x39e>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xf81(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     14fe <main+0x39e>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
lea    0xf6e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x8,-0x4(%rbp)
jmp    1706 <main+0x5a6>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1050 <strlen@plt>
cmp    $0x3,%eax
je     1544 <main+0x3e4>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rsi
lea    0xf6c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x9,-0x4(%rbp)
jmp    1706 <main+0x5a6>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
je     1588 <main+0x428>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rsi
lea    0xf60(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd8e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xa,-0x4(%rbp)
jmp    1706 <main+0x5a6>
movl   $0x1,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    15fa <main+0x49a>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    15e7 <main+0x487>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rsi
lea    0xf2f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xb,-0x4(%rbp)
jmp    1706 <main+0x5a6>
jmp    15ec <main+0x48c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    158f <main+0x42f>
lea    -0x1f(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    0x8(%rax),%al
mov    %al,-0x22(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    0x9(%rax),%al
mov    %al,-0x21(%rbp)
movb   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    0x1(%rax),%al
mov    %al,-0x25(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    0x2(%rax),%al
mov    %al,-0x24(%rbp)
movb   $0x0,-0x23(%rbp)
lea    -0x22(%rbp),%rdi
lea    0xde7(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    16a5 <main+0x545>
lea    -0x25(%rbp),%rdi
call   1080 <atoi@plt>
cmp    $0xc,%eax
jge    168e <main+0x52e>
lea    -0x1f(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    16a0 <main+0x540>
lea    -0x1f(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    16a5 <main+0x545>
lea    -0x22(%rbp),%rdi
lea    0xd98(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    16ff <main+0x59f>
lea    -0x25(%rbp),%rdi
call   1080 <atoi@plt>
cmp    $0x2,%eax
jge    16e8 <main+0x588>
lea    -0x1f(%rbp),%rsi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    16fa <main+0x59a>
lea    -0x1f(%rbp),%rsi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    16ff <main+0x59f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
cmp    $0x8,%edi
jne    1234 <main+0xc4>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1060 <strlen@plt>
mov    $0x1,%ecx
cmp    $0xa,%eax
jg     120c <main+0x9c>
mov    0x10(%rbx),%rdi
call   1060 <strlen@plt>
mov    $0x2,%ecx
cmp    $0xa,%eax
jg     120c <main+0x9c>
mov    0x18(%rbx),%rdi
call   1060 <strlen@plt>
mov    $0x3,%ecx
cmp    $0xa,%eax
jg     120c <main+0x9c>
mov    0x20(%rbx),%rdi
call   1060 <strlen@plt>
mov    $0x4,%ecx
cmp    $0xa,%eax
jg     120c <main+0x9c>
mov    0x28(%rbx),%rdi
call   1060 <strlen@plt>
mov    $0x5,%ecx
cmp    $0xa,%eax
jg     120c <main+0x9c>
mov    0x30(%rbx),%rdi
call   1060 <strlen@plt>
mov    $0x6,%ecx
cmp    $0xa,%eax
jg     120c <main+0x9c>
mov    0x38(%rbx),%rdi
call   1060 <strlen@plt>
mov    $0x7,%ecx
cmp    $0xa,%eax
jle    12eb <main+0x17b>
mov    (%rbx,%rcx,8),%rsi
lea    0xde9(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x1063(%rip),%rdi
call   1050 <puts@plt>
mov    $0x2,%ebx
jmp    12e1 <main+0x171>
lea    0x106c(%rip),%rdi
call   1050 <puts@plt>
lea    0x1067(%rip),%rdi
call   1050 <puts@plt>
lea    0x10a4(%rip),%rdi
call   1050 <puts@plt>
lea    0x10ef(%rip),%rdi
call   1050 <puts@plt>
lea    0x1115(%rip),%rdi
call   1050 <puts@plt>
lea    0x111c(%rip),%rdi
call   1050 <puts@plt>
lea    0x1171(%rip),%rdi
call   1050 <puts@plt>
lea    0x1179(%rip),%rdi
call   1050 <puts@plt>
lea    0x1190(%rip),%rdi
call   1050 <puts@plt>
lea    0x1195(%rip),%rdi
call   1050 <puts@plt>
lea    0x11d4(%rip),%rdi
call   1050 <puts@plt>
lea    0x1213(%rip),%rdi
call   1050 <puts@plt>
lea    0x1231(%rip),%rdi
call   1050 <puts@plt>
lea    0x1248(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
mov    0x8(%rbx),%rdi
call   1060 <strlen@plt>
mov    0x8(%rbx),%r14
cmp    $0x3,%eax
jl     1321 <main+0x1b1>
lea    0xd33(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xf73(%rip),%rdi
call   1050 <puts@plt>
mov    $0x3,%ebx
jmp    12e1 <main+0x171>
mov    %r14,%rdi
call   1090 <atoi@plt>
cmp    $0x11,%eax
jb     1352 <main+0x1e2>
lea    0xd38(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xf42(%rip),%rdi
call   1050 <puts@plt>
mov    $0x4,%ebx
jmp    12e1 <main+0x171>
mov    0x10(%rbx),%rdi
lea    0xd54(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     138f <main+0x21f>
mov    0x10(%rbx),%rsi
lea    0xd45(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xf08(%rip),%rdi
call   1050 <puts@plt>
mov    $0x5,%ebx
jmp    12e1 <main+0x171>
mov    0x18(%rbx),%rdi
call   1060 <strlen@plt>
mov    0x18(%rbx),%rsi
cmp    $0xa,%eax
jne    14c4 <main+0x354>
movsbl (%rsi),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     14e8 <main+0x378>
mov    0x18(%rbx),%rax
movsbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     14e8 <main+0x378>
mov    0x18(%rbx),%rax
movsbl 0x2(%rax),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     14e8 <main+0x378>
mov    0x18(%rbx),%rax
movsbl 0x3(%rax),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     14e8 <main+0x378>
mov    0x18(%rbx),%rax
movsbl 0x4(%rax),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     14e8 <main+0x378>
mov    0x18(%rbx),%rax
movsbl 0x5(%rax),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     14e8 <main+0x378>
mov    0x18(%rbx),%rax
movsbl 0x6(%rax),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     14e8 <main+0x378>
mov    0x18(%rbx),%rax
movsbl 0x7(%rax),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     14e8 <main+0x378>
mov    0x18(%rbx),%rax
movsbl 0x8(%rax),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     14e8 <main+0x378>
mov    0x18(%rbx),%rax
movsbl 0x9(%rax),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     14e8 <main+0x378>
mov    0x20(%rbx),%rdi
lea    0xcd0(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1510 <main+0x3a0>
mov    0x20(%rbx),%rdi
lea    0xcc2(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1510 <main+0x3a0>
mov    0x20(%rbx),%rsi
lea    0xcb8(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdd3(%rip),%rdi
call   1050 <puts@plt>
mov    $0x8,%ebx
jmp    12e1 <main+0x171>
lea    0xc1a(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdaf(%rip),%rdi
call   1050 <puts@plt>
mov    $0x6,%ebx
jmp    12e1 <main+0x171>
mov    0x18(%rbx),%rsi
lea    0xc2b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd87(%rip),%rdi
call   1050 <puts@plt>
mov    $0x7,%ebx
jmp    12e1 <main+0x171>
mov    0x28(%rbx),%rdi
call   1060 <strlen@plt>
mov    0x28(%rbx),%rsi
cmp    $0x3,%eax
jne    1606 <main+0x496>
cmpb   $0x41,(%rsi)
jne    162a <main+0x4ba>
movsbl 0x1(%rsi),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     164e <main+0x4de>
mov    0x28(%rbx),%rax
movsbl 0x2(%rax),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     164e <main+0x4de>
mov    0x18(%rbx),%rsi
lea    0xd(%rsp),%rdi
call   1040 <strcpy@plt>
mov    0x20(%rbx),%rax
mov    0x8(%rax),%cl
mov    %cl,0xa(%rsp)
mov    0x9(%rax),%al
mov    %al,0xb(%rsp)
movb   $0x0,0xc(%rsp)
mov    0x28(%rbx),%rax
mov    0x1(%rax),%cl
mov    %cl,0x7(%rsp)
mov    0x2(%rax),%al
mov    %al,0x8(%rsp)
movb   $0x0,0x9(%rsp)
lea    0xbb9(%rip),%rsi
lea    0xa(%rsp),%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    15d2 <main+0x462>
lea    0x7(%rsp),%rdi
call   1090 <atoi@plt>
cmp    $0xc,%eax
lea    0xc8d(%rip),%rax
lea    0xc98(%rip),%rdi
cmovl  %rax,%rdi
lea    0xd(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb83(%rip),%rsi
lea    0xa(%rsp),%rdi
call   1080 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    12e1 <main+0x171>
lea    0x7(%rsp),%rdi
call   1090 <atoi@plt>
cmp    $0x1,%eax
jg     1676 <main+0x506>
lea    0xc66(%rip),%rdi
jmp    167d <main+0x50d>
lea    0xb96(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc6d(%rip),%rdi
call   1050 <puts@plt>
mov    $0x9,%ebx
jmp    12e1 <main+0x171>
lea    0xbaa(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc49(%rip),%rdi
call   1050 <puts@plt>
mov    $0xa,%ebx
jmp    12e1 <main+0x171>
mov    0x28(%rbx),%rsi
lea    0xbb0(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc21(%rip),%rdi
call   1050 <puts@plt>
mov    $0xb,%ebx
jmp    12e1 <main+0x171>
lea    0xbfd(%rip),%rdi
xor    %ebx,%ebx
lea    0xd(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    12e1 <main+0x171>

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
@.str.1 = [8 x i8] c"Usage:\0A\00"
@.str.2 = [74 x i8] c" Decodes one line from the eSeries \22show version\22 CLI command output.\0A\00"
@.str.3 = [88 x i8] c" Determines if the LM-10 is a CR card or not, and if it is a SEL fixed card or not.\0A\00"
@.str.4 = [51 x i8] c" Also gets the sn and does some sanity checks.\0A\00"
@.str.5 = [20 x i8] c" Example input:\0A\00"
@.str.6 = [98 x i8] c" selCrChecker-v1.exe 0 LM-10 4307327561 4500009501 A05 1024 1.5\0A\00"
@.str.7 = [21 x i8] c" Example output:\0A\00"
@.str.8 = [36 x i8] c" sn4307327561 noCr noSelFix\0A\00"
@.str.9 = [18 x i8] c" Explanation:\0A\00"
@.str.10 = [76 x i8] c" For CR cards (4500009501), A12 or greater is a SEL fixed card.\0A\00"
@.str.11 = [76 x i8] c" For nonCR cards (4500009504), A02 or greater is a SEL fixed card.\0A\00"
@.str.12 = [43 x i8] c" ^^^ ^ ^\0A\00"
@.str.13 = [36 x i8] c" (refer to KA38052 and KA36085)\0A\00"
@.str.14 = [69 x i8] c" Written by Jonathan Natale for Juniper Networks on 11-Feb-2011.\0A\00"
@.str.15 = [55 x i8] c"Sorry, %s is too long (should be less then 11 chars).\0A\00"
@.str.16 = [32 x i8] c"Please try again. Exiting ...\0A\00"
@.str.17 = [54 x i8] c"Sorry, %s is too long (should be less then 3 chars).\0A\00"
@.str.18 = [68 x i8] c"Sorry, %s is out of range (should be between 0 and 16, inclusive).\0A\00"
@.str.19 = [6 x i8] c"LM-10\00"
@.str.20 = [46 x i8] c"Sorry, %s is wrong type (should be \22LM-10\22).\0A\00"
@.str.21 = [57 x i8] c"Sorry, %s is the wrong number of digits (should be 10).\0A\00"
@.str.22 = [43 x i8] c"Sorry, %s is invalid (should be decimal).\0A\00"
@.str.23 = [11 x i8] c"4500009501\00"
@.str.24 = [11 x i8] c"4500009504\00"
@.str.25 = [68 x i8] c"Sorry, %s is invalid (should either \224500009501\22 or \224500009504\22).\0A\00"
@.str.26 = [56 x i8] c"Sorry, %s is the wrong number of digits (should be 3).\0A\00"
@.str.27 = [46 x i8] c"Sorry, %s is wrong (should start with an A).\0A\00"
@.str.28 = [63 x i8] c"Sorry, %s is invalid (should have 2 trailing decimal digits).\0A\00"
@.str.29 = [3 x i8] c"01\00"
@.str.30 = [18 x i8] c"%s noCr noSelFix\0A\00"
@.str.31 = [16 x i8] c"%s noCr selFix\0A\00"
@.str.32 = [3 x i8] c"04\00"
@.str.33 = [16 x i8] c"%s cr noSelFix\0A\00"
@.str.34 = [14 x i8] c"%s cr selFix\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [11 x i8]
%8 = alloca [3 x i8]
%9 = alloca [3 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 8
br i1 %11, label %21, label %12
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 8
br i1 %14, label %15, label %36
15: ; preds = %12
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %36
21: ; preds = %15, %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.3, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.6, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.10, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.11, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.14, i64 0, i64 0))
store i32 1, i32* %3
br label %268
36: ; preds = %15, %12
store i32 1, i32* %6
br label %37
37: ; preds = %57, %36
%38 = load i32, i32* %6
%39 = icmp sle i32 %38, 7
br i1 %39, label %40, label %60
40: ; preds = %37
%41 = load i8**, i8*** %5
%42 = load i32, i32* %6
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %41, i64 %43
%45 = load i8*, i8** %44
%46 = call i32 @strlen(i8* %45)
%47 = icmp sgt i32 %46, 10
br i1 %47, label %48, label %56
48: ; preds = %40
%49 = load i8**, i8*** %5
%50 = load i32, i32* %6
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
%53 = load i8*, i8** %52
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.15, i64 0, i64 0), i8* %53)
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
store i32 2, i32* %3
br label %268
56: ; preds = %40
br label %57
57: ; preds = %56
%58 = load i32, i32* %6
%59 = add nsw i32 %58, 1
store i32 %59, i32* %6
br label %37
60: ; preds = %37
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 1
%63 = load i8*, i8** %62
%64 = call i32 @strlen(i8* %63)
%65 = icmp sgt i32 %64, 2
br i1 %65, label %66, label %72
66: ; preds = %60
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 1
%69 = load i8*, i8** %68
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.17, i64 0, i64 0), i8* %69)
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
store i32 3, i32* %3
br label %268
72: ; preds = %60
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 1
%75 = load i8*, i8** %74
%76 = call i32 @atoi(i8* %75)
%77 = icmp sgt i32 %76, 16
br i1 %77, label %84, label %78
78: ; preds = %72
%79 = load i8**, i8*** %5
%80 = getelementptr inbounds i8*, i8** %79, i64 1
%81 = load i8*, i8** %80
%82 = call i32 @atoi(i8* %81)
%83 = icmp slt i32 %82, 0
br i1 %83, label %84, label %90
84: ; preds = %78, %72
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 1
%87 = load i8*, i8** %86
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.18, i64 0, i64 0), i8* %87)
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
store i32 4, i32* %3
br label %268
90: ; preds = %78
%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 ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %102
96: ; preds = %90
%97 = load i8**, i8*** %5
%98 = getelementptr inbounds i8*, i8** %97, i64 2
%99 = load i8*, i8** %98
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.20, i64 0, i64 0), i8* %99)
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
store i32 5, i32* %3
br label %268
102: ; preds = %90
%103 = load i8**, i8*** %5
%104 = getelementptr inbounds i8*, i8** %103, i64 3
%105 = load i8*, i8** %104
%106 = call i32 @strlen(i8* %105)
%107 = icmp ne i32 %106, 10
br i1 %107, label %108, label %114
108: ; preds = %102
%109 = load i8**, i8*** %5
%110 = getelementptr inbounds i8*, i8** %109, i64 3
%111 = load i8*, i8** %110
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.21, i64 0, i64 0), i8* %111)
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
store i32 6, i32* %3
br label %268
114: ; preds = %102
store i32 0, i32* %6
br label %115
115: ; preds = %135, %114
%116 = load i32, i32* %6
%117 = icmp slt i32 %116, 10
br i1 %117, label %118, label %138
118: ; preds = %115
%119 = load i8**, i8*** %5
%120 = getelementptr inbounds i8*, i8** %119, i64 3
%121 = load i8*, i8** %120
%122 = load i32, i32* %6
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i8, i8* %121, i64 %123
%125 = load i8, i8* %124
%126 = call i32 @isdigit(i8 signext %125)
%127 = icmp ne i32 %126, 0
br i1 %127, label %134, label %128
128: ; preds = %118
%129 = load i8**, i8*** %5
%130 = getelementptr inbounds i8*, i8** %129, i64 3
%131 = load i8*, i8** %130
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.22, i64 0, i64 0), i8* %131)
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
store i32 7, i32* %3
br label %268
134: ; preds = %118
br label %135
135: ; preds = %134
%136 = load i32, i32* %6
%137 = add nsw i32 %136, 1
store i32 %137, i32* %6
br label %115
138: ; preds = %115
%139 = load i8**, i8*** %5
%140 = getelementptr inbounds i8*, i8** %139, i64 4
%141 = load i8*, i8** %140
%142 = call i64 @strcmp(i8* %141, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.23, i64 0, i64 0))
%143 = icmp ne i64 %142, 0
br i1 %143, label %144, label %156
144: ; preds = %138
%145 = load i8**, i8*** %5
%146 = getelementptr inbounds i8*, i8** %145, i64 4
%147 = load i8*, i8** %146
%148 = call i64 @strcmp(i8* %147, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i64 0, i64 0))
%149 = icmp ne i64 %148, 0
br i1 %149, label %150, label %156
150: ; preds = %144
%151 = load i8**, i8*** %5
%152 = getelementptr inbounds i8*, i8** %151, i64 4
%153 = load i8*, i8** %152
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.25, i64 0, i64 0), i8* %153)
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
store i32 8, i32* %3
br label %268
156: ; preds = %144, %138
%157 = load i8**, i8*** %5
%158 = getelementptr inbounds i8*, i8** %157, i64 5
%159 = load i8*, i8** %158
%160 = call i32 @strlen(i8* %159)
%161 = icmp ne i32 %160, 3
br i1 %161, label %162, label %168
162: ; preds = %156
%163 = load i8**, i8*** %5
%164 = getelementptr inbounds i8*, i8** %163, i64 5
%165 = load i8*, i8** %164
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.26, i64 0, i64 0), i8* %165)
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
store i32 9, i32* %3
br label %268
168: ; preds = %156
%169 = load i8**, i8*** %5
%170 = getelementptr inbounds i8*, i8** %169, i64 5
%171 = load i8*, i8** %170
%172 = getelementptr inbounds i8, i8* %171, i64 0
%173 = load i8, i8* %172
%174 = sext i8 %173 to i32
%175 = icmp ne i32 %174, 65
br i1 %175, label %176, label %182
176: ; preds = %168
%177 = load i8**, i8*** %5
%178 = getelementptr inbounds i8*, i8** %177, i64 5
%179 = load i8*, i8** %178
%180 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.27, i64 0, i64 0), i8* %179)
%181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
store i32 10, i32* %3
br label %268
182: ; preds = %168
store i32 1, i32* %6
br label %183
183: ; preds = %203, %182
%184 = load i32, i32* %6
%185 = icmp slt i32 %184, 3
br i1 %185, label %186, label %206
186: ; preds = %183
%187 = load i8**, i8*** %5
%188 = getelementptr inbounds i8*, i8** %187, i64 5
%189 = load i8*, i8** %188
%190 = load i32, i32* %6
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds i8, i8* %189, i64 %191
%193 = load i8, i8* %192
%194 = call i32 @isdigit(i8 signext %193)
%195 = icmp ne i32 %194, 0
br i1 %195, label %202, label %196
196: ; preds = %186
%197 = load i8**, i8*** %5
%198 = getelementptr inbounds i8*, i8** %197, i64 5
%199 = load i8*, i8** %198
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.28, i64 0, i64 0), i8* %199)
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
store i32 11, i32* %3
br label %268
202: ; preds = %186
br label %203
203: ; preds = %202
%204 = load i32, i32* %6
%205 = add nsw i32 %204, 1
store i32 %205, i32* %6
br label %183
206: ; preds = %183
%207 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%208 = load i8**, i8*** %5
%209 = getelementptr inbounds i8*, i8** %208, i64 3
%210 = load i8*, i8** %209
%211 = call i32 @strcpy(i8* %207, i8* %210)
%212 = load i8**, i8*** %5
%213 = getelementptr inbounds i8*, i8** %212, i64 4
%214 = load i8*, i8** %213
%215 = getelementptr inbounds i8, i8* %214, i64 8
%216 = load i8, i8* %215
%217 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
store i8 %216, i8* %217
%218 = load i8**, i8*** %5
%219 = getelementptr inbounds i8*, i8** %218, i64 4
%220 = load i8*, i8** %219
%221 = getelementptr inbounds i8, i8* %220, i64 9
%222 = load i8, i8* %221
%223 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 1
store i8 %222, i8* %223
%224 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 2
store i8 0, i8* %224
%225 = load i8**, i8*** %5
%226 = getelementptr inbounds i8*, i8** %225, i64 5
%227 = load i8*, i8** %226
%228 = getelementptr inbounds i8, i8* %227, i64 1
%229 = load i8, i8* %228
%230 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 0
store i8 %229, i8* %230
%231 = load i8**, i8*** %5
%232 = getelementptr inbounds i8*, i8** %231, i64 5
%233 = load i8*, i8** %232
%234 = getelementptr inbounds i8, i8* %233, i64 2
%235 = load i8, i8* %234
%236 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 1
store i8 %235, i8* %236
%237 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 2
store i8 0, i8* %237
%238 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
%239 = call i64 @strcmp(i8* %238, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.29, i64 0, i64 0))
%240 = icmp ne i64 %239, 0
br i1 %240, label %252, label %241
241: ; preds = %206
%242 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 0
%243 = call i32 @atoi(i8* %242)
%244 = icmp slt i32 %243, 12
br i1 %244, label %245, label %248
245: ; preds = %241
%246 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%247 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.30, i64 0, i64 0), i8* %246)
br label %251
248: ; preds = %241
%249 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%250 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.31, i64 0, i64 0), i8* %249)
br label %251
251: ; preds = %248, %245
br label %252
252: ; preds = %251, %206
%253 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
%254 = call i64 @strcmp(i8* %253, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.32, i64 0, i64 0))
%255 = icmp ne i64 %254, 0
br i1 %255, label %267, label %256
256: ; preds = %252
%257 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 0
%258 = call i32 @atoi(i8* %257)
%259 = icmp slt i32 %258, 2
br i1 %259, label %260, label %263
260: ; preds = %256
%261 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%262 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.33, i64 0, i64 0), i8* %261)
br label %266
263: ; preds = %256
%264 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%265 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.34, i64 0, i64 0), i8* %264)
br label %266
266: ; preds = %263, %260
br label %267
267: ; preds = %266, %252
store i32 0, i32* %3
br label %268
268: ; preds = %267, %196, %176, %162, %150, %128, %108, %96, %84, %66, %48, %21
%269 = load i32, i32* %3
ret i32 %269
}

LLVM IR (-O2):
@.str.15 = [55 x i8] c"Sorry, %s is too long (should be less then 11 chars).\0A\00"
@.str.17 = [54 x i8] c"Sorry, %s is too long (should be less then 3 chars).\0A\00"
@.str.18 = [68 x i8] c"Sorry, %s is out of range (should be between 0 and 16, inclusive).\0A\00"
@.str.19 = [6 x i8] c"LM-10\00"
@.str.20 = [46 x i8] c"Sorry, %s is wrong type (should be \22LM-10\22).\0A\00"
@.str.21 = [57 x i8] c"Sorry, %s is the wrong number of digits (should be 10).\0A\00"
@.str.22 = [43 x i8] c"Sorry, %s is invalid (should be decimal).\0A\00"
@.str.23 = [11 x i8] c"4500009501\00"
@.str.24 = [11 x i8] c"4500009504\00"
@.str.25 = [68 x i8] c"Sorry, %s is invalid (should either \224500009501\22 or \224500009504\22).\0A\00"
@.str.26 = [56 x i8] c"Sorry, %s is the wrong number of digits (should be 3).\0A\00"
@.str.27 = [46 x i8] c"Sorry, %s is wrong (should start with an A).\0A\00"
@.str.28 = [63 x i8] c"Sorry, %s is invalid (should have 2 trailing decimal digits).\0A\00"
@.str.29 = [3 x i8] c"01\00"
@.str.30 = [18 x i8] c"%s noCr noSelFix\0A\00"
@.str.31 = [16 x i8] c"%s noCr selFix\0A\00"
@.str.32 = [3 x i8] c"04\00"
@.str.33 = [16 x i8] c"%s cr noSelFix\0A\00"
@.str.34 = [14 x i8] c"%s cr selFix\0A\00"
@str.43 = [31 x i8] c"Please try again. Exiting ...\00"
@str.44 = [7 x i8] c"Usage:\00"
@str.45 = [73 x i8] c" Decodes one line from the eSeries \22show version\22 CLI command output.\00"
@str.46 = [87 x i8] c" Determines if the LM-10 is a CR card or not, and if it is a SEL fixed card or not.\00"
@str.47 = [50 x i8] c" Also gets the sn and does some sanity checks.\00"
@str.48 = [19 x i8] c" Example input:\00"
@str.49 = [97 x i8] c" selCrChecker-v1.exe 0 LM-10 4307327561 4500009501 A05 1024 1.5\00"
@str.50 = [20 x i8] c" Example output:\00"
@str.51 = [35 x i8] c" sn4307327561 noCr noSelFix\00"
@str.52 = [17 x i8] c" Explanation:\00"
@str.53 = [75 x i8] c" For CR cards (4500009501), A12 or greater is a SEL fixed card.\00"
@str.54 = [75 x i8] c" For nonCR cards (4500009504), A02 or greater is a SEL fixed card.\00"
@str.55 = [42 x i8] c" ^^^ ^ ^\00"
@str.56 = [35 x i8] c" (refer to KA38052 and KA36085)\00"
@str.57 = [68 x i8] c" Written by Jonathan Natale for Juniper Networks on 11-Feb-2011.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [11 x i8]
%4 = alloca [3 x i8]
%5 = alloca [3 x i8]
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32 %0, 8
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @strlen(i8* %12)
%14 = icmp sgt i32 %13, 10
br i1 %14, label %30, label %36
15: ; preds = %2
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.44, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.45, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @str.46, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.47, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.48, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str.49, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.50, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.51, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.52, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.53, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.54, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.55, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.56, i64 0, i64 0))
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.57, i64 0, i64 0))
br label %233
30: ; preds = %61, %56, %51, %46, %41, %36, %10
%31 = phi i64 [ 1, %10 ], [ 2, %36 ], [ 3, %41 ], [ 4, %46 ], [ 5, %51 ], [ 6, %56 ], [ 7, %61 ]
%32 = getelementptr inbounds i8*, i8** %1, i64 %31
%33 = load i8*, i8** %32
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.15, i64 0, i64 0), i8* %33)
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.43, i64 0, i64 0))
br label %233
36: ; preds = %10
%37 = getelementptr inbounds i8*, i8** %1, i64 2
%38 = load i8*, i8** %37
%39 = tail call i32 @strlen(i8* %38)
%40 = icmp sgt i32 %39, 10
br i1 %40, label %30, label %41
41: ; preds = %36
%42 = getelementptr inbounds i8*, i8** %1, i64 3
%43 = load i8*, i8** %42
%44 = tail call i32 @strlen(i8* %43)
%45 = icmp sgt i32 %44, 10
br i1 %45, label %30, label %46
46: ; preds = %41
%47 = getelementptr inbounds i8*, i8** %1, i64 4
%48 = load i8*, i8** %47
%49 = tail call i32 @strlen(i8* %48)
%50 = icmp sgt i32 %49, 10
br i1 %50, label %30, label %51
51: ; preds = %46
%52 = getelementptr inbounds i8*, i8** %1, i64 5
%53 = load i8*, i8** %52
%54 = tail call i32 @strlen(i8* %53)
%55 = icmp sgt i32 %54, 10
br i1 %55, label %30, label %56
56: ; preds = %51
%57 = getelementptr inbounds i8*, i8** %1, i64 6
%58 = load i8*, i8** %57
%59 = tail call i32 @strlen(i8* %58)
%60 = icmp sgt i32 %59, 10
br i1 %60, label %30, label %61
61: ; preds = %56
%62 = getelementptr inbounds i8*, i8** %1, i64 7
%63 = load i8*, i8** %62
%64 = tail call i32 @strlen(i8* %63)
%65 = icmp sgt i32 %64, 10
br i1 %65, label %30, label %66
66: ; preds = %61
%67 = load i8*, i8** %11
%68 = tail call i32 @strlen(i8* %67)
%69 = icmp sgt i32 %68, 2
%70 = load i8*, i8** %11
br i1 %69, label %71, label %74
71: ; preds = %66
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.17, i64 0, i64 0), i8* %70)
%73 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.43, i64 0, i64 0))
br label %233
74: ; preds = %66
%75 = tail call i32 @atoi(i8* %70)
%76 = icmp ugt i32 %75, 16
br i1 %76, label %77, label %80
77: ; preds = %74
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.18, i64 0, i64 0), i8* %70)
%79 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.43, i64 0, i64 0))
br label %233
80: ; preds = %74
%81 = load i8*, i8** %37
%82 = tail call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %88, label %84
84: ; preds = %80
%85 = load i8*, i8** %37
%86 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.20, i64 0, i64 0), i8* %85)
%87 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.43, i64 0, i64 0))
br label %233
88: ; preds = %80
%89 = load i8*, i8** %42
%90 = tail call i32 @strlen(i8* %89)
%91 = icmp eq i32 %90, 10
%92 = load i8*, i8** %42
br i1 %91, label %93, label %97
93: ; preds = %88
%94 = load i8, i8* %92
%95 = tail call i32 @isdigit(i8 signext %94)
%96 = icmp eq i32 %95, 0
br i1 %96, label %158, label %100
97: ; preds = %88
%98 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.21, i64 0, i64 0), i8* %92)
%99 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.43, i64 0, i64 0))
br label %233
100: ; preds = %93
%101 = load i8*, i8** %42
%102 = getelementptr inbounds i8, i8* %101, i64 1
%103 = load i8, i8* %102
%104 = tail call i32 @isdigit(i8 signext %103)
%105 = icmp eq i32 %104, 0
br i1 %105, label %158, label %106
106: ; preds = %100
%107 = load i8*, i8** %42
%108 = getelementptr inbounds i8, i8* %107, i64 2
%109 = load i8, i8* %108
%110 = tail call i32 @isdigit(i8 signext %109)
%111 = icmp eq i32 %110, 0
br i1 %111, label %158, label %112
112: ; preds = %106
%113 = load i8*, i8** %42
%114 = getelementptr inbounds i8, i8* %113, i64 3
%115 = load i8, i8* %114
%116 = tail call i32 @isdigit(i8 signext %115)
%117 = icmp eq i32 %116, 0
br i1 %117, label %158, label %118
118: ; preds = %112
%119 = load i8*, i8** %42
%120 = getelementptr inbounds i8, i8* %119, i64 4
%121 = load i8, i8* %120
%122 = tail call i32 @isdigit(i8 signext %121)
%123 = icmp eq i32 %122, 0
br i1 %123, label %158, label %124
124: ; preds = %118
%125 = load i8*, i8** %42
%126 = getelementptr inbounds i8, i8* %125, i64 5
%127 = load i8, i8* %126
%128 = tail call i32 @isdigit(i8 signext %127)
%129 = icmp eq i32 %128, 0
br i1 %129, label %158, label %130
130: ; preds = %124
%131 = load i8*, i8** %42
%132 = getelementptr inbounds i8, i8* %131, i64 6
%133 = load i8, i8* %132
%134 = tail call i32 @isdigit(i8 signext %133)
%135 = icmp eq i32 %134, 0
br i1 %135, label %158, label %136
136: ; preds = %130
%137 = load i8*, i8** %42
%138 = getelementptr inbounds i8, i8* %137, i64 7
%139 = load i8, i8* %138
%140 = tail call i32 @isdigit(i8 signext %139)
%141 = icmp eq i32 %140, 0
br i1 %141, label %158, label %142
142: ; preds = %136
%143 = load i8*, i8** %42
%144 = getelementptr inbounds i8, i8* %143, i64 8
%145 = load i8, i8* %144
%146 = tail call i32 @isdigit(i8 signext %145)
%147 = icmp eq i32 %146, 0
br i1 %147, label %158, label %148
148: ; preds = %142
%149 = load i8*, i8** %42
%150 = getelementptr inbounds i8, i8* %149, i64 9
%151 = load i8, i8* %150
%152 = tail call i32 @isdigit(i8 signext %151)
%153 = icmp eq i32 %152, 0
br i1 %153, label %158, label %154
154: ; preds = %148
%155 = load i8*, i8** %47
%156 = tail call i64 @strcmp(i8* %155, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.23, i64 0, i64 0))
%157 = icmp eq i64 %156, 0
br i1 %157, label %170, label %162
158: ; preds = %148, %142, %136, %130, %124, %118, %112, %106, %100, %93
%159 = load i8*, i8** %42
%160 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.22, i64 0, i64 0), i8* %159)
%161 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.43, i64 0, i64 0))
br label %233
162: ; preds = %154
%163 = load i8*, i8** %47
%164 = tail call i64 @strcmp(i8* %163, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i64 0, i64 0))
%165 = icmp eq i64 %164, 0
br i1 %165, label %170, label %166
166: ; preds = %162
%167 = load i8*, i8** %47
%168 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.25, i64 0, i64 0), i8* %167)
%169 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.43, i64 0, i64 0))
br label %233
170: ; preds = %162, %154
%171 = load i8*, i8** %52
%172 = tail call i32 @strlen(i8* %171)
%173 = icmp eq i32 %172, 3
%174 = load i8*, i8** %52
br i1 %173, label %178, label %175
175: ; preds = %170
%176 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.26, i64 0, i64 0), i8* %174)
%177 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.43, i64 0, i64 0))
br label %233
178: ; preds = %170
%179 = load i8, i8* %174
%180 = icmp eq i8 %179, 65
br i1 %180, label %181, label %186
181: ; preds = %178
%182 = getelementptr inbounds i8, i8* %174, i64 1
%183 = load i8, i8* %182
%184 = tail call i32 @isdigit(i8 signext %183)
%185 = icmp eq i32 %184, 0
br i1 %185, label %214, label %189
186: ; preds = %178
%187 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.27, i64 0, i64 0), i8* %174)
%188 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.43, i64 0, i64 0))
br label %233
189: ; preds = %181
%190 = load i8*, i8** %52
%191 = getelementptr inbounds i8, i8* %190, i64 2
%192 = load i8, i8* %191
%193 = tail call i32 @isdigit(i8 signext %192)
%194 = icmp eq i32 %193, 0
br i1 %194, label %214, label %195
195: ; preds = %189
%196 = load i8*, i8** %42
%197 = call i32 @strcpy(i8* %6, i8* %196)
%198 = load i8*, i8** %47
%199 = getelementptr inbounds i8, i8* %198, i64 8
%200 = load i8, i8* %199
store i8 %200, i8* %7
%201 = getelementptr inbounds i8, i8* %198, i64 9
%202 = load i8, i8* %201
%203 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 1
store i8 %202, i8* %203
%204 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 2
store i8 0, i8* %204
%205 = load i8*, i8** %52
%206 = getelementptr inbounds i8, i8* %205, i64 1
%207 = load i8, i8* %206
store i8 %207, i8* %8
%208 = getelementptr inbounds i8, i8* %205, i64 2
%209 = load i8, i8* %208
%210 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 %209, i8* %210
%211 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 2
store i8 0, i8* %211
%212 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.29, i64 0, i64 0))
%213 = icmp eq i64 %212, 0
br i1 %213, label %218, label %223
214: ; preds = %189, %181
%215 = load i8*, i8** %52
%216 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.28, i64 0, i64 0), i8* %215)
%217 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.43, i64 0, i64 0))
br label %233
218: ; preds = %195
%219 = call i32 @atoi(i8* %8)
%220 = icmp slt i32 %219, 12
%221 = select i1 %220, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.30, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.31, i64 0, i64 0)
%222 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %221, i8* %6)
br label %223
223: ; preds = %218, %195
%224 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.32, i64 0, i64 0))
%225 = icmp eq i64 %224, 0
br i1 %225, label %226, label %233
226: ; preds = %223
%227 = call i32 @atoi(i8* %8)
%228 = icmp slt i32 %227, 2
br i1 %228, label %229, label %231
229: ; preds = %226
%230 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.33, i64 0, i64 0), i8* %6)
br label %233
231: ; preds = %226
%232 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.34, i64 0, i64 0), i8* %6)
br label %233
233: ; preds = %223, %231, %229, %214, %186, %175, %166, %158, %97, %84, %77, %71, %30, %15
%234 = phi i32 [ 1, %15 ], [ 2, %30 ], [ 3, %71 ], [ 4, %77 ], [ 5, %84 ], [ 6, %97 ], [ 7, %158 ], [ 8, %166 ], [ 9, %175 ], [ 10, %186 ], [ 11, %214 ], [ 0, %229 ], [ 0, %231 ], [ 0, %223 ]
ret i32 %234
}