#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 */
scalar_t__ jiecheng(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int num, wei[10];
  int tmp;
  int count = 0;
  int index = 0;
  int i;
  scanf("%d", &num);
  tmp = num;
  while (num) {
    wei[index] = num % 10;
    num /= 10;
    index++;
  }
  printf("%d,", tmp);
  for (i = index - 1; i >= 0; i--) {
    count += jiecheng(wei[i]);
    if (i > 0)
      printf("%d!+", wei[i]);
    else
      printf("%d!=%d\n", wei[i], count);
  }
  if (count == tmp)
    printf("Yes\n");
  else
    printf("No\n");
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
lea    0xe9c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11ac <main+0x6c>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq -0x3c(%rbp),%rax
mov    %edx,-0x30(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1173 <main+0x33>
mov    -0x34(%rbp),%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x3c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
jl     123b <main+0xfb>
movslq -0x40(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edi
call   1030 <jiecheng@plt>
mov    %rax,%rcx
movslq -0x38(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x40(%rbp)
jle    120f <main+0xcf>
movslq -0x40(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1228 <main+0xe8>
movslq -0x40(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
mov    -0x38(%rbp),%edx
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    122d <main+0xed>
mov    -0x40(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x40(%rbp)
jmp    11c6 <main+0x86>
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jne    125a <main+0x11a>
lea    0xdc6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1268 <main+0x128>
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdae(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
lea    0xe9d(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%r14d
test   %r14d,%r14d
je     1227 <main+0xd7>
xor    %ebx,%ebx
mov    %r14d,%eax
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
mov    %esi,0x10(%rsp,%rbx,4)
add    $0x1,%rbx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1180 <main+0x30>
mov    %eax,0xc(%rsp)
lea    0xe47(%rip),%rdi
xor    %r12d,%r12d
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
test   %ebx,%ebx
jle    123b <main+0xeb>
lea    -0x1(%rbx),%eax
mov    0x10(%rsp,%rax,4),%ebp
mov    %ebp,%edi
call   1030 <jiecheng@plt>
mov    %rax,%r12
cmp    $0x1,%ebx
je     1212 <main+0xc2>
mov    %ebx,%ebx
add    $0xfffffffffffffffe,%rbx
lea    0xe17(%rip),%r15
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%eax
mov    0x10(%rsp,%rax,4),%ebp
mov    %ebp,%edi
call   1030 <jiecheng@plt>
add    %eax,%r12d
add    $0xffffffffffffffff,%rbx
jb     11f0 <main+0xa0>
lea    0xdf3(%rip),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    123b <main+0xeb>
lea    0xdd5(%rip),%rdi
xor    %r12d,%r12d
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    %r14d,%r12d
lea    0xdd8(%rip),%rax
lea    0xdce(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
lea    0xdb8(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d,\00"
@.str.2 = [5 x i8] c"%d!+\00"
@.str.3 = [8 x i8] c"%d!=%d\0A\00"
@.str.4 = [5 x i8] c"Yes\0A\00"
@.str.5 = [4 x i8] c"No\0A\00"
@.str.6 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %6
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
store i32 %9, i32* %4
br label %10
10: ; preds = %13, %0
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i32, i32* %2
%15 = srem i32 %14, 10
%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 i32, i32* %2
%20 = sdiv i32 %19, 10
store i32 %20, i32* %2
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %10
23: ; preds = %10
%24 = load i32, i32* %4
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %6
%27 = sub nsw i32 %26, 1
store i32 %27, i32* %7
br label %28
28: ; preds = %57, %23
%29 = load i32, i32* %7
%30 = icmp sge i32 %29, 0
br i1 %30, label %31, label %60
31: ; preds = %28
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = call i64 @jiecheng(i32 %35)
%37 = load i32, i32* %5
%38 = sext i32 %37 to i64
%39 = add nsw i64 %38, %36
%40 = trunc i64 %39 to i32
store i32 %40, i32* %5
%41 = load i32, i32* %7
%42 = icmp sgt i32 %41, 0
br i1 %42, label %43, label %49
43: ; preds = %31
%44 = load i32, i32* %7
%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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %47)
br label %56
49: ; preds = %31
%50 = load i32, i32* %7
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = load i32, i32* %5
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %53, i32 %54)
br label %56
56: ; preds = %49, %43
br label %57
57: ; preds = %56
%58 = load i32, i32* %7
%59 = add nsw i32 %58, -1
store i32 %59, i32* %7
br label %28
60: ; preds = %28
%61 = load i32, i32* %5
%62 = load i32, i32* %4
%63 = icmp eq i32 %61, %62
br i1 %63, label %64, label %66
64: ; preds = %60
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %68
66: ; preds = %60
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %68
68: ; preds = %66, %64
%69 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d,\00"
@.str.2 = [5 x i8] c"%d!+\00"
@.str.3 = [8 x i8] c"%d!=%d\0A\00"
@.str.6 = [6 x i8] c"pause\00"
@str = [3 x i8] c"No\00"
@str.7 = [4 x i8] c"Yes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %49
10: ; preds = %0, %10
%11 = phi i64 [ %16, %10 ], [ 0, %0 ]
%12 = phi i32 [ %15, %10 ], [ %6, %0 ]
%13 = srem i32 %12, 10
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %11
store i32 %13, i32* %14
%15 = sdiv i32 %12, 10
%16 = add nuw i64 %11, 1
%17 = add i32 %12, 9
%18 = icmp ult i32 %17, 19
br i1 %18, label %19, label %10
19: ; preds = %10
%20 = trunc i64 %16 to i32
store i32 %15, i32* %1
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%22 = icmp sgt i32 %20, 0
br i1 %22, label %23, label %49
23: ; preds = %19
%24 = and i64 %16, 4294967295
%25 = add nsw i64 %24, -1
%26 = and i64 %25, 4294967295
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = call i64 @jiecheng(i32 %28)
%30 = trunc i64 %29 to i32
%31 = icmp eq i64 %24, 1
br i1 %31, label %45, label %32
32: ; preds = %23, %32
%33 = phi i32 [ %43, %32 ], [ %30, %23 ]
%34 = phi i32 [ %40, %32 ], [ %28, %23 ]
%35 = phi i64 [ %37, %32 ], [ %25, %23 ]
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %34)
%37 = add nsw i64 %35, -1
%38 = and i64 %37, 4294967295
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = call i64 @jiecheng(i32 %40)
%42 = trunc i64 %41 to i32
%43 = add i32 %33, %42
%44 = icmp eq i64 %35, 1
br i1 %44, label %45, label %32
45: ; preds = %32, %23
%46 = phi i32 [ %28, %23 ], [ %40, %32 ]
%47 = phi i32 [ %30, %23 ], [ %43, %32 ]
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %46, i32 %47)
br label %49
49: ; preds = %8, %45, %19
%50 = phi i32 [ 0, %19 ], [ %47, %45 ], [ 0, %8 ]
%51 = icmp eq i32 %50, %6
%52 = select i1 %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%53 = call i32 @puts(i8* dereferenceable(1) %52)
%54 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}