#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*/ fgets(char *, int, int /*<<< orphan*/);
int isUniqueHt(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main() {
  char input[1024];
  printf("Please enter the string: ");
  fgets(input, 1024, stdin);
  if (isUniqueHt(input) == true)
    printf("All characters are unique\n");
  else
    printf("Not all characters are unique\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x410(%rbp),%rdi
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1040 <fgets@plt>
lea    -0x410(%rbp),%rdi
call   1050 <isUniqueHt@plt>
cmp    $0x1,%eax
jne    118e <main+0x5e>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    119a <main+0x6a>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1060 <isUniqueHt@plt>
cmp    $0x1,%eax
lea    0xeb9(%rip),%rax
lea    0xe94(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Please enter the string: \00"
@stdin = global i32 0
@.str.1 = [27 x i8] c"All characters are unique\0A\00"
@.str.2 = [31 x i8] c"Not all characters are unique\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 1024, i32 %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%8 = call i32 @isUniqueHt(i8* %7)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Please enter the string: \00"
@stdin = global i32 0
@str = [30 x i8] c"Not all characters are unique\00"
@str.3 = [26 x i8] c"All characters are unique\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 1024, i32 %4)
%6 = call i32 @isUniqueHt(i8* %2)
%7 = icmp eq i32 %6, 1
%8 = select i1 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}