#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 t = 0;
  int i = 0;
  int total = 0;
  for (i = 0; i < 4; i++) {
    scanf("%d", &t);
    if (t >= 2 && t <= 6) {
      total = total + t;
    } else {
      return 0;
    }
  }
  total = total - 3;
  printf("%d", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11a6 <main+0x86>
lea    0xea4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2,-0x8(%rbp)
jl     1187 <main+0x67>
cmpl   $0x6,-0x8(%rbp)
jg     1187 <main+0x67>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1193 <main+0x73>
movl   $0x0,-0x4(%rbp)
jmp    11c5 <main+0xa5>
jmp    1198 <main+0x78>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <main+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xec8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
lea    -0x2(%rbx),%eax
cmp    $0x4,%eax
ja     11c2 <main+0xa2>
lea    0xeab(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%r14d
lea    -0x2(%r14),%eax
cmp    $0x4,%eax
ja     11c2 <main+0xa2>
lea    0xe8c(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%r15d
lea    -0x2(%r15),%eax
cmp    $0x4,%eax
ja     11c2 <main+0xa2>
lea    0xe6d(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x2(%rax),%ecx
cmp    $0x4,%ecx
ja     11c2 <main+0xa2>
add    %ebx,%r14d
add    %r14d,%r15d
lea    (%rax,%r15,1),%esi
add    $0xfffffffd,%esi
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\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* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = icmp sge i32 %10, 2
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i32, i32* %2
%14 = icmp sle i32 %13, 6
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %4
%17 = load i32, i32* %2
%18 = add nsw i32 %16, %17
store i32 %18, i32* %4
br label %20
19: ; preds = %12, %8
store i32 0, i32* %1
br label %29
20: ; preds = %15
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %5
24: ; preds = %5
%25 = load i32, i32* %4
%26 = sub nsw i32 %25, 3
store i32 %26, i32* %4
%27 = load i32, i32* %4
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %27)
store i32 0, i32* %1
br label %29
29: ; preds = %24, %19
%30 = load i32, i32* %1
ret i32 %30
}

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