#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf_s(char *, int *);
int /*<<< orphan*/ system(char *);
main() {
  int number, a, temp, b, c, d, e;
  printf("Enter a number(5 digits): ");
  scanf_s("%d", &number);
  a = number / 10000;
  temp = number % 10000;
  b = temp / 1000;
  temp = temp % 1000;
  c = temp / 100;
  temp = temp % 100;
  d = temp / 10;
  e = temp % 10;
  printf("%d\t%d\t%d\t%d\t%d\n", a, b, c, d, e);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf_s@plt>
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe42(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf_s@plt>
movslq 0x4(%rsp),%rax
imul   $0x68db8bad,%rax,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rsi
add    %ecx,%esi
imul   $0x2710,%esi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8313,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edi
shr    $0xf,%ecx
sar    $0x9,%edi
add    %ecx,%edi
movswl %di,%edx
imul   $0x3e8,%edi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0x147b,%ecx,%ecx
mov    %ecx,%edi
shr    $0x1f,%edi
sar    $0x13,%ecx
add    %edi,%ecx
imul   $0x64,%ecx,%edi
sub    %edi,%eax
movsbl %al,%edi
imul   $0x67,%edi,%edi
movzwl %di,%r8d
movswl %r8w,%edi
shr    $0xf,%r8d
shr    $0xa,%edi
add    %r8b,%dil
movsbl %dil,%r8d
movzbl %r8b,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%edi
sub    %dil,%al
movsbl %al,%r9d
lea    0xe3b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe3d(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter a number(5 digits): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"%d\09%d\09%d\09%d\09%d\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = sdiv i32 %10, 10000
store i32 %11, i32* %2
%12 = load i32, i32* %1
%13 = srem i32 %12, 10000
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 1000
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = srem i32 %16, 1000
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = sdiv i32 %18, 100
store i32 %19, i32* %5
%20 = load i32, i32* %3
%21 = srem i32 %20, 100
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = sdiv i32 %22, 10
store i32 %23, i32* %6
%24 = load i32, i32* %3
%25 = srem i32 %24, 10
store i32 %25, i32* %7
%26 = load i32, i32* %2
%27 = load i32, i32* %4
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %26, i32 %27, i32 %28, i32 %29, i32 %30)
%32 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter a number(5 digits): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"%d\09%d\09%d\09%d\09%d\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sdiv i32 %5, 10000
%7 = srem i32 %5, 10000
%8 = trunc i32 %7 to i16
%9 = sdiv i16 %8, 1000
%10 = sext i16 %9 to i32
%11 = srem i16 %8, 1000
%12 = sdiv i16 %11, 100
%13 = sext i16 %12 to i32
%14 = srem i16 %11, 100
%15 = trunc i16 %14 to i8
%16 = sdiv i8 %15, 10
%17 = sext i8 %16 to i32
%18 = srem i8 %15, 10
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %10, i32 %13, i32 %17, i32 %19)
%21 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}