void trdtou(char *s) {
  for (;; ++s)
    switch (*s) {
    case '\000':
      return;
    case '\202':
      *s = '\351';
      break;
    case '\204':
      *s = '\344';
      break;
    case '\224':
      *s = '\366';
      break;
    case '\201':
      *s = '\374';
      break;
    case '\216':
      *s = '\304';
      break;
    case '\231':
      *s = '\326';
      break;
    case '\232':
      *s = '\334';
      break;
    case '\341':
      *s = '\337';
      break;
    }
}


x86 assembly (clang, -O0):
<trdtou>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
sub    $0xffffff81,%eax
je     11cd <trdtou+0xcd>
jmp    1120 <trdtou+0x20>
mov    -0xc(%rbp),%eax
sub    $0xffffff82,%eax
je     11a9 <trdtou+0xa9>
jmp    1131 <trdtou+0x31>
mov    -0xc(%rbp),%eax
sub    $0xffffff84,%eax
je     11b5 <trdtou+0xb5>
jmp    1142 <trdtou+0x42>
mov    -0xc(%rbp),%eax
sub    $0xffffff8e,%eax
je     11d9 <trdtou+0xd9>
jmp    1153 <trdtou+0x53>
mov    -0xc(%rbp),%eax
sub    $0xffffff94,%eax
je     11c1 <trdtou+0xc1>
jmp    1164 <trdtou+0x64>
mov    -0xc(%rbp),%eax
sub    $0xffffff99,%eax
je     11e5 <trdtou+0xe5>
jmp    1175 <trdtou+0x75>
mov    -0xc(%rbp),%eax
sub    $0xffffff9a,%eax
je     11f1 <trdtou+0xf1>
jmp    1186 <trdtou+0x86>
mov    -0xc(%rbp),%eax
sub    $0xffffffe1,%eax
je     11fd <trdtou+0xfd>
jmp    1197 <trdtou+0x97>
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1204 <trdtou+0x104>
jmp    11a7 <trdtou+0xa7>
pop    %rbp
ret
mov    -0x8(%rbp),%rax
movb   $0xe9,(%rax)
jmp    1204 <trdtou+0x104>
mov    -0x8(%rbp),%rax
movb   $0xe4,(%rax)
jmp    1204 <trdtou+0x104>
mov    -0x8(%rbp),%rax
movb   $0xf6,(%rax)
jmp    1204 <trdtou+0x104>
mov    -0x8(%rbp),%rax
movb   $0xfc,(%rax)
jmp    1204 <trdtou+0x104>
mov    -0x8(%rbp),%rax
movb   $0xc4,(%rax)
jmp    1204 <trdtou+0x104>
mov    -0x8(%rbp),%rax
movb   $0xd6,(%rax)
jmp    1204 <trdtou+0x104>
mov    -0x8(%rbp),%rax
movb   $0xdc,(%rax)
jmp    1204 <trdtou+0x104>
mov    -0x8(%rbp),%rax
movb   $0xdf,(%rax)
jmp    1209 <trdtou+0x109>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <trdtou+0x8>

x86 assembly (clang, -O2):
<trdtou>:
lea    0xef9(%rip),%rax
jmp    1116 <trdtou+0x16>
mov    $0xdc,%cl
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rdi)
add    $0x1,%rdi
movsbl (%rdi),%ecx
lea    0x7f(%rcx),%edx
cmp    $0x19,%edx
ja     1130 <trdtou+0x30>
mov    $0xe9,%cl
movslq (%rax,%rdx,4),%rdx
add    %rax,%rdx
jmp    *%rdx
mov    $0xfc,%cl
jmp    1110 <trdtou+0x10>
cmp    $0xffffffe1,%ecx
je     114b <trdtou+0x4b>
test   %ecx,%ecx
jne    1112 <trdtou+0x12>
jmp    114f <trdtou+0x4f>
mov    $0xe4,%cl
jmp    1110 <trdtou+0x10>
mov    $0xc4,%cl
jmp    1110 <trdtou+0x10>
mov    $0xf6,%cl
jmp    1110 <trdtou+0x10>
mov    $0xd6,%cl
jmp    1110 <trdtou+0x10>
mov    $0xdf,%cl
jmp    1110 <trdtou+0x10>
ret

LLVM IR (-O0):
define void @trdtou(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %25, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %24 [
i32 0, label %7
i32 -126, label %8
i32 -124, label %10
i32 -108, label %12
i32 -127, label %14
i32 -114, label %16
i32 -103, label %18
i32 -102, label %20
i32 -31, label %22
]
7: ; preds = %3
ret void
8: ; preds = %3
%9 = load i8*, i8** %2
store i8 -23, i8* %9
br label %24
10: ; preds = %3
%11 = load i8*, i8** %2
store i8 -28, i8* %11
br label %24
12: ; preds = %3
%13 = load i8*, i8** %2
store i8 -10, i8* %13
br label %24
14: ; preds = %3
%15 = load i8*, i8** %2
store i8 -4, i8* %15
br label %24
16: ; preds = %3
%17 = load i8*, i8** %2
store i8 -60, i8* %17
br label %24
18: ; preds = %3
%19 = load i8*, i8** %2
store i8 -42, i8* %19
br label %24
20: ; preds = %3
%21 = load i8*, i8** %2
store i8 -36, i8* %21
br label %24
22: ; preds = %3
%23 = load i8*, i8** %2
store i8 -33, i8* %23
br label %24
24: ; preds = %3, %22, %20, %18, %16, %14, %12, %10, %8
br label %25
25: ; preds = %24
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %2
br label %3
}

LLVM IR (-O2):
define void @trdtou(i8* nocapture %0) {
br label %2
2: ; preds = %16, %1
%3 = phi i8* [ %0, %1 ], [ %17, %16 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %16 [
i32 0, label %6
i32 -126, label %14
i32 -124, label %7
i32 -108, label %8
i32 -127, label %9
i32 -114, label %10
i32 -103, label %11
i32 -102, label %12
i32 -31, label %13
]
6: ; preds = %2
ret void
7: ; preds = %2
br label %14
8: ; preds = %2
br label %14
9: ; preds = %2
br label %14
10: ; preds = %2
br label %14
11: ; preds = %2
br label %14
12: ; preds = %2
br label %14
13: ; preds = %2
br label %14
14: ; preds = %2, %13, %12, %11, %10, %9, %8, %7
%15 = phi i8 [ -28, %7 ], [ -10, %8 ], [ -4, %9 ], [ -60, %10 ], [ -42, %11 ], [ -36, %12 ], [ -33, %13 ], [ -23, %2 ]
store i8 %15, i8* %3
br label %16
16: ; preds = %14, %2
%17 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
}