#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 */
long long check(long long, long long);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long long *);
int main() {
  long long int in, num, digit, temp;
  int a = 0;
  printf("\nEnter an ingteger > ");
  scanf("%lld", &in);
  if (in > 0) {
    num = 10;
    while (a <= 11) {
      digit = in % num;
      digit = check(digit, (num / 10));
      if (digit == in) {
        break;
      }
      printf("%lld\n", digit);
      num = num * 10;
      a++;
    }
  } else if (in == 0) {
    printf("0\n");
  } else {
    num = (-10);
    while (a <= 11) {
      digit = in % (num);
      digit = check((-digit), (num / 10));
      digit = digit * (-1);
      num = num * 10;
      a++;
      temp = in % num;
      temp = check((-temp), (num / 10));
      temp = temp * (-1);
      if (digit == 0) {
        break;
      }
      if (temp == 0) {
        printf("-%lld\n", digit);
      } else {
        printf("%lld\n", digit);
      }
    }
  }
  printf("That's all, have a nice day!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpq   $0x0,-0x10(%rbp)
jle    11ee <main+0xbe>
movq   $0xa,-0x18(%rbp)
cmpl   $0xb,-0x2c(%rbp)
jg     11e9 <main+0xb9>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rsi
call   1050 <check@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    11c0 <main+0x90>
jmp    11e9 <main+0xb9>
mov    -0x20(%rbp),%rsi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1177 <main+0x47>
jmp    12f5 <main+0x1c5>
cmpq   $0x0,-0x10(%rbp)
jne    120c <main+0xdc>
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f0 <main+0x1c0>
movq   $0xfffffffffffffff6,-0x18(%rbp)
ff
cmpl   $0xb,-0x2c(%rbp)
jg     12eb <main+0x1bb>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
sub    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rsi
call   1050 <check@plt>
mov    %rax,-0x20(%rbp)
imul   $0xffffffffffffffff,-0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
sub    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rsi
call   1050 <check@plt>
mov    %rax,-0x28(%rbp)
imul   $0xffffffffffffffff,-0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12b2 <main+0x182>
jmp    12eb <main+0x1bb>
cmpq   $0x0,-0x28(%rbp)
jne    12d4 <main+0x1a4>
mov    -0x20(%rbp),%rsi
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e6 <main+0x1b6>
mov    -0x20(%rbp),%rsi
lea    0xd40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1214 <main+0xe4>
jmp    12f0 <main+0x1c0>
jmp    12f5 <main+0x1c5>
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
test   %rdi,%rdi
jle    1229 <main+0xe9>
movabs $0x6666666666666667,%rcx
66 66 66
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    %rdx,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%rdi
mov    $0x1,%esi
call   1060 <check@plt>
cmp    (%rsp),%rax
je     1312 <main+0x1d2>
mov    $0xa,%ebx
mov    $0xc,%ebp
lea    0xe5a(%rip),%r14
movabs $0xcccccccccccccccd,%r15
cc cc cc
jmp    11f4 <main+0xb4>
xchg   %ax,%ax
cqto
idiv   %rbx
mov    %rdx,%rdi
mov    %rbx,%rax
mul    %r15
shr    $0x3,%rdx
mov    %rdx,%rsi
call   1060 <check@plt>
cmp    (%rsp),%rax
je     1312 <main+0x1d2>
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
je     1312 <main+0x1d2>
add    %rbx,%rbx
lea    (%rbx,%rbx,4),%rbx
mov    (%rsp),%rax
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
jne    11d0 <main+0x90>
xor    %edx,%edx
div    %ebx
mov    %edx,%edi
jmp    11d8 <main+0x98>
je     1306 <main+0x1c6>
mov    $0xfffffffffffffff6,%r14
mov    $0xb,%ebp
movabs $0x6666666666666667,%r15
66 66 66
lea    0xdd0(%rip),%r13
nopl   0x0(%rax)
mov    %rdi,%rax
or     %r14,%rax
shr    $0x20,%rax
je     1270 <main+0x130>
mov    %rdi,%rax
cqto
idiv   %r14
mov    %rdx,%rdi
jmp    1279 <main+0x139>
nopl   0x0(%rax)
mov    %edi,%eax
xor    %edx,%edx
div    %r14d
mov    %edx,%edi
mov    %r14,%rax
imul   %r15
neg    %rdi
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x2,%rdx
add    %rdx,%rsi
call   1060 <check@plt>
mov    %rax,%rbx
lea    (%r14,%r14,1),%rax
lea    (%rax,%rax,4),%r12
mov    (%rsp),%rax
mov    %rax,%rcx
or     %r12,%rcx
shr    $0x20,%rcx
je     12c0 <main+0x180>
cqto
idiv   %r12
mov    %rdx,%rdi
jmp    12c7 <main+0x187>
nopw   0x0(%rax,%rax,1)
xor    %edx,%edx
div    %r12d
mov    %edx,%edi
neg    %rdi
mov    %r14,%rsi
call   1060 <check@plt>
test   %rbx,%rbx
je     1312 <main+0x1d2>
neg    %rbx
test   %rax,%rax
mov    %r13,%rdi
lea    0xd34(%rip),%rax
cmove  %rax,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
sub    $0x1,%ebp
jb     1312 <main+0x1d2>
mov    (%rsp),%rdi
mov    %r12,%r14
jmp    1250 <main+0x110>
lea    0xd32(%rip),%rdi
call   1030 <puts@plt>
lea    0xd09(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0AEnter an ingteger > \00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [6 x i8] c"%lld\0A\00"
@.str.3 = [3 x i8] c"0\0A\00"
@.str.4 = [7 x i8] c"-%lld\0A\00"
@.str.5 = [30 x i8] c"That's all, have a nice day!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%9 = load i64, i64* %2
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %35
11: ; preds = %0
store i64 10, i64* %3
br label %12
12: ; preds = %27, %11
%13 = load i32, i32* %6
%14 = icmp sle i32 %13, 11
br i1 %14, label %15, label %34
15: ; preds = %12
%16 = load i64, i64* %2
%17 = load i64, i64* %3
%18 = srem i64 %16, %17
store i64 %18, i64* %4
%19 = load i64, i64* %4
%20 = load i64, i64* %3
%21 = sdiv i64 %20, 10
%22 = call i64 @check(i64 %19, i64 %21)
store i64 %22, i64* %4
%23 = load i64, i64* %4
%24 = load i64, i64* %2
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %27
26: ; preds = %15
br label %34
27: ; preds = %15
%28 = load i64, i64* %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 %28)
%30 = load i64, i64* %3
%31 = mul nsw i64 %30, 10
store i64 %31, i64* %3
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %12
34: ; preds = %26, %12
br label %84
35: ; preds = %0
%36 = load i64, i64* %2
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %83
40: ; preds = %35
store i64 -10, i64* %3
br label %41
41: ; preds = %81, %40
%42 = load i32, i32* %6
%43 = icmp sle i32 %42, 11
br i1 %43, label %44, label %82
44: ; preds = %41
%45 = load i64, i64* %2
%46 = load i64, i64* %3
%47 = srem i64 %45, %46
store i64 %47, i64* %4
%48 = load i64, i64* %4
%49 = sub nsw i64 0, %48
%50 = load i64, i64* %3
%51 = sdiv i64 %50, 10
%52 = call i64 @check(i64 %49, i64 %51)
store i64 %52, i64* %4
%53 = load i64, i64* %4
%54 = mul nsw i64 %53, -1
store i64 %54, i64* %4
%55 = load i64, i64* %3
%56 = mul nsw i64 %55, 10
store i64 %56, i64* %3
%57 = load i32, i32* %6
%58 = add nsw i32 %57, 1
store i32 %58, i32* %6
%59 = load i64, i64* %2
%60 = load i64, i64* %3
%61 = srem i64 %59, %60
store i64 %61, i64* %5
%62 = load i64, i64* %5
%63 = sub nsw i64 0, %62
%64 = load i64, i64* %3
%65 = sdiv i64 %64, 10
%66 = call i64 @check(i64 %63, i64 %65)
store i64 %66, i64* %5
%67 = load i64, i64* %5
%68 = mul nsw i64 %67, -1
store i64 %68, i64* %5
%69 = load i64, i64* %4
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %44
br label %82
72: ; preds = %44
%73 = load i64, i64* %5
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %72
%76 = load i64, i64* %4
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i64 %76)
br label %81
78: ; preds = %72
%79 = load i64, i64* %4
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 %79)
br label %81
81: ; preds = %78, %75
br label %41
82: ; preds = %71, %41
br label %83
83: ; preds = %82, %38
br label %84
84: ; preds = %83, %34
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0AEnter an ingteger > \00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [6 x i8] c"%lld\0A\00"
@.str.4 = [7 x i8] c"-%lld\0A\00"
@str = [29 x i8] c"That's all, have a nice day!\00"
@str.6 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %27
7: ; preds = %0
%8 = srem i64 %5, 10
%9 = call i64 @check(i64 %8, i64 1)
%10 = load i64, i64* %1
%11 = icmp eq i64 %9, %10
br i1 %11, label %54, label %12
12: ; preds = %7, %19
%13 = phi i64 [ %24, %19 ], [ %9, %7 ]
%14 = phi i64 [ %20, %19 ], [ 10, %7 ]
%15 = phi i32 [ %17, %19 ], [ 0, %7 ]
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 %13)
%17 = add nuw nsw i32 %15, 1
%18 = icmp eq i32 %17, 12
br i1 %18, label %54, label %19
19: ; preds = %12
%20 = mul nsw i64 %14, 10
%21 = load i64, i64* %1
%22 = srem i64 %21, %20
%23 = udiv i64 %20, 10
%24 = call i64 @check(i64 %22, i64 %23)
%25 = load i64, i64* %1
%26 = icmp eq i64 %24, %25
br i1 %26, label %54, label %12
27: ; preds = %0
%28 = icmp eq i64 %5, 0
br i1 %28, label %29, label %31
29: ; preds = %27
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
br label %54
31: ; preds = %27, %52
%32 = phi i64 [ %53, %52 ], [ %5, %27 ]
%33 = phi i32 [ %40, %52 ], [ 0, %27 ]
%34 = phi i64 [ %39, %52 ], [ -10, %27 ]
%35 = srem i64 %32, %34
%36 = sub nsw i64 0, %35
%37 = sdiv i64 %34, 10
%38 = call i64 @check(i64 %36, i64 %37)
%39 = mul nsw i64 %34, 10
%40 = add nuw nsw i32 %33, 1
%41 = load i64, i64* %1
%42 = srem i64 %41, %39
%43 = sub nsw i64 0, %42
%44 = call i64 @check(i64 %43, i64 %34)
%45 = icmp eq i64 %38, 0
br i1 %45, label %54, label %46
46: ; preds = %31
%47 = sub nsw i64 0, %38
%48 = icmp eq i64 %44, 0
%49 = select i1 %48, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %49, i64 %47)
%51 = icmp eq i32 %40, 12
br i1 %51, label %54, label %52
52: ; preds = %46
%53 = load i64, i64* %1
br label %31
54: ; preds = %31, %46, %19, %12, %7, %29
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}