#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 main() {
  int N = 1000, M, i, sum = 0;
  int arr[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  for (i = 0; i < N; i++) {
    sum = sum + i;
    M = sum % 10;
    if (M == 0) {
      arr[0] = 10;
    } else
      arr[M] = M;
  }
  for (i = 0; i < 10; i++) {
    if (arr[i] == 0)
      printf("tuzi in %d anquan\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ab <main+0x8b>
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    118d <main+0x6d>
movl   $0xa,-0x40(%rbp)
jmp    1198 <main+0x78>
mov    -0xc(%rbp),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
jmp    119d <main+0x7d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1154 <main+0x34>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    11ed <main+0xcd>
movslq -0x10(%rbp),%rax
cmpl   $0x0,-0x40(%rbp,%rax,4)
jne    11da <main+0xba>
mov    -0x10(%rbp),%esi
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
jmp    11df <main+0xbf>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b2 <main+0x92>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
xor    %r8d,%r8d
mov    $0x1,%r9b
mov    $0xcccccccd,%eax
xor    %esi,%esi
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
add    %edi,%esi
mov    %rsi,%rcx
imul   %rax,%rcx
shr    $0x23,%rcx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%edx
mov    %esi,%ecx
sub    %edx,%ecx
je     116a <main+0x5a>
mov    %ecx,%edx
mov    %ecx,(%rsp,%rdx,4)
add    $0x1,%edi
cmp    $0x3e8,%edi
jne    1140 <main+0x30>
jmp    1193 <main+0x83>
lea    0x1(%rdi),%ecx
mov    $0xa,%r8d
xor    %r9d,%r9d
cmp    $0x3e7,%edi
mov    %ecx,%edi
jne    1140 <main+0x30>
movl   $0xa,(%rsp)
cmpl   $0x0,0x4(%rsp)
jne    11a4 <main+0x94>
jmp    1218 <main+0x108>
mov    %r8d,(%rsp)
test   $0x1,%r9b
jne    1203 <main+0xf3>
cmpl   $0x0,0x4(%rsp)
je     1218 <main+0x108>
cmpl   $0x0,0x8(%rsp)
je     1234 <main+0x124>
cmpl   $0x0,0xc(%rsp)
je     1250 <main+0x140>
cmpl   $0x0,0x10(%rsp)
je     126c <main+0x15c>
cmpl   $0x0,0x14(%rsp)
je     1288 <main+0x178>
cmpl   $0x0,0x18(%rsp)
je     12a4 <main+0x194>
cmpl   $0x0,0x1c(%rsp)
je     12c0 <main+0x1b0>
cmpl   $0x0,0x20(%rsp)
je     12dc <main+0x1cc>
cmpl   $0x0,0x24(%rsp)
je     12f8 <main+0x1e8>
xor    %eax,%eax
add    $0x28,%rsp
ret
lea    0xdf6(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jne    11a4 <main+0x94>
lea    0xde1(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
cmpl   $0x0,0x8(%rsp)
jne    11af <main+0x9f>
lea    0xdc5(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jne    11ba <main+0xaa>
lea    0xda9(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
cmpl   $0x0,0x10(%rsp)
jne    11c5 <main+0xb5>
lea    0xd8d(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
cmpl   $0x0,0x14(%rsp)
jne    11d0 <main+0xc0>
lea    0xd71(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
cmpl   $0x0,0x18(%rsp)
jne    11db <main+0xcb>
lea    0xd55(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
cmpl   $0x0,0x1c(%rsp)
jne    11e6 <main+0xd6>
lea    0xd39(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
cmpl   $0x0,0x20(%rsp)
jne    11f1 <main+0xe1>
lea    0xd1d(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
cmpl   $0x0,0x24(%rsp)
jne    11fc <main+0xec>
lea    0xd01(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
jmp    11fc <main+0xec>

LLVM IR (-O0):
@.str = [19 x i8] c"tuzi in %d anquan\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [10 x i32]
store i32 0, i32* %1
store i32 1000, i32* %2
store i32 0, i32* %5
%7 = bitcast [10 x i32]* %6 to i8*
store i32 0, i32* %4
br label %8
8: ; preds = %28, %0
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %31
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = srem i32 %16, 10
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %12
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
store i32 10, i32* %21
br label %27
22: ; preds = %12
%23 = load i32, i32* %3
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %25
store i32 %23, i32* %26
br label %27
27: ; preds = %22, %20
br label %28
28: ; preds = %27
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %8
31: ; preds = %8
store i32 0, i32* %4
br label %32
32: ; preds = %45, %31
%33 = load i32, i32* %4
%34 = icmp slt i32 %33, 10
br i1 %34, label %35, label %48
35: ; preds = %32
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %35
%42 = load i32, i32* %4
%43 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %41, %35
br label %45
45: ; preds = %44
%46 = load i32, i32* %4
%47 = add nsw i32 %46, 1
store i32 %47, i32* %4
br label %32
48: ; preds = %32
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"tuzi in %d anquan\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
br label %4
4: ; preds = %21, %0
%5 = phi i1 [ false, %21 ], [ true, %0 ]
%6 = phi i32 [ 10, %21 ], [ 0, %0 ]
%7 = phi i32 [ %13, %21 ], [ 0, %0 ]
%8 = phi i32 [ %22, %21 ], [ 0, %0 ]
br label %10
9: ; preds = %16
store i32 %6, i32* %3
br i1 %5, label %25, label %27
10: ; preds = %4, %16
%11 = phi i32 [ %13, %16 ], [ %7, %4 ]
%12 = phi i32 [ %19, %16 ], [ %8, %4 ]
%13 = add nuw nsw i32 %11, %12
%14 = urem i32 %13, 10
%15 = icmp eq i32 %14, 0
br i1 %15, label %21, label %16
16: ; preds = %10
%17 = zext i32 %14 to i64
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %17
store i32 %14, i32* %18
%19 = add nuw nsw i32 %12, 1
%20 = icmp eq i32 %19, 1000
br i1 %20, label %9, label %10
21: ; preds = %10
%22 = add nuw nsw i32 %12, 1
%23 = icmp eq i32 %22, 1000
br i1 %23, label %24, label %4
24: ; preds = %21
store i32 10, i32* %3
br label %27
25: ; preds = %9
%26 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0)
br label %27
27: ; preds = %24, %9, %25
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1)
br label %33
33: ; preds = %31, %27
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2)
br label %39
39: ; preds = %37, %33
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%41 = load i32, i32* %40
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 3)
br label %45
45: ; preds = %43, %39
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%47 = load i32, i32* %46
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 4)
br label %51
51: ; preds = %49, %45
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%53 = load i32, i32* %52
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 5)
br label %57
57: ; preds = %55, %51
%58 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%59 = load i32, i32* %58
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 6)
br label %63
63: ; preds = %61, %57
%64 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%65 = load i32, i32* %64
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %63
%68 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 7)
br label %69
69: ; preds = %67, %63
%70 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%71 = load i32, i32* %70
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %69
%74 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 8)
br label %75
75: ; preds = %73, %69
%76 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%77 = load i32, i32* %76
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 9)
br label %81
81: ; preds = %79, %75
ret i32 0
}