#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);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int i, n, m;
  scanf("%d\n%d", &m, &n);
  for (i = n; i > 0; --i) {
    if (i % m == 0) {
      printf("%d\n", i);
      break;
    }
    if (i == 1)
      printf("sem multiplos menores que %d\n", 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    -0x10(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11a3 <main+0x83>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1177 <main+0x57>
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    11a3 <main+0x83>
cmpl   $0x1,-0x8(%rbp)
jne    1190 <main+0x70>
mov    -0xc(%rbp),%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    1195 <main+0x75>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <main+0x29>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
test   %esi,%esi
jle    1172 <main+0x52>
mov    0x4(%rsp),%ecx
mov    %esi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     115a <main+0x3a>
cmp    $0x1,%esi
je     1163 <main+0x43>
lea    -0x1(%rsi),%eax
cmp    $0x1,%esi
mov    %eax,%esi
jg     1140 <main+0x20>
jmp    1172 <main+0x52>
lea    0xebf(%rip),%rdi
jmp    116d <main+0x4d>
mov    (%rsp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d\0A%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [30 x i8] c"sem multiplos menores que %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %3)
%6 = load i32, i32* %3
store i32 %6, i32* %2
br label %7
7: ; preds = %25, %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %28
18: ; preds = %10
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %21, %18
br label %25
25: ; preds = %24
%26 = load i32, i32* %2
%27 = add nsw i32 %26, -1
store i32 %27, i32* %2
br label %7
28: ; preds = %15, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d\0A%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [30 x i8] c"sem multiplos menores que %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %24
8: ; preds = %0
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %21
%11 = phi i32 [ %22, %21 ], [ %6, %8 ]
%12 = srem i32 %11, %9
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %24
16: ; preds = %10
%17 = icmp eq i32 %11, 1
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i32, i32* %1
%20 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %24
21: ; preds = %16
%22 = add nsw i32 %11, -1
%23 = icmp sgt i32 %11, 1
br i1 %23, label %10, label %24
24: ; preds = %21, %18, %0, %14
ret i32 0
}