#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 argc, const char *argv[]) {
  const long int VALEUR_LIMITE = 4000000;
  int x = 0;
  int y = 1;
  int z;
  int Somme = 0;
  do {
    z = x + y;
    x = y;
    y = z;
    if (y % 2 == 0)
      Somme += y;
  } while (y <= VALEUR_LIMITE);
  printf("La réponse de la somme des nombres pairs n'excédant pas 4000000 de "
         "la suite de fibonacci est %d",
         Somme);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x3d0900,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1175 <main+0x65>
mov    -0x20(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    117a <main+0x6a>
movslq -0x20(%rbp),%rax
cmp    $0x3d0900,%rax
jle    1143 <main+0x33>
mov    -0x28(%rbp),%esi
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [98 x i8] c"La r\C3\A9ponse de la somme des nombres pairs n'exc\C3\A9dant pas 4000000 de la suite de fibonacci est %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 4000000, i64* %6
store i32 0, i32* %7
store i32 1, i32* %8
store i32 0, i32* %10
br label %11
11: ; preds = %25, %2
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = add nsw i32 %12, %13
store i32 %14, i32* %9
%15 = load i32, i32* %8
store i32 %15, i32* %7
%16 = load i32, i32* %9
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = srem i32 %17, 2
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %11
%21 = load i32, i32* %8
%22 = load i32, i32* %10
%23 = add nsw i32 %22, %21
store i32 %23, i32* %10
br label %24
24: ; preds = %20, %11
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = icmp sle i64 %27, 4000000
br i1 %28, label %11, label %29
29: ; preds = %25
%30 = load i32, i32* %10
%31 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i32 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [98 x i8] c"La r\C3\A9ponse de la somme des nombres pairs n'exc\C3\A9dant pas 4000000 de la suite de fibonacci est %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 1, %2 ], [ %7, %3 ]
%5 = phi i32 [ 0, %2 ], [ %4, %3 ]
%6 = phi i32 [ 0, %2 ], [ %11, %3 ]
%7 = add nsw i32 %5, %4
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 %7, i32 0
%11 = add nsw i32 %10, %6
%12 = icmp slt i32 %7, 4000001
br i1 %12, label %3, label %13
13: ; preds = %3
%14 = tail call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}