#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 /*<<< orphan*/ scanf(char *, long *);
int main() {
  long int x, i = 1, res = 0;
  scanf("%ld", &x);
  while (i < x) {
    if (x % i == 0)
      res = res + i;
    i++;
  }
  if (res == x)
    printf("yes");
  else
    printf("no");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    118e <main+0x6e>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
cmp    $0x0,%rdx
jne    117d <main+0x5d>
mov    -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114f <main+0x2f>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    11ad <main+0x8d>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
jmp    11b9 <main+0x99>
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%r10
cmp    $0x2,%r10
jl     115b <main+0x3b>
lea    -0x1(%r10),%r8
cmp    $0x2,%r10
jne    1162 <main+0x42>
mov    $0x1,%r11d
xor    %esi,%esi
test   $0x1,%r8b
jne    1200 <main+0xe0>
jmp    122a <main+0x10a>
xor    %esi,%esi
jmp    122a <main+0x10a>
mov    %r8,%r9
and    $0xfffffffffffffffe,%r9
mov    $0x1,%eax
xor    %esi,%esi
jmp    118c <main+0x6c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %rax,%rsi
lea    0x1(%rcx),%rax
cmp    %r9,%rcx
je     11f6 <main+0xd6>
mov    %rax,%r11
mov    %r10,%rax
or     %r11,%rax
shr    $0x20,%rax
je     11b0 <main+0x90>
mov    %r10,%rax
cqto
idiv   %r11
jmp    11b8 <main+0x98>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r10d,%eax
xor    %edx,%edx
div    %r11d
mov    %r11,%rdi
test   %rdx,%rdx
je     11c2 <main+0xa2>
xor    %edi,%edi
lea    0x1(%r11),%rcx
mov    %r10,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     11e0 <main+0xc0>
mov    %r10,%rax
cqto
idiv   %rcx
jmp    11e7 <main+0xc7>
nopl   0x0(%rax)
mov    %r10d,%eax
xor    %edx,%edx
div    %ecx
add    %rdi,%rsi
mov    %rcx,%rax
test   %rdx,%rdx
je     1180 <main+0x60>
xor    %eax,%eax
jmp    1180 <main+0x60>
add    $0x2,%r11
test   $0x1,%r8b
je     122a <main+0x10a>
mov    %r10,%rax
or     %r11,%rax
shr    $0x20,%rax
je     1216 <main+0xf6>
mov    %r10,%rax
cqto
idiv   %r11
jmp    121e <main+0xfe>
mov    %r10d,%eax
xor    %edx,%edx
div    %r11d
xor    %eax,%eax
test   %rdx,%rdx
cmove  %r11,%rax
add    %rax,%rsi
cmp    %r10,%rsi
lea    0xdd0(%rip),%rax
lea    0xdcd(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = icmp sgt i64 %4, 1
br i1 %5, label %6, label %38
6: ; preds = %0
%7 = add i64 %4, -1
%8 = and i64 %7, 1
%9 = icmp eq i64 %4, 2
br i1 %9, label %28, label %10
10: ; preds = %6
%11 = and i64 %7, -2
br label %12
12: ; preds = %12, %10
%13 = phi i64 [ 0, %10 ], [ %24, %12 ]
%14 = phi i64 [ 1, %10 ], [ %25, %12 ]
%15 = phi i64 [ 0, %10 ], [ %26, %12 ]
%16 = srem i64 %4, %14
%17 = icmp eq i64 %16, 0
%18 = select i1 %17, i64 %14, i64 0
%19 = add nuw nsw i64 %18, %13
%20 = add nuw nsw i64 %14, 1
%21 = srem i64 %4, %20
%22 = icmp eq i64 %21, 0
%23 = select i1 %22, i64 %20, i64 0
%24 = add nuw nsw i64 %23, %19
%25 = add nuw nsw i64 %14, 2
%26 = add i64 %15, 2
%27 = icmp eq i64 %26, %11
br i1 %27, label %28, label %12
28: ; preds = %12, %6
%29 = phi i64 [ undef, %6 ], [ %24, %12 ]
%30 = phi i64 [ 0, %6 ], [ %24, %12 ]
%31 = phi i64 [ 1, %6 ], [ %25, %12 ]
%32 = icmp eq i64 %8, 0
br i1 %32, label %38, label %33
33: ; preds = %28
%34 = srem i64 %4, %31
%35 = icmp eq i64 %34, 0
%36 = select i1 %35, i64 %31, i64 0
%37 = add nuw nsw i64 %36, %30
br label %38
38: ; preds = %33, %28, %0
%39 = phi i64 [ 0, %0 ], [ %29, %28 ], [ %37, %33 ]
%40 = icmp eq i64 %39, %4
%41 = select i1 %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%42 = call i32 @printf(i8* dereferenceable(1) %41)
ret i32 0
}