#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 */
unsigned int strlen(char const *);
bool isUniqueHt(const char *input) {
  char ascii[256] = {0};
  unsigned int i;
  for (i = 0; i < strlen(input); ++i) {
    if (ascii[input[i]] != 0)
      return false;
    ascii[input[i]] = 1;
  }
  return true;
}


x86 assembly (clang, -O0):
<isUniqueHt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
movl   $0x0,-0x114(%rbp)
mov    -0x114(%rbp),%eax
mov    %eax,-0x118(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x118(%rbp),%eax
cmp    %ecx,%eax
jae    11c8 <isUniqueHt+0xa8>
mov    -0x10(%rbp),%rax
mov    -0x114(%rbp),%ecx
movsbq (%rax,%rcx,1),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     119d <isUniqueHt+0x7d>
movl   $0x0,-0x4(%rbp)
jmp    11cf <isUniqueHt+0xaf>
mov    -0x10(%rbp),%rax
mov    -0x114(%rbp),%ecx
movsbq (%rax,%rcx,1),%rax
movb   $0x1,-0x110(%rbp,%rax,1)
01
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    114c <isUniqueHt+0x2c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUniqueHt>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%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)
call   1030 <strlen@plt>
mov    $0x1,%r14d
test   %eax,%eax
je     11c7 <isUniqueHt+0xb7>
xor    %ebp,%ebp
nopl   0x0(%rax)
movsbq (%rbx,%rbp,1),%rax
cmpb   $0x0,(%rsp,%rax,1)
jne    11c4 <isUniqueHt+0xb4>
movb   $0x1,(%rsp,%rax,1)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%rbp
jb     11a0 <isUniqueHt+0x90>
jmp    11c7 <isUniqueHt+0xb7>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isUniqueHt(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [256 x i8]
%5 = alloca i32
store i8* %0, i8** %3
%6 = bitcast [256 x i8]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %32, %1
%8 = load i32, i32* %5
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = icmp ult i32 %8, %10
br i1 %11, label %12, label %35
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i64
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %12
store i32 0, i32* %2
br label %36
24: ; preds = %12
%25 = load i8*, i8** %3
%26 = load i32, i32* %5
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i64
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %30
store i8 1, i8* %31
br label %32
32: ; preds = %24
%33 = load i32, i32* %5
%34 = add i32 %33, 1
store i32 %34, i32* %5
br label %7
35: ; preds = %7
store i32 1, i32* %2
br label %36
36: ; preds = %35, %23
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
define i32 @isUniqueHt(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %1, %14
%7 = phi i64 [ %15, %14 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i64
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %6
store i8 1, i8* %11
%15 = add nuw nsw i64 %7, 1
%16 = tail call i32 @strlen(i8* %0)
%17 = zext i32 %16 to i64
%18 = icmp ult i64 %15, %17
br i1 %18, label %6, label %19
19: ; preds = %6, %14, %1
%20 = phi i32 [ 1, %1 ], [ 1, %14 ], [ 0, %6 ]
ret i32 %20
}