#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*/ error_exit(int /*<<< orphan*/, ...);
int /*<<< orphan*/ gettext(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
char *strchr(char const *, char);
char *strdup(char *);
size_t strlen(char const *);
scalar_t__ strncasecmp(char const *, char *, int);
void interpret_url(const char *in, char **path, char **hostname, int *portnr,
                   char use_ipv6, char use_ssl, char **complete_url,
                   char **auth_user, char **auth_password) {
  char in_use[65536] = {0}, *dummy = NULL;
  if (strlen(in) >= sizeof in_use)
    error_exit(gettext("URL too big, HTTPing has a %d bytes limit"),
               sizeof in_use - 1);
  if (strncasecmp(in, "http://", 7) == 0 ||
      strncasecmp(in, "https://", 8) == 0) {
    snprintf(in_use, sizeof in_use - 1, "%s", in);
    if (strchr(&in[8], '/') == NULL)
      in_use[strlen(in_use)] = '/';
  } else if (strchr(in, '/'))
    sprintf(in_use, "http://%s", in);
  else if (use_ssl)
    sprintf(in_use, "https://%s/", in);
  else
    sprintf(in_use, "http://%s/", in);
  if (strncasecmp(in_use, "http://", 7) == 0 && use_ssl)
    error_exit(gettext("using \"http://\" with SSL enabled (-l)"));
  *complete_url = strdup(in_use);
  if (strncasecmp(in_use, "http://", 7) == 0)
    *hostname = strdup(&in_use[7]);
  else
    *hostname = strdup(&in_use[8]);
  dummy = strchr(*hostname, '/');
  if (dummy)
    *dummy = 0x00;
  if (use_ssl || strncasecmp(in, "https://", 8) == 0)
    *portnr = 443;
  else
    *portnr = 80;
  if (!use_ipv6) {
    char *at = strchr(*hostname, '@');
    char *colon = strchr(*hostname, ':');
    char *colon2 = colon ? strchr(colon + 1, ':') : NULL;
    if (colon2) {
      *colon2 = 0x00;
      *portnr = atoi(colon2 + 1);
      if (at) {
        *colon = 0x00;
        *at = 0x00;
        *auth_user = strdup(*hostname);
        *auth_password = strdup(colon + 1);
      }
    } else if (colon) {
      if (colon < at) {
        *colon = 0x00;
        *at = 0x00;
        *auth_user = strdup(*hostname);
        *auth_password = strdup(colon + 1);
      } else if (at) {
        *at = 0x00;
        *auth_user = strdup(*hostname);
      } else {
        *colon = 0x00;
        *portnr = atoi(colon + 1);
      }
    }
  }
  dummy = strchr(&in_use[8], '/');
  if (dummy)
    *path = strdup(dummy);
  else
    *path = strdup("/");
}


x86 assembly (clang, -O0):
<interpret_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10080,%rsp
mov    %r8d,-0x1006c(%rbp)
mov    %rcx,%rax
mov    -0x1006c(%rbp),%ecx
mov    %rax,-0x10068(%rbp)
mov    %rdx,%rax
mov    -0x10068(%rbp),%rdx
mov    %rax,-0x10060(%rbp)
mov    %rsi,%rax
mov    -0x10060(%rbp),%rsi
mov    %rax,-0x10058(%rbp)
mov    %rdi,%r8
mov    -0x10058(%rbp),%rdi
mov    %r9b,%al
mov    0x20(%rbp),%r9
mov    0x18(%rbp),%r9
mov    0x10(%rbp),%r9
mov    %r8,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %cl,-0x21(%rbp)
mov    %al,-0x22(%rbp)
lea    -0x10030(%rbp),%rdi
xor    %esi,%esi
mov    $0x10000,%edx
call   1070 <memset@plt>
movq   $0x0,-0x10038(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x10000,%rax
jb     1260 <interpret_url+0xc0>
lea    0xdb3(%rip),%rdi
call   1040 <gettext@plt>
mov    %eax,%edi
mov    $0xffff,%esi
mov    $0x0,%al
call   1080 <error_exit@plt>
mov    -0x8(%rbp),%rdi
lea    0xdbf(%rip),%rsi
mov    $0x7,%edx
call   1090 <strncasecmp@plt>
cmp    $0x0,%rax
je     129e <interpret_url+0xfe>
mov    -0x8(%rbp),%rdi
lea    0xda8(%rip),%rsi
mov    $0x8,%edx
call   1090 <strncasecmp@plt>
cmp    $0x0,%rax
jne    12ef <interpret_url+0x14f>
lea    -0x10030(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0xffff,%esi
lea    0xd8d(%rip),%rdx
call   1060 <snprintf@plt>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
cmp    $0x0,%rax
jne    12ea <interpret_url+0x14a>
lea    -0x10030(%rbp),%rdi
call   1030 <strlen@plt>
movb   $0x2f,-0x10030(%rbp,%rax,1)
2f
jmp    136a <interpret_url+0x1ca>
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
cmp    $0x0,%rax
je     1323 <interpret_url+0x183>
lea    -0x10030(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xd22(%rip),%rsi
call   10b0 <sprintf@plt>
jmp    1365 <interpret_url+0x1c5>
cmpb   $0x0,-0x22(%rbp)
je     1349 <interpret_url+0x1a9>
lea    -0x10030(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xd06(%rip),%rsi
call   10b0 <sprintf@plt>
jmp    1360 <interpret_url+0x1c0>
lea    -0x10030(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xcf6(%rip),%rsi
call   10b0 <sprintf@plt>
jmp    1365 <interpret_url+0x1c5>
jmp    136a <interpret_url+0x1ca>
lea    -0x10030(%rbp),%rdi
lea    0xcb2(%rip),%rsi
mov    $0x7,%edx
call   1090 <strncasecmp@plt>
cmp    $0x0,%rax
jne    13ae <interpret_url+0x20e>
movsbl -0x22(%rbp),%eax
cmp    $0x0,%eax
je     13ae <interpret_url+0x20e>
lea    0xcbc(%rip),%rdi
call   1040 <gettext@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1080 <error_exit@plt>
lea    -0x10030(%rbp),%rdi
call   10c0 <strdup@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
lea    -0x10030(%rbp),%rdi
lea    0xc58(%rip),%rsi
mov    $0x7,%edx
call   1090 <strncasecmp@plt>
cmp    $0x0,%rax
jne    1405 <interpret_url+0x265>
lea    -0x10030(%rbp),%rdi
add    $0x7,%rdi
call   10c0 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    141f <interpret_url+0x27f>
lea    -0x10030(%rbp),%rdi
add    $0x8,%rdi
call   10c0 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
mov    %rax,-0x10038(%rbp)
cmpq   $0x0,-0x10038(%rbp)
je     144f <interpret_url+0x2af>
mov    -0x10038(%rbp),%rax
movb   $0x0,(%rax)
movsbl -0x22(%rbp),%eax
cmp    $0x0,%eax
jne    147b <interpret_url+0x2db>
mov    -0x8(%rbp),%rdi
lea    0xbcb(%rip),%rsi
mov    $0x8,%edx
call   1090 <strncasecmp@plt>
cmp    $0x0,%rax
jne    148a <interpret_url+0x2ea>
mov    -0x20(%rbp),%rax
movl   $0x1bb,(%rax)
jmp    1494 <interpret_url+0x2f4>
mov    -0x20(%rbp),%rax
movl   $0x50,(%rax)
cmpb   $0x0,-0x21(%rbp)
jne    1674 <interpret_url+0x4d4>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    $0x40,%esi
call   1050 <strchr@plt>
mov    %rax,-0x10040(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    %rax,-0x10048(%rbp)
cmpq   $0x0,-0x10048(%rbp)
je     14fd <interpret_url+0x35d>
mov    -0x10048(%rbp),%rdi
add    $0x1,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    %rax,-0x10078(%rbp)
jmp    150b <interpret_url+0x36b>
xor    %eax,%eax
mov    %rax,-0x10078(%rbp)
jmp    150b <interpret_url+0x36b>
mov    -0x10078(%rbp),%rax
mov    %rax,-0x10050(%rbp)
cmpq   $0x0,-0x10050(%rbp)
je     15a0 <interpret_url+0x400>
mov    -0x10050(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10050(%rbp),%rdi
add    $0x1,%rdi
call   10a0 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x10040(%rbp)
je     159b <interpret_url+0x3fb>
mov    -0x10048(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10040(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <strdup@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10048(%rbp),%rdi
add    $0x1,%rdi
call   10c0 <strdup@plt>
mov    %rax,%rcx
mov    0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    166f <interpret_url+0x4cf>
cmpq   $0x0,-0x10048(%rbp)
je     166a <interpret_url+0x4ca>
mov    -0x10048(%rbp),%rax
cmp    -0x10040(%rbp),%rax
jae    160b <interpret_url+0x46b>
mov    -0x10048(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10040(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <strdup@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10048(%rbp),%rdi
add    $0x1,%rdi
call   10c0 <strdup@plt>
mov    %rax,%rcx
mov    0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    1665 <interpret_url+0x4c5>
cmpq   $0x0,-0x10040(%rbp)
je     163e <interpret_url+0x49e>
mov    -0x10040(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   10c0 <strdup@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    1660 <interpret_url+0x4c0>
mov    -0x10048(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10048(%rbp),%rdi
add    $0x1,%rdi
call   10a0 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    1665 <interpret_url+0x4c5>
jmp    166a <interpret_url+0x4ca>
jmp    166f <interpret_url+0x4cf>
jmp    1674 <interpret_url+0x4d4>
lea    -0x10030(%rbp),%rdi
add    $0x8,%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
mov    %rax,-0x10038(%rbp)
cmpq   $0x0,-0x10038(%rbp)
je     16b9 <interpret_url+0x519>
mov    -0x10038(%rbp),%rdi
call   10c0 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    16cf <interpret_url+0x52f>
lea    0x970(%rip),%rdi
call   10c0 <strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10080,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpret_url>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10028,%rsp
mov    %r9d,%r13d
mov    %r8d,0xc(%rsp)
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0x20(%rsp),%rdi
mov    $0x10000,%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    %rbp,%rdi
call   1030 <strlen@plt>
cmp    $0x10000,%rax
jb     1200 <interpret_url+0x60>
lea    0xe13(%rip),%rdi
call   1040 <gettext@plt>
mov    $0xffff,%esi
mov    %eax,%edi
xor    %eax,%eax
call   1080 <error_exit@plt>
lea    0xe23(%rip),%rsi
mov    %rbp,%rdi
mov    $0x7,%edx
call   1090 <strncasecmp@plt>
test   %rax,%rax
mov    %rbx,0x10(%rsp)
mov    %r14,0x18(%rsp)
je     1257 <interpret_url+0xb7>
lea    0xe08(%rip),%rsi
mov    %rbp,%rdi
mov    $0x8,%edx
call   1090 <strncasecmp@plt>
test   %rax,%rax
je     1257 <interpret_url+0xb7>
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1298 <interpret_url+0xf8>
lea    0xde6(%rip),%rsi
jmp    12ad <interpret_url+0x10d>
lea    0xde4(%rip),%rdx
lea    0x20(%rsp),%rdi
mov    $0xffff,%esi
mov    %rbp,%rcx
call   1060 <snprintf@plt>
lea    0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
test   %rax,%rax
mov    0xc(%rsp),%ebx
jne    12be <interpret_url+0x11e>
lea    0x20(%rsp),%rdi
call   1030 <strlen@plt>
movb   $0x2f,0x20(%rsp,%rax,1)
jmp    12be <interpret_url+0x11e>
test   %r13b,%r13b
je     12a6 <interpret_url+0x106>
lea    0xda1(%rip),%rsi
jmp    12ad <interpret_url+0x10d>
lea    0xda4(%rip),%rsi
lea    0x20(%rsp),%rdi
mov    %rbp,%rdx
call   10b0 <sprintf@plt>
mov    0xc(%rsp),%ebx
mov    0x10060(%rsp),%r15
lea    0xd5d(%rip),%rsi
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x7,%edx
call   1090 <strncasecmp@plt>
test   %r13b,%r13b
je     12fe <interpret_url+0x15e>
test   %rax,%rax
jne    12fe <interpret_url+0x15e>
lea    0xd6c(%rip),%rdi
call   1040 <gettext@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1080 <error_exit@plt>
mov    %r14,%rdi
call   10c0 <strdup@plt>
mov    %rax,(%r15)
lea    0xd1a(%rip),%rsi
mov    %r14,%rdi
mov    $0x7,%edx
call   1090 <strncasecmp@plt>
cmp    $0x1,%rax
sbb    $0x0,%r14
add    $0x8,%r14
mov    %r14,%rdi
call   10c0 <strdup@plt>
mov    %r12,%r15
mov    %rax,(%r12)
mov    %rax,%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     134d <interpret_url+0x1ad>
movb   $0x0,(%rax)
mov    $0x1bb,%eax
test   %r13b,%r13b
mov    0x18(%rsp),%r13
jne    1380 <interpret_url+0x1e0>
lea    0xccf(%rip),%rsi
mov    %rbp,%rdi
mov    $0x8,%edx
call   1090 <strncasecmp@plt>
test   %rax,%rax
mov    $0x1bb,%ecx
mov    $0x50,%eax
cmove  %ecx,%eax
mov    %eax,0x0(%r13)
test   %bl,%bl
je     13a1 <interpret_url+0x201>
lea    0x28(%rsp),%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1401 <interpret_url+0x261>
mov    %rax,%rdi
jmp    1408 <interpret_url+0x268>
mov    (%r15),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1050 <strchr@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1388 <interpret_url+0x1e8>
mov    %rax,%rbx
mov    0x10068(%rsp),%r12
lea    0x1(%rax),%r14
mov    %r14,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1427 <interpret_url+0x287>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
call   10a0 <atoi@plt>
mov    %eax,0x0(%r13)
test   %rbp,%rbp
jne    142c <interpret_url+0x28c>
jmp    1388 <interpret_url+0x1e8>
lea    0xc28(%rip),%rdi
call   10c0 <strdup@plt>
mov    0x10(%rsp),%rcx
mov    %rax,(%rcx)
add    $0x10028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    %rbp,%rbx
jae    1457 <interpret_url+0x2b7>
movb   $0x0,(%rbx)
movb   $0x0,0x0(%rbp)
mov    (%r15),%rdi
call   10c0 <strdup@plt>
mov    %rax,(%r12)
mov    %r14,%rdi
call   10c0 <strdup@plt>
mov    0x10070(%rsp),%rcx
mov    %rax,(%rcx)
jmp    1388 <interpret_url+0x1e8>
test   %rbp,%rbp
je     1471 <interpret_url+0x2d1>
movb   $0x0,0x0(%rbp)
mov    (%r15),%rdi
call   10c0 <strdup@plt>
mov    %rax,(%r12)
jmp    1388 <interpret_url+0x1e8>
movb   $0x0,(%rbx)
mov    %r14,%rdi
call   10a0 <atoi@plt>
mov    %eax,0x0(%r13)
jmp    1388 <interpret_url+0x1e8>

LLVM IR (-O0):
@.str = [42 x i8] c"URL too big, HTTPing has a %d bytes limit\00"
@.str.1 = [8 x i8] c"http://\00"
@.str.2 = [9 x i8] c"https://\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [10 x i8] c"http://%s\00"
@.str.5 = [12 x i8] c"https://%s/\00"
@.str.6 = [11 x i8] c"http://%s/\00"
@.str.7 = [38 x i8] c"using \22http://\22 with SSL enabled (-l)\00"
@.str.8 = [2 x i8] c"/\00"
define void @interpret_url(i8* %0, i8** %1, i8** %2, i32* %3, i8 signext %4, i8 signext %5, i8** %6, i8** %7, i8** %8) {
%10 = alloca i8*
%11 = alloca i8**
%12 = alloca i8**
%13 = alloca i32*
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8**
%17 = alloca i8**
%18 = alloca i8**
%19 = alloca [65536 x i8]
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
store i8* %0, i8** %10
store i8** %1, i8*** %11
store i8** %2, i8*** %12
store i32* %3, i32** %13
store i8 %4, i8* %14
store i8 %5, i8* %15
store i8** %6, i8*** %16
store i8** %7, i8*** %17
store i8** %8, i8*** %18
%24 = bitcast [65536 x i8]* %19 to i8*
store i8* null, i8** %20
%25 = load i8*, i8** %10
%26 = call i64 @strlen(i8* %25)
%27 = icmp uge i64 %26, 65536
br i1 %27, label %28, label %31
28: ; preds = %9
%29 = call i32 @gettext(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%30 = call i32 (i32, ...) @error_exit(i32 %29, i64 65535)
br label %31
31: ; preds = %28, %9
%32 = load i8*, i8** %10
%33 = call i64 @strncasecmp(i8* %32, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%34 = icmp eq i64 %33, 0
br i1 %34, label %39, label %35
35: ; preds = %31
%36 = load i8*, i8** %10
%37 = call i64 @strncasecmp(i8* %36, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 8)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %52
39: ; preds = %35, %31
%40 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 0
%41 = load i8*, i8** %10
%42 = call i32 @snprintf(i8* %40, i32 65535, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %41)
%43 = load i8*, i8** %10
%44 = getelementptr inbounds i8, i8* %43, i64 8
%45 = call i8* @strchr(i8* %44, i8 signext 47)
%46 = icmp eq i8* %45, null
br i1 %46, label %47, label %51
47: ; preds = %39
%48 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 0
%49 = call i64 @strlen(i8* %48)
%50 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 %49
store i8 47, i8* %50
br label %51
51: ; preds = %47, %39
br label %73
52: ; preds = %35
%53 = load i8*, i8** %10
%54 = call i8* @strchr(i8* %53, i8 signext 47)
%55 = icmp ne i8* %54, null
br i1 %55, label %56, label %60
56: ; preds = %52
%57 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 0
%58 = load i8*, i8** %10
%59 = call i32 @sprintf(i8* %57, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %58)
br label %72
60: ; preds = %52
%61 = load i8, i8* %15
%62 = icmp ne i8 %61, 0
br i1 %62, label %63, label %67
63: ; preds = %60
%64 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 0
%65 = load i8*, i8** %10
%66 = call i32 @sprintf(i8* %64, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %65)
br label %71
67: ; preds = %60
%68 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 0
%69 = load i8*, i8** %10
%70 = call i32 @sprintf(i8* %68, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %69)
br label %71
71: ; preds = %67, %63
br label %72
72: ; preds = %71, %56
br label %73
73: ; preds = %72, %51
%74 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 0
%75 = call i64 @strncasecmp(i8* %74, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %84
77: ; preds = %73
%78 = load i8, i8* %15
%79 = sext i8 %78 to i32
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %77
%82 = call i32 @gettext(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%83 = call i32 (i32, ...) @error_exit(i32 %82)
br label %84
84: ; preds = %81, %77, %73
%85 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 0
%86 = call i8* @strdup(i8* %85)
%87 = load i8**, i8*** %16
store i8* %86, i8** %87
%88 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 0
%89 = call i64 @strncasecmp(i8* %88, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %95
91: ; preds = %84
%92 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 7
%93 = call i8* @strdup(i8* %92)
%94 = load i8**, i8*** %12
store i8* %93, i8** %94
br label %99
95: ; preds = %84
%96 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 8
%97 = call i8* @strdup(i8* %96)
%98 = load i8**, i8*** %12
store i8* %97, i8** %98
br label %99
99: ; preds = %95, %91
%100 = load i8**, i8*** %12
%101 = load i8*, i8** %100
%102 = call i8* @strchr(i8* %101, i8 signext 47)
store i8* %102, i8** %20
%103 = load i8*, i8** %20
%104 = icmp ne i8* %103, null
br i1 %104, label %105, label %107
105: ; preds = %99
%106 = load i8*, i8** %20
store i8 0, i8* %106
br label %107
107: ; preds = %105, %99
%108 = load i8, i8* %15
%109 = sext i8 %108 to i32
%110 = icmp ne i32 %109, 0
br i1 %110, label %115, label %111
111: ; preds = %107
%112 = load i8*, i8** %10
%113 = call i64 @strncasecmp(i8* %112, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 8)
%114 = icmp eq i64 %113, 0
br i1 %114, label %115, label %117
115: ; preds = %111, %107
%116 = load i32*, i32** %13
store i32 443, i32* %116
br label %119
117: ; preds = %111
%118 = load i32*, i32** %13
store i32 80, i32* %118
br label %119
119: ; preds = %117, %115
%120 = load i8, i8* %14
%121 = icmp ne i8 %120, 0
br i1 %121, label %197, label %122
122: ; preds = %119
%123 = load i8**, i8*** %12
%124 = load i8*, i8** %123
%125 = call i8* @strchr(i8* %124, i8 signext 64)
store i8* %125, i8** %21
%126 = load i8**, i8*** %12
%127 = load i8*, i8** %126
%128 = call i8* @strchr(i8* %127, i8 signext 58)
store i8* %128, i8** %22
%129 = load i8*, i8** %22
%130 = icmp ne i8* %129, null
br i1 %130, label %131, label %135
131: ; preds = %122
%132 = load i8*, i8** %22
%133 = getelementptr inbounds i8, i8* %132, i64 1
%134 = call i8* @strchr(i8* %133, i8 signext 58)
br label %136
135: ; preds = %122
br label %136
136: ; preds = %135, %131
%137 = phi i8* [ %134, %131 ], [ null, %135 ]
store i8* %137, i8** %23
%138 = load i8*, i8** %23
%139 = icmp ne i8* %138, null
br i1 %139, label %140, label %160
140: ; preds = %136
%141 = load i8*, i8** %23
store i8 0, i8* %141
%142 = load i8*, i8** %23
%143 = getelementptr inbounds i8, i8* %142, i64 1
%144 = call i32 @atoi(i8* %143)
%145 = load i32*, i32** %13
store i32 %144, i32* %145
%146 = load i8*, i8** %21
%147 = icmp ne i8* %146, null
br i1 %147, label %148, label %159
148: ; preds = %140
%149 = load i8*, i8** %22
store i8 0, i8* %149
%150 = load i8*, i8** %21
store i8 0, i8* %150
%151 = load i8**, i8*** %12
%152 = load i8*, i8** %151
%153 = call i8* @strdup(i8* %152)
%154 = load i8**, i8*** %17
store i8* %153, i8** %154
%155 = load i8*, i8** %22
%156 = getelementptr inbounds i8, i8* %155, i64 1
%157 = call i8* @strdup(i8* %156)
%158 = load i8**, i8*** %18
store i8* %157, i8** %158
br label %159
159: ; preds = %148, %140
br label %196
160: ; preds = %136
%161 = load i8*, i8** %22
%162 = icmp ne i8* %161, null
br i1 %162, label %163, label %195
163: ; preds = %160
%164 = load i8*, i8** %22
%165 = load i8*, i8** %21
%166 = icmp ult i8* %164, %165
br i1 %166, label %167, label %178
167: ; preds = %163
%168 = load i8*, i8** %22
store i8 0, i8* %168
%169 = load i8*, i8** %21
store i8 0, i8* %169
%170 = load i8**, i8*** %12
%171 = load i8*, i8** %170
%172 = call i8* @strdup(i8* %171)
%173 = load i8**, i8*** %17
store i8* %172, i8** %173
%174 = load i8*, i8** %22
%175 = getelementptr inbounds i8, i8* %174, i64 1
%176 = call i8* @strdup(i8* %175)
%177 = load i8**, i8*** %18
store i8* %176, i8** %177
br label %194
178: ; preds = %163
%179 = load i8*, i8** %21
%180 = icmp ne i8* %179, null
br i1 %180, label %181, label %187
181: ; preds = %178
%182 = load i8*, i8** %21
store i8 0, i8* %182
%183 = load i8**, i8*** %12
%184 = load i8*, i8** %183
%185 = call i8* @strdup(i8* %184)
%186 = load i8**, i8*** %17
store i8* %185, i8** %186
br label %193
187: ; preds = %178
%188 = load i8*, i8** %22
store i8 0, i8* %188
%189 = load i8*, i8** %22
%190 = getelementptr inbounds i8, i8* %189, i64 1
%191 = call i32 @atoi(i8* %190)
%192 = load i32*, i32** %13
store i32 %191, i32* %192
br label %193
193: ; preds = %187, %181
br label %194
194: ; preds = %193, %167
br label %195
195: ; preds = %194, %160
br label %196
196: ; preds = %195, %159
br label %197
197: ; preds = %196, %119
%198 = getelementptr inbounds [65536 x i8], [65536 x i8]* %19, i64 0, i64 8
%199 = call i8* @strchr(i8* %198, i8 signext 47)
store i8* %199, i8** %20
%200 = load i8*, i8** %20
%201 = icmp ne i8* %200, null
br i1 %201, label %202, label %206
202: ; preds = %197
%203 = load i8*, i8** %20
%204 = call i8* @strdup(i8* %203)
%205 = load i8**, i8*** %11
store i8* %204, i8** %205
br label %209
206: ; preds = %197
%207 = call i8* @strdup(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%208 = load i8**, i8*** %11
store i8* %207, i8** %208
br label %209
209: ; preds = %206, %202
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"URL too big, HTTPing has a %d bytes limit\00"
@.str.1 = [8 x i8] c"http://\00"
@.str.2 = [9 x i8] c"https://\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [10 x i8] c"http://%s\00"
@.str.5 = [12 x i8] c"https://%s/\00"
@.str.6 = [11 x i8] c"http://%s/\00"
@.str.7 = [38 x i8] c"using \22http://\22 with SSL enabled (-l)\00"
@.str.8 = [2 x i8] c"/\00"
define void @interpret_url(i8* %0, i8** nocapture writeonly %1, i8** nocapture %2, i32* nocapture writeonly %3, i8 signext %4, i8 signext %5, i8** nocapture writeonly %6, i8** nocapture writeonly %7, i8** nocapture writeonly %8) {
%10 = alloca [65536 x i8]
%11 = getelementptr inbounds [65536 x i8], [65536 x i8]* %10, i64 0, i64 0
%12 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%13 = icmp ugt i64 %12, 65535
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = tail call i32 @gettext(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%16 = tail call i32 (i32, ...) @error_exit(i32 %15, i64 65535)
br label %17
17: ; preds = %14, %9
%18 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%19 = icmp eq i64 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 8)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %31
23: ; preds = %20, %17
%24 = call i32 @snprintf(i8* %11, i32 65535, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%25 = getelementptr inbounds i8, i8* %0, i64 8
%26 = call i8* @strchr(i8* %25, i8 signext 47)
%27 = icmp eq i8* %26, null
br i1 %27, label %28, label %42
28: ; preds = %23
%29 = call i64 @strlen(i8* %11)
%30 = getelementptr inbounds [65536 x i8], [65536 x i8]* %10, i64 0, i64 %29
store i8 47, i8* %30
br label %42
31: ; preds = %20
%32 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 47)
%33 = icmp eq i8* %32, null
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = call i32 @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %0)
br label %42
36: ; preds = %31
%37 = icmp eq i8 %5, 0
br i1 %37, label %40, label %38
38: ; preds = %36
%39 = call i32 @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %0)
br label %42
40: ; preds = %36
%41 = call i32 @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %0)
br label %42
42: ; preds = %34, %40, %38, %23, %28
%43 = call i64 @strncasecmp(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%44 = icmp eq i64 %43, 0
%45 = icmp ne i8 %5, 0
%46 = and i1 %45, %44
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = call i32 @gettext(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%49 = call i32 (i32, ...) @error_exit(i32 %48)
br label %50
50: ; preds = %47, %42
%51 = call i8* @strdup(i8* %11)
store i8* %51, i8** %6
%52 = call i64 @strncasecmp(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%53 = icmp eq i64 %52, 0
%54 = select i1 %53, i64 7, i64 8
%55 = getelementptr inbounds [65536 x i8], [65536 x i8]* %10, i64 0, i64 %54
%56 = call i8* @strdup(i8* %55)
store i8* %56, i8** %2
%57 = call i8* @strchr(i8* dereferenceable(1) %56, i8 signext 47)
%58 = icmp eq i8* %57, null
br i1 %58, label %60, label %59
59: ; preds = %50
store i8 0, i8* %57
br label %60
60: ; preds = %59, %50
br i1 %45, label %65, label %61
61: ; preds = %60
%62 = call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 8)
%63 = icmp eq i64 %62, 0
%64 = select i1 %63, i32 443, i32 80
br label %65
65: ; preds = %61, %60
%66 = phi i32 [ 443, %60 ], [ %64, %61 ]
store i32 %66, i32* %3
%67 = icmp eq i8 %4, 0
br i1 %67, label %68, label %98
68: ; preds = %65
%69 = load i8*, i8** %2
%70 = call i8* @strchr(i8* dereferenceable(1) %69, i8 signext 64)
%71 = call i8* @strchr(i8* dereferenceable(1) %69, i8 signext 58)
%72 = icmp eq i8* %71, null
br i1 %72, label %98, label %73
73: ; preds = %68
%74 = getelementptr inbounds i8, i8* %71, i64 1
%75 = call i8* @strchr(i8* %74, i8 signext 58)
%76 = icmp eq i8* %75, null
br i1 %76, label %85, label %77
77: ; preds = %73
store i8 0, i8* %75
%78 = getelementptr inbounds i8, i8* %75, i64 1
%79 = call i32 @atoi(i8* %78)
store i32 %79, i32* %3
%80 = icmp eq i8* %70, null
br i1 %80, label %98, label %81
81: ; preds = %77
store i8 0, i8* %71
store i8 0, i8* %70
%82 = load i8*, i8** %2
%83 = call i8* @strdup(i8* %82)
store i8* %83, i8** %7
%84 = call i8* @strdup(i8* %74)
store i8* %84, i8** %8
br label %98
85: ; preds = %73
%86 = icmp ult i8* %71, %70
br i1 %86, label %87, label %91
87: ; preds = %85
store i8 0, i8* %71
store i8 0, i8* %70
%88 = load i8*, i8** %2
%89 = call i8* @strdup(i8* %88)
store i8* %89, i8** %7
%90 = call i8* @strdup(i8* %74)
store i8* %90, i8** %8
br label %98
91: ; preds = %85
%92 = icmp eq i8* %70, null
br i1 %92, label %96, label %93
93: ; preds = %91
store i8 0, i8* %70
%94 = load i8*, i8** %2
%95 = call i8* @strdup(i8* %94)
store i8* %95, i8** %7
br label %98
96: ; preds = %91
store i8 0, i8* %71
%97 = call i32 @atoi(i8* %74)
store i32 %97, i32* %3
br label %98
98: ; preds = %68, %81, %77, %87, %96, %93, %65
%99 = getelementptr inbounds [65536 x i8], [65536 x i8]* %10, i64 0, i64 8
%100 = call i8* @strchr(i8* %99, i8 signext 47)
%101 = icmp eq i8* %100, null
br i1 %101, label %104, label %102
102: ; preds = %98
%103 = call i8* @strdup(i8* %100)
br label %106
104: ; preds = %98
%105 = call dereferenceable_or_null(2) i8* @strdup(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %106
106: ; preds = %104, %102
%107 = phi i8* [ %105, %104 ], [ %103, %102 ]
store i8* %107, i8** %1
ret void
}