#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 *, long);
int main() {
  int fnum = 3;
  int snum = 7;
  long int num = 1;
  for (num = 1; num <= 30000; num += 2) {
    if (num % fnum == 0 && num % snum == 0) {
      printf("%li\n", num);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x7530,-0x18(%rbp)
jg     119f <main+0x8f>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1189 <main+0x79>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1189 <main+0x79>
mov    -0x18(%rbp),%rsi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
jmp    118e <main+0x7e>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
jmp    1140 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x2(%rbx),%rax
cmp    $0x752f,%rbx
mov    %rax,%rbx
jae    1187 <main+0x77>
movzwl %bx,%eax
imul   $0x2493,%eax,%ecx
shr    $0x10,%ecx
mov    %ebx,%edx
sub    %ecx,%edx
movzwl %dx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x2,%edx
lea    0x0(,%rdx,8),%ecx
sub    %ecx,%edx
imul   $0xaaab,%eax,%eax
shr    $0x11,%eax
lea    (%rax,%rax,2),%eax
mov    %ebx,%ecx
sub    %eax,%ecx
add    %ebx,%edx
or     %dx,%cx
jne    1130 <main+0x20>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%li\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %10
%2 = phi i64 [ 1, %0 ], [ %11, %10 ]
%3 = trunc i64 %2 to i16
%4 = urem i16 %3, 3
%5 = urem i16 %3, 7
%6 = or i16 %4, %5
%7 = icmp eq i16 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
br label %10
10: ; preds = %1, %8
%11 = add nuw nsw i64 %2, 2
%12 = icmp ult i64 %2, 29999
br i1 %12, label %1, label %13
13: ; preds = %10
ret i32 0
}