#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 EOF;
int /*<<< orphan*/ free(int *);
char getchar();
int *malloc(int);
int /*<<< orphan*/ printf(char *);
int gameofthrones(void) {
  char input;
  int index;
  int *charCounts = malloc(sizeof(int) * 26);
  int sum = 0;
  for (int i = 0; i < 26; i++) {
    charCounts[i] = 0;
  }
  input = getchar();
  while (input != '\0' && input != '\n' && input != EOF) {
    index = input - 'a';
    charCounts[index] = 1 - charCounts[index];
    input = getchar();
  }
  for (int i = 0; i < 26; i++) {
    sum += charCounts[i];
  }
  if (sum > 1) {
    printf("NO");
  } else {
    printf("YES");
  }
  free(charCounts);
  return 0;
}


x86 assembly (clang, -O0):
<gameofthrones>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x68,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x1a,-0x18(%rbp)
jge    118b <gameofthrones+0x4b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1164 <gameofthrones+0x24>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1d(%rbp)
je     11cf <gameofthrones+0x8f>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x1d(%rbp)
je     11cf <gameofthrones+0x8f>
movsbl -0x1(%rbp),%eax
mov    0x2e24(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    11df <gameofthrones+0x9f>
jmp    1213 <gameofthrones+0xd3>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    $0x1,%edx
sub    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x1(%rbp)
jmp    1195 <gameofthrones+0x55>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1a,-0x1c(%rbp)
jge    1243 <gameofthrones+0x103>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    121a <gameofthrones+0xda>
cmpl   $0x1,-0x14(%rbp)
jle    125e <gameofthrones+0x11e>
lea    0xdac(%rip),%rdi
call   1040 <printf@plt>
jmp    126a <gameofthrones+0x12a>
lea    0xd9e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gameofthrones>:
push   %r14
push   %rbx
push   %rax
mov    $0x68,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
xorps  %xmm0,%xmm0
movups %xmm0,(%rax)
movups %xmm0,0x10(%rax)
movups %xmm0,0x20(%rax)
movups %xmm0,0x30(%rax)
movups %xmm0,0x40(%rax)
movups %xmm0,0x50(%rax)
movq   $0x0,0x60(%rax)
mov    0x2e6e(%rip),%r14
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
test   %al,%al
je     11ad <gameofthrones+0x6d>
cmp    $0xa,%al
je     11ad <gameofthrones+0x6d>
cmp    (%r14),%al
je     11ad <gameofthrones+0x6d>
movsbq %al,%rax
mov    $0x1,%ecx
sub    -0x184(%rbx,%rax,4),%ecx
mov    %ecx,-0x184(%rbx,%rax,4)
jmp    1180 <gameofthrones+0x40>
movdqu 0x48(%rbx),%xmm0
movdqu 0x58(%rbx),%xmm1
movdqu 0x8(%rbx),%xmm2
movdqu 0x18(%rbx),%xmm3
paddd  %xmm2,%xmm3
movdqu 0x28(%rbx),%xmm2
paddd  %xmm0,%xmm2
movdqu 0x38(%rbx),%xmm0
paddd  %xmm1,%xmm0
paddd  %xmm2,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
pshufd $0xee,%xmm3,%xmm0
paddd  %xmm3,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%ecx
add    %eax,%ecx
add    0x4(%rbx),%ecx
add    (%rbx),%ecx
cmp    $0x2,%ecx
lea    0xde8(%rip),%rax
lea    0xde4(%rip),%rdi
cmovge %rax,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [3 x i8] c"NO\00"
@.str.1 = [4 x i8] c"YES\00"
define i32 @gameofthrones() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = call i32* @malloc(i32 104)
store i32* %7, i32** %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %16, %0
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 26
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 0, i32* %15
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %8
19: ; preds = %8
%20 = call signext i8 (...) @getchar()
store i8 %20, i8* %1
br label %21
21: ; preds = %37, %19
%22 = load i8, i8* %1
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %35
25: ; preds = %21
%26 = load i8, i8* %1
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 10
br i1 %28, label %29, label %35
29: ; preds = %25
%30 = load i8, i8* %1
%31 = sext i8 %30 to i32
%32 = load i8, i8* @EOF
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %31, %33
br label %35
35: ; preds = %29, %25, %21
%36 = phi i1 [ false, %25 ], [ false, %21 ], [ %34, %29 ]
br i1 %36, label %37, label %52
37: ; preds = %35
%38 = load i8, i8* %1
%39 = sext i8 %38 to i32
%40 = sub nsw i32 %39, 97
store i32 %40, i32* %2
%41 = load i32*, i32** %3
%42 = load i32, i32* %2
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32, i32* %41, i64 %43
%45 = load i32, i32* %44
%46 = sub nsw i32 1, %45
%47 = load i32*, i32** %3
%48 = load i32, i32* %2
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i32, i32* %47, i64 %49
store i32 %46, i32* %50
%51 = call signext i8 (...) @getchar()
store i8 %51, i8* %1
br label %21
52: ; preds = %35
store i32 0, i32* %6
br label %53
53: ; preds = %64, %52
%54 = load i32, i32* %6
%55 = icmp slt i32 %54, 26
br i1 %55, label %56, label %67
56: ; preds = %53
%57 = load i32*, i32** %3
%58 = load i32, i32* %6
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %57, i64 %59
%61 = load i32, i32* %60
%62 = load i32, i32* %4
%63 = add nsw i32 %62, %61
store i32 %63, i32* %4
br label %64
64: ; preds = %56
%65 = load i32, i32* %6
%66 = add nsw i32 %65, 1
store i32 %66, i32* %6
br label %53
67: ; preds = %53
%68 = load i32, i32* %4
%69 = icmp sgt i32 %68, 1
br i1 %69, label %70, label %72
70: ; preds = %67
%71 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %74
72: ; preds = %67
%73 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %74
74: ; preds = %72, %70
%75 = load i32*, i32** %3
%76 = call i32 @free(i32* %75)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [3 x i8] c"NO\00"
@.str.1 = [4 x i8] c"YES\00"
define i32 @gameofthrones() {
%1 = tail call i32* @malloc(i32 104)
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %9, %0
%4 = tail call signext i8 (...) @getchar()
%5 = sext i8 %4 to i64
switch i8 %4, label %6 [
i8 10, label %14
i8 0, label %14
]
6: ; preds = %3
%7 = load i8, i8* @EOF
%8 = icmp eq i8 %4, %7
br i1 %8, label %14, label %9
9: ; preds = %6
%10 = add nsw i64 %5, -97
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = sub nsw i32 1, %12
store i32 %13, i32* %11
br label %3
14: ; preds = %3, %3, %6
%15 = load i32, i32* %1
%16 = getelementptr inbounds i32, i32* %1, i64 1
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %1, i64 2
%19 = bitcast i32* %18 to <8 x i32>*
%20 = load <8 x i32>, <8 x i32>* %19
%21 = getelementptr inbounds i32, i32* %1, i64 10
%22 = bitcast i32* %21 to <16 x i32>*
%23 = load <16 x i32>, <16 x i32>* %22
%24 = call i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %23)
%25 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %20)
%26 = add nsw i32 %24, %25
%27 = add nsw i32 %26, %17
%28 = add nsw i32 %27, %15
%29 = icmp sgt i32 %28, 1
%30 = select i1 %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%31 = tail call i32 @printf(i8* dereferenceable(1) %30)
%32 = tail call i32 @free(i32* %1)
ret i32 0
}