#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 isUnique(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
void testUnique() {
  bool unique;
  char string[100];
  printf("--------------------------------\n");
  printf("DOES STRING HAVE ALL UNIQUE CHARACTERS\n");
  printf("Enter the string to check: ");
  scanf("%s", string);
  unique = isUnique(string);
  if (unique)
    printf("%s has all unique characters\n", string);
  else
    printf("%s does NOT have all unique characters\n", string);
}


x86 assembly (clang, -O0):
<testUnique>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xef9(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <isUnique@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     119f <testUnique+0x6f>
lea    -0x70(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b1 <testUnique+0x81>
lea    -0x70(%rbp),%rsi
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testUnique>:
push   %rbx
sub    $0x70,%rsp
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1060 <isUnique@plt>
test   %eax,%eax
lea    0xeaf(%rip),%rax
lea    0xe8a(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"--------------------------------\0A\00"
@.str.1 = [40 x i8] c"DOES STRING HAVE ALL UNIQUE CHARACTERS\0A\00"
@.str.2 = [28 x i8] c"Enter the string to check: \00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [30 x i8] c"%s has all unique characters\0A\00"
@.str.5 = [40 x i8] c"%s does NOT have all unique characters\0A\00"
define void @testUnique() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @isUnique(i8* %8)
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %0
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %13)
br label %18
15: ; preds = %0
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
@.str.2 = [28 x i8] c"Enter the string to check: \00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [30 x i8] c"%s has all unique characters\0A\00"
@.str.5 = [40 x i8] c"%s does NOT have all unique characters\0A\00"
@str = [33 x i8] c"--------------------------------\00"
@str.6 = [39 x i8] c"DOES STRING HAVE ALL UNIQUE CHARACTERS\00"
define void @testUnique() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%7 = call i32 @isUnique(i8* %2)
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %9, i8* %2)
ret void
}