#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 odd = 0, div1 = 0, div2 = 0;
  for (odd = 1, div1 = 3, div2 = 7; odd < 30000; odd += 2) {
    if (odd % div1 == 0 && odd % div2 == 0) {
      printf("%d\n", odd);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x7,-0x10(%rbp)
cmpl   $0x7530,-0x8(%rbp)
jge    1198 <main+0x88>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1185 <main+0x75>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1185 <main+0x75>
mov    -0x8(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
jmp    118a <main+0x7a>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <main+0x39>
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    113d <main+0x2d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x2(%rbx),%eax
cmp    $0x752e,%ebx
mov    %eax,%ebx
jae    1183 <main+0x73>
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    %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 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 1, i32* %2
store i32 3, i32* %3
store i32 7, i32* %4
br label %5
5: ; preds = %22, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 30000
br i1 %7, label %8, label %25
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = srem i32 %9, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %8
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32, i32* %2
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18, %13, %8
br label %22
22: ; preds = %21
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 2
store i32 %24, i32* %2
br label %5
25: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %10
%2 = phi i32 [ 1, %0 ], [ %11, %10 ]
%3 = trunc i32 %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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %10
10: ; preds = %1, %8
%11 = add nuw nsw i32 %2, 2
%12 = icmp ult i32 %2, 29998
br i1 %12, label %1, label %13
13: ; preds = %10
ret i32 0
}