#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 num, div_tres, div_cinco;
  printf("Digite o 1o numero inteiro:");
  scanf("%d", &num);
  if (num % 3 == 0 && num % 5 == 0) {
    printf("Numero divisivel por 3 e por 5!");
  } else {
    if (num % 3 == 0) {
      printf("Numero divisivel por 3!");
    } else if (num % 5 == 0) {
      printf("Numero divisivel por 5!");
    } else {
      printf("Numero indivisivel por 3 ou por 5!");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1184 <main+0x64>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1184 <main+0x64>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    11e4 <main+0xc4>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a9 <main+0x89>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    11df <main+0xbf>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ce <main+0xae>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    11da <main+0xba>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    11df <main+0xbf>
jmp    11e4 <main+0xc4>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
mov    %eax,%ecx
sub    %edx,%ecx
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x21,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%eax
mov    %ecx,%edx
or     %eax,%edx
je     1197 <main+0x77>
test   %ecx,%ecx
je     11a0 <main+0x80>
test   %eax,%eax
lea    0xecd(%rip),%rax
lea    0xede(%rip),%rdi
cmove  %rax,%rdi
jmp    11a7 <main+0x87>
lea    0xe81(%rip),%rdi
jmp    11a7 <main+0x87>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Digite o 1o numero inteiro:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"Numero divisivel por 3 e por 5!\00"
@.str.3 = [24 x i8] c"Numero divisivel por 3!\00"
@.str.4 = [24 x i8] c"Numero divisivel por 5!\00"
@.str.5 = [35 x i8] c"Numero indivisivel por 3 ou por 5!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = srem i32 %7, 3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %0
%11 = load i32, i32* %2
%12 = srem i32 %11, 5
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %32
16: ; preds = %10, %0
%17 = load i32, i32* %2
%18 = srem i32 %17, 3
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %31
22: ; preds = %16
%23 = load i32, i32* %2
%24 = srem i32 %23, 5
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %30
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
br label %30
30: ; preds = %28, %26
br label %31
31: ; preds = %30, %20
br label %32
32: ; preds = %31, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Digite o 1o numero inteiro:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"Numero divisivel por 3 e por 5!\00"
@.str.3 = [24 x i8] c"Numero divisivel por 3!\00"
@.str.4 = [24 x i8] c"Numero divisivel por 5!\00"
@.str.5 = [35 x i8] c"Numero indivisivel por 3 ou por 5!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 3
%7 = srem i32 %5, 5
%8 = icmp eq i32 %7, 0
%9 = or i32 %6, %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %0
%12 = icmp eq i32 %6, 0
br i1 %12, label %15, label %13
13: ; preds = %11
%14 = select i1 %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0)
br label %15
15: ; preds = %13, %11, %0
%16 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), %11 ], [ %14, %13 ]
%17 = call i32 @printf(i8* dereferenceable(1) %16)
ret i32 0
}