#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 getint();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ putint(int);
int main() {
  int i;
  int s[10];
  int a;
  a = getint();
  a = a % 10;
  i = 0;
  while (i < 10) {
    s[i] = 1;
    i = i + 1;
  }
  s[3] = a;
  s[a] = 3;
  s[(s[(a + s[3]) % 10] * s[a]) % 10] = s[(s[a] + s[a * 2 % 10]) % 10] + a;
  i = 0;
  while (i < 10) {
    putint(s[i]);
    putchar(10);
    i = i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getint@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x34(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1182 <main+0x52>
movslq -0x8(%rbp),%rax
movl   $0x1,-0x30(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x2e>
mov    -0x34(%rbp),%eax
mov    %eax,-0x24(%rbp)
movslq -0x34(%rbp),%rax
movl   $0x3,-0x30(%rbp,%rax,4)
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x38(%rbp),%eax
movslq %edx,%rcx
add    -0x30(%rbp,%rcx,4),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%ecx
add    -0x34(%rbp),%ecx
mov    -0x34(%rbp),%eax
add    -0x24(%rbp),%eax
mov    $0xa,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%eax
movslq -0x34(%rbp),%rdx
imul   -0x30(%rbp,%rdx,4),%eax
mov    $0xa,%esi
cltd
idiv   %esi
movslq %edx,%rax
mov    %ecx,-0x30(%rbp,%rax,4)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    122c <main+0xfc>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11fd <main+0xcd>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xor    %eax,%eax
call   1050 <getint@plt>
movabs $0x100000001,%rcx
mov    %rcx,(%rsp)
movl   $0x1,0x8(%rsp)
movaps 0xea8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rcx,0x20(%rsp)
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,0xc(%rsp)
cltq
movl   $0x3,(%rsp,%rax,4)
lea    (%rax,%rax,1),%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x20,%rdx
sar    $0x2,%edx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    (%rsp,%rcx,4),%ecx
lea    0x3(%rcx),%edx
movslq %edx,%rdx
imul   $0x66666667,%rdx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x20,%rdx
sar    $0x2,%edx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
neg    %edx
add    %edx,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rsp,%rcx,4),%ecx
add    %eax,%ecx
add    0xc(%rsp),%eax
cltq
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x20,%rdx
sar    $0x2,%edx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%eax
cltq
mov    (%rsp,%rax,4),%eax
lea    (%rax,%rax,2),%eax
cltq
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x20,%rdx
sar    $0x2,%edx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%eax
cltq
mov    %ecx,(%rsp,%rax,4)
mov    (%rsp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x14(%rsp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x1c(%rsp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x20(%rsp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x24(%rsp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @getint()
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = srem i32 %6, 10
store i32 %7, i32* %4
store i32 0, i32* %2
br label %8
8: ; preds = %11, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %13
store i32 1, i32* %14
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %8
17: ; preds = %8
%18 = load i32, i32* %4
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
store i32 %18, i32* %19
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %21
store i32 3, i32* %22
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = load i32, i32* %4
%28 = mul nsw i32 %27, 2
%29 = srem i32 %28, 10
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = add nsw i32 %26, %32
%34 = srem i32 %33, 10
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = load i32, i32* %4
%39 = add nsw i32 %37, %38
%40 = load i32, i32* %4
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%42 = load i32, i32* %41
%43 = add nsw i32 %40, %42
%44 = srem i32 %43, 10
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = mul nsw i32 %47, %51
%53 = srem i32 %52, 10
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %54
store i32 %39, i32* %55
store i32 0, i32* %2
br label %56
56: ; preds = %59, %17
%57 = load i32, i32* %2
%58 = icmp slt i32 %57, 10
br i1 %58, label %59, label %68
59: ; preds = %56
%60 = load i32, i32* %2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = call i32 @putint(i32 %63)
%65 = call i32 @putchar(i32 10)
%66 = load i32, i32* %2
%67 = add nsw i32 %66, 1
store i32 %67, i32* %2
br label %56
68: ; preds = %56
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 (...) @getint()
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32 1, i32* %4
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
store i32 1, i32* %5
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
store i32 1, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%12 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %12
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 1, i32* %13
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 1, i32* %14
%15 = srem i32 %3, 10
store i32 %15, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %16
store i32 3, i32* %17
%18 = shl nsw i32 %15, 1
%19 = srem i32 %18, 10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 3
%24 = srem i32 %23, 10
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = add nsw i32 %27, %15
%29 = load i32, i32* %7
%30 = add nsw i32 %29, %15
%31 = srem i32 %30, 10
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = mul nsw i32 %34, 3
%36 = srem i32 %35, 10
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %37
store i32 %28, i32* %38
%39 = load i32, i32* %4
%40 = tail call i32 @putint(i32 %39)
%41 = tail call i32 @putchar(i32 10)
%42 = load i32, i32* %5
%43 = tail call i32 @putint(i32 %42)
%44 = tail call i32 @putchar(i32 10)
%45 = load i32, i32* %6
%46 = tail call i32 @putint(i32 %45)
%47 = tail call i32 @putchar(i32 10)
%48 = load i32, i32* %7
%49 = tail call i32 @putint(i32 %48)
%50 = tail call i32 @putchar(i32 10)
%51 = load i32, i32* %8
%52 = tail call i32 @putint(i32 %51)
%53 = tail call i32 @putchar(i32 10)
%54 = load i32, i32* %9
%55 = tail call i32 @putint(i32 %54)
%56 = tail call i32 @putchar(i32 10)
%57 = load i32, i32* %10
%58 = tail call i32 @putint(i32 %57)
%59 = tail call i32 @putchar(i32 10)
%60 = load i32, i32* %11
%61 = tail call i32 @putint(i32 %60)
%62 = tail call i32 @putchar(i32 10)
%63 = load i32, i32* %13
%64 = tail call i32 @putint(i32 %63)
%65 = tail call i32 @putchar(i32 10)
%66 = load i32, i32* %14
%67 = tail call i32 @putint(i32 %66)
%68 = tail call i32 @putchar(i32 10)
ret i32 0
}