#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int fscanf(int /*<<< orphan*/ *, char *, char *, char *);
int /*<<< orphan*/ *stderr;
int strlen(char *);
int tolower(char);
int main() {
  FILE *in, *out;
  char s1[101];
  char s2[101];
  int x[26];
  int i, len, ok;
  in = fopen("input.txt", "r");
  out = fopen("output.txt", "w");
  if (in == NULL || out == NULL) {
    fprintf(stderr, "Errore apertura files.\n");
    exit(1);
  }
  if (fscanf(in, "%s %s", s1, s2) != 2) {
    fprintf(stderr, "Errore lettura parole.\n");
    exit(2);
  }
  for (i = 0; i < 26; i++)
    x[i] = 0;
  ok = 0;
  len = strlen(s1);
  if (len == strlen(s2)) {
    for (i = 0; i < len; i++) {
      x[tolower(s1[i]) - (int)'a']++;
      x[tolower(s2[i]) - (int)'a']--;
    }
    i = 0;
    ok = 1;
    while (i < 26 && ok) {
      if (x[i] != 0)
        ok = 0;
      i++;
    }
  }
  if (ok)
    fprintf(out, "SI");
  else
    fprintf(out, "NO");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
lea    0xe8a(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe7c(%rip),%rdi
lea    0xe80(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11b6 <main+0x56>
cmpq   $0x0,-0x18(%rbp)
jne    11d6 <main+0x76>
mov    0x2e23(%rip),%rax
mov    (%rax),%rdi
lea    0xe52(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    -0xf0(%rbp),%rcx
lea    0xe45(%rip),%rsi
call   1040 <fscanf@plt>
cmp    $0x2,%eax
je     121a <main+0xba>
mov    0x2ddf(%rip),%rax
mov    (%rax),%rdi
lea    0xe2c(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x2,%edi
call   1080 <exit@plt>
movl   $0x0,-0x164(%rbp)
cmpl   $0x1a,-0x164(%rbp)
jge    1257 <main+0xf7>
movslq -0x164(%rbp),%rax
movl   $0x0,-0x160(%rbp,%rax,4)
mov    -0x164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164(%rbp)
jmp    1224 <main+0xc4>
movl   $0x0,-0x16c(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x168(%rbp)
mov    -0x168(%rbp),%eax
mov    %eax,-0x170(%rbp)
lea    -0xf0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x170(%rbp),%eax
cmp    %ecx,%eax
jne    139d <main+0x23d>
movl   $0x0,-0x164(%rbp)
mov    -0x164(%rbp),%eax
cmp    -0x168(%rbp),%eax
jge    1319 <main+0x1b9>
movslq -0x164(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%edi
call   1060 <tolower@plt>
sub    $0x61,%eax
cltq
mov    -0x160(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x160(%rbp,%rax,4)
movslq -0x164(%rbp),%rax
movsbl -0xf0(%rbp,%rax,1),%edi
ff
call   1060 <tolower@plt>
sub    $0x61,%eax
cltq
mov    -0x160(%rbp,%rax,4),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x160(%rbp,%rax,4)
mov    -0x164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164(%rbp)
jmp    12a2 <main+0x142>
movl   $0x0,-0x164(%rbp)
movl   $0x1,-0x16c(%rbp)
xor    %eax,%eax
cmpl   $0x1a,-0x164(%rbp)
mov    %al,-0x171(%rbp)
jge    1352 <main+0x1f2>
cmpl   $0x0,-0x16c(%rbp)
setne  %al
mov    %al,-0x171(%rbp)
mov    -0x171(%rbp),%al
test   $0x1,%al
jne    1365 <main+0x205>
jmp    1398 <main+0x238>
movslq -0x164(%rbp),%rax
cmpl   $0x0,-0x160(%rbp,%rax,4)
je     1384 <main+0x224>
movl   $0x0,-0x16c(%rbp)
mov    -0x164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164(%rbp)
jmp    132d <main+0x1cd>
jmp    139d <main+0x23d>
cmpl   $0x0,-0x16c(%rbp)
je     13bf <main+0x25f>
mov    -0x18(%rbp),%rdi
lea    0xc9a(%rip),%rsi
call   1050 <fprintf@plt>
jmp    13cf <main+0x26f>
mov    -0x18(%rbp),%rdi
lea    0xc88(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x150,%rsp
lea    0xe8d(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xe83(%rip),%rdi
lea    0xe87(%rip),%rsi
call   1060 <fopen@plt>
test   %rbx,%rbx
je     12a6 <main+0x146>
mov    %rax,%r14
test   %rax,%rax
je     12a6 <main+0x146>
lea    0xe80(%rip),%rsi
lea    0xe0(%rsp),%rdx
lea    0x70(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <fscanf@plt>
cmp    $0x2,%eax
jne    12d0 <main+0x170>
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x60(%rsp)
lea    0xe0(%rsp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ebx
lea    0x70(%rsp),%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebx
jne    1275 <main+0x115>
test   %ebx,%ebx
jle    1254 <main+0xf4>
mov    %ebx,%r15d
xor    %ebx,%ebx
xchg   %ax,%ax
movsbl 0xe0(%rsp,%rbx,1),%edi
call   1050 <tolower@plt>
cltq
addl   $0x1,-0x184(%rsp,%rax,4)
01
movsbl 0x70(%rsp,%rbx,1),%edi
call   1050 <tolower@plt>
cltq
addl   $0xffffffff,-0x184(%rsp,%rax,4)
ff
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1220 <main+0xc0>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
mov    (%rsp,%rax,4),%ecx
cmp    $0x18,%rax
ja     1271 <main+0x111>
add    $0x1,%rax
test   %ecx,%ecx
je     1260 <main+0x100>
test   %ecx,%ecx
je     129d <main+0x13d>
lea    0xdd6(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xdab(%rip),%rdi
jmp    127c <main+0x11c>
mov    0x2d33(%rip),%rax
mov    (%rax),%rcx
lea    0xd62(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
call   1080 <fwrite@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    0x2d09(%rip),%rax
mov    (%rax),%rcx
lea    0xd56(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
call   1080 <fwrite@plt>
mov    $0x2,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"output.txt\00"
@.str.3 = [2 x i8] c"w\00"
@stderr = global i32* null
@.str.4 = [24 x i8] c"Errore apertura files.\0A\00"
@.str.5 = [6 x i8] c"%s %s\00"
@.str.6 = [24 x i8] c"Errore lettura parole.\0A\00"
@.str.7 = [3 x i8] c"SI\00"
@.str.8 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [101 x i8]
%5 = alloca [101 x i8]
%6 = alloca [26 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32* @fopen(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))
store i32* %10, i32** %2
%11 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %11, i32** %3
%12 = load i32*, i32** %2
%13 = icmp eq i32* %12, null
br i1 %13, label %17, label %14
14: ; preds = %0
%15 = load i32*, i32** %3
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %21
17: ; preds = %14, %0
%18 = load i32*, i32** @stderr
%19 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %14
%22 = load i32*, i32** %2
%23 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%24 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 0
%25 = call i32 @fscanf(i32* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %23, i8* %24)
%26 = icmp ne i32 %25, 2
br i1 %26, label %27, label %31
27: ; preds = %21
%28 = load i32*, i32** @stderr
%29 = call i32 @fprintf(i32* %28, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%30 = call i32 @exit(i32 2)
unreachable
31: ; preds = %21
store i32 0, i32* %7
br label %32
32: ; preds = %39, %31
%33 = load i32, i32* %7
%34 = icmp slt i32 %33, 26
br i1 %34, label %35, label %42
35: ; preds = %32
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [26 x i32], [26 x i32]* %6, i64 0, i64 %37
store i32 0, i32* %38
br label %39
39: ; preds = %35
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
br label %32
42: ; preds = %32
store i32 0, i32* %9
%43 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%44 = call i32 @strlen(i8* %43)
store i32 %44, i32* %8
%45 = load i32, i32* %8
%46 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 0
%47 = call i32 @strlen(i8* %46)
%48 = icmp eq i32 %45, %47
br i1 %48, label %49, label %98
49: ; preds = %42
store i32 0, i32* %7
br label %50
50: ; preds = %75, %49
%51 = load i32, i32* %7
%52 = load i32, i32* %8
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %78
54: ; preds = %50
%55 = load i32, i32* %7
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 %56
%58 = load i8, i8* %57
%59 = call i32 @tolower(i8 signext %58)
%60 = sub nsw i32 %59, 97
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [26 x i32], [26 x i32]* %6, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = add nsw i32 %63, 1
store i32 %64, i32* %62
%65 = load i32, i32* %7
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = call i32 @tolower(i8 signext %68)
%70 = sub nsw i32 %69, 97
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [26 x i32], [26 x i32]* %6, i64 0, i64 %71
%73 = load i32, i32* %72
%74 = add nsw i32 %73, -1
store i32 %74, i32* %72
br label %75
75: ; preds = %54
%76 = load i32, i32* %7
%77 = add nsw i32 %76, 1
store i32 %77, i32* %7
br label %50
78: ; preds = %50
store i32 0, i32* %7
store i32 1, i32* %9
br label %79
79: ; preds = %94, %78
%80 = load i32, i32* %7
%81 = icmp slt i32 %80, 26
br i1 %81, label %82, label %85
82: ; preds = %79
%83 = load i32, i32* %9
%84 = icmp ne i32 %83, 0
br label %85
85: ; preds = %82, %79
%86 = phi i1 [ false, %79 ], [ %84, %82 ]
br i1 %86, label %87, label %97
87: ; preds = %85
%88 = load i32, i32* %7
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [26 x i32], [26 x i32]* %6, i64 0, i64 %89
%91 = load i32, i32* %90
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %94
93: ; preds = %87
store i32 0, i32* %9
br label %94
94: ; preds = %93, %87
%95 = load i32, i32* %7
%96 = add nsw i32 %95, 1
store i32 %96, i32* %7
br label %79
97: ; preds = %85
br label %98
98: ; preds = %97, %42
%99 = load i32, i32* %9
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %104
101: ; preds = %98
%102 = load i32*, i32** %3
%103 = call i32 @fprintf(i32* %102, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %107
104: ; preds = %98
%105 = load i32*, i32** %3
%106 = call i32 @fprintf(i32* %105, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %107
107: ; preds = %104, %101
%108 = load i32, i32* %1
ret i32 %108
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"output.txt\00"
@.str.3 = [2 x i8] c"w\00"
@stderr = global i32* null
@.str.4 = [24 x i8] c"Errore apertura files.\0A\00"
@.str.5 = [6 x i8] c"%s %s\00"
@.str.6 = [24 x i8] c"Errore lettura parole.\0A\00"
@.str.7 = [3 x i8] c"SI\00"
@.str.8 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = alloca [101 x i8]
%3 = alloca [26 x i32]
%4 = bitcast [26 x i32]* %3 to i8*
%5 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%7 = tail call i32* @fopen(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))
%8 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%9 = icmp eq i32* %7, null
%10 = icmp eq i32* %8, null
%11 = or i1 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %0
%13 = load i32*, i32** @stderr
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i64 23, i64 1, i32* %13)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %0
%17 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %5, i8* %6)
%18 = icmp eq i32 %17, 2
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = call i32 @strlen(i8* %5)
%21 = call i32 @strlen(i8* %6)
%22 = icmp eq i32 %20, %21
br i1 %22, label %27, label %61
23: ; preds = %16
%24 = load i32*, i32** @stderr
%25 = call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i64 23, i64 1, i32* %24)
%26 = call i32 @exit(i32 2)
unreachable
27: ; preds = %19
%28 = icmp sgt i32 %20, 0
br i1 %28, label %29, label %51
29: ; preds = %27
%30 = zext i32 %20 to i64
br label %31
31: ; preds = %29, %31
%32 = phi i64 [ 0, %29 ], [ %49, %31 ]
%33 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = call i32 @tolower(i8 signext %34)
%36 = add nsw i32 %35, -97
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = add nsw i32 %39, 1
store i32 %40, i32* %38
%41 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 %32
%42 = load i8, i8* %41
%43 = call i32 @tolower(i8 signext %42)
%44 = add nsw i32 %43, -97
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = add nsw i32 %47, -1
store i32 %48, i32* %46
%49 = add nuw nsw i64 %32, 1
%50 = icmp eq i64 %49, %30
br i1 %50, label %51, label %31
51: ; preds = %31, %27
br label %52
52: ; preds = %51, %52
%53 = phi i64 [ %57, %52 ], [ 0, %51 ]
%54 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = icmp eq i32 %55, 0
%57 = add nuw nsw i64 %53, 1
%58 = icmp ult i64 %53, 25
%59 = and i1 %58, %56
br i1 %59, label %52, label %60
60: ; preds = %52
br i1 %56, label %62, label %61
61: ; preds = %19, %60
br label %62
62: ; preds = %60, %61
%63 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %61 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), %60 ]
%64 = call i64 @fwrite(i8* %63, i64 2, i64 1, i32* %8)
ret i32 0
}