#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 multiplo(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf_s(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int num1, num2;
  printf("Dame 2 enteros y te digo si el segundo es mutiplo del 1r\n");
  printf("Dame el primer entero: ");
  scanf_s("%i", &num1);
  printf("Dame el segundo entero: ");
  scanf_s("%i", &num2);
  if (multiplo(num1, num2) == 1)
    printf("%i es multiplo de %i\n", num2, num1);
  else
    printf("%i no es multiplo de %i\n", num2, num1);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf_s@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf_s@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <multiplo@plt>
cmp    $0x1,%eax
jne    11c6 <main+0x86>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11da <main+0x9a>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xebc(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf0d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xea2(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf_s@plt>
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf_s@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <multiplo@plt>
cmp    $0x1,%eax
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xe77(%rip),%rax
lea    0xe86(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe8d(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"Dame 2 enteros y te digo si el segundo es mutiplo del 1r\0A\00"
@.str.1 = [24 x i8] c"Dame el primer entero: \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [25 x i8] c"Dame el segundo entero: \00"
@.str.4 = [22 x i8] c"%i es multiplo de %i\0A\00"
@.str.5 = [25 x i8] c"%i no es multiplo de %i\0A\00"
@.str.6 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @multiplo(i32 %9, i32 %10)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %17
13: ; preds = %0
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %14, i32 %15)
br label %21
17: ; preds = %0
%18 = load i32, i32* %3
%19 = load i32, i32* %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %18, i32 %19)
br label %21
21: ; preds = %17, %13
%22 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"Dame el primer entero: \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [25 x i8] c"Dame el segundo entero: \00"
@.str.4 = [22 x i8] c"%i es multiplo de %i\0A\00"
@.str.5 = [25 x i8] c"%i no es multiplo de %i\0A\00"
@.str.6 = [6 x i8] c"pause\00"
@str = [57 x i8] c"Dame 2 enteros y te digo si el segundo es mutiplo del 1r\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 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 @multiplo(i32 %10, i32 %11)
%13 = icmp eq i32 %12, 1
%14 = load i32, i32* %2
%15 = load i32, i32* %1
%16 = select i1 %13, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %16, i32 %14, i32 %15)
%18 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}