#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 /*<<< orphan*/ printf(char *, char *, ...);
scalar_t__ sp(char *, char *);
main() {
  char t1[] = "Hello";
  char t2[] = "Hllle";
  printf("t1=%s, t2=%s\n", t1, t2);
  printf("String Permutation: %s\n", sp(t1, t2) ? "Yes" : "No");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x2(%rbp)
mov    0xec4(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    0xebe(%rip),%ax
mov    %ax,-0x8(%rbp)
lea    -0x6(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x6(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <sp@plt>
mov    %rax,%rcx
lea    0xeb9(%rip),%rsi
lea    0xeae(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movw   $0x6f,0x14(%rsp)
movl   $0x6c6c6548,0x10(%rsp)
6c
movw   $0x65,0xc(%rsp)
movl   $0x6c6c6c48,0x8(%rsp)
6c
lea    0xec0(%rip),%rdi
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <sp@plt>
test   %rax,%rax
lea    0xebe(%rip),%rax
lea    0xeb3(%rip),%rsi
cmove  %rax,%rsi
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.t1 = [6 x i8] c"Hello\00"
@__const.main.t2 = [6 x i8] c"Hllle\00"
@.str = [14 x i8] c"t1=%s, t2=%s\0A\00"
@.str.1 = [24 x i8] c"String Permutation: %s\0A\00"
@.str.2 = [4 x i8] c"Yes\00"
@.str.3 = [3 x i8] c"No\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = bitcast [6 x i8]* %1 to i8*
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%10 = call i64 @sp(i8* %8, i8* %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%14 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.t1 = [6 x i8] c"Hello\00"
@__const.main.t2 = [6 x i8] c"Hllle\00"
@.str = [14 x i8] c"t1=%s, t2=%s\0A\00"
@.str.1 = [24 x i8] c"String Permutation: %s\0A\00"
@.str.2 = [4 x i8] c"Yes\00"
@.str.3 = [3 x i8] c"No\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i64 @sp(i8* %3, i8* %4)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}