#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(char *, int *);
int main() {
  int num;
  printf("Input a five-digit number: ");
  scanf("%d", &num);
  printf("%d   ", (num / 10000));
  num = num - ((num / 10000) * 10000);
  printf("%d   ", (num / 1000));
  num = num - ((num / 1000) * 1000);
  printf("%d   ", (num / 100));
  num = num - ((num / 100) * 100);
  printf("%d   ", (num / 10));
  num = num - ((num / 10) * 10);
  printf("%d\n", (num % 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
imul   $0x2710,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0xa,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x68db8bad,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x2c,%rsi
add    %eax,%esi
lea    0xebb(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0xc(%rsp),%rax
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rcx
add    %edx,%ecx
imul   $0x2710,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0xc(%rsp)
movswl %ax,%ecx
imul   $0xffff8313,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%eax
movswl %ax,%ecx
shr    $0xf,%eax
sar    $0x9,%ecx
add    %eax,%ecx
movswl %cx,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0xc(%rsp),%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0xc(%rsp)
cwtl
imul   $0x147b,%eax,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0x13,%esi
add    %eax,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0xc(%rsp),%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0xc(%rsp)
movsbl %al,%eax
imul   $0x67,%eax,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
shr    $0xa,%ecx
add    %al,%cl
movsbl %cl,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0xc(%rsp),%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
mov    %esi,0xc(%rsp)
lea    0xdbb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Input a five-digit number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"%d \00"
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 10000
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 10000
%11 = mul nsw i32 %10, 10000
%12 = sub nsw i32 %8, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 1000
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %2
%18 = sdiv i32 %17, 1000
%19 = mul nsw i32 %18, 1000
%20 = sub nsw i32 %16, %19
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = sdiv i32 %21, 100
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %2
%25 = load i32, i32* %2
%26 = sdiv i32 %25, 100
%27 = mul nsw i32 %26, 100
%28 = sub nsw i32 %24, %27
store i32 %28, i32* %2
%29 = load i32, i32* %2
%30 = sdiv i32 %29, 10
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %2
%33 = load i32, i32* %2
%34 = sdiv i32 %33, 10
%35 = mul nsw i32 %34, 10
%36 = sub nsw i32 %32, %35
store i32 %36, i32* %2
%37 = load i32, i32* %2
%38 = srem i32 %37, 10
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Input a five-digit number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"%d \00"
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = srem i32 %8, 10000
store i32 %9, i32* %1
%10 = trunc i32 %9 to i16
%11 = sdiv i16 %10, 1000
%12 = sext i16 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %1
%15 = srem i32 %14, 1000
store i32 %15, i32* %1
%16 = trunc i32 %15 to i16
%17 = sdiv i16 %16, 100
%18 = sext i16 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %1
%21 = srem i32 %20, 100
store i32 %21, i32* %1
%22 = trunc i32 %21 to i8
%23 = sdiv i8 %22, 10
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %1
%27 = srem i32 %26, 10
store i32 %27, i32* %1
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %27)
ret i32 0
}