#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 EINVAL;
int EPROTONOSUPPORT;
int /*<<< orphan*/ strcasecmp(char *, char *);
char *strchr(char *, char);
char *strdup(char *);
char *strrchr(char *, char);
char *strstr(char *, char *);
int strtol(char *, char **, int);
int openconnect_parse_url(char *url, char **res_proto, char **res_host,
                          int *res_port, char **res_path, int default_port) {
  char *proto = url;
  char *host, *path, *port_str;
  int port;
  host = strstr(url, "://");
  if (host) {
    *host = 0;
    host += 3;
    if (!strcasecmp(proto, "https"))
      port = 443;
    else if (!strcasecmp(proto, "http"))
      port = 80;
    else if (!strcasecmp(proto, "socks") || !strcasecmp(proto, "socks4") ||
             !strcasecmp(proto, "socks5"))
      port = 1080;
    else
      return -EPROTONOSUPPORT;
  } else {
    if (default_port) {
      proto = NULL;
      port = default_port;
      host = url;
    } else
      return -EINVAL;
  }
  path = strchr(host, '/');
  if (path)
    *(path++) = 0;
  port_str = strrchr(host, ':');
  if (port_str) {
    char *end;
    int new_port = strtol(port_str + 1, &end, 10);
    if (!*end) {
      *port_str = 0;
      port = new_port;
    }
  }
  if (res_proto)
    *res_proto = proto ? strdup(proto) : NULL;
  if (res_host)
    *res_host = strdup(host);
  if (res_port)
    *res_port = port;
  if (res_path)
    *res_path = (path && *path) ? strdup(path) : NULL;
  if (path)
    *(path - 1) = '/';
  if (proto)
    *(host - 3) = ':';
  return 0;
}


