#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int /*<<< orphan*/ stderr;
int strcspn(char const *, char *);
scalar_t__ strncasecmp(char const *, char *, int);
int parse_url(const char *url, char *host, char *port, char **path, char *ssl) {
  const char *end, *start;
  if (strncasecmp(url, "http://", 7) == 0)
    *ssl = 0;
  else if (strncasecmp(url, "https://", 8) == 0)
    *ssl = 1;
  else {
    fprintf(stderr, "Only URLs for HTTP and HTTPS requests are allowed\n");
    return -1;
  }
  start = url + 7 + *ssl;
  end = start + strcspn(start, "/:");
  if (start == end) {
    fprintf(stderr, "The URL is missing its host component\n");
    return -2;
  } else if (end - start > 256 - 1) {
    fprintf(stderr, "The URL host component is too long\n");
    return -3;
  }
  memcpy(host, start, end - start);
  host[end - start] = '\0';
  if (*end == ':') {
    start = end + 1;
    end = start + strcspn(start, "/");
    if (start == end) {
      fprintf(stderr, "The URL is missing its port component\n");
      return -4;
    } else if (end - start > 256 - 1) {
      fprintf(stderr, "The URL port component is too long\n");
      return -5;
    }
    memcpy(port, start, end - start);
    port[end - start] = '\0';
  } else if (*ssl) {
    port[0] = '4';
    port[1] = '4';
    port[2] = '3';
    port[3] = '\0';
  } else {
    port[0] = '8';
    port[1] = '0';
    port[2] = '\0';
  }
  if (*end != '/') {
    fprintf(stderr, "The URL is missing its path component\n");
    return -6;
  }
  *path = (char *)end;
  return 0;
}


