#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*/ print(int *, int, long);
void separate(long int input) {
  int sep[10] = {0};
  int size = 0;
  long int input2 = input;
  for (int i = 0; i < 10; i++) {
    sep[i] = input % 10;
    input = input / 10;
    if (input < 1) {
      size = (i + 1);
      break;
    }
  }
  print(sep, size, input2);
}


x86 assembly (clang, -O0):
<separate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    11b2 <separate+0x92>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %edx,%ecx
movslq -0x44(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jge    119f <separate+0x7f>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11b2 <separate+0x92>
jmp    11a4 <separate+0x84>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1152 <separate+0x32>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x40(%rbp),%rdx
call   1040 <print@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<separate>:
sub    $0x28,%rsp
mov    %rdi,%rcx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movabs $0x6666666666666667,%rdx
66 66 66
mov    %rdi,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x2,%rdx
add    %eax,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
mov    %ecx,%edx
sub    %eax,%edx
mov    %edx,(%rsp)
mov    $0x1,%esi
cmp    $0xa,%rdi
jl     13a0 <separate+0x290>
movabs $0xcccccccccccccccd,%rdi
cc cc cc
mov    %rcx,%rax
mul    %rdi
mov    %rdx,%rsi
shr    $0x3,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x3,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
mov    %esi,0x4(%rsp)
mov    $0x2,%esi
cmp    $0x64,%rcx
jb     13a0 <separate+0x290>
mov    %rcx,%rax
shr    $0x2,%rax
movabs $0x28f5c28f5c28f5c3,%rdx
c2 f5 28
mul    %rdx
mov    %rdx,%rsi
shr    $0x2,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x3,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
mov    %esi,0x8(%rsp)
mov    $0x3,%esi
cmp    $0x3e8,%rcx
jb     13a0 <separate+0x290>
mov    %rcx,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
mul    %rdx
mov    %rdx,%rsi
shr    $0x4,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x3,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
mov    %esi,0xc(%rsp)
mov    $0x4,%esi
cmp    $0x2710,%rcx
jb     13a0 <separate+0x290>
movabs $0x346dc5d63886594b,%rdx
c5 6d 34
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%rsi
shr    $0xb,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x3,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
mov    %esi,0x10(%rsp)
mov    $0x5,%esi
cmp    $0x186a0,%rcx
jb     13a0 <separate+0x290>
mov    %rcx,%rax
shr    $0x5,%rax
movabs $0xa7c5ac471b47843,%rdx
5a 7c 0a
mul    %rdx
mov    %rdx,%rsi
shr    $0x7,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x3,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
mov    %esi,0x14(%rsp)
mov    $0x6,%esi
cmp    $0xf4240,%rcx
jb     13a0 <separate+0x290>
movabs $0x431bde82d7b634db,%rdx
de 1b 43
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%rsi
shr    $0x12,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x3,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
mov    %esi,0x18(%rsp)
mov    $0x7,%esi
cmp    $0x989680,%rcx
jb     13a0 <separate+0x290>
movabs $0xd6bf94d5e57a42bd,%rdx
94 bf d6
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%rsi
shr    $0x17,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x3,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
mov    %esi,0x1c(%rsp)
mov    $0x8,%esi
cmp    $0x5f5e100,%rcx
jb     13a0 <separate+0x290>
movabs $0xabcc77118461cefd,%rdx
77 cc ab
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%rsi
shr    $0x1a,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x3,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
mov    %esi,0x20(%rsp)
mov    $0x9,%esi
cmp    $0x3b9aca00,%rcx
jb     13a0 <separate+0x290>
mov    %rcx,%rax
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rdx
mul    %rdx
mov    %rdx,%rsi
shr    $0xb,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x3,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
mov    %esi,0x24(%rsp)
mov    %rcx,%rax
shr    $0xa,%rax
xor    %edx,%edx
cmp    $0x9502f9,%rax
mov    $0xa,%esi
cmovae %edx,%esi
mov    %rsp,%rdi
mov    %rcx,%rdx
call   1030 <print@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @separate(i64 %0) {
%2 = alloca i64
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %2
%7 = bitcast [10 x i32]* %3 to i8*
store i32 0, i32* %4
%8 = load i64, i64* %2
store i64 %8, i64* %5
store i32 0, i32* %6
br label %9
9: ; preds = %27, %1
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %30
12: ; preds = %9
%13 = load i64, i64* %2
%14 = srem i64 %13, 10
%15 = trunc i64 %14 to i32
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %17
store i32 %15, i32* %18
%19 = load i64, i64* %2
%20 = sdiv i64 %19, 10
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = icmp slt i64 %21, 1
br i1 %22, label %23, label %26
23: ; preds = %12
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %30
26: ; preds = %12
br label %27
27: ; preds = %26
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %9
30: ; preds = %23, %9
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%32 = load i32, i32* %4
%33 = load i64, i64* %5
%34 = call i32 @print(i32* %31, i32 %32, i64 %33)
ret void
}

LLVM IR (-O2):
define void @separate(i64 %0) {
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %2 to i8*
%4 = srem i64 %0, 10
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 %5, i32* %6
%7 = icmp slt i64 %0, 10
br i1 %7, label %63, label %8
8: ; preds = %1
%9 = udiv i64 %0, 10
%10 = urem i64 %9, 10
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
store i32 %11, i32* %12
%13 = icmp ult i64 %0, 100
br i1 %13, label %63, label %14
14: ; preds = %8
%15 = udiv i64 %0, 100
%16 = urem i64 %15, 10
%17 = trunc i64 %16 to i32
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
store i32 %17, i32* %18
%19 = icmp ult i64 %0, 1000
br i1 %19, label %63, label %20
20: ; preds = %14
%21 = udiv i64 %0, 1000
%22 = urem i64 %21, 10
%23 = trunc i64 %22 to i32
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
store i32 %23, i32* %24
%25 = icmp ult i64 %0, 10000
br i1 %25, label %63, label %26
26: ; preds = %20
%27 = udiv i64 %0, 10000
%28 = urem i64 %27, 10
%29 = trunc i64 %28 to i32
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
store i32 %29, i32* %30
%31 = icmp ult i64 %0, 100000
br i1 %31, label %63, label %32
32: ; preds = %26
%33 = udiv i64 %0, 100000
%34 = urem i64 %33, 10
%35 = trunc i64 %34 to i32
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
store i32 %35, i32* %36
%37 = icmp ult i64 %0, 1000000
br i1 %37, label %63, label %38
38: ; preds = %32
%39 = udiv i64 %0, 1000000
%40 = urem i64 %39, 10
%41 = trunc i64 %40 to i32
%42 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
store i32 %41, i32* %42
%43 = icmp ult i64 %0, 10000000
br i1 %43, label %63, label %44
44: ; preds = %38
%45 = udiv i64 %0, 10000000
%46 = urem i64 %45, 10
%47 = trunc i64 %46 to i32
%48 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
store i32 %47, i32* %48
%49 = icmp ult i64 %0, 100000000
br i1 %49, label %63, label %50
50: ; preds = %44
%51 = udiv i64 %0, 100000000
%52 = urem i64 %51, 10
%53 = trunc i64 %52 to i32
%54 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
store i32 %53, i32* %54
%55 = icmp ult i64 %0, 1000000000
br i1 %55, label %63, label %56
56: ; preds = %50
%57 = udiv i64 %0, 1000000000
%58 = urem i64 %57, 10
%59 = trunc i64 %58 to i32
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
store i32 %59, i32* %60
%61 = icmp ult i64 %0, 10000000000
%62 = select i1 %61, i32 10, i32 0
br label %63
63: ; preds = %56, %1, %8, %14, %20, %26, %32, %38, %44, %50
%64 = phi i32 [ 1, %1 ], [ 2, %8 ], [ 3, %14 ], [ 4, %20 ], [ 5, %26 ], [ 6, %32 ], [ 7, %38 ], [ 8, %44 ], [ 9, %50 ], [ %62, %56 ]
%65 = call i32 @print(i32* %6, i32 %64, i64 %0)
ret void
}