#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*/ sprintf(char *, char *, char *, char);
char *strdup(char *);
char *url_percent_encode_byte(char byte, int set) {
  char enc[64];
  char *c = &byte;
  switch (set) {
  case 0x01:
    if (0 == ((byte < 0x020) || (byte > 0x07e)) ? 1 : 0) {
      goto noset;
    }
    break;
  case 0x02:
    if (0 == ((((byte < 0x020) || (byte > 0x07e)) ? 1 : 0) || (byte == 0x020) ||
              (byte == '"') || (byte == '#') || (byte == '<') ||
              (byte == '>') || (byte == '?') || (byte == '`'))
            ? 1
            : 0) {
      goto noset;
    }
    break;
  case 0x03:
    if (0 == ((((((byte < 0x020) || (byte > 0x07e)) ? 1 : 0) ||
                (byte == 0x020) || (byte == '"') || (byte == '#') ||
                (byte == '<') || (byte == '>') || (byte == '?') ||
                (byte == '`'))
                   ? 1
                   : 0) ||
              (byte == '/') || (byte == '@') || (byte == '\\'))
            ? 1
            : 0) {
      goto noset;
    }
    break;
  case 0x04:
    if (0 == ((((((((byte < 0x020) || (byte > 0x07e)) ? 1 : 0) ||
                  (byte == 0x020) || (byte == '"') || (byte == '#') ||
                  (byte == '<') || (byte == '>') || (byte == '?') ||
                  (byte == '`'))
                     ? 1
                     : 0) ||
                (byte == '/') || (byte == '@') || (byte == '\\'))
                   ? 1
                   : 0) ||
              (byte == ':'))
            ? 1
            : 0) {
      goto noset;
    }
    break;
  default:
    goto noset;
  }
  if (byte >= 0x041 && byte <= 0x07a) {
    byte = (byte & ~(0x01 << 0x05));
  }
  sprintf(enc, "%s%02X", "%", byte);
  return strdup(enc);
noset:
  c[1] = '\0';
  return c;
}


