#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 isAnagram(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char s1[] = "anagram";
  char t1[] = "nagaram";
  char s2[] = "rat";
  char t2[] = "car";
  printf("%d\n", isAnagram(s1, t1));
  printf("%d\n", isAnagram(s2, t2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xec0(%rip),%eax
mov    %eax,-0x1c(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <isAnagram@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
lea    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <isAnagram@plt>
mov    %eax,%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x6d61726167616e,%rax
lea    0x5fa0cf3(%rax),%rcx
mov    %rcx,0x18(%rsp)
mov    %rax,0x10(%rsp)
movl   $0x746172,0xc(%rsp)
movl   $0x726163,0x8(%rsp)
lea    0x18(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <isAnagram@plt>
lea    0xe9a(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <isAnagram@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [8 x i8] c"anagram\00"
@__const.main.t1 = [8 x i8] c"nagaram\00"
@__const.main.s2 = [4 x i8] c"rat\00"
@__const.main.t2 = [4 x i8] c"car\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = alloca [8 x i8]
%4 = alloca [4 x i8]
%5 = alloca [4 x i8]
store i32 0, i32* %1
%6 = bitcast [8 x i8]* %2 to i8*
%7 = bitcast [8 x i8]* %3 to i8*
%8 = bitcast [4 x i8]* %4 to i8*
%9 = bitcast [4 x i8]* %5 to i8*
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%12 = call i32 @isAnagram(i8* %10, i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%16 = call i32 @isAnagram(i8* %14, i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i64* %1 to i8*
store i64 30787916450066017, i64* %1
%6 = bitcast i64* %2 to i8*
store i64 30787916349792622, i64* %2
%7 = bitcast i32* %3 to i8*
store i32 7627122, i32* %3
%8 = bitcast i32* %4 to i8*
store i32 7496035, i32* %4
%9 = call i32 @isAnagram(i8* %5, i8* %6)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @isAnagram(i8* %7, i8* %8)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}