#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 */
char getchar();
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  char mark[256], seq[100099];
  memset(mark, 0, 256);
  int i, idx = 0;
  for (i = 0; i < 10000; i++) {
    char k;
    k = getchar();
    if (k == '\n')
      break;
    mark[k]++;
    seq[idx] = k;
    idx++;
  }
  for (i = 0; i < idx; i++)
    if (mark[seq[i]] == 1) {
      printf("%c", seq[i]);
      break;
    }
  if (i == idx)
    puts("no");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x18830,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
movl   $0x0,-0x18828(%rbp)
movl   $0x0,-0x18824(%rbp)
cmpl   $0x2710,-0x18824(%rbp)
jge    1202 <main+0xc2>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x18829(%rbp)
movsbl -0x18829(%rbp),%eax
cmp    $0xa,%eax
jne    11b2 <main+0x72>
jmp    1202 <main+0xc2>
movsbq -0x18829(%rbp),%rax
ff
mov    -0x110(%rbp,%rax,1),%cl
add    $0x1,%cl
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x18829(%rbp),%cl
movslq -0x18828(%rbp),%rax
mov    %cl,-0x18820(%rbp,%rax,1)
mov    -0x18828(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18828(%rbp)
mov    -0x18824(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18824(%rbp)
jmp    1180 <main+0x40>
movl   $0x0,-0x18824(%rbp)
mov    -0x18824(%rbp),%eax
cmp    -0x18828(%rbp),%eax
jge    1278 <main+0x138>
movslq -0x18824(%rbp),%rax
movsbq -0x18820(%rbp,%rax,1),%rax
fe ff
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0x1,%eax
jne    125f <main+0x11f>
movslq -0x18824(%rbp),%rax
lea    0xdb3(%rip),%rdi
movsbl -0x18820(%rbp,%rax,1),%esi
ff
call   1040 <printf@plt>
jmp    1278 <main+0x138>
jmp    1264 <main+0x124>
mov    -0x18824(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18824(%rbp)
jmp    120c <main+0xcc>
mov    -0x18824(%rbp),%eax
cmp    -0x18828(%rbp),%eax
jne    1296 <main+0x156>
lea    0xd72(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18808,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     118e <main+0x4e>
movsbq %al,%rcx
addb   $0x1,(%rsp,%rcx,1)
mov    %al,0x100(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x2710,%rbx
jne    1160 <main+0x20>
mov    $0x2710,%ebx
jmp    1192 <main+0x52>
test   %ebx,%ebx
je     11e7 <main+0xa7>
mov    %ebx,%r14d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbq 0x100(%rsp,%rbx,1),%rax
cmpb   $0x1,(%rsp,%rax,1)
je     11ba <main+0x7a>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11a0 <main+0x60>
jmp    11ce <main+0x8e>
movsbl %al,%esi
lea    0xe3c(%rip),%rdi
call   1040 <printf@plt>
cmp    %r14d,%ebx
jne    11da <main+0x9a>
lea    0xe2e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18808,%rsp
pop    %rbx
pop    %r14
ret
xor    %r14d,%r14d
xor    %ebx,%ebx
cmp    %r14d,%ebx
je     11ce <main+0x8e>
jmp    11da <main+0x9a>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [3 x i8] c"no\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
%7 = alloca [100099 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = call i32 @memset(i8* %11, i32 0, i32 256)
store i32 0, i32* %9
store i32 0, i32* %8
br label %13
13: ; preds = %34, %2
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 10000
br i1 %15, label %16, label %37
16: ; preds = %13
%17 = call signext i8 (...) @getchar()
store i8 %17, i8* %10
%18 = load i8, i8* %10
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 10
br i1 %20, label %21, label %22
21: ; preds = %16
br label %37
22: ; preds = %16
%23 = load i8, i8* %10
%24 = sext i8 %23 to i64
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = add i8 %26, 1
store i8 %27, i8* %25
%28 = load i8, i8* %10
%29 = load i32, i32* %9
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [100099 x i8], [100099 x i8]* %7, i64 0, i64 %30
store i8 %28, i8* %31
%32 = load i32, i32* %9
%33 = add nsw i32 %32, 1
store i32 %33, i32* %9
br label %34
34: ; preds = %22
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
br label %13
37: ; preds = %21, %13
store i32 0, i32* %8
br label %38
38: ; preds = %59, %37
%39 = load i32, i32* %8
%40 = load i32, i32* %9
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %62
42: ; preds = %38
%43 = load i32, i32* %8
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [100099 x i8], [100099 x i8]* %7, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i64
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %58
52: ; preds = %42
%53 = load i32, i32* %8
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [100099 x i8], [100099 x i8]* %7, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %56)
br label %62
58: ; preds = %42
br label %59
59: ; preds = %58
%60 = load i32, i32* %8
%61 = add nsw i32 %60, 1
store i32 %61, i32* %8
br label %38
62: ; preds = %52, %38
%63 = load i32, i32* %8
%64 = load i32, i32* %9
%65 = icmp eq i32 %63, %64
br i1 %65, label %66, label %68
66: ; preds = %62
%67 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %68
68: ; preds = %66, %62
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [3 x i8] c"no\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = alloca [100099 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [100099 x i8], [100099 x i8]* %4, i64 0, i64 0
%7 = call i32 @memset(i8* %5, i32 0, i32 256)
br label %8
8: ; preds = %2, %12
%9 = phi i64 [ 0, %2 ], [ %18, %12 ]
%10 = call signext i8 (...) @getchar()
%11 = icmp eq i8 %10, 10
br i1 %11, label %20, label %12
12: ; preds = %8
%13 = sext i8 %10 to i64
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = add i8 %15, 1
store i8 %16, i8* %14
%17 = getelementptr inbounds [100099 x i8], [100099 x i8]* %4, i64 0, i64 %9
store i8 %10, i8* %17
%18 = add nuw nsw i64 %9, 1
%19 = icmp eq i64 %18, 10000
br i1 %19, label %23, label %8
20: ; preds = %8
%21 = trunc i64 %9 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %40, label %23
23: ; preds = %12, %20
%24 = phi i32 [ %21, %20 ], [ 10000, %12 ]
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %23, %37
%27 = phi i64 [ 0, %23 ], [ %38, %37 ]
%28 = getelementptr inbounds [100099 x i8], [100099 x i8]* %4, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i64
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 1
br i1 %33, label %34, label %37
34: ; preds = %26
%35 = trunc i64 %27 to i32
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %29)
br label %40
37: ; preds = %26
%38 = add nuw nsw i64 %27, 1
%39 = icmp eq i64 %38, %25
br i1 %39, label %44, label %26
40: ; preds = %20, %34
%41 = phi i32 [ %24, %34 ], [ 0, %20 ]
%42 = phi i32 [ %35, %34 ], [ 0, %20 ]
%43 = icmp eq i32 %42, %41
br i1 %43, label %44, label %46
44: ; preds = %37, %40
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %46
46: ; preds = %44, %40
ret i32 0
}