#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__ areAnagrams(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readln(char *);
int main() {
  char input[2][1024];
  readln(input[0]);
  readln(input[1]);
  if (areAnagrams(input[0], input[1]))
    printf("String are anagrams\n");
  else
    printf("Strings are not anagrams\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x810(%rbp),%rdi
call   1040 <readln@plt>
lea    -0x810(%rbp),%rdi
add    $0x400,%rdi
call   1040 <readln@plt>
lea    -0x810(%rbp),%rdi
lea    -0x810(%rbp),%rsi
add    $0x400,%rsi
call   1050 <areAnagrams@plt>
cmp    $0x0,%rax
je     1196 <main+0x66>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <main+0x72>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <readln@plt>
lea    0x400(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <readln@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <areAnagrams@plt>
test   %rax,%rax
lea    0xe96(%rip),%rax
lea    0xea8(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"String are anagrams\0A\00"
@.str.1 = [26 x i8] c"Strings are not anagrams\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [1024 x i8]]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x [1024 x i8]], [2 x [1024 x i8]]* %2, i64 0, i64 0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @readln(i8* %4)
%6 = getelementptr inbounds [2 x [1024 x i8]], [2 x [1024 x i8]]* %2, i64 0, i64 1
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%8 = call i32 @readln(i8* %7)
%9 = getelementptr inbounds [2 x [1024 x i8]], [2 x [1024 x i8]]* %2, i64 0, i64 0
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%11 = getelementptr inbounds [2 x [1024 x i8]], [2 x [1024 x i8]]* %2, i64 0, i64 1
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%13 = call i64 @areAnagrams(i8* %10, i8* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %19
17: ; preds = %0
%18 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Strings are not anagrams\00"
@str.2 = [20 x i8] c"String are anagrams\00"
define i32 @main() {
%1 = alloca [2 x [1024 x i8]]
%2 = getelementptr inbounds [2 x [1024 x i8]], [2 x [1024 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 @readln(i8* %2)
%4 = getelementptr inbounds [2 x [1024 x i8]], [2 x [1024 x i8]]* %1, i64 0, i64 1, i64 0
%5 = call i32 @readln(i8* %4)
%6 = call i64 @areAnagrams(i8* %2, i8* %4)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}