unsigned long GrMapISO8859_6_Unicode(const char *pcSrcChar,
                                     unsigned long ulCount,
                                     unsigned long *pulSkip) {
  assert(pulSkip);
  assert(pcSrcChar);
  *pulSkip = 1;
  if (((unsigned char)*pcSrcChar <= 0xA4) ||
      ((unsigned char)*pcSrcChar == 0xAD)) {
    return ((unsigned long)(unsigned char)*pcSrcChar);
  } else {
    return ((unsigned long)((unsigned char)*pcSrcChar) + 0x560);
  }
}


x86 assembly (clang, -O0):
<GrMapISO8859_6_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    $0xa4,%eax
jle    1169 <GrMapISO8859_6_Unicode+0x59>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xad,%eax
jne    1179 <GrMapISO8859_6_Unicode+0x69>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    %rax,-0x8(%rbp)
jmp    118a <GrMapISO8859_6_Unicode+0x7a>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
add    $0x560,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GrMapISO8859_6_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
lea    0x560(%rcx),%rax
cmp    $0xad,%rcx
cmove  %rcx,%rax
cmp    $0xa5,%rcx
cmovb  %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @GrMapISO8859_6_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, 164
br i1 %16, label %22, label %17
17: ; preds = %3
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = icmp eq i32 %20, 173
br i1 %21, label %22, label %26
22: ; preds = %17, %3
%23 = load i8*, i8** %5
%24 = load i8, i8* %23
%25 = zext i8 %24 to i64
store i64 %25, i64* %4
br label %31
26: ; preds = %17
%27 = load i8*, i8** %5
%28 = load i8, i8* %27
%29 = zext i8 %28 to i64
%30 = add i64 %29, 1376
store i64 %30, i64* %4
br label %31
31: ; preds = %26, %22
%32 = load i64, i64* %4
ret i64 %32
}

LLVM IR (-O2):
define i64 @GrMapISO8859_6_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 = icmp ult i8 %6, -91
%8 = icmp eq i8 %6, -83
%9 = or i1 %7, %8
%10 = zext i8 %6 to i64
%11 = add nuw nsw i64 %10, 1376
%12 = select i1 %9, i64 %10, i64 %11
ret i64 %12
}