x86 assembly (clang, -O0):
<openconnect_parse_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1080 <strstr@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     1280 <openconnect_parse_url+0x120>
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x48(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11e2 <openconnect_parse_url+0x82>
movl   $0x1bb,-0x5c(%rbp)
jmp    127b <openconnect_parse_url+0x11b>
mov    -0x40(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1207 <openconnect_parse_url+0xa7>
movl   $0x50,-0x5c(%rbp)
jmp    1276 <openconnect_parse_url+0x116>
mov    -0x40(%rbp),%rdi
lea    0xdfd(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     1252 <openconnect_parse_url+0xf2>
mov    -0x40(%rbp),%rdi
lea    0xdea(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     1252 <openconnect_parse_url+0xf2>
mov    -0x40(%rbp),%rdi
lea    0xdd8(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    125e <openconnect_parse_url+0xfe>
movl   $0x438,-0x5c(%rbp)
jmp    1271 <openconnect_parse_url+0x111>
xor    %eax,%eax
mov    0x2d79(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    142c <openconnect_parse_url+0x2cc>
jmp    1276 <openconnect_parse_url+0x116>
jmp    127b <openconnect_parse_url+0x11b>
jmp    12bd <openconnect_parse_url+0x15d>
cmpl   $0x0,-0x34(%rbp)
je     12a5 <openconnect_parse_url+0x145>
movq   $0x0,-0x40(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    12b8 <openconnect_parse_url+0x158>
xor    %eax,%eax
mov    0x2d2a(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    142c <openconnect_parse_url+0x2cc>
jmp    12bd <openconnect_parse_url+0x15d>
mov    -0x48(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strchr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     12ec <openconnect_parse_url+0x18c>
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x50(%rbp)
movb   $0x0,(%rax)
mov    -0x48(%rbp),%rdi
mov    $0x3a,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     1341 <openconnect_parse_url+0x1e1>
mov    -0x58(%rbp),%rdi
add    $0x1,%rdi
lea    -0x68(%rbp),%rsi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%rax
cmpb   $0x0,(%rax)
jne    133c <openconnect_parse_url+0x1dc>
mov    -0x58(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
jmp    1341 <openconnect_parse_url+0x1e1>
cmpq   $0x0,-0x18(%rbp)
je     137f <openconnect_parse_url+0x21f>
cmpq   $0x0,-0x40(%rbp)
je     1369 <openconnect_parse_url+0x209>
mov    -0x40(%rbp),%rdi
call   1070 <strdup@plt>
mov    %rax,-0x78(%rbp)
jmp    1374 <openconnect_parse_url+0x214>
xor    %eax,%eax
mov    %rax,-0x78(%rbp)
jmp    1374 <openconnect_parse_url+0x214>
mov    -0x78(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     139d <openconnect_parse_url+0x23d>
mov    -0x48(%rbp),%rdi
call   1070 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x28(%rbp)
je     13b1 <openconnect_parse_url+0x251>
mov    -0x5c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x30(%rbp)
je     13ff <openconnect_parse_url+0x29f>
cmpq   $0x0,-0x50(%rbp)
je     13e9 <openconnect_parse_url+0x289>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     13e9 <openconnect_parse_url+0x289>
mov    -0x50(%rbp),%rdi
call   1070 <strdup@plt>
mov    %rax,-0x80(%rbp)
jmp    13f4 <openconnect_parse_url+0x294>
xor    %eax,%eax
mov    %rax,-0x80(%rbp)
jmp    13f4 <openconnect_parse_url+0x294>
mov    -0x80(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x50(%rbp)
je     1412 <openconnect_parse_url+0x2b2>
mov    -0x50(%rbp),%rax
movb   $0x2f,-0x1(%rax)
cmpq   $0x0,-0x40(%rbp)
je     1425 <openconnect_parse_url+0x2c5>
mov    -0x48(%rbp),%rax
movb   $0x3a,-0x3(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openconnect_parse_url>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9d,%r13d
mov    %r8,%r12
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,0x18(%rsp)
mov    %rdi,%rbx
lea    0xe77(%rip),%rsi
call   1080 <strstr@plt>
test   %rax,%rax
je     1212 <openconnect_parse_url+0xb2>
mov    %rax,%rbp
movb   $0x0,(%rax)
add    $0x3,%rbp
lea    0xe60(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1224 <openconnect_parse_url+0xc4>
lea    0xe53(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     122c <openconnect_parse_url+0xcc>
lea    0xe45(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    $0x438,%r13d
test   %eax,%eax
je     1232 <openconnect_parse_url+0xd2>
lea    0xe32(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1232 <openconnect_parse_url+0xd2>
lea    0xe26(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1232 <openconnect_parse_url+0xd2>
mov    0x2dd7(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
jmp    1322 <openconnect_parse_url+0x1c2>
xor    %eax,%eax
test   %r13d,%r13d
je     1319 <openconnect_parse_url+0x1b9>
mov    %rbx,%rbp
xor    %ebx,%ebx
jmp    1232 <openconnect_parse_url+0xd2>
mov    $0x1bb,%r13d
jmp    1232 <openconnect_parse_url+0xd2>
mov    $0x50,%r13d
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1040 <strchr@plt>
test   %rax,%rax
mov    %rbx,0x10(%rsp)
mov    %r13d,0xc(%rsp)
mov    %r12,%rbx
je     125d <openconnect_parse_url+0xfd>
mov    %rax,%r12
add    $0x1,%r12
movb   $0x0,(%rax)
jmp    1260 <openconnect_parse_url+0x100>
xor    %r12d,%r12d
mov    %rbp,%rdi
mov    $0x3a,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     129b <openconnect_parse_url+0x13b>
mov    %rax,%r13
lea    0x1(%rax),%rdi
lea    0x20(%rsp),%rsi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    0x20(%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    129b <openconnect_parse_url+0x13b>
movb   $0x0,0x0(%r13)
mov    %eax,0xc(%rsp)
mov    %rbx,%r13
mov    0x10(%rsp),%rbx
cmpq   $0x0,0x18(%rsp)
je     12c4 <openconnect_parse_url+0x164>
test   %rbx,%rbx
je     12ba <openconnect_parse_url+0x15a>
mov    %rbx,%rdi
call   1070 <strdup@plt>
jmp    12bc <openconnect_parse_url+0x15c>
xor    %eax,%eax
mov    0x18(%rsp),%rcx
mov    %rax,(%rcx)
test   %r15,%r15
je     12d4 <openconnect_parse_url+0x174>
mov    %rbp,%rdi
call   1070 <strdup@plt>
mov    %rax,(%r15)
test   %r14,%r14
je     12e0 <openconnect_parse_url+0x180>
mov    0xc(%rsp),%eax
mov    %eax,(%r14)
test   %r13,%r13
je     1301 <openconnect_parse_url+0x1a1>
test   %r12,%r12
je     12fb <openconnect_parse_url+0x19b>
cmpb   $0x0,(%r12)
je     12fb <openconnect_parse_url+0x19b>
mov    %r12,%rdi
call   1070 <strdup@plt>
jmp    12fd <openconnect_parse_url+0x19d>
xor    %eax,%eax
mov    %rax,0x0(%r13)
test   %r12,%r12
je     130c <openconnect_parse_url+0x1ac>
movb   $0x2f,-0x1(%r12)
xor    %eax,%eax
test   %rbx,%rbx
je     1322 <openconnect_parse_url+0x1c2>
movb   $0x3a,-0x3(%rbp)
jmp    1322 <openconnect_parse_url+0x1c2>
mov    0x2cb8(%rip),%rcx
sub    (%rcx),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"://\00"
@.str.1 = [6 x i8] c"https\00"
@.str.2 = [5 x i8] c"http\00"
@.str.3 = [6 x i8] c"socks\00"
@.str.4 = [7 x i8] c"socks4\00"
@.str.5 = [7 x i8] c"socks5\00"
@EPROTONOSUPPORT = global i32 0
@EINVAL = global i32 0
define i32 @openconnect_parse_url(i8* %0, i8** %1, i8** %2, i32* %3, i8** %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8**
%10 = alloca i8**
%11 = alloca i32*
%12 = alloca i8**
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i32
store i8* %0, i8** %8
store i8** %1, i8*** %9
store i8** %2, i8*** %10
store i32* %3, i32** %11
store i8** %4, i8*** %12
store i32 %5, i32* %13
%21 = load i8*, i8** %8
store i8* %21, i8** %14
%22 = load i8*, i8** %8
%23 = call i8* @strstr(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %23, i8** %15
%24 = load i8*, i8** %15
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %58
26: ; preds = %6
%27 = load i8*, i8** %15
store i8 0, i8* %27
%28 = load i8*, i8** %15
%29 = getelementptr inbounds i8, i8* %28, i64 3
store i8* %29, i8** %15
%30 = load i8*, i8** %14
%31 = call i32 @strcasecmp(i8* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%32 = icmp ne i32 %31, 0
br i1 %32, label %34, label %33
33: ; preds = %26
store i32 443, i32* %18
br label %57
34: ; preds = %26
%35 = load i8*, i8** %14
%36 = call i32 @strcasecmp(i8* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
br i1 %37, label %39, label %38
38: ; preds = %34
store i32 80, i32* %18
br label %56
39: ; preds = %34
%40 = load i8*, i8** %14
%41 = call i32 @strcasecmp(i8* %40, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %51
43: ; preds = %39
%44 = load i8*, i8** %14
%45 = call i32 @strcasecmp(i8* %44, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %51
47: ; preds = %43
%48 = load i8*, i8** %14
%49 = call i32 @strcasecmp(i8* %48, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%50 = icmp ne i32 %49, 0
br i1 %50, label %52, label %51
51: ; preds = %47, %43, %39
store i32 1080, i32* %18
br label %55
52: ; preds = %47
%53 = load i32, i32* @EPROTONOSUPPORT
%54 = sub nsw i32 0, %53
store i32 %54, i32* %7
br label %149
55: ; preds = %51
br label %56
56: ; preds = %55, %38
br label %57
57: ; preds = %56, %33
br label %68
58: ; preds = %6
%59 = load i32, i32* %13
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %58
store i8* null, i8** %14
%62 = load i32, i32* %13
store i32 %62, i32* %18
%63 = load i8*, i8** %8
store i8* %63, i8** %15
br label %67
64: ; preds = %58
%65 = load i32, i32* @EINVAL
%66 = sub nsw i32 0, %65
store i32 %66, i32* %7
br label %149
67: ; preds = %61
br label %68
68: ; preds = %67, %57
%69 = load i8*, i8** %15
%70 = call i8* @strchr(i8* %69, i8 signext 47)
store i8* %70, i8** %16
%71 = load i8*, i8** %16
%72 = icmp ne i8* %71, null
br i1 %72, label %73, label %76
73: ; preds = %68
%74 = load i8*, i8** %16
%75 = getelementptr inbounds i8, i8* %74, i32 1
store i8* %75, i8** %16
store i8 0, i8* %74
br label %76
76: ; preds = %73, %68
%77 = load i8*, i8** %15
%78 = call i8* @strrchr(i8* %77, i8 signext 58)
store i8* %78, i8** %17
%79 = load i8*, i8** %17
%80 = icmp ne i8* %79, null
br i1 %80, label %81, label %92
81: ; preds = %76
%82 = load i8*, i8** %17
%83 = getelementptr inbounds i8, i8* %82, i64 1
%84 = call i32 @strtol(i8* %83, i8** %19, i32 10)
store i32 %84, i32* %20
%85 = load i8*, i8** %19
%86 = load i8, i8* %85
%87 = icmp ne i8 %86, 0
br i1 %87, label %91, label %88
88: ; preds = %81
%89 = load i8*, i8** %17
store i8 0, i8* %89
%90 = load i32, i32* %20
store i32 %90, i32* %18
br label %91
91: ; preds = %88, %81
br label %92
92: ; preds = %91, %76
%93 = load i8**, i8*** %9
%94 = icmp ne i8** %93, null
br i1 %94, label %95, label %105
95: ; preds = %92
%96 = load i8*, i8** %14
%97 = icmp ne i8* %96, null
br i1 %97, label %98, label %101
98: ; preds = %95
%99 = load i8*, i8** %14
%100 = call i8* @strdup(i8* %99)
br label %102
101: ; preds = %95
br label %102
102: ; preds = %101, %98
%103 = phi i8* [ %100, %98 ], [ null, %101 ]
%104 = load i8**, i8*** %9
store i8* %103, i8** %104
br label %105
105: ; preds = %102, %92
%106 = load i8**, i8*** %10
%107 = icmp ne i8** %106, null
br i1 %107, label %108, label %112
108: ; preds = %105
%109 = load i8*, i8** %15
%110 = call i8* @strdup(i8* %109)
%111 = load i8**, i8*** %10
store i8* %110, i8** %111
br label %112
112: ; preds = %108, %105
%113 = load i32*, i32** %11
%114 = icmp ne i32* %113, null
br i1 %114, label %115, label %118
115: ; preds = %112
%116 = load i32, i32* %18
%117 = load i32*, i32** %11
store i32 %116, i32* %117
br label %118
118: ; preds = %115, %112
%119 = load i8**, i8*** %12
%120 = icmp ne i8** %119, null
br i1 %120, label %121, label %136
121: ; preds = %118
%122 = load i8*, i8** %16
%123 = icmp ne i8* %122, null
br i1 %123, label %124, label %132
124: ; preds = %121
%125 = load i8*, i8** %16
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = icmp ne i32 %127, 0
br i1 %128, label %129, label %132
129: ; preds = %124
%130 = load i8*, i8** %16
%131 = call i8* @strdup(i8* %130)
br label %133
132: ; preds = %124, %121
br label %133
133: ; preds = %132, %129
%134 = phi i8* [ %131, %129 ], [ null, %132 ]
%135 = load i8**, i8*** %12
store i8* %134, i8** %135
br label %136
136: ; preds = %133, %118
%137 = load i8*, i8** %16
%138 = icmp ne i8* %137, null
br i1 %138, label %139, label %142
139: ; preds = %136
%140 = load i8*, i8** %16
%141 = getelementptr inbounds i8, i8* %140, i64 -1
store i8 47, i8* %141
br label %142
142: ; preds = %139, %136
%143 = load i8*, i8** %14
%144 = icmp ne i8* %143, null
br i1 %144, label %145, label %148
145: ; preds = %142
%146 = load i8*, i8** %15
%147 = getelementptr inbounds i8, i8* %146, i64 -3
store i8 58, i8* %147
br label %148
148: ; preds = %145, %142
store i32 0, i32* %7
br label %149
149: ; preds = %148, %64, %52
%150 = load i32, i32* %7
ret i32 %150
}

LLVM IR (-O2):
@.str = [4 x i8] c"://\00"
@.str.1 = [6 x i8] c"https\00"
@.str.2 = [5 x i8] c"http\00"
@.str.3 = [6 x i8] c"socks\00"
@.str.4 = [7 x i8] c"socks4\00"
@.str.5 = [7 x i8] c"socks5\00"
@EPROTONOSUPPORT = global i32 0
@EINVAL = global i32 0
define i32 @openconnect_parse_url(i8* %0, i8** writeonly %1, i8** writeonly %2, i32* writeonly %3, i8** writeonly %4, i32 %5) {
%7 = alloca i8*
%8 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %29, label %10
10: ; preds = %6
store i8 0, i8* %8
%11 = getelementptr inbounds i8, i8* %8, i64 3
%12 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %34, label %14
14: ; preds = %10
%15 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %34, label %17
17: ; preds = %14
%18 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %34, label %20
20: ; preds = %17
%21 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %34, label %23
23: ; preds = %20
%24 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %34, label %26
26: ; preds = %23
%27 = load i32, i32* @EPROTONOSUPPORT
%28 = sub nsw i32 0, %27
br label %91
29: ; preds = %6
%30 = icmp eq i32 %5, 0
br i1 %30, label %31, label %34
31: ; preds = %29
%32 = load i32, i32* @EINVAL
%33 = sub nsw i32 0, %32
br label %91
34: ; preds = %29, %17, %20, %23, %14, %10
%35 = phi i8* [ %11, %10 ], [ %11, %14 ], [ %11, %23 ], [ %11, %20 ], [ %11, %17 ], [ %0, %29 ]
%36 = phi i8* [ %0, %10 ], [ %0, %14 ], [ %0, %23 ], [ %0, %20 ], [ %0, %17 ], [ null, %29 ]
%37 = phi i32 [ 443, %10 ], [ 80, %14 ], [ 1080, %23 ], [ 1080, %20 ], [ 1080, %17 ], [ %5, %29 ]
%38 = tail call i8* @strchr(i8* dereferenceable(1) %35, i8 signext 47)
%39 = icmp eq i8* %38, null
br i1 %39, label %42, label %40
40: ; preds = %34
%41 = getelementptr inbounds i8, i8* %38, i64 1
store i8 0, i8* %38
br label %42
42: ; preds = %40, %34
%43 = phi i8* [ %41, %40 ], [ null, %34 ]
%44 = tail call i8* @strrchr(i8* dereferenceable(1) %35, i8 signext 58)
%45 = icmp eq i8* %44, null
br i1 %45, label %56, label %46
46: ; preds = %42
%47 = bitcast i8** %7 to i8*
%48 = getelementptr inbounds i8, i8* %44, i64 1
%49 = call i32 @strtol(i8* %48, i8** %7, i32 10)
%50 = load i8*, i8** %7
%51 = load i8, i8* %50
%52 = icmp eq i8 %51, 0
br i1 %52, label %53, label %54
53: ; preds = %46
store i8 0, i8* %44
br label %54
54: ; preds = %53, %46
%55 = phi i32 [ %37, %46 ], [ %49, %53 ]
br label %56
56: ; preds = %54, %42
%57 = phi i32 [ %55, %54 ], [ %37, %42 ]
%58 = icmp eq i8** %1, null
br i1 %58, label %65, label %59
59: ; preds = %56
%60 = icmp eq i8* %36, null
br i1 %60, label %63, label %61
61: ; preds = %59
%62 = tail call i8* @strdup(i8* %36)
br label %63
63: ; preds = %59, %61
%64 = phi i8* [ %62, %61 ], [ null, %59 ]
store i8* %64, i8** %1
br label %65
65: ; preds = %63, %56
%66 = icmp eq i8** %2, null
br i1 %66, label %69, label %67
67: ; preds = %65
%68 = tail call i8* @strdup(i8* %35)
store i8* %68, i8** %2
br label %69
69: ; preds = %67, %65
%70 = icmp eq i32* %3, null
br i1 %70, label %72, label %71
71: ; preds = %69
store i32 %57, i32* %3
br label %72
72: ; preds = %71, %69
%73 = icmp eq i8** %4, null
br i1 %73, label %83, label %74
74: ; preds = %72
%75 = icmp eq i8* %43, null
br i1 %75, label %81, label %76
76: ; preds = %74
%77 = load i8, i8* %43
%78 = icmp eq i8 %77, 0
br i1 %78, label %81, label %79
79: ; preds = %76
%80 = tail call i8* @strdup(i8* %43)
br label %81
81: ; preds = %74, %76, %79
%82 = phi i8* [ %80, %79 ], [ null, %76 ], [ null, %74 ]
store i8* %82, i8** %4
br label %83
83: ; preds = %81, %72
%84 = icmp eq i8* %43, null
br i1 %84, label %87, label %85
85: ; preds = %83
%86 = getelementptr inbounds i8, i8* %43, i64 -1
store i8 47, i8* %86
br label %87
87: ; preds = %85, %83
%88 = icmp eq i8* %36, null
br i1 %88, label %91, label %89
89: ; preds = %87
%90 = getelementptr inbounds i8, i8* %35, i64 -3
store i8 58, i8* %90
br label %91
91: ; preds = %87, %89, %31, %26
%92 = phi i32 [ %28, %26 ], [ %33, %31 ], [ 0, %89 ], [ 0, %87 ]
ret i32 %92
}