#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*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long long, ...);
int scanf(char *, long long *);
int /*<<< orphan*/ stdin;
int main() {
  long long int c = 1;
  printf("%d\n", scanf("%lld", &c));
  printf("%lld %c\n", c, (char)c);
  while (c == 0) {
    fseek(stdin, 0, SEEK_END);
    scanf("%lld", &c);
    printf("%lld\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
lea    0xeb6(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movslq %eax,%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
movsbl %al,%edx
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
jne    11cc <main+0x9c>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
mov    0x2e4c(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
lea    0xe58(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1181 <main+0x51>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movq   $0x1,0x8(%rsp)
lea    0xeb7(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
movslq %eax,%rsi
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rsi
movsbl %sil,%edx
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpq   $0x0,0x8(%rsp)
jne    11e1 <main+0xb1>
mov    0x2e52(%rip),%r12
mov    0x2e53(%rip),%r13
lea    0xe68(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xe6a(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%r12),%edi
mov    0x0(%r13),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpq   $0x0,0x8(%rsp)
je     11b0 <main+0x80>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [9 x i8] c"%lld %c\0A\00"
@stdin = global i32 0
@SEEK_END = global i32 0
@.str.3 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%4 = sext i32 %3 to i64
%5 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = load i64, i64* %2
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i8
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %6, i32 %9)
br label %11
11: ; preds = %14, %0
%12 = load i64, i64* %2
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* @stdin
%16 = load i32, i32* @SEEK_END
%17 = call i32 @fseek(i32 %15, i32 0, i32 %16)
%18 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%19 = load i64, i64* %2
%20 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64 %19)
br label %11
21: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [9 x i8] c"%lld %c\0A\00"
@stdin = global i32 0
@SEEK_END = global i32 0
@.str.3 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 1, i64* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%4 = sext i32 %3 to i64
%5 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = load i64, i64* %1
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 24
%9 = ashr exact i32 %8, 24
%10 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %6, i32 %9)
%11 = load i64, i64* %1
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %0, %13
%14 = load i32, i32* @stdin
%15 = load i32, i32* @SEEK_END
%16 = call i32 @fseek(i32 %14, i32 0, i32 %15)
%17 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%18 = load i64, i64* %1
%19 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64 %18)
%20 = load i64, i64* %1
%21 = icmp eq i64 %20, 0
br i1 %21, label %13, label %22
22: ; preds = %13, %0
ret i32 0
}