#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() {
  long int number;
  for (number = 0; number < 30000; number++) {
    if (number % 2 != 0) {
      if (number % 3 == 0 && number % 7 == 0) {
        printf("%ld\n", number);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x7530,-0x10(%rbp)
jge    11a8 <main+0x98>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     1192 <main+0x82>
mov    -0x10(%rbp),%rax
mov    $0x3,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    118d <main+0x7d>
mov    -0x10(%rbp),%rax
mov    $0x7,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    118d <main+0x7d>
mov    -0x10(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
jmp    1192 <main+0x82>
jmp    1197 <main+0x87>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <main+0x17>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
jmp    112d <main+0x1d>
nop
add    $0x1,%rbx
cmp    $0x7530,%rbx
je     117e <main+0x6e>
test   $0x1,%bl
je     1120 <main+0x10>
movzwl %bx,%eax
imul   $0xaaab,%eax,%ecx
shr    $0x11,%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %ebx,%edx
sub    %ecx,%edx
test   %dx,%dx
jne    1120 <main+0x10>
imul   $0x2493,%eax,%eax
shr    $0x10,%eax
mov    %ebx,%ecx
sub    %eax,%ecx
movzwl %cx,%ecx
shr    %ecx
add    %eax,%ecx
shr    $0x2,%ecx
lea    0x0(,%rcx,8),%eax
sub    %eax,%ecx
add    %ebx,%ecx
test   %cx,%cx
jne    1120 <main+0x10>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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