#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__ isUniqueChars(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char *testStrings[5] = {"abcde", "hello", "apple", "kite", "padle"};
  for (int i = 0; i < 5; i++)
    printf("%s: %s\n", testStrings[i],
           isUniqueChars(testStrings[i]) ? "true" : "false");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
lea    0xeaa(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xea5(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xea0(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe9b(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe95(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    11e9 <main+0xb9>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rax
mov    %rax,-0x40(%rbp)
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rdi
call   1040 <isUniqueChars@plt>
mov    -0x40(%rbp),%rsi
mov    %rax,%rcx
lea    0xe6a(%rip),%rdx
lea    0xe5e(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    118d <main+0x5d>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%r15
mov    %r15,%rdi
call   1040 <isUniqueChars@plt>
test   %rax,%rax
lea    0xee9(%rip),%r12
lea    0xedd(%rip),%rbx
mov    %rbx,%rdx
cmove  %r12,%rdx
lea    0xec7(%rip),%r14
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0xe9e(%rip),%r15
mov    %r15,%rdi
call   1040 <isUniqueChars@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r12,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0xe80(%rip),%r15
mov    %r15,%rdi
call   1040 <isUniqueChars@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r12,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0xe62(%rip),%r15
mov    %r15,%rdi
call   1040 <isUniqueChars@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r12,%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0xe43(%rip),%r15
mov    %r15,%rdi
call   1040 <isUniqueChars@plt>
test   %rax,%rax
cmove  %r12,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [6 x i8] c"hello\00"
@.str.2 = [6 x i8] c"apple\00"
@.str.3 = [5 x i8] c"kite\00"
@.str.4 = [6 x i8] c"padle\00"
@.str.5 = [8 x i8] c"%s: %s\0A\00"
@.str.6 = [5 x i8] c"true\00"
@.str.7 = [6 x i8] c"false\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8*]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i8*]* %2 to i8*
%5 = bitcast i8* %4 to [5 x i8*]*
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8** %10
store i32 0, i32* %3
br label %11
11: ; preds = %28, %0
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 5
br i1 %13, label %14, label %31
14: ; preds = %11
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 %16
%18 = load i8*, i8** %17
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 %20
%22 = load i8*, i8** %21
%23 = call i64 @isUniqueChars(i8* %22)
%24 = icmp ne i64 %23, 0
%25 = zext i1 %24 to i64
%26 = select i1 %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0)
%27 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %18, i8* %26)
br label %28
28: ; preds = %14
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %11
31: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [6 x i8] c"hello\00"
@.str.2 = [6 x i8] c"apple\00"
@.str.3 = [5 x i8] c"kite\00"
@.str.4 = [6 x i8] c"padle\00"
@.str.5 = [8 x i8] c"%s: %s\0A\00"
@.str.6 = [5 x i8] c"true\00"
@.str.7 = [6 x i8] c"false\00"
define i32 @main() {
%1 = tail call i64 @isUniqueChars(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i64 @isUniqueChars(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = tail call i64 @isUniqueChars(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = tail call i64 @isUniqueChars(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%17 = tail call i64 @isUniqueChars(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %19)
ret i32 0
}