#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 *, unsigned int);
int main(void) {
  unsigned int zx1 = 1, zx2 = 1, zx3 = 2, zsum = 0;
  while (zx3 < 4000000) {
    zx3 = zx1 + zx2;
    zsum += zx3 * !(zx3 % 2);
    zx1 = zx2;
    zx2 = zx3;
  }
  printf("%u\n", zsum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3d0900,-0x10(%rbp)
jae    1183 <main+0x73>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
and    $0x1,%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
imul   %ecx,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113b <main+0x2b>
mov    -0x14(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%ecx
xor    %esi,%esi
mov    $0x1,%eax
nopl   0x0(%rax)
mov    %ecx,%edx
add    %ecx,%eax
mov    %eax,%ecx
not    %ecx
and    $0x1,%ecx
imul   %eax,%ecx
add    %ecx,%esi
mov    %eax,%ecx
cmp    $0x3d0900,%eax
mov    %edx,%eax
jb     1120 <main+0x10>
push   %rax
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = phi i32 [ 1, %0 ], [ %5, %1 ]
%4 = phi i32 [ 1, %0 ], [ %3, %1 ]
%5 = add i32 %3, %4
%6 = and i32 %5, 1
%7 = xor i32 %6, 1
%8 = mul nuw i32 %7, %5
%9 = add i32 %8, %2
%10 = icmp ult i32 %5, 4000000
br i1 %10, label %1, label %11
11: ; preds = %1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}