#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 main() {
  int a;
  a = 0;
  while (a < 30000) {
    a = a + 1;
    if ((a % 2 != 0) && (a % 3 == 0) && (a % 7 == 0)) {
      printf("%d \n", a);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7530,-0x8(%rbp)
jge    118c <main+0x7c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1187 <main+0x77>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1187 <main+0x77>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1187 <main+0x77>
mov    -0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
jmp    113b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x7531,%ebx
je     118b <main+0x7b>
test   $0x1,%bl
je     1130 <main+0x20>
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    1130 <main+0x20>
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    1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
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"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %23, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 30000
br i1 %5, label %6, label %24
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %6
%13 = load i32, i32* %2
%14 = srem i32 %13, 3
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i32, i32* %2
%18 = srem i32 %17, 7
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* %2
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %16, %12, %6
br label %3
24: ; preds = %3
ret i32 0
}

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