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


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    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     115d <main+0x4d>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     115d <main+0x4d>
mov    -0x8(%rbp),%esi
lea    0xea8(%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>
xor    %eax,%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     1185 <main+0x75>
movzwl %bp,%eax
imul   $0xaaab,%eax,%ecx
shr    $0x11,%ecx
lea    (%rcx,%rcx,2),%ecx
add    %bx,%cx
je     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
je     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 = [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 = %17, %0
%4 = load i32, i32* %2
%5 = srem i32 %4, 3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i32, i32* %2
%9 = srem i32 %8, 7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %7, %3
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 30000
br i1 %19, label %3, label %20
20: ; preds = %17
ret i32 0
}

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