#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 main() {
  int n, a[105];
  long long x;
  for (scanf("%d", &n); n; n--) {
    scanf("%lld", &x);
    if (x == 0) {
      printf("0\n");
      continue;
    }
    int i;
    for (i = 0; x; i++, x /= 10)
      a[i] = x % 10;
    for (i--; i; i--)
      printf("%d ", a[i]);
    printf("%d\n", a[0]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1257 <main+0x137>
lea    0xeae(%rip),%rdi
lea    -0x1b8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpq   $0x0,-0x1b8(%rbp)
jne    1184 <main+0x64>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1249 <main+0x129>
movl   $0x0,-0x1bc(%rbp)
cmpq   $0x0,-0x1b8(%rbp)
je     11e9 <main+0xc9>
mov    -0x1b8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %edx,%ecx
movslq -0x1bc(%rbp),%rax
mov    %ecx,-0x1b0(%rbp,%rax,4)
mov    -0x1bc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1bc(%rbp)
mov    -0x1b8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x1b8(%rbp)
jmp    118e <main+0x6e>
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cmpl   $0x0,-0x1bc(%rbp)
je     1235 <main+0x115>
movslq -0x1bc(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%esi
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
jmp    11f8 <main+0xd8>
mov    -0x1b0(%rbp),%esi
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1b8,%rsp
lea    0xeb8(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
je     1277 <main+0x147>
movabs $0x6666666666666667,%r15
66 66 66
movabs $0x100000000,%rbp
lea    0xe8e(%rip),%rbx
jmp    119d <main+0x6d>
nopl   0x0(%rax)
mov    0x10(%rsp),%esi
lea    0xe81(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
addl   $0xffffffff,0x4(%rsp)
je     1277 <main+0x147>
lea    0xe5f(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x8(%rsp),%rdx
test   %rdx,%rdx
je     1260 <main+0x130>
mov    %rbx,%r8
mov    $0xffffffff,%esi
movabs $0xffffffff00000000,%rdi
ff ff ff
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rdx,%rcx
mov    %rdx,%rax
imul   %r15
add    %rbp,%rdi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ecx,%ebx
sub    %eax,%ebx
mov    %ebx,0x10(%rsp,%r12,4)
add    $0x1,%r12
add    $0x9,%rcx
add    $0x1,%esi
cmp    $0x13,%rcx
jae    11e0 <main+0xb0>
mov    %rdx,0x8(%rsp)
cmp    $0x1,%r12d
mov    %r8,%rbx
je     1180 <main+0x50>
movslq %esi,%rax
lea    (%rsp,%rax,4),%r14
add    $0x10,%r14
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
mov    (%r14,%r13,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffffffffffff,%r13
lea    (%r12,%r13,1),%eax
cmp    $0x1,%eax
jne    1240 <main+0x110>
jmp    1180 <main+0x50>
lea    0xda9(%rip),%rdi
call   1030 <puts@plt>
addl   $0xffffffff,0x4(%rsp)
jne    119d <main+0x6d>
xor    %eax,%eax
add    $0x1b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.3 = [4 x i8] c"%d \00"
@.str.4 = [4 x i8] c"%d\0A\00"
@str = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [105 x i32]
%3 = alloca i64
%4 = bitcast i32* %1 to i8*
%5 = bitcast [105 x i32]* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %49, label %10
10: ; preds = %0
%11 = getelementptr inbounds [105 x i32], [105 x i32]* %2, i64 0, i64 0
br label %12
12: ; preds = %10, %45
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %3)
%14 = load i64, i64* %3
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %45
18: ; preds = %24
%19 = trunc i64 %25 to i32
store i64 %31, i64* %3
%20 = icmp eq i32 %19, 0
br i1 %20, label %42, label %21
21: ; preds = %18
%22 = shl i64 %25, 32
%23 = ashr exact i64 %22, 32
br label %34
24: ; preds = %12, %24
%25 = phi i64 [ %30, %24 ], [ 0, %12 ]
%26 = phi i64 [ %31, %24 ], [ %14, %12 ]
%27 = srem i64 %26, 10
%28 = trunc i64 %27 to i32
%29 = getelementptr inbounds [105 x i32], [105 x i32]* %2, i64 0, i64 %25
store i32 %28, i32* %29
%30 = add nuw i64 %25, 1
%31 = sdiv i64 %26, 10
%32 = add i64 %26, 9
%33 = icmp ult i64 %32, 19
br i1 %33, label %18, label %24
34: ; preds = %21, %34
%35 = phi i64 [ %23, %21 ], [ %39, %34 ]
%36 = getelementptr inbounds [105 x i32], [105 x i32]* %2, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %37)
%39 = add nsw i64 %35, -1
%40 = trunc i64 %39 to i32
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %34
42: ; preds = %34, %18
%43 = load i32, i32* %11
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %42, %16
%46 = load i32, i32* %1
%47 = add nsw i32 %46, -1
store i32 %47, i32* %1
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %12
49: ; preds = %45, %0
ret i32 0
}