#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(void) {
  bool isUniqueChars(char *string);
  char inputString[127] = {};
  printf("Please enter your string: ");
  fgets(inputString, 128, stdin);
  printf("This string with %s\n",
         isUniqueChars(inputString) ? "unique characters." : "duplicates.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x7f,%edx
call   1050 <memset@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    0x2e67(%rip),%rax
mov    (%rax),%edx
mov    $0x80,%esi
call   1060 <fgets@plt>
lea    -0x90(%rbp),%rdi
call   1040 <isUniqueChars@plt>
mov    %eax,%ecx
lea    0xea1(%rip),%rsi
lea    0xe87(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x6f(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1040 <isUniqueChars@plt>
test   %eax,%eax
lea    0xea9(%rip),%rax
lea    0xe8f(%rip),%rsi
cmove  %rax,%rsi
lea    0xe6f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please enter your string: \00"
@stdin = global i32 0
@.str.1 = [21 x i8] c"This string with %s\0A\00"
@.str.2 = [19 x i8] c"unique characters.\00"
@.str.3 = [12 x i8] c"duplicates.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [127 x i8]
store i32 0, i32* %1
%3 = bitcast [127 x i8]* %2 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [127 x i8], [127 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 128, i32 %6)
%8 = getelementptr inbounds [127 x i8], [127 x i8]* %2, i64 0, i64 0
%9 = call i32 @isUniqueChars(i8* %8)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Please enter your string: \00"
@stdin = global i32 0
@.str.1 = [21 x i8] c"This string with %s\0A\00"
@.str.2 = [19 x i8] c"unique characters.\00"
@.str.3 = [12 x i8] c"duplicates.\00"
define i32 @main() {
%1 = alloca [127 x i8]
%2 = getelementptr inbounds [127 x i8], [127 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 128, i32 %4)
%6 = call i32 @isUniqueChars(i8* %2)
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}