#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 has_unique_chars(char *string) {
  int count['z' - 'A'];
  for (size_t i = 0; i < 'z' - 'A'; i++) {
    count[i] = 0;
  }
  char *c = string;
  while (*c) {
    int index = *c - 'A';
    int value = count[index];
    if (value) {
      return 0;
    } else {
      count[index]++;
      c++;
    }
  }
  return !0;
}


x86 assembly (clang, -O0):
<has_unique_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x108(%rbp)
cmpq   $0x39,-0x108(%rbp)
39
jae    1151 <has_unique_chars+0x51>
mov    -0x108(%rbp),%rax
movl   $0x0,-0x100(%rbp,%rax,4)
mov    -0x108(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x108(%rbp)
jmp    111a <has_unique_chars+0x1a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x110(%rbp)
mov    -0x110(%rbp),%rax
cmpb   $0x0,(%rax)
je     11db <has_unique_chars+0xdb>
mov    -0x110(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
mov    %eax,-0x114(%rbp)
movslq -0x114(%rbp),%rax
mov    -0x100(%rbp,%rax,4),%eax
mov    %eax,-0x118(%rbp)
cmpl   $0x0,-0x118(%rbp)
je     11ac <has_unique_chars+0xac>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <has_unique_chars+0xe2>
movslq -0x114(%rbp),%rax
mov    -0x100(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x100(%rbp,%rax,4)
mov    -0x110(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x110(%rbp)
jmp    115c <has_unique_chars+0x5c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_unique_chars>:
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movaps %xmm0,-0x10(%rsp)
movaps %xmm0,-0x20(%rsp)
movaps %xmm0,-0x30(%rsp)
movaps %xmm0,-0x40(%rsp)
movaps %xmm0,-0x50(%rsp)
movaps %xmm0,-0x60(%rsp)
movaps %xmm0,-0x70(%rsp)
movaps %xmm0,-0x80(%rsp)
movl   $0x0,0x60(%rsp)
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1194 <has_unique_chars+0x94>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbq %cl,%rcx
cmpl   $0x0,-0x184(%rsp,%rcx,4)
jne    1199 <has_unique_chars+0x99>
movl   $0x1,-0x184(%rsp,%rcx,4)
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1170 <has_unique_chars+0x70>
add    $0x68,%rsp
ret
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @has_unique_chars(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [57 x i32]
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i64 0, i64* %5
br label %9
9: ; preds = %15, %1
%10 = load i64, i64* %5
%11 = icmp ult i64 %10, 57
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i64, i64* %5
%14 = getelementptr inbounds [57 x i32], [57 x i32]* %4, i64 0, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %12
%16 = load i64, i64* %5
%17 = add i64 %16, 1
store i64 %17, i64* %5
br label %9
18: ; preds = %9
%19 = load i8*, i8** %3
store i8* %19, i8** %6
br label %20
20: ; preds = %44, %18
%21 = load i8*, i8** %6
%22 = load i8, i8* %21
%23 = icmp ne i8 %22, 0
br i1 %23, label %24, label %45
24: ; preds = %20
%25 = load i8*, i8** %6
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = sub nsw i32 %27, 65
store i32 %28, i32* %7
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [57 x i32], [57 x i32]* %4, i64 0, i64 %30
%32 = load i32, i32* %31
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %24
store i32 0, i32* %2
br label %46
36: ; preds = %24
%37 = load i32, i32* %7
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [57 x i32], [57 x i32]* %4, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = add nsw i32 %40, 1
store i32 %41, i32* %39
%42 = load i8*, i8** %6
%43 = getelementptr inbounds i8, i8* %42, i32 1
store i8* %43, i8** %6
br label %44
44: ; preds = %36
br label %20
45: ; preds = %20
store i32 1, i32* %2
br label %46
46: ; preds = %45, %35
%47 = load i32, i32* %2
ret i32 %47
}

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