#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 pow(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, temp;
  int digits = 0;
  int one_digit;
  scanf("%d", &num);
  temp = num;
  while (temp) {
    temp /= 10;
    digits += 1;
  }
  while (num) {
    one_digit = num / pow(10, digits - 1);
    printf("%d ", one_digit);
    num = num - one_digit * pow(10, digits - 1);
    digits--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1182 <main+0x52>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115c <main+0x2c>
jmp    1187 <main+0x57>
cmpl   $0x0,-0x8(%rbp)
je     11fb <main+0xcb>
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    $0xa,%edi
call   1050 <pow@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    $0xa,%edi
call   1050 <pow@plt>
mov    -0x1c(%rbp),%ecx
mov    %eax,%edx
mov    -0x18(%rbp),%eax
imul   %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1187 <main+0x57>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
test   %ebp,%ebp
je     11cf <main+0x9f>
mov    $0xffffffff,%ebx
mov    %ebp,%eax
nopw   0x0(%rax,%rax,1)
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
add    $0x9,%ecx
add    $0x1,%ebx
cmp    $0x12,%ecx
ja     1160 <main+0x30>
test   %ebp,%ebp
je     11cf <main+0x9f>
lea    0xe76(%rip),%r14
nopl   (%rax)
mov    $0xa,%edi
mov    %ebx,%esi
call   1050 <pow@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%r15d
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x4(%rsp),%ebp
mov    $0xa,%edi
mov    %ebx,%esi
call   1050 <pow@plt>
imul   %r15d,%eax
add    $0xffffffff,%ebx
sub    %eax,%ebp
mov    %ebp,0x4(%rsp)
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
store i32 %7, i32* %3
br label %8
8: ; preds = %11, %0
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 10
store i32 %13, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %8
16: ; preds = %8
br label %17
17: ; preds = %20, %16
%18 = load i32, i32* %2
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %37
20: ; preds = %17
%21 = load i32, i32* %2
%22 = load i32, i32* %4
%23 = sub nsw i32 %22, 1
%24 = call i32 @pow(i32 10, i32 %23)
%25 = sdiv i32 %21, %24
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %2
%29 = load i32, i32* %5
%30 = load i32, i32* %4
%31 = sub nsw i32 %30, 1
%32 = call i32 @pow(i32 10, i32 %31)
%33 = mul nsw i32 %29, %32
%34 = sub nsw i32 %28, %33
store i32 %34, i32* %2
%35 = load i32, i32* %4
%36 = add nsw i32 %35, -1
store i32 %36, i32* %4
br label %17
37: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %26, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ %4, %0 ]
%8 = phi i32 [ %10, %6 ], [ 0, %0 ]
%9 = sdiv i32 %7, 10
%10 = add nuw nsw i32 %8, 1
%11 = add i32 %7, 9
%12 = icmp ult i32 %11, 19
br i1 %12, label %13, label %6
13: ; preds = %6
br i1 %5, label %26, label %14
14: ; preds = %13, %14
%15 = phi i32 [ %17, %14 ], [ %10, %13 ]
%16 = phi i32 [ %24, %14 ], [ %4, %13 ]
%17 = add nsw i32 %15, -1
%18 = call i32 @pow(i32 10, i32 %17)
%19 = sdiv i32 %16, %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %1
%22 = call i32 @pow(i32 10, i32 %17)
%23 = mul nsw i32 %22, %19
%24 = sub nsw i32 %21, %23
store i32 %24, i32* %1
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %14
26: ; preds = %14, %0, %13
ret i32 0
}