#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 *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (n % 10 != 0 && n % (n / 10) == 0)
    printf("SIM\n");
  else
    printf("NAO\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1186 <main+0x66>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1186 <main+0x66>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    1192 <main+0x72>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0xcccccccd,%eax,%ecx
add    $0x19999998,%ecx
ror    %ecx
cmp    $0x19999999,%ecx
jb     1168 <main+0x48>
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
cltd
idiv   %ecx
test   %edx,%edx
je     1171 <main+0x51>
lea    0xe94(%rip),%rdi
jmp    1178 <main+0x58>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"SIM\0A\00"
@.str.2 = [5 x i8] c"NAO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 10
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %0
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 10
%11 = srem i32 %8, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %17
15: ; preds = %7, %0
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [4 x i8] c"NAO\00"
@str.3 = [4 x i8] c"SIM\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 10
%6 = sdiv i32 %4, 10
%7 = icmp eq i32 %5, 0
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = srem i32 %4, %6
%10 = icmp eq i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %8, %0
br label %12
12: ; preds = %8, %11
%13 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), %8 ]
%14 = call i32 @puts(i8* dereferenceable(1) %13)
ret i32 0
}