#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 = 0; i <= 100; i++) {
    if (i % 6 == 0 && i % 4 != 0) {
      sum += i;
      printf("%d \n", i);
    }
  }
  printf("Sum= %d \n", 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   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     118a <main+0x7a>
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1177 <main+0x67>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1177 <main+0x67>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x6c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe6c(%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
xor    %ebx,%ebx
lea    0xee8(%rip),%r14
xor    %ebp,%ebp
jmp    1138 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    $0x65,%ebp
je     1167 <main+0x57>
test   $0x3,%bpl
je     1130 <main+0x20>
movzbl %bpl,%eax
imul   $0xab,%eax,%eax
shr    $0x9,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,2),%eax
mov    %ebp,%ecx
sub    %eax,%ecx
test   %cl,%cl
jne    1130 <main+0x20>
add    %ebp,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
lea    0xe92(%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"Sum= %d \0A\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 0, i32* %2
br label %4
4: ; preds = %22, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %25
7: ; preds = %4
%8 = load i32, i32* %2
%9 = srem i32 %8, 6
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32, i32* %2
%13 = srem i32 %12, 4
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = add nsw i32 %17, %16
store i32 %18, i32* %3
%19 = load i32, i32* %2
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %15, %11, %7
br label %22
22: ; preds = %21
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %4
25: ; preds = %4
%26 = load i32, i32* %3
%27 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %26)
ret i32 0
}

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