#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(void) {
  int n, i, j, multiplosI = 0, multiplosJ = 0, multiplos = 0;
  printf("Digite o valor de N: ");
  scanf("%d", &n);
  printf("Digite o valor de I e J: ");
  scanf("%d %d", &i, &j);
  for (int contador = 1; contador < n; contador++) {
    if (contador % i == 0)
      multiplosI++;
    if (contador % j == 0)
      multiplosJ++;
    if (contador % (i * j) == 0)
      multiplos++;
  }
  printf("\nMultiplos apenas de I: %d", multiplosI);
  printf("\nMultiplos apenas de J: %d", multiplosJ);
  printf("\nMultiplos apenas de ambos: %d", multiplos);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ff <main+0xdf>
mov    -0x20(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    11b4 <main+0x94>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11cd <main+0xad>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ec <main+0xcc>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11f1 <main+0xd1>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    118f <main+0x6f>
mov    -0x14(%rbp),%esi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf0e(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%r8d
mov    $0x0,%ebx
mov    $0x0,%ebp
cmp    $0x2,%r8d
jl     11db <main+0xbb>
mov    0x8(%rsp),%r9d
mov    0x4(%rsp),%edi
mov    %edi,%esi
imul   %r9d,%esi
xor    %ebp,%ebp
mov    $0x1,%ecx
xor    %ebx,%ebx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%eax
cltd
idiv   %r9d
cmp    $0x1,%edx
adc    $0x0,%r14d
mov    %ecx,%eax
cltd
idiv   %edi
cmp    $0x1,%edx
adc    $0x0,%ebx
mov    %ecx,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
adc    $0x0,%ebp
add    $0x1,%ecx
cmp    %ecx,%r8d
jne    11b0 <main+0x90>
lea    0xe54(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe5e(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe69(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Digite o valor de N: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"Digite o valor de I e J: \00"
@.str.3 = [6 x i8] c"%d %d\00"
@.str.4 = [27 x i8] c"\0AMultiplos apenas de I: %d\00"
@.str.5 = [27 x i8] c"\0AMultiplos apenas de J: %d\00"
@.str.6 = [31 x i8] c"\0AMultiplos apenas de ambos: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %3, i32* %4)
store i32 1, i32* %8
br label %13
13: ; preds = %44, %0
%14 = load i32, i32* %8
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %47
17: ; preds = %13
%18 = load i32, i32* %8
%19 = load i32, i32* %3
%20 = srem i32 %18, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %25
25: ; preds = %22, %17
%26 = load i32, i32* %8
%27 = load i32, i32* %4
%28 = srem i32 %26, %27
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %25
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %33
33: ; preds = %30, %25
%34 = load i32, i32* %8
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = mul nsw i32 %35, %36
%38 = srem i32 %34, %37
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %33
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %43
43: ; preds = %40, %33
br label %44
44: ; preds = %43
%45 = load i32, i32* %8
%46 = add nsw i32 %45, 1
store i32 %46, i32* %8
br label %13
47: ; preds = %13
%48 = load i32, i32* %5
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %48)
%50 = load i32, i32* %6
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %7
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i32 %52)
%54 = load i32, i32* %1
ret i32 %54
}

LLVM IR (-O2):
@.str = [22 x i8] c"Digite o valor de N: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"Digite o valor de I e J: \00"
@.str.3 = [6 x i8] c"%d %d\00"
@.str.4 = [27 x i8] c"\0AMultiplos apenas de I: %d\00"
@.str.5 = [27 x i8] c"\0AMultiplos apenas de J: %d\00"
@.str.6 = [31 x i8] c"\0AMultiplos apenas de ambos: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %2, i32* %3)
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %17
13: ; preds = %0
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = mul nsw i32 %15, %14
br label %24
17: ; preds = %24, %0
%18 = phi i32 [ 0, %0 ], [ %32, %24 ]
%19 = phi i32 [ 0, %0 ], [ %36, %24 ]
%20 = phi i32 [ 0, %0 ], [ %40, %24 ]
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %19)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i32 %20)
ret i32 0
24: ; preds = %13, %24
%25 = phi i32 [ 1, %13 ], [ %41, %24 ]
%26 = phi i32 [ 0, %13 ], [ %40, %24 ]
%27 = phi i32 [ 0, %13 ], [ %36, %24 ]
%28 = phi i32 [ 0, %13 ], [ %32, %24 ]
%29 = srem i32 %25, %14
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
%32 = add nuw nsw i32 %28, %31
%33 = srem i32 %25, %15
%34 = icmp eq i32 %33, 0
%35 = zext i1 %34 to i32
%36 = add nuw nsw i32 %27, %35
%37 = srem i32 %25, %16
%38 = icmp eq i32 %37, 0
%39 = zext i1 %38 to i32
%40 = add nuw nsw i32 %26, %39
%41 = add nuw nsw i32 %25, 1
%42 = icmp eq i32 %41, %11
br i1 %42, label %17, label %24
}