#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void printToBoard(char *BoardNumbers, uint16_t number) {
  BoardNumbers[3] = number % 10;
  BoardNumbers[2] = (number / 10) % 10;
  BoardNumbers[1] = (number / 100) % 10;
  BoardNumbers[0] = (number / 1000) % 10;
}


x86 assembly (clang, -O0):
<printToBoard>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<printToBoard>:
movslq %esi,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,4),%r8d
imul   $0x51eb851f,%rcx,%r9
imul   $0x10624dd3,%rcx,%rdx
sub    %r8d,%ecx
mov    %cl,0x3(%rdi)
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
shr    $0x22,%rcx
add    %esi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %al,0x2(%rdi)
mov    %r9,%rax
shr    $0x3f,%rax
sar    $0x25,%r9
add    %eax,%r9d
movslq %r9d,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
shr    $0x22,%rcx
add    %esi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %al,0x1(%rdi)
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x26,%rdx
add    %eax,%edx
movslq %edx,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @printToBoard(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 10
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 3
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 10
%12 = srem i32 %11, 10
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 2
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = sdiv i32 %16, 100
%18 = srem i32 %17, 10
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = sdiv i32 %22, 1000
%24 = srem i32 %23, 10
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 0
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @printToBoard(i8* nocapture writeonly %0, i32 %1) {
%3 = srem i32 %1, 10
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %4, i8* %5
%6 = sdiv i32 %1, 10
%7 = srem i32 %6, 10
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = sdiv i32 %1, 100
%11 = srem i32 %10, 10
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %12, i8* %13
%14 = sdiv i32 %1, 1000
%15 = srem i32 %14, 10
%16 = trunc i32 %15 to i8
store i8 %16, i8* %0
ret void
}