#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*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int v, t = 0;
  while (!feof(stdin)) {
    fscanf(stdin, "%d", &v);
    t += v / 16;
    t -= t / 16;
    fprintf(stdout, "%d\n", v - t);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1170 <main+0x40>
jmp    11cf <main+0x9f>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <fscanf@plt>
mov    -0x14(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
sub    -0x18(%rbp),%edx
lea    0xe3e(%rip),%rsi
call   1040 <fprintf@plt>
jmp    114d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2ea6(%rip),%rbx
mov    (%rbx),%edi
call   1050 <feof@plt>
test   %eax,%eax
jne    11c3 <main+0x93>
xor    %ebp,%ebp
lea    0x4(%rsp),%r15
mov    0x2e7d(%rip),%r13
lea    0xea1(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx),%edi
lea    0xe87(%rip),%rsi
mov    %r15,%rdx
call   1030 <fscanf@plt>
mov    0x4(%rsp),%edx
lea    0xf(%rdx),%eax
test   %edx,%edx
cmovns %edx,%eax
sar    $0x4,%eax
lea    (%rax,%rbp,1),%ecx
add    $0xf,%ecx
mov    %eax,%r14d
add    %ebp,%r14d
cmovns %r14d,%ecx
sar    $0x4,%ecx
sub    %ecx,%r14d
mov    0x0(%r13),%edi
sub    %r14d,%edx
mov    %r12,%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <feof@plt>
mov    %r14d,%ebp
test   %eax,%eax
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @stdin
%6 = call i32 @feof(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %2, %8
%9 = phi i32 [ %16, %8 ], [ 0, %2 ]
%10 = load i32, i32* @stdin
%11 = call i32 @fscanf(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 16
%14 = add nsw i32 %13, %9
%15 = sdiv i32 %14, -16
%16 = add i32 %15, %14
%17 = load i32, i32* @stdout
%18 = sub nsw i32 %12, %16
%19 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = load i32, i32* @stdin
%21 = call i32 @feof(i32 %20)
%22 = icmp eq i32 %21, 0
br i1 %22, label %8, label %23
23: ; preds = %8, %2
ret i32 0
}