#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*/ char_array_to_c(char *, int, char *);
void hexencodemap_char() {
  static const unsigned char sHexChars[] = "0123456789ABCDEF";
  int i;
  unsigned char e1[256];
  unsigned char e2[256];
  for (i = 0; i < 256; ++i) {
    e1[i] = 0;
    e2[i] = 0;
  }
  for (i = 0; i < 256; ++i) {
    e1[i] = sHexChars[i >> 4];
    e2[i] = sHexChars[i & 0x0f];
  }
  char_array_to_c((char *)e1, 256, "gsHexEncodeC1");
  char_array_to_c((char *)e2, 256, "gsHexEncodeC2");
}


x86 assembly (clang, -O0):
<hexencodemap_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1155 <hexencodemap_char+0x45>
movslq -0x4(%rbp),%rax
movb   $0x0,-0x110(%rbp,%rax,1)
movslq -0x4(%rbp),%rax
movb   $0x0,-0x210(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <hexencodemap_char+0x12>
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    11b3 <hexencodemap_char+0xa3>
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0xe87(%rip),%rax
mov    (%rax,%rcx,1),%cl
movslq -0x4(%rbp),%rax
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xe69(%rip),%rax
mov    (%rax,%rcx,1),%cl
movslq -0x4(%rbp),%rax
mov    %cl,-0x210(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115c <hexencodemap_char+0x4c>
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
lea    0xe4b(%rip),%rdx
call   1030 <char_array_to_c@plt>
lea    -0x210(%rbp),%rdi
mov    $0x100,%esi
lea    0xe41(%rip),%rdx
call   1030 <char_array_to_c@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexencodemap_char>:
sub    $0x208,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xf0(%rsp)
xor    %eax,%eax
lea    0xdf6(%rip),%rdi
nopw   0x0(%rax,%rax,1)
mov    %eax,%edx
shr    $0x4,%edx
movzbl (%rdx,%rdi,1),%edx
mov    %dl,0x100(%rsp,%rax,1)
mov    %eax,%esi
and    $0xe,%esi
movzbl (%rsi,%rdi,1),%ecx
mov    %cl,(%rsp,%rax,1)
lea    0x1(%rax),%ecx
mov    %dl,0x101(%rsp,%rax,1)
and    $0xf,%ecx
movzbl (%rcx,%rdi,1),%ecx
mov    %cl,0x1(%rsp,%rax,1)
add    $0x2,%rax
cmp    $0x100,%rax
jne    1210 <hexencodemap_char+0x100>
lea    0xdbd(%rip),%rdx
lea    0x100(%rsp),%rdi
mov    $0x100,%esi
call   1030 <char_array_to_c@plt>
lea    0xdb2(%rip),%rdx
mov    %rsp,%rdi
mov    $0x100,%esi
call   1030 <char_array_to_c@plt>
add    $0x208,%rsp
ret

LLVM IR (-O0):
@hexencodemap_char.sHexChars = internal constant [17 x i8] c"0123456789ABCDEF\00"
@.str = [14 x i8] c"gsHexEncodeC1\00"
@.str.1 = [14 x i8] c"gsHexEncodeC2\00"
define void @hexencodemap_char() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 256
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %9
store i8 0, i8* %10
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %12
store i8 0, i8* %13
br label %14
14: ; preds = %7
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %4
17: ; preds = %4
store i32 0, i32* %1
br label %18
18: ; preds = %38, %17
%19 = load i32, i32* %1
%20 = icmp slt i32 %19, 256
br i1 %20, label %21, label %41
21: ; preds = %18
%22 = load i32, i32* %1
%23 = ashr i32 %22, 4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [17 x i8], [17 x i8]* @hexencodemap_char.sHexChars, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = load i32, i32* %1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %28
store i8 %26, i8* %29
%30 = load i32, i32* %1
%31 = and i32 %30, 15
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [17 x i8], [17 x i8]* @hexencodemap_char.sHexChars, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = load i32, i32* %1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %36
store i8 %34, i8* %37
br label %38
38: ; preds = %21
%39 = load i32, i32* %1
%40 = add nsw i32 %39, 1
store i32 %40, i32* %1
br label %18
41: ; preds = %18
%42 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%43 = call i32 @char_array_to_c(i8* %42, i32 256, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%45 = call i32 @char_array_to_c(i8* %44, i32 256, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@hexencodemap_char.sHexChars = internal unnamed_addr constant [17 x i8] c"0123456789ABCDEF\00"
@.str = [14 x i8] c"gsHexEncodeC1\00"
@.str.1 = [14 x i8] c"gsHexEncodeC2\00"
define void @hexencodemap_char() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
br label %7
7: ; preds = %7, %0
%8 = phi i64 [ 0, %0 ], [ %28, %7 ]
%9 = lshr i64 %8, 4
%10 = and i64 %9, 268435455
%11 = getelementptr inbounds [17 x i8], [17 x i8]* @hexencodemap_char.sHexChars, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %8
store i8 %12, i8* %13
%14 = and i64 %8, 14
%15 = getelementptr inbounds [17 x i8], [17 x i8]* @hexencodemap_char.sHexChars, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %8
store i8 %16, i8* %17
%18 = or i64 %8, 1
%19 = lshr i64 %8, 4
%20 = and i64 %19, 268435455
%21 = getelementptr inbounds [17 x i8], [17 x i8]* @hexencodemap_char.sHexChars, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %18
store i8 %22, i8* %23
%24 = and i64 %18, 15
%25 = getelementptr inbounds [17 x i8], [17 x i8]* @hexencodemap_char.sHexChars, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %18
store i8 %26, i8* %27
%28 = add nuw nsw i64 %8, 2
%29 = icmp eq i64 %28, 256
br i1 %29, label %30, label %7
30: ; preds = %7
%31 = call i32 @char_array_to_c(i8* %5, i32 256, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%32 = call i32 @char_array_to_c(i8* %6, i32 256, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}