int encode_final_transform(x, y)
int x, y;
{
  int i, j, digit, sum;
  int a[9], b[9], out[17];
  for (i = 0; i < 9; i++) {
    digit = x % 10;
    a[i] = digit;
    x = (x - digit) / 10;
  }
  for (i = 0; i < 9; i++) {
    digit = y % 10;
    b[i] = digit;
    y = (y - digit) / 10;
  }
  for (i = 0; i < 17; i++) {
    out[i] = 0;
  }
  for (i = 0; i <= 8; i++) {
    for (j = 0; j <= 8; j++) {
      out[i + j] += b[j] * a[i];
    }
  }
  j = 1;
  sum = 0;
  for (i = 0; i <= 8; i++) {
    sum += j * (out[i] % 10);
    j *= 10;
  }
  return (sum);
}


x86 assembly (clang, -O0):
<encode_final_transform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1157 <encode_final_transform+0x57>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <encode_final_transform+0x15>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    11a0 <encode_final_transform+0xa0>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x70(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115e <encode_final_transform+0x5e>
movl   $0x0,-0xc(%rbp)
cmpl   $0x11,-0xc(%rbp)
jge    11ce <encode_final_transform+0xce>
movslq -0xc(%rbp),%rax
movl   $0x0,-0xc0(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a7 <encode_final_transform+0xa7>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jg     1238 <encode_final_transform+0x138>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jg     1225 <encode_final_transform+0x125>
movslq -0x10(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%ecx
movslq -0xc(%rbp),%rax
imul   -0x40(%rbp,%rax,4),%ecx
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cltq
add    -0xc0(%rbp,%rax,4),%ecx
mov    %ecx,-0xc0(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e6 <encode_final_transform+0xe6>
jmp    122a <encode_final_transform+0x12a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d5 <encode_final_transform+0xd5>
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jg     1297 <encode_final_transform+0x197>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc4(%rbp)
movslq -0xc(%rbp),%rax
mov    -0xc0(%rbp,%rax,4),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc4(%rbp),%eax
imul   %edx,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
imul   $0xa,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    124d <encode_final_transform+0x14d>
mov    -0x18(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_final_transform>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
movslq %edi,%rdx
imul   $0x66666667,%rdx,%r9
mov    %r9,%rcx
shr    $0x3f,%rcx
shr    $0x20,%r9
sar    $0x2,%r9d
add    %ecx,%r9d
lea    (%r9,%r9,1),%ecx
lea    (%rcx,%rcx,4),%r8d
imul   $0x51eb851f,%rdx,%r10
imul   $0x10624dd3,%rdx,%r11
imul   $0x68db8bad,%rdx,%r14
imul   $0x14f8b589,%rdx,%r15
imul   $0x431bde83,%rdx,%rax
imul   $0x6b5fca6b,%rdx,%rbx
imul   $0x55e63b89,%rdx,%rcx
mov    %edx,%r12d
sub    %r8d,%r12d
mov    %r12d,-0x78(%rsp)
movslq %r9d,%rbp
imul   $0x66666667,%rbp,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rdi
sar    $0x2,%edi
add    %edx,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%edx
sub    %edx,%ebp
mov    %ebp,-0x74(%rsp)
mov    %r10,%rdx
shr    $0x3f,%rdx
shr    $0x20,%r10
sar    $0x5,%r10d
add    %edx,%r10d
movslq %r10d,%rdx
imul   $0x66666667,%rdx,%rdi
mov    %rdi,%rbp
shr    $0x3f,%rbp
shr    $0x20,%rdi
sar    $0x2,%edi
add    %ebp,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%edi
sub    %edi,%edx
mov    %edx,-0x70(%rsp)
mov    %r11,%rdx
shr    $0x3f,%rdx
shr    $0x20,%r11
sar    $0x6,%r11d
add    %edx,%r11d
movslq %r11d,%rdx
imul   $0x66666667,%rdx,%rdi
mov    %rdi,%rbp
shr    $0x3f,%rbp
shr    $0x20,%rdi
sar    $0x2,%edi
add    %ebp,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%edi
sub    %edi,%edx
mov    %edx,-0x6c(%rsp)
mov    %r14,%rdx
shr    $0x3f,%rdx
shr    $0x20,%r14
sar    $0xc,%r14d
add    %edx,%r14d
movslq %r14d,%rdx
imul   $0x66666667,%rdx,%rdi
mov    %rdi,%rbp
shr    $0x3f,%rbp
shr    $0x20,%rdi
sar    $0x2,%edi
add    %ebp,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%edi
sub    %edi,%edx
mov    %edx,-0x68(%rsp)
mov    %r15,%rdx
shr    $0x3f,%rdx
shr    $0x20,%r15
sar    $0xd,%r15d
add    %edx,%r15d
movswl %r15w,%edx
imul   $0x6667,%edx,%edx
mov    %edx,%edi
shr    $0x1f,%edi
sar    $0x12,%edx
add    %edi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%r15d
movswl %r15w,%edx
mov    %edx,-0x64(%rsp)
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
sar    $0x12,%eax
add    %edx,%eax
imul   $0x6667,%eax,%edx
mov    %edx,%edi
shr    $0x1f,%edi
sar    $0x12,%edx
add    %edi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%eax
movswl %ax,%edx
mov    %edx,-0x60(%rsp)
mov    %rbx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rbx
sar    $0x16,%ebx
add    %edx,%ebx
imul   $0x6667,%ebx,%edx
mov    %edx,%edi
shr    $0x1f,%edi
sar    $0x12,%edx
add    %edi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ebx
movswl %bx,%edx
mov    %edx,-0x5c(%rsp)
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x19,%ecx
add    %edx,%ecx
imul   $0x67,%ecx,%edx
movzwl %dx,%edx
mov    %edx,%edi
shr    $0xf,%edi
shr    $0x8,%edx
sar    $0x2,%dl
add    %dil,%dl
movzbl %dl,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movsbl %cl,%ecx
mov    %ecx,-0x58(%rsp)
movslq %esi,%r10
imul   $0x66666667,%r10,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
imul   $0x51eb851f,%r10,%rsi
imul   $0x10624dd3,%r10,%rdi
imul   $0x68db8bad,%r10,%rbx
imul   $0x14f8b589,%r10,%rbp
imul   $0x431bde83,%r10,%rax
imul   $0x6b5fca6b,%r10,%r13
imul   $0x55e63b89,%r10,%r8
sub    %edx,%r10d
movslq %ecx,%r9
imul   $0x66666667,%r9,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%r9d
mov    %rsi,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rsi
sar    $0x5,%esi
add    %ecx,%esi
movslq %esi,%r11
imul   $0x66666667,%r11,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%r11d
mov    %rdi,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdi
sar    $0x6,%edi
add    %ecx,%edi
movslq %edi,%r14
imul   $0x66666667,%r14,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%r14d
mov    %rbx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rbx
sar    $0xc,%ebx
add    %ecx,%ebx
movslq %ebx,%r15
imul   $0x66666667,%r15,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%r15d
mov    %rbp,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rbp
sar    $0xd,%ebp
add    %ecx,%ebp
movswl %bp,%ecx
imul   $0x6667,%ecx,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x12,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%ebp
movswl %bp,%ebp
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
sar    $0x12,%eax
add    %ecx,%eax
imul   $0x6667,%eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x12,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
movswl %ax,%esi
mov    %r13,%rcx
shr    $0x3f,%rcx
shr    $0x20,%r13
sar    $0x16,%r13d
add    %ecx,%r13d
imul   $0x6667,%r13d,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x12,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%r13d
movswl %r13w,%ecx
mov    %r8,%rdx
shr    $0x3f,%rdx
shr    $0x20,%r8
sar    $0x19,%r8d
add    %edx,%r8d
imul   $0x67,%r8d,%edx
movzwl %dx,%edx
mov    %edx,%edi
shr    $0xf,%edi
shr    $0x8,%edx
sar    $0x2,%dl
add    %dil,%dl
movzbl %dl,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%r8b
movsbl %r8b,%edi
xorps  %xmm0,%xmm0
movaps %xmm0,-0x48(%rsp)
movaps %xmm0,-0x38(%rsp)
movaps %xmm0,-0x28(%rsp)
movaps %xmm0,-0x18(%rsp)
movl   $0x0,-0x8(%rsp)
xor    %edx,%edx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r12d,%eax
imul   %r10d,%eax
add    %edx,%eax
mov    %eax,-0x48(%rsp,%rbx,4)
mov    %r12d,%edx
imul   %r9d,%edx
add    -0x44(%rsp,%rbx,4),%edx
mov    %edx,-0x44(%rsp,%rbx,4)
mov    %r12d,%eax
imul   %r11d,%eax
add    %eax,-0x40(%rsp,%rbx,4)
mov    %r12d,%eax
imul   %r14d,%eax
add    %eax,-0x3c(%rsp,%rbx,4)
mov    %r12d,%eax
imul   %r15d,%eax
add    %eax,-0x38(%rsp,%rbx,4)
mov    %r12d,%eax
imul   %ebp,%eax
add    %eax,-0x34(%rsp,%rbx,4)
mov    %r12d,%eax
imul   %esi,%eax
add    %eax,-0x30(%rsp,%rbx,4)
mov    %r12d,%eax
imul   %ecx,%eax
add    %eax,-0x2c(%rsp,%rbx,4)
imul   %edi,%r12d
add    %r12d,-0x28(%rsp,%rbx,4)
cmp    $0x8,%rbx
je     1565 <encode_final_transform+0x465>
mov    -0x74(%rsp,%rbx,4),%r12d
add    $0x1,%rbx
jmp    14f0 <encode_final_transform+0x3f0>
movslq -0x48(%rsp),%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ecx
movdqu -0x44(%rsp),%xmm0
movdqu -0x34(%rsp),%xmm1
movdqa 0xa67(%rip),%xmm2
movdqa %xmm0,%xmm3
pmuludq %xmm2,%xmm3
pshufd $0xed,%xmm3,%xmm5
pshufd $0xf5,%xmm0,%xmm3
pmuludq %xmm2,%xmm3
pshufd $0xed,%xmm3,%xmm3
punpckldq %xmm3,%xmm5
pxor   %xmm3,%xmm3
pxor   %xmm4,%xmm4
pcmpgtd %xmm0,%xmm4
pand   %xmm2,%xmm4
psubd  %xmm4,%xmm5
movdqa %xmm5,%xmm4
psrld  $0x1f,%xmm4
psrad  $0x2,%xmm5
paddd  %xmm4,%xmm5
movdqa 0xa2a(%rip),%xmm4
pshufd $0xf5,%xmm5,%xmm6
pmuludq %xmm4,%xmm5
pshufd $0xe8,%xmm5,%xmm5
pmuludq %xmm4,%xmm6
pshufd $0xe8,%xmm6,%xmm6
punpckldq %xmm6,%xmm5
psubd  %xmm5,%xmm0
movdqa %xmm1,%xmm5
pmuludq %xmm2,%xmm5
pshufd $0xed,%xmm5,%xmm5
pshufd $0xf5,%xmm1,%xmm6
pmuludq %xmm2,%xmm6
pshufd $0xed,%xmm6,%xmm6
punpckldq %xmm6,%xmm5
pcmpgtd %xmm1,%xmm3
pand   %xmm2,%xmm3
psubd  %xmm3,%xmm5
movdqa %xmm5,%xmm2
psrld  $0x1f,%xmm2
psrad  $0x2,%xmm5
paddd  %xmm2,%xmm5
pshufd $0xf5,%xmm5,%xmm2
pmuludq %xmm4,%xmm5
pshufd $0xe8,%xmm5,%xmm3
pmuludq %xmm4,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm3
psubd  %xmm3,%xmm1
pshufd $0xf5,%xmm1,%xmm2
pmuludq 0x9b2(%rip),%xmm1
pshufd $0xe8,%xmm1,%xmm1
pmuludq 0x9b5(%rip),%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
pshufd $0xf5,%xmm0,%xmm2
pmuludq 0x9af(%rip),%xmm0
pshufd $0xe8,%xmm0,%xmm0
pmuludq 0x9b2(%rip),%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm0
paddd  %xmm1,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
add    %ecx,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @encode_final_transform(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [9 x i32]
%10 = alloca [9 x i32]
%11 = alloca [17 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %12
12: ; preds = %26, %2
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 9
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = load i32, i32* %3
%17 = srem i32 %16, 10
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [9 x i32], [9 x i32]* %9, i64 0, i64 %20
store i32 %18, i32* %21
%22 = load i32, i32* %3
%23 = load i32, i32* %7
%24 = sub nsw i32 %22, %23
%25 = sdiv i32 %24, 10
store i32 %25, i32* %3
br label %26
26: ; preds = %15
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %12
29: ; preds = %12
store i32 0, i32* %5
br label %30
30: ; preds = %44, %29
%31 = load i32, i32* %5
%32 = icmp slt i32 %31, 9
br i1 %32, label %33, label %47
33: ; preds = %30
%34 = load i32, i32* %4
%35 = srem i32 %34, 10
store i32 %35, i32* %7
%36 = load i32, i32* %7
%37 = load i32, i32* %5
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [9 x i32], [9 x i32]* %10, i64 0, i64 %38
store i32 %36, i32* %39
%40 = load i32, i32* %4
%41 = load i32, i32* %7
%42 = sub nsw i32 %40, %41
%43 = sdiv i32 %42, 10
store i32 %43, i32* %4
br label %44
44: ; preds = %33
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %30
47: ; preds = %30
store i32 0, i32* %5
br label %48
48: ; preds = %55, %47
%49 = load i32, i32* %5
%50 = icmp slt i32 %49, 17
br i1 %50, label %51, label %58
51: ; preds = %48
%52 = load i32, i32* %5
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [17 x i32], [17 x i32]* %11, i64 0, i64 %53
store i32 0, i32* %54
br label %55
55: ; preds = %51
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
br label %48
58: ; preds = %48
store i32 0, i32* %5
br label %59
59: ; preds = %87, %58
%60 = load i32, i32* %5
%61 = icmp sle i32 %60, 8
br i1 %61, label %62, label %90
62: ; preds = %59
store i32 0, i32* %6
br label %63
63: ; preds = %83, %62
%64 = load i32, i32* %6
%65 = icmp sle i32 %64, 8
br i1 %65, label %66, label %86
66: ; preds = %63
%67 = load i32, i32* %6
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [9 x i32], [9 x i32]* %10, i64 0, i64 %68
%70 = load i32, i32* %69
%71 = load i32, i32* %5
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [9 x i32], [9 x i32]* %9, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = mul nsw i32 %70, %74
%76 = load i32, i32* %5
%77 = load i32, i32* %6
%78 = add nsw i32 %76, %77
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [17 x i32], [17 x i32]* %11, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = add nsw i32 %81, %75
store i32 %82, i32* %80
br label %83
83: ; preds = %66
%84 = load i32, i32* %6
%85 = add nsw i32 %84, 1
store i32 %85, i32* %6
br label %63
86: ; preds = %63
br label %87
87: ; preds = %86
%88 = load i32, i32* %5
%89 = add nsw i32 %88, 1
store i32 %89, i32* %5
br label %59
90: ; preds = %59
store i32 1, i32* %6
store i32 0, i32* %8
store i32 0, i32* %5
br label %91
91: ; preds = %106, %90
%92 = load i32, i32* %5
%93 = icmp sle i32 %92, 8
br i1 %93, label %94, label %109
94: ; preds = %91
%95 = load i32, i32* %6
%96 = load i32, i32* %5
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [17 x i32], [17 x i32]* %11, i64 0, i64 %97
%99 = load i32, i32* %98
%100 = srem i32 %99, 10
%101 = mul nsw i32 %95, %100
%102 = load i32, i32* %8
%103 = add nsw i32 %102, %101
store i32 %103, i32* %8
%104 = load i32, i32* %6
%105 = mul nsw i32 %104, 10
store i32 %105, i32* %6
br label %106
106: ; preds = %94
%107 = load i32, i32* %5
%108 = add nsw i32 %107, 1
store i32 %108, i32* %5
br label %91
109: ; preds = %91
%110 = load i32, i32* %8
ret i32 %110
}

LLVM IR (-O2):
define i32 @encode_final_transform(i32 %0, i32 %1) {
%3 = alloca [9 x i32]
%4 = alloca [17 x i32]
%5 = bitcast [17 x i32]* %4 to i8*
%6 = bitcast [9 x i32]* %3 to i8*
%7 = srem i32 %0, 10
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
store i32 %7, i32* %8
%9 = sdiv i32 %0, 10
%10 = srem i32 %9, 10
%11 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 1
store i32 %10, i32* %11
%12 = sdiv i32 %0, 100
%13 = srem i32 %12, 10
%14 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 2
store i32 %13, i32* %14
%15 = sdiv i32 %0, 1000
%16 = srem i32 %15, 10
%17 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 3
store i32 %16, i32* %17
%18 = sdiv i32 %0, 10000
%19 = srem i32 %18, 10
%20 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 4
store i32 %19, i32* %20
%21 = sdiv i32 %0, 100000
%22 = trunc i32 %21 to i16
%23 = srem i16 %22, 10
%24 = sext i16 %23 to i32
%25 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 5
store i32 %24, i32* %25
%26 = sdiv i32 %0, 1000000
%27 = trunc i32 %26 to i16
%28 = srem i16 %27, 10
%29 = sext i16 %28 to i32
%30 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 6
store i32 %29, i32* %30
%31 = sdiv i32 %0, 10000000
%32 = trunc i32 %31 to i16
%33 = srem i16 %32, 10
%34 = sext i16 %33 to i32
%35 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 7
store i32 %34, i32* %35
%36 = sdiv i32 %0, 100000000
%37 = trunc i32 %36 to i8
%38 = srem i8 %37, 10
%39 = sext i8 %38 to i32
%40 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 8
store i32 %39, i32* %40
%41 = srem i32 %1, 10
%42 = sdiv i32 %1, 10
%43 = srem i32 %42, 10
%44 = sdiv i32 %1, 100
%45 = srem i32 %44, 10
%46 = sdiv i32 %1, 1000
%47 = srem i32 %46, 10
%48 = sdiv i32 %1, 10000
%49 = srem i32 %48, 10
%50 = sdiv i32 %1, 100000
%51 = trunc i32 %50 to i16
%52 = srem i16 %51, 10
%53 = sext i16 %52 to i32
%54 = sdiv i32 %1, 1000000
%55 = trunc i32 %54 to i16
%56 = srem i16 %55, 10
%57 = sext i16 %56 to i32
%58 = sdiv i32 %1, 10000000
%59 = trunc i32 %58 to i16
%60 = srem i16 %59, 10
%61 = sext i16 %60 to i32
%62 = sdiv i32 %1, 100000000
%63 = trunc i32 %62 to i8
%64 = srem i8 %63, 10
%65 = sext i8 %64 to i32
br label %66
66: ; preds = %114, %2
%67 = phi i32 [ 0, %2 ], [ %77, %114 ]
%68 = phi i32 [ %7, %2 ], [ %116, %114 ]
%69 = phi i64 [ 0, %2 ], [ %74, %114 ]
%70 = mul nsw i32 %68, %41
%71 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 %69
%72 = add nsw i32 %67, %70
store i32 %72, i32* %71
%73 = mul nsw i32 %68, %43
%74 = add nuw nsw i64 %69, 1
%75 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 %74
%76 = load i32, i32* %75
%77 = add nsw i32 %76, %73
store i32 %77, i32* %75
%78 = mul nsw i32 %68, %45
%79 = add nuw nsw i64 %69, 2
%80 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = add nsw i32 %81, %78
store i32 %82, i32* %80
%83 = mul nsw i32 %68, %47
%84 = add nuw nsw i64 %69, 3
%85 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 %84
%86 = load i32, i32* %85
%87 = add nsw i32 %86, %83
store i32 %87, i32* %85
%88 = mul nsw i32 %68, %49
%89 = add nuw nsw i64 %69, 4
%90 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 %89
%91 = load i32, i32* %90
%92 = add nsw i32 %91, %88
store i32 %92, i32* %90
%93 = mul nsw i32 %68, %53
%94 = add nuw nsw i64 %69, 5
%95 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 %94
%96 = load i32, i32* %95
%97 = add nsw i32 %96, %93
store i32 %97, i32* %95
%98 = mul nsw i32 %68, %57
%99 = add nuw nsw i64 %69, 6
%100 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 %99
%101 = load i32, i32* %100
%102 = add nsw i32 %101, %98
store i32 %102, i32* %100
%103 = mul nsw i32 %68, %61
%104 = add nuw nsw i64 %69, 7
%105 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 %104
%106 = load i32, i32* %105
%107 = add nsw i32 %106, %103
store i32 %107, i32* %105
%108 = mul nsw i32 %68, %65
%109 = add nuw nsw i64 %69, 8
%110 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 %109
%111 = load i32, i32* %110
%112 = add nsw i32 %111, %108
store i32 %112, i32* %110
%113 = icmp eq i64 %74, 9
br i1 %113, label %117, label %114
114: ; preds = %66
%115 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %74
%116 = load i32, i32* %115
br label %66
117: ; preds = %66
%118 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 0
%119 = load i32, i32* %118
%120 = srem i32 %119, 10
%121 = getelementptr inbounds [17 x i32], [17 x i32]* %4, i64 0, i64 1
%122 = bitcast i32* %121 to <8 x i32>*
%123 = load <8 x i32>, <8 x i32>* %122
%124 = srem <8 x i32> %123, <i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10>
%125 = mul nsw <8 x i32> %124, <i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000>
%126 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %125)
%127 = add nsw i32 %126, %120
ret i32 %127
}