#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);
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;
  }
  printf("%d\n", nixu);
}


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>
mov    -0xc(%rbp),%esi
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%r8
lea    0x9(%r8),%edx
imul   $0x66666667,%r8,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%esi
mov    %r8d,%ecx
sub    %esi,%ecx
cmp    $0x12,%edx
ja     1164 <main+0x44>
xor    %esi,%esi
test   %ecx,%ecx
je     11c0 <main+0xa0>
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
movslq %r8d,%rax
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rdx
lea    (%rdx,%rdi,1),%r8d
lea    (%rsi,%rsi,4),%esi
lea    (%rcx,%rsi,2),%esi
add    %edi,%edx
add    $0x9,%edx
movslq %r8d,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x22,%rdi
add    %eax,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
sub    %eax,%ecx
cmp    $0x12,%edx
ja     1170 <main+0x50>
test   %ecx,%ecx
jne    1170 <main+0x50>
mov    %r8d,0x4(%rsp)
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\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
%25 = load i32, i32* %3
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 %23, label %10
10: ; preds = %0, %10
%11 = phi i32 [ %19, %10 ], [ %7, %0 ]
%12 = phi i32 [ %16, %10 ], [ 0, %0 ]
%13 = phi i32 [ %14, %10 ], [ %4, %0 ]
%14 = sdiv i32 %13, 10
%15 = mul nsw i32 %12, 10
%16 = add nsw i32 %11, %15
%17 = add nsw i32 %14, 9
%18 = icmp ult i32 %17, 19
%19 = srem i32 %14, 10
%20 = icmp eq i32 %19, 0
%21 = and i1 %18, %20
br i1 %21, label %22, label %10
22: ; preds = %10
store i32 %14, i32* %1
br label %23
23: ; preds = %22, %0
%24 = phi i32 [ %16, %22 ], [ 0, %0 ]
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
ret void
}