#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 *);
main() {
  int a, b, resultado1, resultado2;
  printf("Insira o Primeiro Valor (a): ");
  scanf("%d", &a);
  printf("Insira o Segundo Valor (b): ");
  scanf("%d", &b);
  resultado1 = a % b;
  resultado2 = b % a;
  if (resultado1 == 0) {
    printf("%d e multiplo de %d", a, b);
  } else {
    if (resultado2 == 0) {
      printf("%d e multiplo de %d", b, a);
    } else {
      printf("%d e %d NAO sao multiplos", b, a);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    11a2 <main+0x82>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11de <main+0xbe>
cmpl   $0x0,-0x14(%rbp)
jne    11c5 <main+0xa5>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d9 <main+0xb9>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11de <main+0xbe>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf12(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%r8d
mov    0x8(%rsp),%ecx
mov    %r8d,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1188 <main+0x68>
mov    %ecx,%eax
cltd
idiv   %r8d
test   %edx,%edx
je     1196 <main+0x76>
lea    0xec9(%rip),%rdi
jmp    119d <main+0x7d>
lea    0xeac(%rip),%rdi
mov    %r8d,%esi
mov    %ecx,%edx
jmp    11a2 <main+0x82>
lea    0xe9e(%rip),%rdi
mov    %ecx,%esi
mov    %r8d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Insira o Primeiro Valor (a): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"Insira o Segundo Valor (b): \00"
@.str.3 = [20 x i8] c"%d e multiplo de %d\00"
@.str.4 = [26 x i8] c"%d e %d NAO sao multiplos\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = srem i32 %10, %11
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = srem i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %0
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %19, i32 %20)
br label %34
22: ; preds = %0
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = load i32, i32* %3
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %26, i32 %27)
br label %33
29: ; preds = %22
%30 = load i32, i32* %3
%31 = load i32, i32* %2
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %30, i32 %31)
br label %33
33: ; preds = %29, %25
br label %34
34: ; preds = %33, %18
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
@.str = [30 x i8] c"Insira o Primeiro Valor (a): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"Insira o Segundo Valor (b): \00"
@.str.3 = [20 x i8] c"%d e multiplo de %d\00"
@.str.4 = [26 x i8] c"%d e %d NAO sao multiplos\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 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* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = srem i32 %9, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 %10)
br label %22
15: ; preds = %0
%16 = srem i32 %10, %9
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %10, i32 %9)
br label %22
20: ; preds = %15
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %10, i32 %9)
br label %22
22: ; preds = %18, %20, %13
ret i32 0
}