#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 *);
int main() {
  int n, i, j;
  int cont = 0;
  int aux = 0;
  scanf("%d %d %d", &n, &i, &j);
  while (cont < n) {
    if (aux % i == 0 || aux % j == 0) {
      printf("%d\n", aux);
      cont++;
    }
    aux++;
  }
  return 0;
}


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)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a7 <main+0x87>
mov    -0x18(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1181 <main+0x61>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1199 <main+0x79>
mov    -0x18(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1155 <main+0x35>
xor    %eax,%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
lea    0x4(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
test   %ecx,%ecx
jle    1190 <main+0x70>
xor    %ebx,%ebx
lea    0xeb5(%rip),%r14
xor    %ebp,%ebp
jmp    1178 <main+0x58>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
mov    0x4(%rsp),%ecx
add    $0x1,%ebx
cmp    %ecx,%ebp
jge    1190 <main+0x70>
mov    %ebx,%eax
cltd
idivl  0xc(%rsp)
test   %edx,%edx
je     1160 <main+0x40>
mov    %ebx,%eax
cltd
idivl  0x8(%rsp)
test   %edx,%edx
jne    1171 <main+0x51>
jmp    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [4 x i8] c"%d\0A\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 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %30
10: ; preds = %0, %25
%11 = phi i32 [ %26, %25 ], [ %8, %0 ]
%12 = phi i32 [ %28, %25 ], [ 0, %0 ]
%13 = phi i32 [ %27, %25 ], [ 0, %0 ]
%14 = load i32, i32* %2
%15 = srem i32 %12, %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %10
%18 = load i32, i32* %3
%19 = srem i32 %12, %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %17, %10
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%23 = add nsw i32 %13, 1
%24 = load i32, i32* %1
br label %25
25: ; preds = %21, %17
%26 = phi i32 [ %24, %21 ], [ %11, %17 ]
%27 = phi i32 [ %23, %21 ], [ %13, %17 ]
%28 = add nuw nsw i32 %12, 1
%29 = icmp slt i32 %27, %26
br i1 %29, label %10, label %30
30: ; preds = %25, %0
ret i32 0
}