#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 *);
void main(void) {
  int num, temp, nixu = 0;
  scanf("%d", &num);
  while (0 != num / 10 || 0 != num % 10) {
    temp = num % 10;
    num /= 10;
    nixu = nixu * 10 + temp;
  }
  while (0 != nixu / 10 || 0 != nixu % 10) {
    temp = nixu % 10;
    nixu /= 10;
    printf("%d ", temp);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    $0x1,%al
xor    %ecx,%ecx
cmp    %edx,%ecx
mov    %al,-0xd(%rbp)
jne    1170 <main+0x50>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1180 <main+0x60>
jmp    11ab <main+0x8b>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113f <main+0x1f>
jmp    11b0 <main+0x90>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    $0x1,%al
xor    %ecx,%ecx
cmp    %edx,%ecx
mov    %al,-0xe(%rbp)
jne    11e1 <main+0xc1>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    11f1 <main+0xd1>
jmp    1223 <main+0x103>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b0 <main+0x90>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
lea    0x9(%rax),%edx
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%esi
mov    %eax,%ecx
sub    %esi,%ecx
cmp    $0x12,%edx
ja     117b <main+0x4b>
xor    %r14d,%r14d
test   %ecx,%ecx
je     11cf <main+0x9f>
xor    %r14d,%r14d
xchg   %ax,%ax
cltq
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
lea    (%rdx,%rsi,1),%eax
lea    (%r14,%r14,4),%edi
lea    (%rcx,%rdi,2),%r14d
add    %esi,%edx
add    $0x9,%edx
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rsi
add    %edi,%esi
add    %esi,%esi
lea    (%rsi,%rsi,4),%esi
sub    %esi,%ecx
cmp    $0x12,%edx
ja     1180 <main+0x50>
test   %ecx,%ecx
jne    1180 <main+0x50>
mov    %eax,0xc(%rsp)
lea    0x9(%r14),%eax
jmp    120e <main+0xde>
cs nopw 0x0(%rax,%rax,1)
nop
movslq %r14d,%rax
imul   $0x66666667,%rax,%rbx
mov    %rbx,%r15
shr    $0x3f,%r15
sar    $0x22,%rbx
lea    (%rbx,%r15,1),%r14d
lea    0xe03(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rbx,%r15,1),%eax
add    $0x9,%eax
movslq %r14d,%rsi
imul   $0x66666667,%rsi,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%esi
cmp    $0x12,%eax
ja     11e0 <main+0xb0>
test   %esi,%esi
jne    11e0 <main+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define void @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 = add i32 %4, 9
%6 = icmp ult i32 %5, 19
%7 = srem i32 %4, 10
%8 = icmp eq i32 %7, 0
%9 = and i1 %6, %8
br i1 %9, label %11, label %18
10: ; preds = %18
store i32 %22, i32* %1
br label %11
11: ; preds = %10, %0
%12 = phi i32 [ %24, %10 ], [ 0, %0 ]
%13 = add i32 %12, 9
%14 = icmp ult i32 %13, 19
%15 = srem i32 %12, 10
%16 = icmp eq i32 %15, 0
%17 = and i1 %14, %16
br i1 %17, label %40, label %30
18: ; preds = %0, %18
%19 = phi i32 [ %27, %18 ], [ %7, %0 ]
%20 = phi i32 [ %24, %18 ], [ 0, %0 ]
%21 = phi i32 [ %22, %18 ], [ %4, %0 ]
%22 = sdiv i32 %21, 10
%23 = mul nsw i32 %20, 10
%24 = add nsw i32 %19, %23
%25 = add nsw i32 %22, 9
%26 = icmp ult i32 %25, 19
%27 = srem i32 %22, 10
%28 = icmp eq i32 %27, 0
%29 = and i1 %26, %28
br i1 %29, label %10, label %18
30: ; preds = %11, %30
%31 = phi i32 [ %37, %30 ], [ %15, %11 ]
%32 = phi i32 [ %33, %30 ], [ %12, %11 ]
%33 = sdiv i32 %32, 10
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%35 = add nsw i32 %33, 9
%36 = icmp ult i32 %35, 19
%37 = srem i32 %33, 10
%38 = icmp eq i32 %37, 0
%39 = and i1 %36, %38
br i1 %39, label %40, label %30
40: ; preds = %30, %11
%41 = call i32 @putchar(i32 10)
ret void
}