#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 *, ...);
scalar_t__ scanf(char *, int *);
int main() {
  int t;
  scanf("%i", &t);
  for (int a = 1, n; a <= t && scanf("%i", &n); a++) {
    while (n) {
      int x = n % 10;
      n /= 10;
      printf("%i", x);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x15(%rbp)
jg     1171 <main+0x51>
lea    0xea2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1181 <main+0x61>
jmp    11de <main+0xbe>
jmp    1186 <main+0x66>
cmpl   $0x0,-0x10(%rbp)
je     11c2 <main+0xa2>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1186 <main+0x66>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x20,%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>
cmpl   $0x0,0xc(%rsp)
jle    11d7 <main+0xa7>
mov    $0x1,%r15d
lea    0xe9e(%rip),%rbx
lea    0x8(%rsp),%r14
jmp    1188 <main+0x58>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%eax
cmp    0xc(%rsp),%r15d
mov    %eax,%r15d
jge    11d7 <main+0xa7>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
je     11d7 <main+0xa7>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%eax
test   %eax,%eax
je     1170 <main+0x40>
movslq %eax,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%esi
mov    %eax,0x8(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11a0 <main+0x70>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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