#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__ isAnagram(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  char str1[] = "test";
  char str2[] = "ttes";
  if (isAnagram(str1, str2)) {
    printf("Both the strings are anagram of each other\n");
  } else {
    printf("Not an anagram \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    0xec4(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x11(%rbp)
mov    0xeb7(%rip),%eax
mov    %eax,-0x1a(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0x16(%rbp)
lea    -0x15(%rbp),%rdi
lea    -0x1a(%rbp),%rsi
call   1040 <isAnagram@plt>
cmp    $0x0,%rax
je     1182 <main+0x62>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    118e <main+0x6e>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movb   $0x0,0x14(%rsp)
movl   $0x74736574,0x10(%rsp)
74
movb   $0x0,0xc(%rsp)
movl   $0x73657474,0x8(%rsp)
73
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <isAnagram@plt>
test   %rax,%rax
lea    0xeb3(%rip),%rax
lea    0xebc(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str1 = [5 x i8] c"test\00"
@__const.main.str2 = [5 x i8] c"ttes\00"
@.str = [44 x i8] c"Both the strings are anagram of each other\0A\00"
@.str.1 = [17 x i8] c"Not an anagram \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i8]
%7 = alloca [5 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [5 x i8]* %6 to i8*
%9 = bitcast [5 x i8]* %7 to i8*
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%12 = call i64 @isAnagram(i8* %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [5 x i8] c"test\00"
@__const.main.str2 = [5 x i8] c"ttes\00"
@str = [16 x i8] c"Not an anagram \00"
@str.2 = [43 x i8] c"Both the strings are anagram of each other\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i8]
%4 = alloca [5 x i8]
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%7 = call i64 @isAnagram(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @str.2, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}