unsigned long GrMapISO8859_8_Unicode(const char *pcSrcChar,
                                     unsigned long ulCount,
                                     unsigned long *pulSkip) {
  assert(pulSkip);
  assert(pcSrcChar);
  *pulSkip = 1;
  if ((unsigned char)*pcSrcChar <= 0xDE) {
    return ((unsigned long)(unsigned char)*pcSrcChar);
  } else if ((unsigned char)*pcSrcChar == 0xDF) {
    return (0x2017);
  } else if ((unsigned char)*pcSrcChar <= 0xFC) {
    return ((unsigned char)*pcSrcChar + 0x4F0);
  } else {
    return ((unsigned char)*pcSrcChar + 0x1F11);
  }
}


x86 assembly (clang, -O0):
<GrMapISO8859_8_Unicode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
movq   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xde,%eax
jg     1167 <GrMapISO8859_8_Unicode+0x57>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    %rax,-0x8(%rbp)
jmp    11c1 <GrMapISO8859_8_Unicode+0xb1>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xdf,%eax
jne    1186 <GrMapISO8859_8_Unicode+0x76>
movq   $0x2017,-0x8(%rbp)
jmp    11c1 <GrMapISO8859_8_Unicode+0xb1>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xfc,%eax
jg     11af <GrMapISO8859_8_Unicode+0x9f>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
add    $0x4f0,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    11c1 <GrMapISO8859_8_Unicode+0xb1>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
add    $0x1f11,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GrMapISO8859_8_Unicode>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rdx,%rdi
xor    %eax,%eax
call   1030 <assert@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <assert@plt>
movq   $0x1,(%rbx)
movzbl (%r14),%ecx
cmp    $0xde,%ecx
ja     1146 <GrMapISO8859_8_Unicode+0x36>
mov    %rcx,%rax
jmp    1165 <GrMapISO8859_8_Unicode+0x55>
mov    $0x2017,%eax
cmp    $0xdf,%cl
je     1165 <GrMapISO8859_8_Unicode+0x55>
cmp    $0xfc,%cl
ja     115e <GrMapISO8859_8_Unicode+0x4e>
lea    0x4f0(%rcx),%rax
jmp    1165 <GrMapISO8859_8_Unicode+0x55>
lea    0x1f11(%rcx),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @GrMapISO8859_8_Unicode(i8* %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64* %2, i64** %7
%8 = load i64*, i64** %7
%9 = call i32 (i64*, ...) bitcast (i32 (...)* @assert to i32 (i64*, ...)*)(i64* %8)
%10 = load i8*, i8** %5
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %10)
%12 = load i64*, i64** %7
store i64 1, i64* %12
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = icmp sle i32 %15, 222
br i1 %16, label %17, label %21
17: ; preds = %3
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = zext i8 %19 to i64
store i64 %20, i64* %4
br label %44
21: ; preds = %3
%22 = load i8*, i8** %5
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = icmp eq i32 %24, 223
br i1 %25, label %26, label %27
26: ; preds = %21
store i64 8215, i64* %4
br label %44
27: ; preds = %21
%28 = load i8*, i8** %5
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = icmp sle i32 %30, 252
br i1 %31, label %32, label %38
32: ; preds = %27
%33 = load i8*, i8** %5
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = add nsw i32 %35, 1264
%37 = sext i32 %36 to i64
store i64 %37, i64* %4
br label %44
38: ; preds = %27
%39 = load i8*, i8** %5
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = add nsw i32 %41, 7953
%43 = sext i32 %42 to i64
store i64 %43, i64* %4
br label %44
44: ; preds = %38, %32, %26, %17
%45 = load i64, i64* %4
ret i64 %45
}

LLVM IR (-O2):
define i64 @GrMapISO8859_8_Unicode(i8* %0, i64 %1, i64* %2) {
%4 = tail call i32 (i64*, ...) bitcast (i32 (...)* @assert to i32 (i64*, ...)*)(i64* %2)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %0)
store i64 1, i64* %2
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = icmp ult i8 %6, -33
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = zext i8 %6 to i64
br label %21
11: ; preds = %3
%12 = icmp eq i8 %6, -33
br i1 %12, label %21, label %13
13: ; preds = %11
%14 = icmp ult i8 %6, -3
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = add nuw nsw i32 %7, 1264
%17 = zext i32 %16 to i64
br label %21
18: ; preds = %13
%19 = add nuw nsw i32 %7, 7953
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %11, %18, %15, %9
%22 = phi i64 [ %10, %9 ], [ %17, %15 ], [ %20, %18 ], [ 8215, %11 ]
ret i64 %22
}