#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 */
typedef int /*<<< orphan*/ safechar;

/* Variables and functions */
int /*<<< orphan*/ char_array_to_c(char *, int, char *);
void urlencodeminmap() {
  int i;
  char urlEncodeMap[256];
  for (i = 0; i < 256; ++i) {
    urlEncodeMap[i] = 0;
  }
  for (i = 'A'; i <= 'Z'; ++i) {
    urlEncodeMap[i] = (char)i;
  }
  for (i = 'a'; i <= 'z'; ++i) {
    urlEncodeMap[i] = (char)i;
  }
  for (i = '0'; i <= '9'; ++i) {
    urlEncodeMap[i] = (char)i;
  }
  urlEncodeMap[(int)' '] = '+';
  const char safechar[] = {'_', '.', '-', '~', '!', '$', '(', ')',
                           '*', ',', ';', ':', '@', '/', '?'};
  int imax = sizeof(safechar);
  for (i = 0; i < imax; ++i) {
    urlEncodeMap[(int)(safechar[i])] = safechar[i];
  }
  char_array_to_c(urlEncodeMap, 256, "gsUrlEncodeMinMap");
}


x86 assembly (clang, -O0):
<urlencodeminmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1149 <urlencodeminmap+0x39>
movslq -0x4(%rbp),%rax
movb   $0x0,-0x110(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <urlencodeminmap+0x12>
movl   $0x41,-0x4(%rbp)
cmpl   $0x5a,-0x4(%rbp)
jg     1178 <urlencodeminmap+0x68>
mov    -0x4(%rbp),%eax
mov    %al,%cl
movslq -0x4(%rbp),%rax
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <urlencodeminmap+0x40>
movl   $0x61,-0x4(%rbp)
cmpl   $0x7a,-0x4(%rbp)
jg     11a7 <urlencodeminmap+0x97>
mov    -0x4(%rbp),%eax
mov    %al,%cl
movslq -0x4(%rbp),%rax
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117f <urlencodeminmap+0x6f>
movl   $0x30,-0x4(%rbp)
cmpl   $0x39,-0x4(%rbp)
jg     11d6 <urlencodeminmap+0xc6>
mov    -0x4(%rbp),%eax
mov    %al,%cl
movslq -0x4(%rbp),%rax
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11ae <urlencodeminmap+0x9e>
movb   $0x2b,-0xf0(%rbp)
mov    0xe1c(%rip),%rax
mov    %rax,-0x11f(%rbp)
mov    0xe17(%rip),%eax
mov    %eax,-0x117(%rbp)
mov    0xe0e(%rip),%ax
mov    %ax,-0x113(%rbp)
mov    0xe03(%rip),%al
mov    %al,-0x111(%rbp)
movl   $0xf,-0x124(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x124(%rbp),%eax
jge    125f <urlencodeminmap+0x14f>
movslq -0x4(%rbp),%rax
mov    -0x11f(%rbp,%rax,1),%cl
movslq -0x4(%rbp),%rax
movsbl -0x11f(%rbp,%rax,1),%eax
ff
cltq
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1222 <urlencodeminmap+0x112>
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
lea    0xd9d(%rip),%rdx
call   1030 <char_array_to_c@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<urlencodeminmap>:
sub    $0x108,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movaps 0xe78(%rip),%xmm0
movups %xmm0,0x41(%rsp)
movabs $0x5857565554535251,%rax
56 57 58
mov    %rax,0x51(%rsp)
movw   $0x5a59,0x59(%rsp)
movabs $0x6867666564636261,%rax
66 67 68
mov    %rax,0x61(%rsp)
movw   $0x6a69,0x69(%rsp)
movaps 0xe50(%rip),%xmm0
movups %xmm0,0x6b(%rsp)
movabs $0x3736353433323130,%rax
35 36 37
mov    %rax,0x30(%rsp)
movl   $0x3b3a3938,0x38(%rsp)
3b
movw   $0x212b,0x20(%rsp)
movb   $0x5f,0x5f(%rsp)
movb   $0x7e,0x7e(%rsp)
movb   $0x24,0x24(%rsp)
movw   $0x2928,0x28(%rsp)
movb   $0x2a,0x2a(%rsp)
movl   $0x2f2e2d2c,0x2c(%rsp)
2f
movw   $0x403f,0x3f(%rsp)
lea    0xe0c(%rip),%rdx
mov    %rsp,%rdi
mov    $0x100,%esi
call   1030 <char_array_to_c@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
@__const.urlencodeminmap.safechar = [15 x i8] c"_.-~!$()*,;:@/?"
@.str = [18 x i8] c"gsUrlEncodeMinMap\00"
define void @urlencodeminmap() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca [15 x i8]
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 256
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %8
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %5
15: ; preds = %5
store i32 65, i32* %1
br label %16
16: ; preds = %25, %15
%17 = load i32, i32* %1
%18 = icmp sle i32 %17, 90
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = load i32, i32* %1
%21 = trunc i32 %20 to i8
%22 = load i32, i32* %1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %23
store i8 %21, i8* %24
br label %25
25: ; preds = %19
%26 = load i32, i32* %1
%27 = add nsw i32 %26, 1
store i32 %27, i32* %1
br label %16
28: ; preds = %16
store i32 97, i32* %1
br label %29
29: ; preds = %38, %28
%30 = load i32, i32* %1
%31 = icmp sle i32 %30, 122
br i1 %31, label %32, label %41
32: ; preds = %29
%33 = load i32, i32* %1
%34 = trunc i32 %33 to i8
%35 = load i32, i32* %1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %36
store i8 %34, i8* %37
br label %38
38: ; preds = %32
%39 = load i32, i32* %1
%40 = add nsw i32 %39, 1
store i32 %40, i32* %1
br label %29
41: ; preds = %29
store i32 48, i32* %1
br label %42
42: ; preds = %51, %41
%43 = load i32, i32* %1
%44 = icmp sle i32 %43, 57
br i1 %44, label %45, label %54
45: ; preds = %42
%46 = load i32, i32* %1
%47 = trunc i32 %46 to i8
%48 = load i32, i32* %1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %49
store i8 %47, i8* %50
br label %51
51: ; preds = %45
%52 = load i32, i32* %1
%53 = add nsw i32 %52, 1
store i32 %53, i32* %1
br label %42
54: ; preds = %42
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 32
store i8 43, i8* %55
%56 = bitcast [15 x i8]* %3 to i8*
store i32 15, i32* %4
store i32 0, i32* %1
br label %57
57: ; preds = %73, %54
%58 = load i32, i32* %1
%59 = load i32, i32* %4
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %76
61: ; preds = %57
%62 = load i32, i32* %1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 %63
%65 = load i8, i8* %64
%66 = load i32, i32* %1
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %71
store i8 %65, i8* %72
br label %73
73: ; preds = %61
%74 = load i32, i32* %1
%75 = add nsw i32 %74, 1
store i32 %75, i32* %1
br label %57
76: ; preds = %57
%77 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%78 = call i32 @char_array_to_c(i8* %77, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"gsUrlEncodeMinMap\00"
define void @urlencodeminmap() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 65
%5 = bitcast i8* %4 to <16 x i8>*
store <16 x i8> <i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75, i8 76, i8 77, i8 78, i8 79, i8 80>, <16 x i8>* %5
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 81
store i8 81, i8* %6
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 82
store i8 82, i8* %7
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 83
store i8 83, i8* %8
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 84
store i8 84, i8* %9
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 85
store i8 85, i8* %10
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 86
store i8 86, i8* %11
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 87
store i8 87, i8* %12
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 88
store i8 88, i8* %13
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 89
store i8 89, i8* %14
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 90
store i8 90, i8* %15
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 97
store i8 97, i8* %16
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 98
store i8 98, i8* %17
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 99
store i8 99, i8* %18
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 100
store i8 100, i8* %19
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 101
store i8 101, i8* %20
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 102
store i8 102, i8* %21
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 103
store i8 103, i8* %22
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 104
store i8 104, i8* %23
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 105
store i8 105, i8* %24
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 106
store i8 106, i8* %25
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 107
%27 = bitcast i8* %26 to <16 x i8>*
store <16 x i8> <i8 107, i8 108, i8 109, i8 110, i8 111, i8 112, i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122>, <16 x i8>* %27
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 48
store i8 48, i8* %28
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 49
store i8 49, i8* %29
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 50
store i8 50, i8* %30
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 51
store i8 51, i8* %31
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 52
store i8 52, i8* %32
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 53
store i8 53, i8* %33
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 54
store i8 54, i8* %34
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 55
store i8 55, i8* %35
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 56
store i8 56, i8* %36
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 57
store i8 57, i8* %37
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 32
store i8 43, i8* %38
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 95
store i8 95, i8* %39
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 46
store i8 46, i8* %40
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 45
store i8 45, i8* %41
%42 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 126
store i8 126, i8* %42
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 33
store i8 33, i8* %43
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 36
store i8 36, i8* %44
%45 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 40
store i8 40, i8* %45
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 41
store i8 41, i8* %46
%47 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 42
store i8 42, i8* %47
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 44
store i8 44, i8* %48
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 59
store i8 59, i8* %49
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 58
store i8 58, i8* %50
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 64
store i8 64, i8* %51
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 47
store i8 47, i8* %52
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 63
store i8 63, i8* %53
%54 = call i32 @char_array_to_c(i8* %3, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}