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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     119e <main+0x7e>
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    1199 <main+0x79>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11b6 <main+0x96>
jmp    119e <main+0x7e>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%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     1170 <main+0x50>
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
cltd
idiv   %ecx
test   %edx,%edx
je     1179 <main+0x59>
lea    0xe8c(%rip),%rdi
jmp    1180 <main+0x60>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"SIM\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.2 = [5 x i8] c"NAO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%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 %17
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 %16
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* @EXIT_SUCCESS
store i32 %15, i32* %1
br label %20
16: ; preds = %7
br label %17
17: ; preds = %16, %0
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%19 = load i32, i32* @EXIT_SUCCESS
store i32 %19, i32* %1
br label %20
20: ; preds = %17, %13
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
@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*
store i32 0, i32* %1
%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)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}