#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 in, c = 0, sum = 0;
  while (1) {
    scanf("%d", &in);
    if (in < 200 || in > 10000) {
      break;
    }
    if (!(++c % 5)) {
      printf("free %d\n", in);
    } else {
      sum += in;
    }
  }
  printf("total %d", 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,-0x10(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xc8,-0x8(%rbp)
jl     1167 <main+0x47>
cmpl   $0x2710,-0x8(%rbp)
jle    116c <main+0x4c>
jmp    11a8 <main+0x88>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    119a <main+0x7a>
mov    -0x8(%rbp),%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
jmp    11a3 <main+0x83>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x1d>
mov    -0x10(%rbp),%esi
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x2711(%rsi),%eax
xor    %r13d,%r13d
cmp    $0xffffd9b7,%eax
jae    1170 <main+0x50>
lea    0xeb2(%rip),%rdi
mov    %r13d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r13d,%r13d
mov    $0xffffffff,%ebp
mov    $0x1,%ebx
mov    $0xcccccccd,%r14d
lea    0xe85(%rip),%r15
lea    0x4(%rsp),%r12
jmp    11c8 <main+0xa8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %r13d,%esi
mov    %esi,%r13d
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x2711(%rsi),%eax
add    $0xffffffff,%ebp
add    $0x1,%ebx
cmp    $0xffffd9b6,%eax
jbe    1150 <main+0x30>
mov    %ebx,%eax
imul   %r14,%rax
shr    $0x22,%rax
lea    (%rax,%rax,4),%eax
add    %ebp,%eax
jne    11a0 <main+0x80>
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
jmp    11a6 <main+0x86>

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

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