x86 assembly (clang, -O0):
<parse_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe99(%rip),%rsi
mov    $0x7,%edx
call   1060 <strncasecmp@plt>
cmp    $0x0,%rax
jne    1187 <parse_url+0x47>
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
jmp    11d8 <parse_url+0x98>
mov    -0x10(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x8,%edx
call   1060 <strncasecmp@plt>
cmp    $0x0,%rax
jne    11b2 <parse_url+0x72>
mov    -0x30(%rbp),%rax
movb   $0x1,(%rax)
jmp    11d3 <parse_url+0x93>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
lea    0xe4f(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1424 <parse_url+0x2e4>
jmp    11d8 <parse_url+0x98>
mov    -0x10(%rbp),%rax
add    $0x7,%rax
mov    -0x30(%rbp),%rcx
movsbl (%rcx),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xe40(%rip),%rsi
call   1030 <strcspn@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x38(%rbp),%rax
jne    1248 <parse_url+0x108>
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
lea    0xe10(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1424 <parse_url+0x2e4>
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    %rcx,%rax
cmp    $0xff,%rax
jle    1280 <parse_url+0x140>
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
lea    0xdff(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    1424 <parse_url+0x2e4>
jmp    1285 <parse_url+0x145>
mov    -0x18(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1394 <parse_url+0x254>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xd25(%rip),%rsi
call   1030 <strcspn@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x38(%rbp),%rax
jne    1325 <parse_url+0x1e5>
mov    0x2cd5(%rip),%rax
mov    (%rax),%edi
lea    0xd7e(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xfffffffc,-0x4(%rbp)
jmp    1424 <parse_url+0x2e4>
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    %rcx,%rax
cmp    $0xff,%rax
jle    135d <parse_url+0x21d>
mov    0x2c9d(%rip),%rax
mov    (%rax),%edi
lea    0xd6d(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xfffffffb,-0x4(%rbp)
jmp    1424 <parse_url+0x2e4>
jmp    1362 <parse_url+0x222>
mov    -0x20(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    13e1 <parse_url+0x2a1>
mov    -0x30(%rbp),%rax
cmpb   $0x0,(%rax)
je     13c5 <parse_url+0x285>
mov    -0x20(%rbp),%rax
movb   $0x34,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x34,0x1(%rax)
mov    -0x20(%rbp),%rax
movb   $0x33,0x2(%rax)
mov    -0x20(%rbp),%rax
movb   $0x0,0x3(%rax)
jmp    13dc <parse_url+0x29c>
mov    -0x20(%rbp),%rax
movb   $0x38,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x30,0x1(%rax)
mov    -0x20(%rbp),%rax
movb   $0x0,0x2(%rax)
jmp    13e1 <parse_url+0x2a1>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1412 <parse_url+0x2d2>
mov    0x2be8(%rip),%rax
mov    (%rax),%edi
lea    0xcdc(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xfffffffa,-0x4(%rbp)
jmp    1424 <parse_url+0x2e4>
mov    -0x38(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_url>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r13
mov    %rcx,%rbp
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0xe9f(%rip),%rsi
mov    $0x7,%edx
call   1060 <strncasecmp@plt>
test   %rax,%rax
je     11a8 <parse_url+0x68>
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1060 <strncasecmp@plt>
test   %rax,%rax
je     11b0 <parse_url+0x70>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    130a <parse_url+0x1ca>
mov    %rbp,(%rsp)
xor    %eax,%eax
jmp    11b6 <parse_url+0x76>
mov    %rbp,(%rsp)
mov    $0x1,%al
mov    %al,0x0(%r13)
movzbl %al,%r14d
lea    (%rbx,%r14,1),%rbp
add    $0x7,%rbp
lea    0xe77(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcspn@plt>
test   %eax,%eax
je     11ff <parse_url+0xbf>
cmp    $0x100,%eax
jl     121e <parse_url+0xde>
mov    0x2df9(%rip),%rax
mov    (%rax),%edi
lea    0xe7e(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffd,%eax
jmp    130a <parse_url+0x1ca>
mov    0x2dda(%rip),%rax
mov    (%rax),%edi
lea    0xe38(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffe,%eax
jmp    130a <parse_url+0x1ca>
add    %r14,%rbx
movslq %eax,%r14
add    %r14,%rbx
add    $0x7,%rbx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
call   1050 <memcpy@plt>
movb   $0x0,(%r12,%r14,1)
cmpb   $0x3a,0x0(%rbp,%r14,1)
jne    1282 <parse_url+0x142>
lea    0x1(%rbx),%r12
lea    0xdb6(%rip),%rsi
mov    %r12,%rdi
call   1030 <strcspn@plt>
test   %eax,%eax
je     129b <parse_url+0x15b>
cmp    $0x100,%eax
jl     12c4 <parse_url+0x184>
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
lea    0xe46(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffb,%eax
jmp    130a <parse_url+0x1ca>
cmpb   $0x0,0x0(%r13)
je     12b7 <parse_url+0x177>
movw   $0x3434,(%r15)
movb   $0x33,0x2(%r15)
mov    $0x3,%ebp
jmp    12db <parse_url+0x19b>
mov    0x2d3e(%rip),%rax
mov    (%rax),%edi
lea    0xde7(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffc,%eax
jmp    130a <parse_url+0x1ca>
movw   $0x3038,(%r15)
mov    $0x2,%ebp
jmp    12db <parse_url+0x19b>
movslq %eax,%rbp
add    %rbp,%rbx
add    $0x1,%rbx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %eax,%edx
call   1050 <memcpy@plt>
movb   $0x0,(%r15,%rbp,1)
cmpb   $0x2f,(%rbx)
jne    12f0 <parse_url+0x1b0>
mov    (%rsp),%rax
mov    %rbx,(%rax)
xor    %eax,%eax
jmp    130a <parse_url+0x1ca>
mov    0x2ce9(%rip),%rax
mov    (%rax),%edi
lea    0xddd(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffa,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"http://\00"
@.str.1 = [9 x i8] c"https://\00"
@stderr = global i32 0
@.str.2 = [51 x i8] c"Only URLs for HTTP and HTTPS requests are allowed\0A\00"
@.str.3 = [3 x i8] c"/:\00"
@.str.4 = [39 x i8] c"The URL is missing its host component\0A\00"
@.str.5 = [36 x i8] c"The URL host component is too long\0A\00"
@.str.6 = [2 x i8] c"/\00"
@.str.7 = [39 x i8] c"The URL is missing its port component\0A\00"
@.str.8 = [36 x i8] c"The URL port component is too long\0A\00"
@.str.9 = [39 x i8] c"The URL is missing its path component\0A\00"
define i32 @parse_url(i8* %0, i8* %1, i8* %2, i8** %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8**
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8** %3, i8*** %10
store i8* %4, i8** %11
%14 = load i8*, i8** %7
%15 = call i64 @strncasecmp(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %5
%18 = load i8*, i8** %11
store i8 0, i8* %18
br label %29
19: ; preds = %5
%20 = load i8*, i8** %7
%21 = call i64 @strncasecmp(i8* %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load i8*, i8** %11
store i8 1, i8* %24
br label %28
25: ; preds = %19
%26 = load i32, i32* @stderr
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %6
br label %154
28: ; preds = %23
br label %29
29: ; preds = %28, %17
%30 = load i8*, i8** %7
%31 = getelementptr inbounds i8, i8* %30, i64 7
%32 = load i8*, i8** %11
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %31, i64 %35
store i8* %36, i8** %13
%37 = load i8*, i8** %13
%38 = load i8*, i8** %13
%39 = call i32 @strcspn(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %37, i64 %40
store i8* %41, i8** %12
%42 = load i8*, i8** %13
%43 = load i8*, i8** %12
%44 = icmp eq i8* %42, %43
br i1 %44, label %45, label %48
45: ; preds = %29
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
store i32 -2, i32* %6
br label %154
48: ; preds = %29
%49 = load i8*, i8** %12
%50 = load i8*, i8** %13
%51 = ptrtoint i8* %49 to i64
%52 = ptrtoint i8* %50 to i64
%53 = sub i64 %51, %52
%54 = icmp sgt i64 %53, 255
br i1 %54, label %55, label %58
55: ; preds = %48
%56 = load i32, i32* @stderr
%57 = call i32 @fprintf(i32 %56, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
store i32 -3, i32* %6
br label %154
58: ; preds = %48
br label %59
59: ; preds = %58
%60 = load i8*, i8** %8
%61 = load i8*, i8** %13
%62 = load i8*, i8** %12
%63 = load i8*, i8** %13
%64 = ptrtoint i8* %62 to i64
%65 = ptrtoint i8* %63 to i64
%66 = sub i64 %64, %65
%67 = trunc i64 %66 to i32
%68 = call i32 @memcpy(i8* %60, i8* %61, i32 %67)
%69 = load i8*, i8** %8
%70 = load i8*, i8** %12
%71 = load i8*, i8** %13
%72 = ptrtoint i8* %70 to i64
%73 = ptrtoint i8* %71 to i64
%74 = sub i64 %72, %73
%75 = getelementptr inbounds i8, i8* %69, i64 %74
store i8 0, i8* %75
%76 = load i8*, i8** %12
%77 = load i8, i8* %76
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 58
br i1 %79, label %80, label %122
80: ; preds = %59
%81 = load i8*, i8** %12
%82 = getelementptr inbounds i8, i8* %81, i64 1
store i8* %82, i8** %13
%83 = load i8*, i8** %13
%84 = load i8*, i8** %13
%85 = call i32 @strcspn(i8* %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8, i8* %83, i64 %86
store i8* %87, i8** %12
%88 = load i8*, i8** %13
%89 = load i8*, i8** %12
%90 = icmp eq i8* %88, %89
br i1 %90, label %91, label %94
91: ; preds = %80
%92 = load i32, i32* @stderr
%93 = call i32 @fprintf(i32 %92, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
store i32 -4, i32* %6
br label %154
94: ; preds = %80
%95 = load i8*, i8** %12
%96 = load i8*, i8** %13
%97 = ptrtoint i8* %95 to i64
%98 = ptrtoint i8* %96 to i64
%99 = sub i64 %97, %98
%100 = icmp sgt i64 %99, 255
br i1 %100, label %101, label %104
101: ; preds = %94
%102 = load i32, i32* @stderr
%103 = call i32 @fprintf(i32 %102, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
store i32 -5, i32* %6
br label %154
104: ; preds = %94
br label %105
105: ; preds = %104
%106 = load i8*, i8** %9
%107 = load i8*, i8** %13
%108 = load i8*, i8** %12
%109 = load i8*, i8** %13
%110 = ptrtoint i8* %108 to i64
%111 = ptrtoint i8* %109 to i64
%112 = sub i64 %110, %111
%113 = trunc i64 %112 to i32
%114 = call i32 @memcpy(i8* %106, i8* %107, i32 %113)
%115 = load i8*, i8** %9
%116 = load i8*, i8** %12
%117 = load i8*, i8** %13
%118 = ptrtoint i8* %116 to i64
%119 = ptrtoint i8* %117 to i64
%120 = sub i64 %118, %119
%121 = getelementptr inbounds i8, i8* %115, i64 %120
store i8 0, i8* %121
br label %143
122: ; preds = %59
%123 = load i8*, i8** %11
%124 = load i8, i8* %123
%125 = icmp ne i8 %124, 0
br i1 %125, label %126, label %135
126: ; preds = %122
%127 = load i8*, i8** %9
%128 = getelementptr inbounds i8, i8* %127, i64 0
store i8 52, i8* %128
%129 = load i8*, i8** %9
%130 = getelementptr inbounds i8, i8* %129, i64 1
store i8 52, i8* %130
%131 = load i8*, i8** %9
%132 = getelementptr inbounds i8, i8* %131, i64 2
store i8 51, i8* %132
%133 = load i8*, i8** %9
%134 = getelementptr inbounds i8, i8* %133, i64 3
store i8 0, i8* %134
br label %142
135: ; preds = %122
%136 = load i8*, i8** %9
%137 = getelementptr inbounds i8, i8* %136, i64 0
store i8 56, i8* %137
%138 = load i8*, i8** %9
%139 = getelementptr inbounds i8, i8* %138, i64 1
store i8 48, i8* %139
%140 = load i8*, i8** %9
%141 = getelementptr inbounds i8, i8* %140, i64 2
store i8 0, i8* %141
br label %142
142: ; preds = %135, %126
br label %143
143: ; preds = %142, %105
%144 = load i8*, i8** %12
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
%147 = icmp ne i32 %146, 47
br i1 %147, label %148, label %151
148: ; preds = %143
%149 = load i32, i32* @stderr
%150 = call i32 @fprintf(i32 %149, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0))
store i32 -6, i32* %6
br label %154
151: ; preds = %143
%152 = load i8*, i8** %12
%153 = load i8**, i8*** %10
store i8* %152, i8** %153
store i32 0, i32* %6
br label %154
154: ; preds = %151, %148, %101, %91, %55, %45, %25
%155 = load i32, i32* %6
ret i32 %155
}

LLVM IR (-O2):
@.str = [8 x i8] c"http://\00"
@.str.1 = [9 x i8] c"https://\00"
@stderr = global i32 0
@.str.2 = [51 x i8] c"Only URLs for HTTP and HTTPS requests are allowed\0A\00"
@.str.3 = [3 x i8] c"/:\00"
@.str.4 = [39 x i8] c"The URL is missing its host component\0A\00"
@.str.5 = [36 x i8] c"The URL host component is too long\0A\00"
@.str.6 = [2 x i8] c"/\00"
@.str.7 = [39 x i8] c"The URL is missing its port component\0A\00"
@.str.8 = [36 x i8] c"The URL port component is too long\0A\00"
@.str.9 = [39 x i8] c"The URL is missing its path component\0A\00"
define i32 @parse_url(i8* %0, i8* %1, i8* %2, i8** nocapture writeonly %3, i8* nocapture %4) {
%6 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
br label %71
14: ; preds = %8, %5
%15 = phi i8 [ 0, %5 ], [ 1, %8 ]
store i8 %15, i8* %4
%16 = getelementptr inbounds i8, i8* %0, i64 7
%17 = zext i8 %15 to i64
%18 = getelementptr inbounds i8, i8* %16, i64 %17
%19 = tail call i32 @strcspn(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = icmp eq i32 %19, 0
br i1 %22, label %23, label %26
23: ; preds = %14
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %71
26: ; preds = %14
%27 = icmp sgt i32 %19, 255
br i1 %27, label %28, label %31
28: ; preds = %26
%29 = load i32, i32* @stderr
%30 = tail call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
br label %71
31: ; preds = %26
%32 = tail call i32 @memcpy(i8* %1, i8* %18, i32 %19)
%33 = getelementptr inbounds i8, i8* %1, i64 %20
store i8 0, i8* %33
%34 = load i8, i8* %21
%35 = icmp eq i8 %34, 58
br i1 %35, label %36, label %53
36: ; preds = %31
%37 = getelementptr inbounds i8, i8* %21, i64 1
%38 = tail call i32 @strcspn(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%39 = sext i32 %38 to i64
%40 = add nsw i64 %39, 1
%41 = getelementptr inbounds i8, i8* %21, i64 %40
%42 = icmp eq i32 %38, 0
br i1 %42, label %43, label %46
43: ; preds = %36
%44 = load i32, i32* @stderr
%45 = tail call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
br label %71
46: ; preds = %36
%47 = icmp sgt i32 %38, 255
br i1 %47, label %48, label %51
48: ; preds = %46
%49 = load i32, i32* @stderr
%50 = tail call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
br label %71
51: ; preds = %46
%52 = tail call i32 @memcpy(i8* %2, i8* %37, i32 %38)
br label %61
53: ; preds = %31
%54 = load i8, i8* %4
%55 = icmp eq i8 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %53
store i8 52, i8* %2
%57 = getelementptr inbounds i8, i8* %2, i64 1
store i8 52, i8* %57
%58 = getelementptr inbounds i8, i8* %2, i64 2
store i8 51, i8* %58
br label %61
59: ; preds = %53
store i8 56, i8* %2
%60 = getelementptr inbounds i8, i8* %2, i64 1
store i8 48, i8* %60
br label %61
61: ; preds = %56, %59, %51
%62 = phi i64 [ 3, %56 ], [ 2, %59 ], [ %39, %51 ]
%63 = phi i8* [ %21, %56 ], [ %21, %59 ], [ %41, %51 ]
%64 = getelementptr inbounds i8, i8* %2, i64 %62
store i8 0, i8* %64
%65 = load i8, i8* %63
%66 = icmp eq i8 %65, 47
br i1 %66, label %70, label %67
67: ; preds = %61
%68 = load i32, i32* @stderr
%69 = tail call i32 @fprintf(i32 %68, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0))
br label %71
70: ; preds = %61
store i8* %63, i8** %3
br label %71
71: ; preds = %70, %67, %48, %43, %28, %23, %11
%72 = phi i32 [ -2, %23 ], [ -3, %28 ], [ -4, %43 ], [ -5, %48 ], [ -6, %67 ], [ 0, %70 ], [ -1, %11 ]
ret i32 %72
}