#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__ anagrams(char *, char *);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char *buf1 = (char *)calloc(96, sizeof(char));
  char *buf2 = (char *)calloc(96, sizeof(char));
  char *copy1 = (char *)calloc(96, sizeof(char));
  char *copy2 = (char *)calloc(96, sizeof(char));
  fgets(buf1, 95, stdin);
  fgets(buf2, 95, stdin);
  strcpy(copy1, buf1);
  strcpy(copy2, buf2);
  if (anagrams(buf1, buf2)) {
    printf("\n%sand\n%sare anagrams\n", copy1, copy2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x60,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x60,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x60,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x60,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e32(%rip),%rax
mov    (%rax),%edx
mov    $0x5f,%esi
call   1060 <fgets@plt>
mov    -0x18(%rbp),%rdi
mov    0x2e1b(%rip),%rax
mov    (%rax),%edx
mov    $0x5f,%esi
call   1060 <fgets@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <anagrams@plt>
cmp    $0x0,%rax
je     121e <main+0xce>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xde7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    $0x60,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,%r12
mov    $0x60,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,%rbx
mov    $0x60,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,%r14
mov    $0x60,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,%r15
mov    0x2e40(%rip),%r13
mov    0x0(%r13),%edx
mov    %r12,%rdi
mov    $0x5f,%esi
call   1060 <fgets@plt>
mov    0x0(%r13),%edx
mov    %rbx,%rdi
mov    $0x5f,%esi
call   1060 <fgets@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <anagrams@plt>
test   %rax,%rax
je     1202 <main+0xb2>
lea    0xe09(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [23 x i8] c"\0A%sand\0A%sare anagrams\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
%6 = call i64 @calloc(i32 96, i32 1)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %2
%8 = call i64 @calloc(i32 96, i32 1)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = call i64 @calloc(i32 96, i32 1)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = call i64 @calloc(i32 96, i32 1)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %2
%15 = load i32, i32* @stdin
%16 = call i32 @fgets(i8* %14, i32 95, i32 %15)
%17 = load i8*, i8** %3
%18 = load i32, i32* @stdin
%19 = call i32 @fgets(i8* %17, i32 95, i32 %18)
%20 = load i8*, i8** %4
%21 = load i8*, i8** %2
%22 = call i32 @strcpy(i8* %20, i8* %21)
%23 = load i8*, i8** %5
%24 = load i8*, i8** %3
%25 = call i32 @strcpy(i8* %23, i8* %24)
%26 = load i8*, i8** %2
%27 = load i8*, i8** %3
%28 = call i64 @anagrams(i8* %26, i8* %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %0
%31 = load i8*, i8** %4
%32 = load i8*, i8** %5
%33 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %31, i8* %32)
br label %34
34: ; preds = %30, %0
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [23 x i8] c"\0A%sand\0A%sare anagrams\0A\00"
define i32 @main() {
%1 = tail call i64 @calloc(i32 96, i32 1)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @calloc(i32 96, i32 1)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i64 @calloc(i32 96, i32 1)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @calloc(i32 96, i32 1)
%8 = inttoptr i64 %7 to i8*
%9 = load i32, i32* @stdin
%10 = tail call i32 @fgets(i8* %2, i32 95, i32 %9)
%11 = load i32, i32* @stdin
%12 = tail call i32 @fgets(i8* %4, i32 95, i32 %11)
%13 = tail call i32 @strcpy(i8* %6, i8* %2)
%14 = tail call i32 @strcpy(i8* %8, i8* %4)
%15 = tail call i64 @anagrams(i8* %2, i8* %4)
%16 = icmp eq i64 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %0
%18 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8)
br label %19
19: ; preds = %17, %0
ret i32 0
}