#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*/ RemoveNonAlphabet(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sort(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ toUpper(char *);
main() {
  char s1[100], s2[100];
  char temps1[100], temps2[100];
  puts("Enter s1");
  gets(s1);
  puts("Enter s2");
  gets(s2);
  strcpy(temps1, s1);
  strcpy(temps2, s2);
  RemoveNonAlphabet(temps1);
  RemoveNonAlphabet(temps2);
  toUpper(temps1);
  toUpper(temps2);
  sort(temps1);
  printf("sorted tem %s\n", temps1);
  sort(temps2);
  printf("sorted temps2 %s\n", temps2);
  if (strcmp(temps1, temps2) == 0)
    printf("Anagram\n");
  else
    printf("Not Anagram\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe67(%rip),%rdi
call   1040 <puts@plt>
lea    -0x70(%rbp),%rdi
call   1090 <gets@plt>
lea    0xe5b(%rip),%rdi
call   1040 <puts@plt>
lea    -0xe0(%rbp),%rdi
call   1090 <gets@plt>
lea    -0x150(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x1c0(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x150(%rbp),%rdi
call   10a0 <RemoveNonAlphabet@plt>
lea    -0x1c0(%rbp),%rdi
call   10a0 <RemoveNonAlphabet@plt>
lea    -0x150(%rbp),%rdi
call   1080 <toUpper@plt>
lea    -0x1c0(%rbp),%rdi
call   1080 <toUpper@plt>
lea    -0x150(%rbp),%rdi
call   1060 <sort@plt>
lea    -0x150(%rbp),%rsi
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1c0(%rbp),%rdi
call   1060 <sort@plt>
lea    -0x1c0(%rbp),%rsi
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x150(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1284 <main+0x104>
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1292 <main+0x112>
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1c0,%rsp
lea    0xe6d(%rip),%rdi
call   1040 <puts@plt>
lea    0x150(%rsp),%rbx
mov    %rbx,%rdi
call   1090 <gets@plt>
lea    0xe5a(%rip),%rdi
call   1040 <puts@plt>
lea    0xe0(%rsp),%r15
mov    %r15,%rdi
call   1090 <gets@plt>
lea    0x70(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   10a0 <RemoveNonAlphabet@plt>
mov    %rbx,%rdi
call   10a0 <RemoveNonAlphabet@plt>
mov    %r14,%rdi
call   1080 <toUpper@plt>
mov    %rbx,%rdi
call   1080 <toUpper@plt>
mov    %r14,%rdi
call   1060 <sort@plt>
lea    0xe01(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <sort@plt>
lea    0xdf7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
lea    0xdee(%rip),%rax
lea    0xde3(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Enter s1\00"
@.str.1 = [9 x i8] c"Enter s2\00"
@.str.2 = [15 x i8] c"sorted tem %s\0A\00"
@.str.3 = [18 x i8] c"sorted temps2 %s\0A\00"
@.str.4 = [9 x i8] c"Anagram\0A\00"
@.str.5 = [13 x i8] c"Not Anagram\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
store i32 0, i32* %1
%6 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = call i32 @gets(i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%19 = call i32 @RemoveNonAlphabet(i8* %18)
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%21 = call i32 @RemoveNonAlphabet(i8* %20)
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%23 = call i32 @toUpper(i8* %22)
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%25 = call i32 @toUpper(i8* %24)
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%27 = call i32 @sort(i8* %26)
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%31 = call i32 @sort(i8* %30)
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %32)
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%36 = call i64 @strcmp(i8* %34, i8* %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %0
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %42
40: ; preds = %0
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %42
42: ; preds = %40, %38
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
@.str = [9 x i8] c"Enter s1\00"
@.str.1 = [9 x i8] c"Enter s2\00"
@.str.2 = [15 x i8] c"sorted tem %s\0A\00"
@.str.3 = [18 x i8] c"sorted temps2 %s\0A\00"
@str = [12 x i8] c"Not Anagram\00"
@str.6 = [8 x i8] c"Anagram\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @gets(i8* %5)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @gets(i8* %6)
%13 = call i32 @strcpy(i8* %7, i8* %5)
%14 = call i32 @strcpy(i8* %8, i8* %6)
%15 = call i32 @RemoveNonAlphabet(i8* %7)
%16 = call i32 @RemoveNonAlphabet(i8* %8)
%17 = call i32 @toUpper(i8* %7)
%18 = call i32 @toUpper(i8* %8)
%19 = call i32 @sort(i8* %7)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%21 = call i32 @sort(i8* %8)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%23 = call i64 @strcmp(i8* %7, i8* %8)
%24 = icmp eq i64 %23, 0
%25 = select i1 %24, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0)
%26 = call i32 @puts(i8* dereferenceable(1) %25)
ret i32 0
}