#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 bigobject_rfc3986_dec_octet(const char **str) {
  const char *cur = NULL;
  if (str == NULL)
    return -1;
  cur = *str;
  if (!(((*(cur) >= '0') && (*(cur) <= '9'))))
    return 1;
  if (!((*(cur + 1) >= '0') && (*(cur + 1) <= '9')))
    cur++;
  else if ((*cur != '0') && (((*(cur + 1) >= '0') && (*(cur + 1) <= '9'))) &&
           (!((*(cur + 2) >= '0') && (*(cur + 2) <= '9'))))
    cur += 2;
  else if ((*cur == '1') && (((*(cur + 1) >= '0') && (*(cur + 1) <= '9'))) &&
           (((*(cur + 2) >= '0') && (*(cur + 2) <= '9'))))
    cur += 3;
  else if ((*cur == '2') && (*(cur + 1) >= '0') && (*(cur + 1) <= '4') &&
           (((*(cur + 2) >= '0') && (*(cur + 2) <= '9'))))
    cur += 3;
  else if ((*cur == '2') && (*(cur + 1) == '5') && (*(cur + 2) >= '0') &&
           (*(cur + 1) <= '5'))
    cur += 3;
  else
    return 1;
  *str = cur;
  return 0;
}


x86 assembly (clang, -O0):
<bigobject_rfc3986_dec_octet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1127 <bigobject_rfc3986_dec_octet+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    1346 <bigobject_rfc3986_dec_octet+0x246>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1152 <bigobject_rfc3986_dec_octet+0x52>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    115e <bigobject_rfc3986_dec_octet+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1346 <bigobject_rfc3986_dec_octet+0x246>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x30,%eax
jl     1180 <bigobject_rfc3986_dec_octet+0x80>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x39,%eax
jle    1191 <bigobject_rfc3986_dec_octet+0x91>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1334 <bigobject_rfc3986_dec_octet+0x234>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
je     11f6 <bigobject_rfc3986_dec_octet+0xf6>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x30,%eax
jl     11f6 <bigobject_rfc3986_dec_octet+0xf6>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x39,%eax
jg     11f6 <bigobject_rfc3986_dec_octet+0xf6>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x30,%eax
jl     11e5 <bigobject_rfc3986_dec_octet+0xe5>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x39,%eax
jle    11f6 <bigobject_rfc3986_dec_octet+0xf6>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    132f <bigobject_rfc3986_dec_octet+0x22f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    125b <bigobject_rfc3986_dec_octet+0x15b>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x30,%eax
jl     125b <bigobject_rfc3986_dec_octet+0x15b>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x39,%eax
jg     125b <bigobject_rfc3986_dec_octet+0x15b>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x30,%eax
jl     125b <bigobject_rfc3986_dec_octet+0x15b>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x39,%eax
jg     125b <bigobject_rfc3986_dec_octet+0x15b>
mov    -0x18(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x18(%rbp)
jmp    132a <bigobject_rfc3986_dec_octet+0x22a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x32,%eax
jne    12c0 <bigobject_rfc3986_dec_octet+0x1c0>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x30,%eax
jl     12c0 <bigobject_rfc3986_dec_octet+0x1c0>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x34,%eax
jg     12c0 <bigobject_rfc3986_dec_octet+0x1c0>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x30,%eax
jl     12c0 <bigobject_rfc3986_dec_octet+0x1c0>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x39,%eax
jg     12c0 <bigobject_rfc3986_dec_octet+0x1c0>
mov    -0x18(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x18(%rbp)
jmp    1325 <bigobject_rfc3986_dec_octet+0x225>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x32,%eax
jne    1314 <bigobject_rfc3986_dec_octet+0x214>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x35,%eax
jne    1314 <bigobject_rfc3986_dec_octet+0x214>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x30,%eax
jl     1314 <bigobject_rfc3986_dec_octet+0x214>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x35,%eax
jg     1314 <bigobject_rfc3986_dec_octet+0x214>
mov    -0x18(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x18(%rbp)
jmp    1320 <bigobject_rfc3986_dec_octet+0x220>
movl   $0x1,-0x4(%rbp)
jmp    1346 <bigobject_rfc3986_dec_octet+0x246>
jmp    1325 <bigobject_rfc3986_dec_octet+0x225>
jmp    132a <bigobject_rfc3986_dec_octet+0x22a>
jmp    132f <bigobject_rfc3986_dec_octet+0x22f>
jmp    1334 <bigobject_rfc3986_dec_octet+0x234>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigobject_rfc3986_dec_octet>:
test   %rdi,%rdi
je     1144 <bigobject_rfc3986_dec_octet+0x44>
mov    (%rdi),%r9
mov    (%r9),%dl
lea    -0x30(%rdx),%esi
mov    $0x1,%eax
cmp    $0x9,%sil
ja     1153 <bigobject_rfc3986_dec_octet+0x53>
mov    0x1(%r9),%r8b
lea    -0x30(%r8),%esi
cmp    $0x9,%sil
ja     114a <bigobject_rfc3986_dec_octet+0x4a>
cmp    $0x30,%dl
je     1153 <bigobject_rfc3986_dec_octet+0x53>
mov    0x2(%r9),%cl
add    $0xd0,%cl
cmp    $0x9,%cl
ja     1154 <bigobject_rfc3986_dec_octet+0x54>
cmp    $0x32,%dl
je     115a <bigobject_rfc3986_dec_octet+0x5a>
cmp    $0x31,%dl
je     1166 <bigobject_rfc3986_dec_octet+0x66>
jmp    1153 <bigobject_rfc3986_dec_octet+0x53>
mov    $0xffffffff,%eax
ret
add    $0x1,%r9
mov    %r9,(%rdi)
xor    %eax,%eax
ret
add    $0x2,%r9
jmp    114e <bigobject_rfc3986_dec_octet+0x4e>
cmp    $0x34,%r8b
jbe    1166 <bigobject_rfc3986_dec_octet+0x66>
cmp    $0x35,%r8b
jne    1153 <bigobject_rfc3986_dec_octet+0x53>
add    $0x3,%r9
jmp    114e <bigobject_rfc3986_dec_octet+0x4e>

LLVM IR (-O0):
define i32 @bigobject_rfc3986_dec_octet(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* null, i8** %4
%5 = load i8**, i8*** %3
%6 = icmp eq i8** %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %166
8: ; preds = %1
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 48
br i1 %14, label %15, label %20
15: ; preds = %8
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 57
br i1 %19, label %21, label %20
20: ; preds = %15, %8
store i32 1, i32* %2
br label %166
21: ; preds = %15
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp sge i32 %25, 48
br i1 %26, label %27, label %33
27: ; preds = %21
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 1
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp sle i32 %31, 57
br i1 %32, label %36, label %33
33: ; preds = %27, %21
%34 = load i8*, i8** %4
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %4
br label %163
36: ; preds = %27
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %39, 48
br i1 %40, label %41, label %68
41: ; preds = %36
%42 = load i8*, i8** %4
%43 = getelementptr inbounds i8, i8* %42, i64 1
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp sge i32 %45, 48
br i1 %46, label %47, label %68
47: ; preds = %41
%48 = load i8*, i8** %4
%49 = getelementptr inbounds i8, i8* %48, i64 1
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp sle i32 %51, 57
br i1 %52, label %53, label %68
53: ; preds = %47
%54 = load i8*, i8** %4
%55 = getelementptr inbounds i8, i8* %54, i64 2
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp sge i32 %57, 48
br i1 %58, label %59, label %65
59: ; preds = %53
%60 = load i8*, i8** %4
%61 = getelementptr inbounds i8, i8* %60, i64 2
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp sle i32 %63, 57
br i1 %64, label %68, label %65
65: ; preds = %59, %53
%66 = load i8*, i8** %4
%67 = getelementptr inbounds i8, i8* %66, i64 2
store i8* %67, i8** %4
br label %162
68: ; preds = %59, %47, %41, %36
%69 = load i8*, i8** %4
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 49
br i1 %72, label %73, label %100
73: ; preds = %68
%74 = load i8*, i8** %4
%75 = getelementptr inbounds i8, i8* %74, i64 1
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp sge i32 %77, 48
br i1 %78, label %79, label %100
79: ; preds = %73
%80 = load i8*, i8** %4
%81 = getelementptr inbounds i8, i8* %80, i64 1
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp sle i32 %83, 57
br i1 %84, label %85, label %100
85: ; preds = %79
%86 = load i8*, i8** %4
%87 = getelementptr inbounds i8, i8* %86, i64 2
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp sge i32 %89, 48
br i1 %90, label %91, label %100
91: ; preds = %85
%92 = load i8*, i8** %4
%93 = getelementptr inbounds i8, i8* %92, i64 2
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp sle i32 %95, 57
br i1 %96, label %97, label %100
97: ; preds = %91
%98 = load i8*, i8** %4
%99 = getelementptr inbounds i8, i8* %98, i64 3
store i8* %99, i8** %4
br label %161
100: ; preds = %91, %85, %79, %73, %68
%101 = load i8*, i8** %4
%102 = load i8, i8* %101
%103 = sext i8 %102 to i32
%104 = icmp eq i32 %103, 50
br i1 %104, label %105, label %132
105: ; preds = %100
%106 = load i8*, i8** %4
%107 = getelementptr inbounds i8, i8* %106, i64 1
%108 = load i8, i8* %107
%109 = sext i8 %108 to i32
%110 = icmp sge i32 %109, 48
br i1 %110, label %111, label %132
111: ; preds = %105
%112 = load i8*, i8** %4
%113 = getelementptr inbounds i8, i8* %112, i64 1
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp sle i32 %115, 52
br i1 %116, label %117, label %132
117: ; preds = %111
%118 = load i8*, i8** %4
%119 = getelementptr inbounds i8, i8* %118, i64 2
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp sge i32 %121, 48
br i1 %122, label %123, label %132
123: ; preds = %117
%124 = load i8*, i8** %4
%125 = getelementptr inbounds i8, i8* %124, i64 2
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = icmp sle i32 %127, 57
br i1 %128, label %129, label %132
129: ; preds = %123
%130 = load i8*, i8** %4
%131 = getelementptr inbounds i8, i8* %130, i64 3
store i8* %131, i8** %4
br label %160
132: ; preds = %123, %117, %111, %105, %100
%133 = load i8*, i8** %4
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp eq i32 %135, 50
br i1 %136, label %137, label %158
137: ; preds = %132
%138 = load i8*, i8** %4
%139 = getelementptr inbounds i8, i8* %138, i64 1
%140 = load i8, i8* %139
%141 = sext i8 %140 to i32
%142 = icmp eq i32 %141, 53
br i1 %142, label %143, label %158
143: ; preds = %137
%144 = load i8*, i8** %4
%145 = getelementptr inbounds i8, i8* %144, i64 2
%146 = load i8, i8* %145
%147 = sext i8 %146 to i32
%148 = icmp sge i32 %147, 48
br i1 %148, label %149, label %158
149: ; preds = %143
%150 = load i8*, i8** %4
%151 = getelementptr inbounds i8, i8* %150, i64 1
%152 = load i8, i8* %151
%153 = sext i8 %152 to i32
%154 = icmp sle i32 %153, 53
br i1 %154, label %155, label %158
155: ; preds = %149
%156 = load i8*, i8** %4
%157 = getelementptr inbounds i8, i8* %156, i64 3
store i8* %157, i8** %4
br label %159
158: ; preds = %149, %143, %137, %132
store i32 1, i32* %2
br label %166
159: ; preds = %155
br label %160
160: ; preds = %159, %129
br label %161
161: ; preds = %160, %97
br label %162
162: ; preds = %161, %65
br label %163
163: ; preds = %162, %33
%164 = load i8*, i8** %4
%165 = load i8**, i8*** %3
store i8* %164, i8** %165
store i32 0, i32* %2
br label %166
166: ; preds = %163, %158, %20, %7
%167 = load i32, i32* %2
ret i32 %167
}

LLVM IR (-O2):
define i32 @bigobject_rfc3986_dec_octet(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %33, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = load i8, i8* %4
%6 = add i8 %5, -48
%7 = icmp ult i8 %6, 10
br i1 %7, label %8, label %33
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %9
%11 = add i8 %10, -48
%12 = icmp ult i8 %11, 10
br i1 %12, label %13, label %31
13: ; preds = %8
%14 = icmp eq i8 %5, 48
br i1 %14, label %33, label %15
15: ; preds = %13
%16 = getelementptr inbounds i8, i8* %4, i64 2
%17 = load i8, i8* %16
%18 = add i8 %17, -48
%19 = icmp ult i8 %18, 10
br i1 %19, label %20, label %31
20: ; preds = %15
switch i8 %5, label %33 [
i8 49, label %21
i8 50, label %23
]
21: ; preds = %20
%22 = getelementptr inbounds i8, i8* %4, i64 3
br label %31
23: ; preds = %20
%24 = icmp ult i8 %10, 53
br i1 %24, label %25, label %27
25: ; preds = %23
%26 = getelementptr inbounds i8, i8* %4, i64 3
br label %31
27: ; preds = %23
%28 = icmp eq i8 %10, 53
br i1 %28, label %29, label %33
29: ; preds = %27
%30 = getelementptr inbounds i8, i8* %4, i64 3
br label %31
31: ; preds = %8, %15, %25, %29, %21
%32 = phi i8* [ %22, %21 ], [ %26, %25 ], [ %30, %29 ], [ %16, %15 ], [ %9, %8 ]
store i8* %32, i8** %0
br label %33
33: ; preds = %20, %13, %27, %3, %1, %31
%34 = phi i32 [ 0, %31 ], [ -1, %1 ], [ 1, %3 ], [ 1, %27 ], [ 1, %13 ], [ 1, %20 ]
ret i32 %34
}