x86 assembly (clang, -O0):
<url_percent_encode_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    %esi,-0x10(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x60(%rbp)
sub    $0x3,%eax
ja     151a <url_percent_encode_byte+0x3fa>
mov    -0x60(%rbp),%rax
lea    0xea7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x61(%rbp)
jl     1181 <url_percent_encode_byte+0x61>
movsbl -0x9(%rbp),%eax
cmp    $0x7e,%eax
setg   %al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    11a2 <url_percent_encode_byte+0x82>
mov    $0x1,%al
test   $0x1,%al
jne    11b1 <url_percent_encode_byte+0x91>
jmp    11b6 <url_percent_encode_byte+0x96>
xor    %eax,%eax
test   $0x1,%al
jne    11b1 <url_percent_encode_byte+0x91>
jmp    11b6 <url_percent_encode_byte+0x96>
jmp    1570 <url_percent_encode_byte+0x450>
jmp    151f <url_percent_encode_byte+0x3ff>
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jl     11d5 <url_percent_encode_byte+0xb5>
movsbl -0x9(%rbp),%eax
cmp    $0x7e,%eax
jle    11e7 <url_percent_encode_byte+0xc7>
mov    $0x1,%al
test   $0x1,%al
mov    %al,-0x62(%rbp)
jne    1275 <url_percent_encode_byte+0x155>
jmp    11fc <url_percent_encode_byte+0xdc>
mov    $0x1,%al
xor    %ecx,%ecx
test   $0x1,%cl
mov    %al,-0x62(%rbp)
jne    1275 <url_percent_encode_byte+0x155>
jmp    11fc <url_percent_encode_byte+0xdc>
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x62(%rbp)
je     1275 <url_percent_encode_byte+0x155>
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x22,%ecx
mov    %al,-0x62(%rbp)
je     1275 <url_percent_encode_byte+0x155>
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x23,%ecx
mov    %al,-0x62(%rbp)
je     1275 <url_percent_encode_byte+0x155>
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3c,%ecx
mov    %al,-0x62(%rbp)
je     1275 <url_percent_encode_byte+0x155>
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3e,%ecx
mov    %al,-0x62(%rbp)
je     1275 <url_percent_encode_byte+0x155>
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3f,%ecx
mov    %al,-0x62(%rbp)
je     1275 <url_percent_encode_byte+0x155>
movsbl -0x9(%rbp),%eax
cmp    $0x60,%eax
sete   %al
mov    %al,-0x62(%rbp)
mov    -0x62(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1296 <url_percent_encode_byte+0x176>
mov    $0x1,%al
test   $0x1,%al
jne    12a5 <url_percent_encode_byte+0x185>
jmp    12aa <url_percent_encode_byte+0x18a>
xor    %eax,%eax
test   $0x1,%al
jne    12a5 <url_percent_encode_byte+0x185>
jmp    12aa <url_percent_encode_byte+0x18a>
jmp    1570 <url_percent_encode_byte+0x450>
jmp    151f <url_percent_encode_byte+0x3ff>
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jl     12c9 <url_percent_encode_byte+0x1a9>
movsbl -0x9(%rbp),%eax
cmp    $0x7e,%eax
jle    12d8 <url_percent_encode_byte+0x1b8>
mov    $0x1,%al
test   $0x1,%al
jne    1342 <url_percent_encode_byte+0x222>
jmp    12e7 <url_percent_encode_byte+0x1c7>
xor    %eax,%eax
test   $0x1,%al
jne    1342 <url_percent_encode_byte+0x222>
jmp    12e7 <url_percent_encode_byte+0x1c7>
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
je     1342 <url_percent_encode_byte+0x222>
movsbl -0x9(%rbp),%eax
cmp    $0x22,%eax
je     1342 <url_percent_encode_byte+0x222>
movsbl -0x9(%rbp),%eax
cmp    $0x23,%eax
je     1342 <url_percent_encode_byte+0x222>
movsbl -0x9(%rbp),%eax
cmp    $0x3c,%eax
je     1342 <url_percent_encode_byte+0x222>
movsbl -0x9(%rbp),%eax
cmp    $0x3e,%eax
je     1342 <url_percent_encode_byte+0x222>
movsbl -0x9(%rbp),%eax
cmp    $0x3f,%eax
je     1342 <url_percent_encode_byte+0x222>
movsbl -0x9(%rbp),%eax
cmp    $0x60,%eax
jne    1354 <url_percent_encode_byte+0x234>
mov    $0x1,%al
test   $0x1,%al
mov    %al,-0x63(%rbp)
jne    139a <url_percent_encode_byte+0x27a>
jmp    1369 <url_percent_encode_byte+0x249>
mov    $0x1,%al
xor    %ecx,%ecx
test   $0x1,%cl
mov    %al,-0x63(%rbp)
jne    139a <url_percent_encode_byte+0x27a>
jmp    1369 <url_percent_encode_byte+0x249>
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x63(%rbp)
je     139a <url_percent_encode_byte+0x27a>
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x40,%ecx
mov    %al,-0x63(%rbp)
je     139a <url_percent_encode_byte+0x27a>
movsbl -0x9(%rbp),%eax
cmp    $0x5c,%eax
sete   %al
mov    %al,-0x63(%rbp)
mov    -0x63(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    13bb <url_percent_encode_byte+0x29b>
mov    $0x1,%al
test   $0x1,%al
jne    13ca <url_percent_encode_byte+0x2aa>
jmp    13cf <url_percent_encode_byte+0x2af>
xor    %eax,%eax
test   $0x1,%al
jne    13ca <url_percent_encode_byte+0x2aa>
jmp    13cf <url_percent_encode_byte+0x2af>
jmp    1570 <url_percent_encode_byte+0x450>
jmp    151f <url_percent_encode_byte+0x3ff>
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jl     13ee <url_percent_encode_byte+0x2ce>
movsbl -0x9(%rbp),%eax
cmp    $0x7e,%eax
jle    13fd <url_percent_encode_byte+0x2dd>
mov    $0x1,%al
test   $0x1,%al
jne    1467 <url_percent_encode_byte+0x347>
jmp    140c <url_percent_encode_byte+0x2ec>
xor    %eax,%eax
test   $0x1,%al
jne    1467 <url_percent_encode_byte+0x347>
jmp    140c <url_percent_encode_byte+0x2ec>
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
je     1467 <url_percent_encode_byte+0x347>
movsbl -0x9(%rbp),%eax
cmp    $0x22,%eax
je     1467 <url_percent_encode_byte+0x347>
movsbl -0x9(%rbp),%eax
cmp    $0x23,%eax
je     1467 <url_percent_encode_byte+0x347>
movsbl -0x9(%rbp),%eax
cmp    $0x3c,%eax
je     1467 <url_percent_encode_byte+0x347>
movsbl -0x9(%rbp),%eax
cmp    $0x3e,%eax
je     1467 <url_percent_encode_byte+0x347>
movsbl -0x9(%rbp),%eax
cmp    $0x3f,%eax
je     1467 <url_percent_encode_byte+0x347>
movsbl -0x9(%rbp),%eax
cmp    $0x60,%eax
jne    1476 <url_percent_encode_byte+0x356>
mov    $0x1,%al
test   $0x1,%al
jne    14ac <url_percent_encode_byte+0x38c>
jmp    1485 <url_percent_encode_byte+0x365>
xor    %eax,%eax
test   $0x1,%al
jne    14ac <url_percent_encode_byte+0x38c>
jmp    1485 <url_percent_encode_byte+0x365>
movsbl -0x9(%rbp),%eax
cmp    $0x2f,%eax
je     14ac <url_percent_encode_byte+0x38c>
movsbl -0x9(%rbp),%eax
cmp    $0x40,%eax
je     14ac <url_percent_encode_byte+0x38c>
movsbl -0x9(%rbp),%eax
cmp    $0x5c,%eax
jne    14be <url_percent_encode_byte+0x39e>
mov    $0x1,%al
test   $0x1,%al
mov    %al,-0x64(%rbp)
jne    14e0 <url_percent_encode_byte+0x3c0>
jmp    14d3 <url_percent_encode_byte+0x3b3>
mov    $0x1,%al
xor    %ecx,%ecx
test   $0x1,%cl
mov    %al,-0x64(%rbp)
jne    14e0 <url_percent_encode_byte+0x3c0>
jmp    14d3 <url_percent_encode_byte+0x3b3>
movsbl -0x9(%rbp),%eax
cmp    $0x3a,%eax
sete   %al
mov    %al,-0x64(%rbp)
mov    -0x64(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1501 <url_percent_encode_byte+0x3e1>
mov    $0x1,%al
test   $0x1,%al
jne    1510 <url_percent_encode_byte+0x3f0>
jmp    1515 <url_percent_encode_byte+0x3f5>
xor    %eax,%eax
test   $0x1,%al
jne    1510 <url_percent_encode_byte+0x3f0>
jmp    1515 <url_percent_encode_byte+0x3f5>
jmp    1570 <url_percent_encode_byte+0x450>
jmp    151f <url_percent_encode_byte+0x3ff>
jmp    1570 <url_percent_encode_byte+0x450>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jl     1543 <url_percent_encode_byte+0x423>
movsbl -0x9(%rbp),%eax
cmp    $0x7a,%eax
jg     1543 <url_percent_encode_byte+0x423>
movsbl -0x9(%rbp),%eax
and    $0xffffffdf,%eax
mov    %al,-0x9(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xac2(%rip),%rsi
lea    0xac2(%rip),%rdx
movsbl -0x9(%rbp),%ecx
call   1030 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1580 <url_percent_encode_byte+0x460>
mov    -0x58(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x58(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<url_percent_encode_byte>:
push   %rbx
sub    $0x50,%rsp
add    $0xffffffff,%esi
cmp    $0x3,%esi
ja     1144 <url_percent_encode_byte+0x24>
lea    0xecc(%rip),%rax
movslq (%rax,%rsi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    -0x20(%rdi),%eax
cmp    $0x5f,%al
jae    11be <url_percent_encode_byte+0x9e>
movb   $0x0,0x10(%rsp)
lea    0xf(%rsp),%rax
jmp    11e5 <url_percent_encode_byte+0xc5>
lea    -0x7f(%rdi),%eax
cmp    $0xa2,%al
jb     11be <url_percent_encode_byte+0x9e>
lea    -0x22(%rdi),%eax
cmp    $0x3e,%al
ja     1144 <url_percent_encode_byte+0x24>
movzbl %al,%eax
movabs $0x4000000034000003,%rcx
jmp    11a8 <url_percent_encode_byte+0x88>
lea    -0x7f(%rdi),%eax
cmp    $0xa2,%al
jb     11be <url_percent_encode_byte+0x9e>
lea    -0x22(%rdi),%eax
cmp    $0x3e,%al
ja     1144 <url_percent_encode_byte+0x24>
movzbl %al,%eax
movabs $0x4400000074002003,%rcx
jmp    11a8 <url_percent_encode_byte+0x88>
lea    -0x7f(%rdi),%eax
cmp    $0xa2,%al
jb     11be <url_percent_encode_byte+0x9e>
lea    -0x22(%rdi),%eax
cmp    $0x3e,%al
ja     1144 <url_percent_encode_byte+0x24>
movzbl %al,%eax
movabs $0x4400000075002003,%rcx
bt     %rax,%rcx
jae    1144 <url_percent_encode_byte+0x24>
lea    -0x41(%rdi),%eax
cmp    $0x39,%al
ja     11be <url_percent_encode_byte+0x9e>
and    $0xdf,%dil
mov    %dil,0xf(%rsp)
movsbl %dil,%ecx
lea    0xe47(%rip),%rsi
lea    0xe47(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s%02X\00"
@.str.1 = [2 x i8] c"%\00"
define noalias i8* @url_percent_encode_byte(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca [64 x i8]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
switch i32 %1, label %30 [
i32 1, label %6
i32 2, label %9
i32 3, label %13
i32 4, label %17
]
6: ; preds = %2
%7 = add i8 %0, -32
%8 = icmp ult i8 %7, 95
br i1 %8, label %30, label %26
9: ; preds = %2
%10 = add i8 %0, -127
%11 = icmp ult i8 %10, -94
br i1 %11, label %26, label %12
12: ; preds = %9
switch i8 %0, label %30 [
i8 63, label %21
i8 62, label %21
i8 60, label %21
i8 35, label %21
i8 34, label %21
i8 96, label %21
]
13: ; preds = %2
%14 = add i8 %0, -127
%15 = icmp ult i8 %14, -94
br i1 %15, label %26, label %16
16: ; preds = %13
switch i8 %0, label %30 [
i8 96, label %21
i8 64, label %21
i8 63, label %21
i8 62, label %21
i8 60, label %21
i8 47, label %21
i8 35, label %21
i8 34, label %21
i8 92, label %21
]
17: ; preds = %2
%18 = add i8 %0, -127
%19 = icmp ult i8 %18, -94
br i1 %19, label %26, label %20
20: ; preds = %17
switch i8 %0, label %30 [
i8 96, label %21
i8 92, label %21
i8 64, label %21
i8 63, label %21
i8 62, label %21
i8 60, label %21
i8 47, label %21
i8 35, label %21
i8 34, label %21
i8 58, label %21
]
21: ; preds = %20, %16, %12, %20, %20, %20, %20, %20, %20, %20, %20, %20, %16, %16, %16, %16, %16, %16, %16, %16, %12, %12, %12, %12, %12
%22 = add nsw i8 %0, -65
%23 = icmp ult i8 %22, 58
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = and i8 %0, -33
store i8 %25, i8* %3
br label %26
26: ; preds = %6, %9, %13, %17, %24, %21
%27 = phi i8 [ %0, %6 ], [ %0, %9 ], [ %0, %13 ], [ %0, %17 ], [ %25, %24 ], [ %0, %21 ]
%28 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8 signext %27)
%29 = call i8* @strdup(i8* %5)
br label %32
30: ; preds = %20, %16, %12, %2, %6
%31 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %31
br label %32
32: ; preds = %30, %26
%33 = phi i8* [ %3, %30 ], [ %29, %26 ]
ret i8* %33
}