#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, sum = 0;
  for (i = 1; i <= 100; i++) {
    if (i % 2 != 0 && i % 3 != 0) {
      printf("%d \n", i);
      sum++;
    }
  }
  printf("Total: %d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     118a <main+0x7a>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1177 <main+0x67>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1177 <main+0x67>
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117c <main+0x6c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebp
xor    %ebx,%ebx
lea    0xede(%rip),%r14
jmp    1138 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebp
cmp    $0x65,%ebp
je     1165 <main+0x55>
test   $0x1,%bpl
je     1130 <main+0x20>
movzbl %bpl,%eax
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%eax
mov    %ebp,%ecx
sub    %eax,%ecx
test   %cl,%cl
je     1130 <main+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1130 <main+0x20>
lea    0xe99(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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