#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 SHRT_MAX;
int getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ system(char *);
char tolower(char);
char toupper(char);
void main() {
  char sw[] = "https://www.";
  char w[] = "http://www.";
  int c;
  char URL[SHRT_MAX];
  int i = 0;
  while ((c = getchar()) != '\n') {
    if (c == ' ') {
      printf("has space\n");
      return;
    }
    URL[i++] = c;
  }
  int cw = 1, csw = 1;
  for (i = 0; i < 12; i++) {
    if (tolower(URL[i]) != sw[i]) {
      csw = 0;
      break;
    }
  }
  for (i = 0; i < 11; i++) {
    if (tolower(URL[i]) != w[i]) {
      cw = 0;
      break;
    }
  }
  if (cw == 0 && csw == 0) {
    printf("ill formatted protocol, %s\n", URL);
    return;
  }
  char output[SHRT_MAX];
  for (i = 0; i < SHRT_MAX; i++) {
    if (csw == 1 && i >= 4) {
      URL[i] = URL[i + 1];
    } else {
      URL[i] = URL[i];
    }
  }
  int j = 0, out = 0;
  for (i = 7; i < SHRT_MAX; i++) {
    if ((URL[i] == '.') && (URL[i + 1] == 'e' || URL[i + 1] == 'E') &&
        (URL[i + 2] == 'd' || URL[i + 2] == 'D') &&
        (URL[i + 3] == 'u' || URL[i + 3] == 'U') &&
        (URL[i + 4] == '/' || URL[i + 4] == '\0' || URL[i + 4] == ':')) {
      output[j] = URL[i];
      output[j + 1] = URL[i + 1];
      output[j + 2] = URL[i + 2];
      output[j + 3] = URL[i + 3];
      out = 1;
      break;
    } else if ((URL[i] == '.') && (URL[i + 1] == 'c' || URL[i + 1] == 'C') &&
               (URL[i + 2] == 'o' || URL[i + 2] == 'O') &&
               (URL[i + 3] == 'm' || URL[i + 3] == 'M') &&
               (URL[i + 4] == '/' || URL[i + 4] == '\0' || URL[i + 4] == ':')) {
      output[j] = URL[i];
      output[j + 1] = URL[i + 1];
      output[j + 2] = URL[i + 2];
      output[j + 3] = URL[i + 3];
      out = 1;
      break;
    } else {
      output[j++] = URL[i];
    }
  }
  char host[SHRT_MAX];
  host[0] = 'h';
  host[1] = 'o';
  host[2] = 's';
  host[3] = 't';
  host[4] = ' ';
  if (out == 1) {
    printf("%s", output);
    for (i = 0; i < SHRT_MAX; i++) {
      output[i] = toupper(output[i]);
    }
    printf(", %s\n", output);
    for (i = 0; i < SHRT_MAX; i++) {
      host[i + 5] = output[i];
    }
    char *p = host;
    system(p);
  } else {
    printf("no ending %s\n", output);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movabs $0x2e7777772f2f3a,%rax
mov    %rax,-0xb(%rbp)
movabs $0x2f2f3a7370747468,%rax
3a 2f 2f
mov    %rax,-0x10(%rbp)
movabs $0x772f2f3a70747468,%rax
2f 2f 77
mov    %rax,-0x20(%rbp)
movl   $0x2e7777,-0x18(%rbp)
mov    0x2e4d(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xa,%eax
je     1215 <main+0xc5>
cmpl   $0x20,-0x24(%rbp)
jne    11f6 <main+0xa6>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x40(%rbp)
jmp    17ed <main+0x69d>
mov    -0x70(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %cl,%dl
mov    -0x3c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x3c(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    11bf <main+0x6f>
movl   $0x1,-0x44(%rbp)
movl   $0x1,-0x48(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0xc,-0x3c(%rbp)
jge    1278 <main+0x128>
mov    -0x70(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1070 <tolower@plt>
movsbl %al,%eax
movslq -0x3c(%rbp),%rcx
movsbl -0x10(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     1265 <main+0x115>
movl   $0x0,-0x48(%rbp)
jmp    1278 <main+0x128>
jmp    126a <main+0x11a>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    122a <main+0xda>
movl   $0x0,-0x3c(%rbp)
cmpl   $0xb,-0x3c(%rbp)
jge    12cd <main+0x17d>
mov    -0x70(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1070 <tolower@plt>
movsbl %al,%eax
movslq -0x3c(%rbp),%rcx
movsbl -0x20(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     12ba <main+0x16a>
movl   $0x0,-0x44(%rbp)
jmp    12cd <main+0x17d>
jmp    12bf <main+0x16f>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    127f <main+0x12f>
cmpl   $0x0,-0x44(%rbp)
jne    12ff <main+0x1af>
cmpl   $0x0,-0x48(%rbp)
jne    12ff <main+0x1af>
mov    -0x70(%rbp),%rsi
lea    0xd38(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x40(%rbp)
jmp    17ed <main+0x69d>
mov    0x2cda(%rip),%rax
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    0x2cab(%rip),%rcx
cmp    (%rcx),%eax
jge    1392 <main+0x242>
cmpl   $0x1,-0x48(%rbp)
jne    136d <main+0x21d>
cmpl   $0x4,-0x3c(%rbp)
jl     136d <main+0x21d>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
movslq -0x3c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    137f <main+0x22f>
mov    -0x70(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
movslq -0x3c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1384 <main+0x234>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    132b <main+0x1db>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x7,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    0x2c2f(%rip),%rcx
cmp    (%rcx),%eax
jge    16cf <main+0x57f>
mov    -0x70(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1528 <main+0x3d8>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x65,%eax
je     1402 <main+0x2b2>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x45,%eax
jne    1528 <main+0x3d8>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x64,%eax
je     1436 <main+0x2e6>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x44,%eax
jne    1528 <main+0x3d8>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x75,%eax
je     146a <main+0x31a>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x55,%eax
jne    1528 <main+0x3d8>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     14b8 <main+0x368>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     14b8 <main+0x368>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1528 <main+0x3d8>
mov    -0x78(%rbp),%rax
mov    -0x70(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
mov    (%rcx,%rdx,1),%sil
movslq -0x54(%rbp),%rdx
mov    %sil,(%rax,%rdx,1)
mov    -0x3c(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,1),%sil
mov    -0x54(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
mov    %sil,(%rax,%rdx,1)
mov    -0x3c(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,1),%sil
mov    -0x54(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
mov    %sil,(%rax,%rdx,1)
mov    -0x3c(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,1),%dl
mov    -0x54(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movl   $0x1,-0x58(%rbp)
jmp    16cf <main+0x57f>
mov    -0x70(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1697 <main+0x547>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x63,%eax
je     1571 <main+0x421>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x43,%eax
jne    1697 <main+0x547>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6f,%eax
je     15a5 <main+0x455>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4f,%eax
jne    1697 <main+0x547>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6d,%eax
je     15d9 <main+0x489>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4d,%eax
jne    1697 <main+0x547>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     1627 <main+0x4d7>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1627 <main+0x4d7>
mov    -0x70(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1697 <main+0x547>
mov    -0x78(%rbp),%rax
mov    -0x70(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
mov    (%rcx,%rdx,1),%sil
movslq -0x54(%rbp),%rdx
mov    %sil,(%rax,%rdx,1)
mov    -0x3c(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,1),%sil
mov    -0x54(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
mov    %sil,(%rax,%rdx,1)
mov    -0x3c(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,1),%sil
mov    -0x54(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
mov    %sil,(%rax,%rdx,1)
mov    -0x3c(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,1),%dl
mov    -0x54(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movl   $0x1,-0x58(%rbp)
jmp    16cf <main+0x57f>
mov    -0x78(%rbp),%rax
mov    -0x70(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
mov    -0x54(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x54(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    16bc <main+0x56c>
jmp    16c1 <main+0x571>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13a7 <main+0x257>
mov    0x290a(%rip),%rax
mov    (%rax),%eax
mov    %eax,%ecx
mov    %rcx,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,-0x80(%rbp)
mov    %rax,%rsp
mov    %rcx,-0x60(%rbp)
movb   $0x68,(%rax)
movb   $0x6f,0x1(%rax)
movb   $0x73,0x2(%rax)
movb   $0x74,0x3(%rax)
movb   $0x20,0x4(%rax)
cmpl   $0x1,-0x58(%rbp)
jne    17d4 <main+0x684>
mov    -0x78(%rbp),%rsi
lea    0x922(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    0x28aa(%rip),%rcx
cmp    (%rcx),%eax
jge    176a <main+0x61a>
mov    -0x78(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x78(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    172c <main+0x5dc>
mov    -0x78(%rbp),%rsi
lea    0x8c5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    0x2853(%rip),%rcx
cmp    (%rcx),%eax
jge    17be <main+0x66e>
mov    -0x80(%rbp),%rax
mov    -0x78(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
mov    -0x3c(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1783 <main+0x633>
mov    -0x80(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rdi
call   1040 <system@plt>
jmp    17e6 <main+0x696>
mov    -0x78(%rbp),%rsi
lea    0x864(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e5b(%rip),%r14
mov    (%r14),%eax
mov    %rsp,%r15
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %r15,%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0x20,%eax
je     1342 <main+0x1d2>
cmp    $0xa,%eax
je     11bd <main+0x4d>
mov    %al,(%rbx)
add    $0x1,%rbx
jmp    11a0 <main+0x30>
mov    %r14,%rbx
movsbl (%r15),%r14d
mov    %r14d,%edi
call   1090 <tolower@plt>
mov    $0x1,%r12b
cmp    $0x68,%al
jne    127b <main+0x10b>
movsbl 0x1(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x74,%al
jne    127b <main+0x10b>
movsbl 0x2(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x74,%al
jne    127b <main+0x10b>
movsbl 0x3(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x70,%al
jne    127b <main+0x10b>
movsbl 0x4(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x73,%al
jne    127b <main+0x10b>
movsbl 0x5(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x3a,%al
jne    127b <main+0x10b>
movsbl 0x6(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x2f,%al
jne    127b <main+0x10b>
movsbl 0x7(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x2f,%al
jne    127b <main+0x10b>
movsbl 0x8(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x77,%al
jne    127b <main+0x10b>
movsbl 0x9(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x77,%al
jne    127b <main+0x10b>
movsbl 0xa(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x77,%al
jne    127b <main+0x10b>
movsbl 0xb(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x2e,%al
setne  %r12b
mov    %r12d,%r13d
xor    $0x1,%r13b
mov    %r14d,%edi
call   1090 <tolower@plt>
cmp    $0x68,%al
jne    135c <main+0x1ec>
movsbl 0x1(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x74,%al
jne    135c <main+0x1ec>
movsbl 0x2(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x74,%al
jne    135c <main+0x1ec>
movsbl 0x3(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x70,%al
jne    135c <main+0x1ec>
movsbl 0x4(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x3a,%al
jne    135c <main+0x1ec>
movsbl 0x5(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x2f,%al
jne    135c <main+0x1ec>
movsbl 0x6(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x2f,%al
jne    135c <main+0x1ec>
movsbl 0x7(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x77,%al
jne    135c <main+0x1ec>
movsbl 0x8(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x77,%al
jne    135c <main+0x1ec>
movsbl 0x9(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x77,%al
jne    135c <main+0x1ec>
movsbl 0xa(%r15),%edi
call   1090 <tolower@plt>
cmp    $0x2e,%al
je     1361 <main+0x1f1>
test   %r13b,%r13b
jne    1361 <main+0x1f1>
lea    0xd52(%rip),%rdi
mov    %r15,%rsi
jmp    1524 <main+0x3b4>
lea    0xd70(%rip),%rdi
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>
test   %r12b,%r12b
jne    1333 <main+0x1c3>
mov    (%rbx),%esi
mov    %rsp,%r14
lea    0xf(%rsi),%r9
and    $0xfffffffffffffff0,%r9
sub    %r9,%r14
mov    %r14,%rsp
test   %esi,%esi
jle    151a <main+0x3aa>
mov    %rbx,%r12
cmp    $0x1,%esi
jne    153a <main+0x3ca>
xor    %ecx,%ecx
test   $0x1,%sil
je     13a9 <main+0x239>
cmp    $0x4,%rcx
setae  %al
and    %al,%r13b
cmp    $0x1,%r13b
jne    13a9 <main+0x239>
mov    0x1(%r15,%rcx,1),%al
mov    %al,(%r15,%rcx,1)
cmp    $0x8,%esi
jl     151a <main+0x3aa>
add    $0xfffffff9,%esi
xor    %edx,%edx
lea    0xc42(%rip),%r10
movabs $0x400800000000001,%r8
jmp    13e1 <main+0x271>
nopw   0x0(%rax,%rax,1)
mov    %al,(%r14,%rdx,1)
add    $0x1,%rdx
cmp    %rdx,%rsi
je     151a <main+0x3aa>
movzbl 0x7(%r15,%rdx,1),%eax
cmp    $0x2e,%al
jne    13d0 <main+0x260>
movzbl 0x8(%r15,%rdx,1),%edi
lea    -0x43(%rdi),%ecx
cmp    $0x22,%cl
ja     13d0 <main+0x260>
movzbl %cl,%ecx
movslq (%r10,%rcx,4),%rcx
add    %r10,%rcx
jmp    *%rcx
movzbl 0x9(%r15,%rdx,1),%ebx
mov    %ebx,%ecx
or     $0x20,%cl
cmp    $0x64,%cl
jne    1438 <main+0x2c8>
movzbl 0xa(%r15,%rdx,1),%r11d
mov    %r11d,%ecx
or     $0x20,%cl
cmp    $0x75,%cl
jne    1438 <main+0x2c8>
movzbl 0xb(%r15,%rdx,1),%ecx
cmp    $0x3a,%rcx
ja     1438 <main+0x2c8>
bt     %rcx,%r8
jb     1485 <main+0x315>
mov    %edi,%ecx
or     $0x20,%cl
cmp    $0x63,%cl
jne    13d0 <main+0x260>
movzbl 0x9(%r15,%rdx,1),%ebx
mov    %ebx,%ecx
or     $0x20,%cl
cmp    $0x6f,%cl
jne    13d0 <main+0x260>
movzbl 0xa(%r15,%rdx,1),%r11d
mov    %r11d,%ecx
or     $0x20,%cl
cmp    $0x6d,%cl
jne    13d0 <main+0x260>
movzbl 0xb(%r15,%rdx,1),%ecx
cmp    $0x3a,%rcx
ja     13d0 <main+0x260>
bt     %rcx,%r8
jae    13d0 <main+0x260>
movb   $0x2e,(%r14,%rdx,1)
mov    %dil,0x1(%r14,%rdx,1)
mov    %bl,0x2(%r14,%rdx,1)
mov    %r11b,0x3(%r14,%rdx,1)
mov    %rsp,%rax
mov    %rax,%r15
sub    %r9,%r15
mov    %r15,%rsp
movl   $0x74736f68,(%r15)
neg    %r9
movb   $0x20,0x4(%rax,%r9,1)
lea    0xbec(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,(%r12)
jle    14eb <main+0x37b>
xor    %ebx,%ebx
nop
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
movslq (%r12),%rax
cmp    %rax,%rbx
jl     14d0 <main+0x360>
lea    0xbb0(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r12),%edx
test   %edx,%edx
jle    1510 <main+0x3a0>
lea    0x5(%r15),%rdi
mov    %r14,%rsi
call   1080 <memcpy@plt>
mov    %r15,%rdi
call   1050 <system@plt>
jmp    152b <main+0x3bb>
lea    0xb8a(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %esi,%eax
and    $0xfffffffe,%eax
xor    %edx,%edx
jmp    155c <main+0x3ec>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,%rdx
cmp    %rcx,%rax
je     138a <main+0x21a>
cmp    $0x4,%rdx
setae  %cl
and    %r13b,%cl
cmp    $0x1,%cl
jne    1575 <main+0x405>
movzbl 0x1(%r15,%rdx,1),%ecx
mov    %cl,(%r15,%rdx,1)
cmp    $0x3,%rdx
setae  %bl
and    %r13b,%bl
lea    0x2(%rdx),%rcx
cmp    $0x1,%bl
jne    1550 <main+0x3e0>
movzbl 0x2(%r15,%rdx,1),%ebx
mov    %bl,0x1(%r15,%rdx,1)
jmp    1550 <main+0x3e0>

LLVM IR (-O0):
@__const.main.sw = [13 x i8] c"https://www.\00"
@__const.main.w = [12 x i8] c"http://www.\00"
@SHRT_MAX = global i32 0
@.str = [11 x i8] c"has space\0A\00"
@.str.1 = [28 x i8] c"ill formatted protocol, %s\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [6 x i8] c", %s\0A\00"
@.str.4 = [14 x i8] c"no ending %s\0A\00"
define void @main() {
%1 = alloca [13 x i8]
%2 = alloca [12 x i8]
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i64
%14 = alloca i8*
%15 = bitcast [13 x i8]* %1 to i8*
%16 = bitcast [12 x i8]* %2 to i8*
%17 = load i32, i32* @SHRT_MAX
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %4
%20 = alloca i8, i64 %18
store i64 %18, i64* %5
store i32 0, i32* %6
br label %21
21: ; preds = %29, %0
%22 = call i32 (...) @getchar()
store i32 %22, i32* %3
%23 = icmp ne i32 %22, 10
br i1 %23, label %24, label %36
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 32
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %7
br label %423
29: ; preds = %24
%30 = load i32, i32* %3
%31 = trunc i32 %30 to i8
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
%34 = sext i32 %32 to i64
%35 = getelementptr inbounds i8, i8* %20, i64 %34
store i8 %31, i8* %35
br label %21
36: ; preds = %21
store i32 1, i32* %8
store i32 1, i32* %9
store i32 0, i32* %6
br label %37
37: ; preds = %55, %36
%38 = load i32, i32* %6
%39 = icmp slt i32 %38, 12
br i1 %39, label %40, label %58
40: ; preds = %37
%41 = load i32, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8, i8* %20, i64 %42
%44 = load i8, i8* %43
%45 = call signext i8 @tolower(i8 signext %44)
%46 = sext i8 %45 to i32
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp ne i32 %46, %51
br i1 %52, label %53, label %54
53: ; preds = %40
store i32 0, i32* %9
br label %58
54: ; preds = %40
br label %55
55: ; preds = %54
%56 = load i32, i32* %6
%57 = add nsw i32 %56, 1
store i32 %57, i32* %6
br label %37
58: ; preds = %53, %37
store i32 0, i32* %6
br label %59
59: ; preds = %77, %58
%60 = load i32, i32* %6
%61 = icmp slt i32 %60, 11
br i1 %61, label %62, label %80
62: ; preds = %59
%63 = load i32, i32* %6
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %20, i64 %64
%66 = load i8, i8* %65
%67 = call signext i8 @tolower(i8 signext %66)
%68 = sext i8 %67 to i32
%69 = load i32, i32* %6
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 %70
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp ne i32 %68, %73
br i1 %74, label %75, label %76
75: ; preds = %62
store i32 0, i32* %8
br label %80
76: ; preds = %62
br label %77
77: ; preds = %76
%78 = load i32, i32* %6
%79 = add nsw i32 %78, 1
store i32 %79, i32* %6
br label %59
80: ; preds = %75, %59
%81 = load i32, i32* %8
%82 = icmp eq i32 %81, 0
br i1 %82, label %83, label %88
83: ; preds = %80
%84 = load i32, i32* %9
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %83
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %20)
store i32 1, i32* %7
br label %423
88: ; preds = %83, %80
%89 = load i32, i32* @SHRT_MAX
%90 = zext i32 %89 to i64
%91 = alloca i8, i64 %90
store i64 %90, i64* %10
store i32 0, i32* %6
br label %92
92: ; preds = %120, %88
%93 = load i32, i32* %6
%94 = load i32, i32* @SHRT_MAX
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %123
96: ; preds = %92
%97 = load i32, i32* %9
%98 = icmp eq i32 %97, 1
br i1 %98, label %99, label %111
99: ; preds = %96
%100 = load i32, i32* %6
%101 = icmp sge i32 %100, 4
br i1 %101, label %102, label %111
102: ; preds = %99
%103 = load i32, i32* %6
%104 = add nsw i32 %103, 1
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %20, i64 %105
%107 = load i8, i8* %106
%108 = load i32, i32* %6
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %20, i64 %109
store i8 %107, i8* %110
br label %119
111: ; preds = %99, %96
%112 = load i32, i32* %6
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8, i8* %20, i64 %113
%115 = load i8, i8* %114
%116 = load i32, i32* %6
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i8, i8* %20, i64 %117
store i8 %115, i8* %118
br label %119
119: ; preds = %111, %102
br label %120
120: ; preds = %119
%121 = load i32, i32* %6
%122 = add nsw i32 %121, 1
store i32 %122, i32* %6
br label %92
123: ; preds = %92
store i32 0, i32* %11
store i32 0, i32* %12
store i32 7, i32* %6
br label %124
124: ; preds = %367, %123
%125 = load i32, i32* %6
%126 = load i32, i32* @SHRT_MAX
%127 = icmp slt i32 %125, %126
br i1 %127, label %128, label %370
128: ; preds = %124
%129 = load i32, i32* %6
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i8, i8* %20, i64 %130
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = icmp eq i32 %133, 46
br i1 %134, label %135, label %242
135: ; preds = %128
%136 = load i32, i32* %6
%137 = add nsw i32 %136, 1
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i8, i8* %20, i64 %138
%140 = load i8, i8* %139
%141 = sext i8 %140 to i32
%142 = icmp eq i32 %141, 101
br i1 %142, label %151, label %143
143: ; preds = %135
%144 = load i32, i32* %6
%145 = add nsw i32 %144, 1
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i8, i8* %20, i64 %146
%148 = load i8, i8* %147
%149 = sext i8 %148 to i32
%150 = icmp eq i32 %149, 69
br i1 %150, label %151, label %242
151: ; preds = %143, %135
%152 = load i32, i32* %6
%153 = add nsw i32 %152, 2
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i8, i8* %20, i64 %154
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
%158 = icmp eq i32 %157, 100
br i1 %158, label %167, label %159
159: ; preds = %151
%160 = load i32, i32* %6
%161 = add nsw i32 %160, 2
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds i8, i8* %20, i64 %162
%164 = load i8, i8* %163
%165 = sext i8 %164 to i32
%166 = icmp eq i32 %165, 68
br i1 %166, label %167, label %242
167: ; preds = %159, %151
%168 = load i32, i32* %6
%169 = add nsw i32 %168, 3
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds i8, i8* %20, i64 %170
%172 = load i8, i8* %171
%173 = sext i8 %172 to i32
%174 = icmp eq i32 %173, 117
br i1 %174, label %183, label %175
175: ; preds = %167
%176 = load i32, i32* %6
%177 = add nsw i32 %176, 3
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i8, i8* %20, i64 %178
%180 = load i8, i8* %179
%181 = sext i8 %180 to i32
%182 = icmp eq i32 %181, 85
br i1 %182, label %183, label %242
183: ; preds = %175, %167
%184 = load i32, i32* %6
%185 = add nsw i32 %184, 4
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds i8, i8* %20, i64 %186
%188 = load i8, i8* %187
%189 = sext i8 %188 to i32
%190 = icmp eq i32 %189, 47
br i1 %190, label %207, label %191
191: ; preds = %183
%192 = load i32, i32* %6
%193 = add nsw i32 %192, 4
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds i8, i8* %20, i64 %194
%196 = load i8, i8* %195
%197 = sext i8 %196 to i32
%198 = icmp eq i32 %197, 0
br i1 %198, label %207, label %199
199: ; preds = %191
%200 = load i32, i32* %6
%201 = add nsw i32 %200, 4
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds i8, i8* %20, i64 %202
%204 = load i8, i8* %203
%205 = sext i8 %204 to i32
%206 = icmp eq i32 %205, 58
br i1 %206, label %207, label %242
207: ; preds = %199, %191, %183
%208 = load i32, i32* %6
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds i8, i8* %20, i64 %209
%211 = load i8, i8* %210
%212 = load i32, i32* %11
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds i8, i8* %91, i64 %213
store i8 %211, i8* %214
%215 = load i32, i32* %6
%216 = add nsw i32 %215, 1
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds i8, i8* %20, i64 %217
%219 = load i8, i8* %218
%220 = load i32, i32* %11
%221 = add nsw i32 %220, 1
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds i8, i8* %91, i64 %222
store i8 %219, i8* %223
%224 = load i32, i32* %6
%225 = add nsw i32 %224, 2
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds i8, i8* %20, i64 %226
%228 = load i8, i8* %227
%229 = load i32, i32* %11
%230 = add nsw i32 %229, 2
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds i8, i8* %91, i64 %231
store i8 %228, i8* %232
%233 = load i32, i32* %6
%234 = add nsw i32 %233, 3
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds i8, i8* %20, i64 %235
%237 = load i8, i8* %236
%238 = load i32, i32* %11
%239 = add nsw i32 %238, 3
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds i8, i8* %91, i64 %240
store i8 %237, i8* %241
store i32 1, i32* %12
br label %370
242: ; preds = %199, %175, %159, %143, %128
%243 = load i32, i32* %6
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds i8, i8* %20, i64 %244
%246 = load i8, i8* %245
%247 = sext i8 %246 to i32
%248 = icmp eq i32 %247, 46
br i1 %248, label %249, label %356
249: ; preds = %242
%250 = load i32, i32* %6
%251 = add nsw i32 %250, 1
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds i8, i8* %20, i64 %252
%254 = load i8, i8* %253
%255 = sext i8 %254 to i32
%256 = icmp eq i32 %255, 99
br i1 %256, label %265, label %257
257: ; preds = %249
%258 = load i32, i32* %6
%259 = add nsw i32 %258, 1
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds i8, i8* %20, i64 %260
%262 = load i8, i8* %261
%263 = sext i8 %262 to i32
%264 = icmp eq i32 %263, 67
br i1 %264, label %265, label %356
265: ; preds = %257, %249
%266 = load i32, i32* %6
%267 = add nsw i32 %266, 2
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds i8, i8* %20, i64 %268
%270 = load i8, i8* %269
%271 = sext i8 %270 to i32
%272 = icmp eq i32 %271, 111
br i1 %272, label %281, label %273
273: ; preds = %265
%274 = load i32, i32* %6
%275 = add nsw i32 %274, 2
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds i8, i8* %20, i64 %276
%278 = load i8, i8* %277
%279 = sext i8 %278 to i32
%280 = icmp eq i32 %279, 79
br i1 %280, label %281, label %356
281: ; preds = %273, %265
%282 = load i32, i32* %6
%283 = add nsw i32 %282, 3
%284 = sext i32 %283 to i64
%285 = getelementptr inbounds i8, i8* %20, i64 %284
%286 = load i8, i8* %285
%287 = sext i8 %286 to i32
%288 = icmp eq i32 %287, 109
br i1 %288, label %297, label %289
289: ; preds = %281
%290 = load i32, i32* %6
%291 = add nsw i32 %290, 3
%292 = sext i32 %291 to i64
%293 = getelementptr inbounds i8, i8* %20, i64 %292
%294 = load i8, i8* %293
%295 = sext i8 %294 to i32
%296 = icmp eq i32 %295, 77
br i1 %296, label %297, label %356
297: ; preds = %289, %281
%298 = load i32, i32* %6
%299 = add nsw i32 %298, 4
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds i8, i8* %20, i64 %300
%302 = load i8, i8* %301
%303 = sext i8 %302 to i32
%304 = icmp eq i32 %303, 47
br i1 %304, label %321, label %305
305: ; preds = %297
%306 = load i32, i32* %6
%307 = add nsw i32 %306, 4
%308 = sext i32 %307 to i64
%309 = getelementptr inbounds i8, i8* %20, i64 %308
%310 = load i8, i8* %309
%311 = sext i8 %310 to i32
%312 = icmp eq i32 %311, 0
br i1 %312, label %321, label %313
313: ; preds = %305
%314 = load i32, i32* %6
%315 = add nsw i32 %314, 4
%316 = sext i32 %315 to i64
%317 = getelementptr inbounds i8, i8* %20, i64 %316
%318 = load i8, i8* %317
%319 = sext i8 %318 to i32
%320 = icmp eq i32 %319, 58
br i1 %320, label %321, label %356
321: ; preds = %313, %305, %297
%322 = load i32, i32* %6
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds i8, i8* %20, i64 %323
%325 = load i8, i8* %324
%326 = load i32, i32* %11
%327 = sext i32 %326 to i64
%328 = getelementptr inbounds i8, i8* %91, i64 %327
store i8 %325, i8* %328
%329 = load i32, i32* %6
%330 = add nsw i32 %329, 1
%331 = sext i32 %330 to i64
%332 = getelementptr inbounds i8, i8* %20, i64 %331
%333 = load i8, i8* %332
%334 = load i32, i32* %11
%335 = add nsw i32 %334, 1
%336 = sext i32 %335 to i64
%337 = getelementptr inbounds i8, i8* %91, i64 %336
store i8 %333, i8* %337
%338 = load i32, i32* %6
%339 = add nsw i32 %338, 2
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds i8, i8* %20, i64 %340
%342 = load i8, i8* %341
%343 = load i32, i32* %11
%344 = add nsw i32 %343, 2
%345 = sext i32 %344 to i64
%346 = getelementptr inbounds i8, i8* %91, i64 %345
store i8 %342, i8* %346
%347 = load i32, i32* %6
%348 = add nsw i32 %347, 3
%349 = sext i32 %348 to i64
%350 = getelementptr inbounds i8, i8* %20, i64 %349
%351 = load i8, i8* %350
%352 = load i32, i32* %11
%353 = add nsw i32 %352, 3
%354 = sext i32 %353 to i64
%355 = getelementptr inbounds i8, i8* %91, i64 %354
store i8 %351, i8* %355
store i32 1, i32* %12
br label %370
356: ; preds = %313, %289, %273, %257, %242
%357 = load i32, i32* %6
%358 = sext i32 %357 to i64
%359 = getelementptr inbounds i8, i8* %20, i64 %358
%360 = load i8, i8* %359
%361 = load i32, i32* %11
%362 = add nsw i32 %361, 1
store i32 %362, i32* %11
%363 = sext i32 %361 to i64
%364 = getelementptr inbounds i8, i8* %91, i64 %363
store i8 %360, i8* %364
br label %365
365: ; preds = %356
br label %366
366: ; preds = %365
br label %367
367: ; preds = %366
%368 = load i32, i32* %6
%369 = add nsw i32 %368, 1
store i32 %369, i32* %6
br label %124
370: ; preds = %321, %207, %124
%371 = load i32, i32* @SHRT_MAX
%372 = zext i32 %371 to i64
%373 = alloca i8, i64 %372
store i64 %372, i64* %13
%374 = getelementptr inbounds i8, i8* %373, i64 0
store i8 104, i8* %374
%375 = getelementptr inbounds i8, i8* %373, i64 1
store i8 111, i8* %375
%376 = getelementptr inbounds i8, i8* %373, i64 2
store i8 115, i8* %376
%377 = getelementptr inbounds i8, i8* %373, i64 3
store i8 116, i8* %377
%378 = getelementptr inbounds i8, i8* %373, i64 4
store i8 32, i8* %378
%379 = load i32, i32* %12
%380 = icmp eq i32 %379, 1
br i1 %380, label %381, label %420
381: ; preds = %370
%382 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %91)
store i32 0, i32* %6
br label %383
383: ; preds = %396, %381
%384 = load i32, i32* %6
%385 = load i32, i32* @SHRT_MAX
%386 = icmp slt i32 %384, %385
br i1 %386, label %387, label %399
387: ; preds = %383
%388 = load i32, i32* %6
%389 = sext i32 %388 to i64
%390 = getelementptr inbounds i8, i8* %91, i64 %389
%391 = load i8, i8* %390
%392 = call signext i8 @toupper(i8 signext %391)
%393 = load i32, i32* %6
%394 = sext i32 %393 to i64
%395 = getelementptr inbounds i8, i8* %91, i64 %394
store i8 %392, i8* %395
br label %396
396: ; preds = %387
%397 = load i32, i32* %6
%398 = add nsw i32 %397, 1
store i32 %398, i32* %6
br label %383
399: ; preds = %383
%400 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %91)
store i32 0, i32* %6
br label %401
401: ; preds = %414, %399
%402 = load i32, i32* %6
%403 = load i32, i32* @SHRT_MAX
%404 = icmp slt i32 %402, %403
br i1 %404, label %405, label %417
405: ; preds = %401
%406 = load i32, i32* %6
%407 = sext i32 %406 to i64
%408 = getelementptr inbounds i8, i8* %91, i64 %407
%409 = load i8, i8* %408
%410 = load i32, i32* %6
%411 = add nsw i32 %410, 5
%412 = sext i32 %411 to i64
%413 = getelementptr inbounds i8, i8* %373, i64 %412
store i8 %409, i8* %413
br label %414
414: ; preds = %405
%415 = load i32, i32* %6
%416 = add nsw i32 %415, 1
store i32 %416, i32* %6
br label %401
417: ; preds = %401
store i8* %373, i8** %14
%418 = load i8*, i8** %14
%419 = call i32 @system(i8* %418)
br label %422
420: ; preds = %370
%421 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %91)
br label %422
422: ; preds = %420, %417
store i32 0, i32* %7
br label %423
423: ; preds = %422, %86, %27
%424 = load i8*, i8** %4
%425 = load i32, i32* %7
switch i32 %425, label %427 [
i32 0, label %426
i32 1, label %426
]
426: ; preds = %423, %423
ret void
427: ; preds = %423
unreachable
}

LLVM IR (-O2):
@SHRT_MAX = global i32 0
@.str.1 = [28 x i8] c"ill formatted protocol, %s\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [6 x i8] c", %s\0A\00"
@.str.4 = [14 x i8] c"no ending %s\0A\00"
@str = [10 x i8] c"has space\00"
define void @main() {
%1 = load i32, i32* @SHRT_MAX
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
br label %4
4: ; preds = %13, %0
%5 = phi i64 [ %15, %13 ], [ 0, %0 ]
%6 = tail call i32 (...) @getchar()
switch i32 %6, label %13 [
i32 10, label %7
i32 32, label %11
]
7: ; preds = %4
%8 = load i8, i8* %3
%9 = tail call signext i8 @tolower(i8 signext %8)
%10 = icmp eq i8 %9, 104
br i1 %10, label %17, label %72
11: ; preds = %4
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %260
13: ; preds = %4
%14 = trunc i32 %6 to i8
%15 = add nuw i64 %5, 1
%16 = getelementptr inbounds i8, i8* %3, i64 %5
store i8 %14, i8* %16
br label %4
17: ; preds = %7
%18 = getelementptr inbounds i8, i8* %3, i64 1
%19 = load i8, i8* %18
%20 = tail call signext i8 @tolower(i8 signext %19)
%21 = icmp eq i8 %20, 116
br i1 %21, label %22, label %72
22: ; preds = %17
%23 = getelementptr inbounds i8, i8* %3, i64 2
%24 = load i8, i8* %23
%25 = tail call signext i8 @tolower(i8 signext %24)
%26 = icmp eq i8 %25, 116
br i1 %26, label %27, label %72
27: ; preds = %22
%28 = getelementptr inbounds i8, i8* %3, i64 3
%29 = load i8, i8* %28
%30 = tail call signext i8 @tolower(i8 signext %29)
%31 = icmp eq i8 %30, 112
br i1 %31, label %32, label %72
32: ; preds = %27
%33 = getelementptr inbounds i8, i8* %3, i64 4
%34 = load i8, i8* %33
%35 = tail call signext i8 @tolower(i8 signext %34)
%36 = icmp eq i8 %35, 115
br i1 %36, label %37, label %72
37: ; preds = %32
%38 = getelementptr inbounds i8, i8* %3, i64 5
%39 = load i8, i8* %38
%40 = tail call signext i8 @tolower(i8 signext %39)
%41 = icmp eq i8 %40, 58
br i1 %41, label %42, label %72
42: ; preds = %37
%43 = getelementptr inbounds i8, i8* %3, i64 6
%44 = load i8, i8* %43
%45 = tail call signext i8 @tolower(i8 signext %44)
%46 = icmp eq i8 %45, 47
br i1 %46, label %47, label %72
47: ; preds = %42
%48 = getelementptr inbounds i8, i8* %3, i64 7
%49 = load i8, i8* %48
%50 = tail call signext i8 @tolower(i8 signext %49)
%51 = icmp eq i8 %50, 47
br i1 %51, label %52, label %72
52: ; preds = %47
%53 = getelementptr inbounds i8, i8* %3, i64 8
%54 = load i8, i8* %53
%55 = tail call signext i8 @tolower(i8 signext %54)
%56 = icmp eq i8 %55, 119
br i1 %56, label %57, label %72
57: ; preds = %52
%58 = getelementptr inbounds i8, i8* %3, i64 9
%59 = load i8, i8* %58
%60 = tail call signext i8 @tolower(i8 signext %59)
%61 = icmp eq i8 %60, 119
br i1 %61, label %62, label %72
62: ; preds = %57
%63 = getelementptr inbounds i8, i8* %3, i64 10
%64 = load i8, i8* %63
%65 = tail call signext i8 @tolower(i8 signext %64)
%66 = icmp eq i8 %65, 119
br i1 %66, label %67, label %72
67: ; preds = %62
%68 = getelementptr inbounds i8, i8* %3, i64 11
%69 = load i8, i8* %68
%70 = tail call signext i8 @tolower(i8 signext %69)
%71 = icmp ne i8 %70, 46
br label %72
72: ; preds = %67, %62, %57, %52, %47, %42, %37, %32, %27, %22, %17, %7
%73 = phi i1 [ true, %7 ], [ true, %17 ], [ true, %22 ], [ true, %27 ], [ true, %32 ], [ true, %37 ], [ true, %42 ], [ true, %47 ], [ true, %52 ], [ true, %57 ], [ true, %62 ], [ %71, %67 ]
%74 = xor i1 %73, true
%75 = tail call signext i8 @tolower(i8 signext %8)
%76 = icmp eq i8 %75, 104
br i1 %76, label %77, label %129
77: ; preds = %72
%78 = getelementptr inbounds i8, i8* %3, i64 1
%79 = load i8, i8* %78
%80 = tail call signext i8 @tolower(i8 signext %79)
%81 = icmp eq i8 %80, 116
br i1 %81, label %82, label %129
82: ; preds = %77
%83 = getelementptr inbounds i8, i8* %3, i64 2
%84 = load i8, i8* %83
%85 = tail call signext i8 @tolower(i8 signext %84)
%86 = icmp eq i8 %85, 116
br i1 %86, label %87, label %129
87: ; preds = %82
%88 = getelementptr inbounds i8, i8* %3, i64 3
%89 = load i8, i8* %88
%90 = tail call signext i8 @tolower(i8 signext %89)
%91 = icmp eq i8 %90, 112
br i1 %91, label %92, label %129
92: ; preds = %87
%93 = getelementptr inbounds i8, i8* %3, i64 4
%94 = load i8, i8* %93
%95 = tail call signext i8 @tolower(i8 signext %94)
%96 = icmp eq i8 %95, 58
br i1 %96, label %97, label %129
97: ; preds = %92
%98 = getelementptr inbounds i8, i8* %3, i64 5
%99 = load i8, i8* %98
%100 = tail call signext i8 @tolower(i8 signext %99)
%101 = icmp eq i8 %100, 47
br i1 %101, label %102, label %129
102: ; preds = %97
%103 = getelementptr inbounds i8, i8* %3, i64 6
%104 = load i8, i8* %103
%105 = tail call signext i8 @tolower(i8 signext %104)
%106 = icmp eq i8 %105, 47
br i1 %106, label %107, label %129
107: ; preds = %102
%108 = getelementptr inbounds i8, i8* %3, i64 7
%109 = load i8, i8* %108
%110 = tail call signext i8 @tolower(i8 signext %109)
%111 = icmp eq i8 %110, 119
br i1 %111, label %112, label %129
112: ; preds = %107
%113 = getelementptr inbounds i8, i8* %3, i64 8
%114 = load i8, i8* %113
%115 = tail call signext i8 @tolower(i8 signext %114)
%116 = icmp eq i8 %115, 119
br i1 %116, label %117, label %129
117: ; preds = %112
%118 = getelementptr inbounds i8, i8* %3, i64 9
%119 = load i8, i8* %118
%120 = tail call signext i8 @tolower(i8 signext %119)
%121 = icmp eq i8 %120, 119
br i1 %121, label %122, label %129
122: ; preds = %117
%123 = getelementptr inbounds i8, i8* %3, i64 10
%124 = load i8, i8* %123
%125 = tail call signext i8 @tolower(i8 signext %124)
%126 = icmp eq i8 %125, 46
%127 = xor i1 %73, true
%128 = select i1 %126, i1 true, i1 %127
br i1 %128, label %132, label %130
129: ; preds = %117, %112, %107, %102, %97, %92, %87, %82, %77, %72
br i1 %73, label %130, label %132
130: ; preds = %122, %129
%131 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %260
132: ; preds = %122, %129
%133 = load i32, i32* @SHRT_MAX
%134 = zext i32 %133 to i64
%135 = alloca i8, i64 %134
%136 = icmp sgt i32 %133, 0
br i1 %136, label %137, label %258
137: ; preds = %132
%138 = and i64 %134, 1
%139 = icmp eq i32 %133, 1
br i1 %139, label %142, label %140
140: ; preds = %137
%141 = and i64 %134, 4294967294
br label %158
142: ; preds = %176, %137
%143 = phi i64 [ 0, %137 ], [ %171, %176 ]
%144 = icmp eq i64 %138, 0
br i1 %144, label %153, label %145
145: ; preds = %142
%146 = icmp ugt i64 %143, 3
%147 = select i1 %74, i1 %146, i1 false
br i1 %147, label %148, label %153
148: ; preds = %145
%149 = add nuw nsw i64 %143, 1
%150 = getelementptr inbounds i8, i8* %3, i64 %149
%151 = load i8, i8* %150
%152 = getelementptr inbounds i8, i8* %3, i64 %143
store i8 %151, i8* %152
br label %153
153: ; preds = %145, %148, %142
%154 = icmp sgt i32 %133, 7
br i1 %154, label %155, label %258
155: ; preds = %153
%156 = add nsw i32 %133, -7
%157 = zext i32 %156 to i64
br label %179
158: ; preds = %176, %140
%159 = phi i64 [ 0, %140 ], [ %171, %176 ]
%160 = phi i64 [ 0, %140 ], [ %177, %176 ]
%161 = icmp ugt i64 %159, 3
%162 = select i1 %74, i1 %161, i1 false
%163 = or i64 %159, 1
br i1 %162, label %164, label %168
164: ; preds = %158
%165 = getelementptr inbounds i8, i8* %3, i64 %163
%166 = load i8, i8* %165
%167 = getelementptr inbounds i8, i8* %3, i64 %159
store i8 %166, i8* %167
br label %168
168: ; preds = %158, %164
%169 = icmp ugt i64 %159, 2
%170 = select i1 %74, i1 %169, i1 false
%171 = add nuw nsw i64 %159, 2
br i1 %170, label %172, label %176
172: ; preds = %168
%173 = getelementptr inbounds i8, i8* %3, i64 %171
%174 = load i8, i8* %173
%175 = getelementptr inbounds i8, i8* %3, i64 %163
store i8 %174, i8* %175
br label %176
176: ; preds = %172, %168
%177 = add i64 %160, 2
%178 = icmp eq i64 %177, %141
br i1 %178, label %142, label %158
179: ; preds = %155, %214
%180 = phi i64 [ 0, %155 ], [ %215, %214 ]
%181 = phi i64 [ 7, %155 ], [ %185, %214 ]
%182 = getelementptr inbounds i8, i8* %3, i64 %181
%183 = load i8, i8* %182
%184 = icmp eq i8 %183, 46
%185 = add nuw nsw i64 %181, 1
br i1 %184, label %186, label %214
186: ; preds = %179
%187 = getelementptr inbounds i8, i8* %3, i64 %185
%188 = load i8, i8* %187
switch i8 %188, label %214 [
i8 101, label %189
i8 69, label %189
i8 99, label %202
i8 67, label %202
]
189: ; preds = %186, %186
%190 = add nuw nsw i64 %181, 2
%191 = getelementptr inbounds i8, i8* %3, i64 %190
%192 = load i8, i8* %191
switch i8 %192, label %201 [
i8 100, label %193
i8 68, label %193
]
193: ; preds = %189, %189
%194 = add nuw nsw i64 %181, 3
%195 = getelementptr inbounds i8, i8* %3, i64 %194
%196 = load i8, i8* %195
switch i8 %196, label %201 [
i8 117, label %197
i8 85, label %197
]
197: ; preds = %193, %193
%198 = add nuw nsw i64 %181, 4
%199 = getelementptr inbounds i8, i8* %3, i64 %198
%200 = load i8, i8* %199
switch i8 %200, label %201 [
i8 47, label %218
i8 0, label %218
i8 58, label %218
]
201: ; preds = %197, %193, %189
switch i8 %188, label %214 [
i8 99, label %202
i8 67, label %202
]
202: ; preds = %186, %186, %201, %201
%203 = add nuw nsw i64 %181, 2
%204 = getelementptr inbounds i8, i8* %3, i64 %203
%205 = load i8, i8* %204
switch i8 %205, label %214 [
i8 111, label %206
i8 79, label %206
]
206: ; preds = %202, %202
%207 = add nuw nsw i64 %181, 3
%208 = getelementptr inbounds i8, i8* %3, i64 %207
%209 = load i8, i8* %208
switch i8 %209, label %214 [
i8 109, label %210
i8 77, label %210
]
210: ; preds = %206, %206
%211 = add nuw nsw i64 %181, 4
%212 = getelementptr inbounds i8, i8* %3, i64 %211
%213 = load i8, i8* %212
switch i8 %213, label %214 [
i8 47, label %218
i8 0, label %218
i8 58, label %218
]
214: ; preds = %186, %179, %210, %206, %202, %201
%215 = add nuw nsw i64 %180, 1
%216 = getelementptr inbounds i8, i8* %135, i64 %180
store i8 %183, i8* %216
%217 = icmp eq i64 %215, %157
br i1 %217, label %258, label %179
218: ; preds = %210, %210, %210, %197, %197, %197
%219 = phi i8 [ %192, %197 ], [ %192, %197 ], [ %192, %197 ], [ %205, %210 ], [ %205, %210 ], [ %205, %210 ]
%220 = phi i8 [ %196, %197 ], [ %196, %197 ], [ %196, %197 ], [ %209, %210 ], [ %209, %210 ], [ %209, %210 ]
%221 = and i64 %180, 4294967295
%222 = getelementptr inbounds i8, i8* %135, i64 %221
store i8 46, i8* %222
%223 = add nuw i64 %180, 1
%224 = and i64 %223, 4294967295
%225 = getelementptr inbounds i8, i8* %135, i64 %224
store i8 %188, i8* %225
%226 = add nuw i64 %180, 2
%227 = and i64 %226, 4294967295
%228 = getelementptr inbounds i8, i8* %135, i64 %227
store i8 %219, i8* %228
%229 = add nuw i64 %180, 3
%230 = and i64 %229, 4294967295
%231 = getelementptr inbounds i8, i8* %135, i64 %230
store i8 %220, i8* %231
%232 = alloca i8, i64 %134
store i8 104, i8* %232
%233 = getelementptr inbounds i8, i8* %232, i64 1
store i8 111, i8* %233
%234 = getelementptr inbounds i8, i8* %232, i64 2
store i8 115, i8* %234
%235 = getelementptr inbounds i8, i8* %232, i64 3
store i8 116, i8* %235
%236 = getelementptr inbounds i8, i8* %232, i64 4
store i8 32, i8* %236
%237 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %135)
%238 = load i32, i32* @SHRT_MAX
%239 = icmp sgt i32 %238, 0
br i1 %239, label %240, label %249
240: ; preds = %218, %240
%241 = phi i64 [ %245, %240 ], [ 0, %218 ]
%242 = getelementptr inbounds i8, i8* %135, i64 %241
%243 = load i8, i8* %242
%244 = call signext i8 @toupper(i8 signext %243)
store i8 %244, i8* %242
%245 = add nuw nsw i64 %241, 1
%246 = load i32, i32* @SHRT_MAX
%247 = sext i32 %246 to i64
%248 = icmp slt i64 %245, %247
br i1 %248, label %240, label %249
249: ; preds = %240, %218
%250 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %135)
%251 = load i32, i32* @SHRT_MAX
%252 = icmp sgt i32 %251, 0
br i1 %252, label %253, label %256
253: ; preds = %249
%254 = getelementptr i8, i8* %232, i64 5
%255 = zext i32 %251 to i64
br label %256
256: ; preds = %253, %249
%257 = call i32 @system(i8* %232)
br label %260
258: ; preds = %214, %132, %153
%259 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %135)
br label %260
260: ; preds = %130, %258, %256, %11
ret void
}