#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__ are_anagrams(char *, char *);
int /*<<< orphan*/ getstr(char *, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char str1[50], str2[50];
  printf("Inserisci la prima stringa: \n");
  getstr(str1, 50);
  printf("\nInserisci la seconda stringa: \n");
  getstr(str2, 50);
  if (are_anagrams(str1, str2)) {
    printf("\nLe due stringhe sono anagrammi!\n");
  } else {
    printf("\nLe due stringhe non sono anagrammi!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x32,%esi
call   1040 <getstr@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    $0x32,%esi
call   1040 <getstr@plt>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1050 <are_anagrams@plt>
cmp    $0x0,%rax
je     119e <main+0x6e>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    11aa <main+0x7a>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0x40(%rsp),%r14
mov    %r14,%rdi
mov    $0x32,%esi
call   1040 <getstr@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x32,%esi
call   1040 <getstr@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <are_anagrams@plt>
test   %rax,%rax
lea    0xeb7(%rip),%rax
lea    0xed5(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Inserisci la prima stringa: \0A\00"
@.str.1 = [33 x i8] c"\0AInserisci la seconda stringa: \0A\00"
@.str.2 = [34 x i8] c"\0ALe due stringhe sono anagrammi!\0A\00"
@.str.3 = [38 x i8] c"\0ALe due stringhe non sono anagrammi!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca [50 x i8]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = call i32 @getstr(i8* %5, i32 50)
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%9 = call i32 @getstr(i8* %8, i32 50)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%12 = call i64 @are_anagrams(i8* %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
br label %18
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"Inserisci la prima stringa: \00"
@str.4 = [32 x i8] c"\0AInserisci la seconda stringa: \00"
@str.5 = [37 x i8] c"\0ALe due stringhe non sono anagrammi!\00"
@str.6 = [33 x i8] c"\0ALe due stringhe sono anagrammi!\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%6 = call i32 @getstr(i8* %3, i32 50)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
%8 = call i32 @getstr(i8* %4, i32 50)
%9 = call i64 @are_anagrams(i8* %3, i8* %4)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str.6, i64 0, i64 0)
%12 = call i32 @puts(i8* dereferenceable(1) %11)
ret i32 0
}