void A2C128_C(unsigned char **ppOutPos, unsigned char c1, unsigned char c2) {
  unsigned char *pOutPos = *ppOutPos;
  switch (c1) {
  case (unsigned char)(128):
    *pOutPos = 102;
    break;
  case (unsigned char)(133):
    *pOutPos = 100;
    break;
  case (unsigned char)(132):
    *pOutPos = 101;
    break;
  default:
    *pOutPos = (char)(10 * (c1 - '0') + (c2 - '0'));
    break;
  }
  (*ppOutPos)++;
}


x86 assembly (clang, -O0):
<A2C128_C>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movzbl -0x9(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x80,%eax
je     115b <A2C128_C+0x5b>
jmp    1135 <A2C128_C+0x35>
mov    -0x1c(%rbp),%eax
sub    $0x84,%eax
je     1173 <A2C128_C+0x73>
jmp    1148 <A2C128_C+0x48>
mov    -0x1c(%rbp),%eax
sub    $0x85,%eax
je     1167 <A2C128_C+0x67>
jmp    117f <A2C128_C+0x7f>
mov    -0x18(%rbp),%rax
movb   $0x66,(%rax)
jmp    119a <A2C128_C+0x9a>
mov    -0x18(%rbp),%rax
movb   $0x64,(%rax)
jmp    119a <A2C128_C+0x9a>
mov    -0x18(%rbp),%rax
movb   $0x65,(%rax)
jmp    119a <A2C128_C+0x9a>
movzbl -0x9(%rbp),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
movzbl -0xa(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<A2C128_C>:
mov    (%rdi),%rax
cmp    $0x80,%sil
je     1119 <A2C128_C+0x19>
cmp    $0x84,%sil
je     111d <A2C128_C+0x1d>
cmp    $0x85,%sil
jne    1121 <A2C128_C+0x21>
mov    $0x64,%cl
jmp    112f <A2C128_C+0x2f>
mov    $0x66,%cl
jmp    112f <A2C128_C+0x2f>
mov    $0x65,%cl
jmp    112f <A2C128_C+0x2f>
movzbl %sil,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
add    %dl,%cl
add    $0xf0,%cl
mov    %cl,(%rax)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @A2C128_C(i8** %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8**
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8*
store i8** %0, i8*** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
store i8* %9, i8** %7
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
switch i32 %11, label %18 [
i32 128, label %12
i32 133, label %14
i32 132, label %16
]
12: ; preds = %3
%13 = load i8*, i8** %7
store i8 102, i8* %13
br label %29
14: ; preds = %3
%15 = load i8*, i8** %7
store i8 100, i8* %15
br label %29
16: ; preds = %3
%17 = load i8*, i8** %7
store i8 101, i8* %17
br label %29
18: ; preds = %3
%19 = load i8, i8* %5
%20 = zext i8 %19 to i32
%21 = sub nsw i32 %20, 48
%22 = mul nsw i32 10, %21
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = sub nsw i32 %24, 48
%26 = add nsw i32 %22, %25
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %7
store i8 %27, i8* %28
br label %29
29: ; preds = %18, %16, %14, %12
%30 = load i8**, i8*** %4
%31 = load i8*, i8** %30
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %30
ret void
}

LLVM IR (-O2):
define void @A2C128_C(i8** nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8*, i8** %0
switch i8 %1, label %7 [
i8 -128, label %11
i8 -123, label %5
i8 -124, label %6
]
5: ; preds = %3
br label %11
6: ; preds = %3
br label %11
7: ; preds = %3
%8 = mul i8 %1, 10
%9 = add i8 %2, -16
%10 = add i8 %9, %8
br label %11
11: ; preds = %3, %7, %6, %5
%12 = phi i8 [ %10, %7 ], [ 101, %6 ], [ 100, %5 ], [ 102, %3 ]
store i8 %12, i8* %4
%13 = load i8*, i8** %0
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8* %14, i8** %0
ret void
}