#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 */
scalar_t__ check(int);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int n;
  freopen("input.txt", "r", stdin);
  while (scanf("%d", &n), n) {
    if (check(n)) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}


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)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
lea    0xe9a(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1040 <freopen@plt>
lea    0xe93(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
je     11c0 <main+0x80>
mov    -0x14(%rbp),%edi
call   1060 <check@plt>
cmp    $0x0,%rax
je     11af <main+0x6f>
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <main+0x7b>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <main+0x32>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
lea    0xea8(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1040 <freopen@plt>
lea    0xea1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
je     11c7 <main+0x87>
lea    0xe8b(%rip),%r15
lea    0xe87(%rip),%r12
lea    0xe7a(%rip),%r14
lea    0x4(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
call   1060 <check@plt>
test   %rax,%rax
mov    %r12,%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
jne    11a0 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [3 x i8] c"%d\00"
@str = [3 x i8] c"No\00"
@str.5 = [4 x i8] c"Yes\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 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %19, label %10
10: ; preds = %2, %10
%11 = phi i32 [ %17, %10 ], [ %8, %2 ]
%12 = call i64 @check(i32 %11)
%13 = icmp eq i64 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.5, i64 0, i64 0)
%15 = call i32 @puts(i8* dereferenceable(1) %14)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %10
19: ; preds = %10, %2
ret i32 0
}