#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, b;
  a = 0;
  while (a < 30000) {
    a++;
    if (a % 3 == 0) {
      if (a % 7 == 0) {
        if (a % 2 != 0) {
          printf(" %i \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    1196 <main+0x86>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1191 <main+0x81>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118c <main+0x7c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1187 <main+0x77>
mov    -0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x7c>
jmp    1191 <main+0x81>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x7530,%ebp
mov    $0x1,%ebx
lea    0xedb(%rip),%r14
jmp    1138 <main+0x28>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
add    $0xffffffff,%ebp
je     1185 <main+0x75>
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
add    %ebx,%edx
imul   $0xaaab,%eax,%eax
shr    $0x11,%eax
lea    (%rax,%rax,2),%eax
mov    %ebx,%ecx
sub    %eax,%ecx
or     %dx,%cx
jne    1130 <main+0x20>
mov    %ebx,%eax
and    $0x1,%eax
je     1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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