#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*/ putchar(char);
int /*<<< orphan*/ rec_conv(long long);
scalar_t__ scanf(char *, long long *);
int main() {
  long long n;
  short ind, res[1000];
  while (scanf("%lld", &n) && n >= 0) {
    if (n)
      rec_conv(n);
    else
      putchar('0');
    putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x7f1(%rbp)
je     1175 <main+0x45>
cmpq   $0x0,-0x10(%rbp)
setge  %al
mov    %al,-0x7f1(%rbp)
mov    -0x7f1(%rbp),%al
test   $0x1,%al
jne    1188 <main+0x58>
jmp    11ba <main+0x8a>
cmpq   $0x0,-0x10(%rbp)
je     11a1 <main+0x71>
mov    -0x10(%rbp),%rdi
call   1040 <rec_conv@plt>
jmp    11ab <main+0x7b>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
je     119d <main+0x6d>
mov    (%rsp),%rdi
test   %rdi,%rdi
js     119d <main+0x6d>
lea    0xea8(%rip),%r14
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
test   %rdi,%rdi
je     1170 <main+0x40>
call   1040 <rec_conv@plt>
jmp    117a <main+0x4a>
nopl   0x0(%rax)
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
je     119d <main+0x6d>
mov    (%rsp),%rdi
test   %rdi,%rdi
jns    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i16
%4 = alloca [1000 x i16]
store i32 0, i32* %1
br label %5
5: ; preds = %21, %0
%6 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i64, i64* %2
%10 = icmp sge i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
br i1 %12, label %13, label %23
13: ; preds = %11
%14 = load i64, i64* %2
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i64, i64* %2
%18 = call i32 @rec_conv(i64 %17)
br label %21
19: ; preds = %13
%20 = call i32 @putchar(i8 signext 48)
br label %21
21: ; preds = %19, %16
%22 = call i32 @putchar(i8 signext 10)
br label %5
23: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = icmp ne i64 %3, 0
%5 = load i64, i64* %1
%6 = icmp sgt i64 %5, -1
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %8, label %22
8: ; preds = %0, %15
%9 = phi i64 [ %19, %15 ], [ %5, %0 ]
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @rec_conv(i64 %9)
br label %15
13: ; preds = %8
%14 = call i32 @putchar(i8 signext 48)
br label %15
15: ; preds = %13, %11
%16 = call i32 @putchar(i8 signext 10)
%17 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%18 = icmp ne i64 %17, 0
%19 = load i64, i64* %1
%20 = icmp sgt i64 %19, -1
%21 = select i1 %18, i1 %20, i1 false
br i1 %21, label %8, label %22
22: ; preds = %15, %0
ret i32 0
}