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


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

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
xor    %ebp,%ebp
jmp    113e <main+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    $0x7531,%ebp
je     118d <main+0x7d>
test   $0x1,%bpl
je     1130 <main+0x20>
movzwl %bp,%eax
imul   $0xaaab,%eax,%ecx
shr    $0x11,%ecx
lea    (%rcx,%rcx,2),%ecx
add    %ebx,%ecx
test   %cx,%cx
jne    1130 <main+0x20>
imul   $0x2493,%eax,%eax
shr    $0x10,%eax
mov    %ebp,%ecx
sub    %eax,%ecx
movzwl %cx,%ecx
shr    %ecx
add    %eax,%ecx
shr    $0x2,%ecx
lea    0x0(,%rcx,8),%eax
sub    %ecx,%eax
add    %ebx,%eax
test   %ax,%ax
jne    1130 <main+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %14, %0
%2 = phi i32 [ 0, %0 ], [ %15, %14 ]
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
%5 = trunc i32 %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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %14
14: ; preds = %12, %1
%15 = add nuw nsw i32 %2, 1
%16 = icmp eq i32 %15, 30001
br i1 %16, label %17, label %1
17: ; preds = %14
ret i32 0
}