#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x, i, sum;
  sum = 0;
  sum = 0;
  scanf(" %d", &x);
  while (x != 0) {
    sum = 0;
    i = 1;
    while (i <= 5) {
      if (x % 2 != 0)
        x++;
      else {
        sum += x;
        x += 2;
        i++;
      }
    }
    printf("%d\n", sum);
    scanf(" %d", &x);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     11d5 <main+0xb5>
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jg     11b1 <main+0x91>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1191 <main+0x71>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ac <main+0x8c>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <main+0x45>
mov    -0x10(%rbp),%esi
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
lea    0xe39(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     11b1 <main+0x91>
mov    $0x1,%ecx
xor    %esi,%esi
lea    0xeb4(%rip),%r14
lea    0xea9(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
test   $0x1,%al
jne    1180 <main+0x60>
add    %eax,%esi
add    $0x2,%eax
mov    %eax,0xc(%rsp)
add    $0x1,%ecx
cmp    $0x6,%ecx
jl     1160 <main+0x40>
jmp    118c <main+0x6c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
mov    %eax,0xc(%rsp)
cmp    $0x6,%ecx
jl     1160 <main+0x40>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    $0x0,%esi
mov    $0x1,%ecx
test   %eax,%eax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %32, label %6
6: ; preds = %0, %23
%7 = phi i32 [ %24, %23 ], [ 0, %0 ]
%8 = phi i32 [ %25, %23 ], [ 1, %0 ]
%9 = phi i32 [ %26, %23 ], [ %4, %0 ]
%10 = and i32 %9, 1
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %6
%13 = add nsw i32 %9, 1
store i32 %13, i32* %1
br label %18
14: ; preds = %6
%15 = add nsw i32 %9, %7
%16 = add nsw i32 %9, 2
store i32 %16, i32* %1
%17 = add nsw i32 %8, 1
br label %18
18: ; preds = %14, %12
%19 = phi i32 [ %13, %12 ], [ %16, %14 ]
%20 = phi i32 [ %8, %12 ], [ %17, %14 ]
%21 = phi i32 [ %7, %12 ], [ %15, %14 ]
%22 = icmp slt i32 %20, 6
br i1 %22, label %23, label %27
23: ; preds = %18, %27
%24 = phi i32 [ %21, %18 ], [ 0, %27 ]
%25 = phi i32 [ %20, %18 ], [ 1, %27 ]
%26 = phi i32 [ %19, %18 ], [ %30, %27 ]
br label %6
27: ; preds = %18
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%29 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%30 = load i32, i32* %1
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %23
32: ; preds = %27, %0
ret i32 0
}