#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 strlen(int);
int main(void) {
  int cardNum[15];
  int num = 5105105105105100;
  int i;
  int length;
  length = strlen(num);
  for (i = 0; i < length; i++) {
    cardNum[i] = num % 10;
  }
  for (i = 0; i < length; i++) {
    printf("%d", cardNum[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xe854b0cc,-0x44(%rbp)
mov    -0x44(%rbp),%edi
call   1030 <strlen@plt>
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    1175 <main+0x55>
mov    -0x44(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq -0x48(%rbp),%rax
mov    %edx,-0x40(%rbp,%rax,4)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1148 <main+0x28>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    11aa <main+0x8a>
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    117c <main+0x5c>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    $0xe854b0cc,%edi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1184 <main+0x54>
mov    %eax,%r15d
lea    0x0(,%r15,4),%rdx
mov    %rsp,%rdi
xor    %ebx,%ebx
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe9b(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rsp,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [15 x i32]
%2 = bitcast [15 x i32]* %1 to i8*
%3 = tail call i32 @strlen(i32 -397102900)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %0
%6 = zext i32 %3 to i64
%7 = shl nuw nsw i64 %6, 2
%8 = zext i32 %3 to i64
br label %9
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %14, %9 ]
%11 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %0
ret i32 0
}