#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 */
bool doesAlphabetHaveDuplicates(char *alphabet) {
  if (NULL == alphabet) {
    return (false);
  }
  unsigned short count[256];
  for (short i = 0; i < 256; i++) {
    count[i] = 0;
  }
  for (short i = 0; 0 != alphabet[i] && i < 256; i++) {
    if (0 < count[(short)alphabet[i]]) {
      return (true);
    }
    count[(short)alphabet[i]] = 1;
  }
  return (false);
}


x86 assembly (clang, -O0):
<doesAlphabetHaveDuplicates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1127 <doesAlphabetHaveDuplicates+0x27>
movl   $0x0,-0x4(%rbp)
jmp    122c <doesAlphabetHaveDuplicates+0x12c>
movw   $0x0,-0x212(%rbp)
movswl -0x212(%rbp),%eax
cmp    $0x100,%eax
jge    116b <doesAlphabetHaveDuplicates+0x6b>
movswq -0x212(%rbp),%rax
ff
movw   $0x0,-0x210(%rbp,%rax,2)
mov    -0x212(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x212(%rbp)
jmp    1130 <doesAlphabetHaveDuplicates+0x30>
movw   $0x0,-0x214(%rbp)
mov    -0x10(%rbp),%rax
movswq -0x214(%rbp),%rcx
ff
movsbl (%rax,%rcx,1),%edx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %edx,%ecx
mov    %al,-0x215(%rbp)
je     11ab <doesAlphabetHaveDuplicates+0xab>
movswl -0x214(%rbp),%eax
cmp    $0x100,%eax
setl   %al
mov    %al,-0x215(%rbp)
mov    -0x215(%rbp),%al
test   $0x1,%al
jne    11be <doesAlphabetHaveDuplicates+0xbe>
jmp    1225 <doesAlphabetHaveDuplicates+0x125>
mov    -0x10(%rbp),%rax
movswq -0x214(%rbp),%rcx
ff
movsbl (%rax,%rcx,1),%eax
movswq %ax,%rax
movzwl -0x210(%rbp,%rax,2),%ecx
ff
xor    %eax,%eax
cmp    %ecx,%eax
jge    11f0 <doesAlphabetHaveDuplicates+0xf0>
movl   $0x1,-0x4(%rbp)
jmp    122c <doesAlphabetHaveDuplicates+0x12c>
mov    -0x10(%rbp),%rax
movswq -0x214(%rbp),%rcx
ff
movsbl (%rax,%rcx,1),%eax
movswq %ax,%rax
movw   $0x1,-0x210(%rbp,%rax,2)
mov    -0x214(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x214(%rbp)
jmp    1174 <doesAlphabetHaveDuplicates+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doesAlphabetHaveDuplicates>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
test   %rdi,%rdi
je     116c <doesAlphabetHaveDuplicates+0x5c>
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %ebp,%ebp
mov    $0x200,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    (%rbx),%al
test   %al,%al
je     1175 <doesAlphabetHaveDuplicates+0x65>
xor    %ecx,%ecx
xor    %ebp,%ebp
nopl   0x0(%rax)
movsbq %al,%rax
cmpw   $0x0,(%rsp,%rax,2)
jne    1170 <doesAlphabetHaveDuplicates+0x60>
movw   $0x1,(%rsp,%rax,2)
movzbl 0x1(%rbx,%rcx,1),%eax
test   %al,%al
je     1175 <doesAlphabetHaveDuplicates+0x65>
lea    0x1(%rcx),%rdx
cmp    $0xff,%rcx
mov    %rdx,%rcx
jb     1140 <doesAlphabetHaveDuplicates+0x30>
jmp    1175 <doesAlphabetHaveDuplicates+0x65>
xor    %ebp,%ebp
jmp    1175 <doesAlphabetHaveDuplicates+0x65>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x208,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @doesAlphabetHaveDuplicates(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [256 x i16]
%5 = alloca i16
%6 = alloca i16
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* null, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %63
10: ; preds = %1
store i16 0, i16* %5
br label %11
11: ; preds = %19, %10
%12 = load i16, i16* %5
%13 = sext i16 %12 to i32
%14 = icmp slt i32 %13, 256
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load i16, i16* %5
%17 = sext i16 %16 to i64
%18 = getelementptr inbounds [256 x i16], [256 x i16]* %4, i64 0, i64 %17
store i16 0, i16* %18
br label %19
19: ; preds = %15
%20 = load i16, i16* %5
%21 = add i16 %20, 1
store i16 %21, i16* %5
br label %11
22: ; preds = %11
store i16 0, i16* %6
br label %23
23: ; preds = %59, %22
%24 = load i8*, i8** %3
%25 = load i16, i16* %6
%26 = sext i16 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 0, %29
br i1 %30, label %31, label %35
31: ; preds = %23
%32 = load i16, i16* %6
%33 = sext i16 %32 to i32
%34 = icmp slt i32 %33, 256
br label %35
35: ; preds = %31, %23
%36 = phi i1 [ false, %23 ], [ %34, %31 ]
br i1 %36, label %37, label %62
37: ; preds = %35
%38 = load i8*, i8** %3
%39 = load i16, i16* %6
%40 = sext i16 %39 to i64
%41 = getelementptr inbounds i8, i8* %38, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i16
%44 = sext i16 %43 to i64
%45 = getelementptr inbounds [256 x i16], [256 x i16]* %4, i64 0, i64 %44
%46 = load i16, i16* %45
%47 = zext i16 %46 to i32
%48 = icmp slt i32 0, %47
br i1 %48, label %49, label %50
49: ; preds = %37
store i32 1, i32* %2
br label %63
50: ; preds = %37
%51 = load i8*, i8** %3
%52 = load i16, i16* %6
%53 = sext i16 %52 to i64
%54 = getelementptr inbounds i8, i8* %51, i64 %53
%55 = load i8, i8* %54
%56 = sext i8 %55 to i16
%57 = sext i16 %56 to i64
%58 = getelementptr inbounds [256 x i16], [256 x i16]* %4, i64 0, i64 %57
store i16 1, i16* %58
br label %59
59: ; preds = %50
%60 = load i16, i16* %6
%61 = add i16 %60, 1
store i16 %61, i16* %6
br label %23
62: ; preds = %35
store i32 0, i32* %2
br label %63
63: ; preds = %62, %49, %9
%64 = load i32, i32* %2
ret i32 %64
}

LLVM IR (-O2):
define i32 @doesAlphabetHaveDuplicates(i8* %0) {
%2 = alloca [256 x i16]
%3 = bitcast [256 x i16]* %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %24, label %5
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %22, label %8
8: ; preds = %5, %15
%9 = phi i64 [ %16, %15 ], [ 0, %5 ]
%10 = phi i8 [ %18, %15 ], [ %6, %5 ]
%11 = sext i8 %10 to i64
%12 = getelementptr inbounds [256 x i16], [256 x i16]* %2, i64 0, i64 %11
%13 = load i16, i16* %12
%14 = icmp eq i16 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %8
store i16 1, i16* %12
%16 = add nuw nsw i64 %9, 1
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
%20 = icmp ult i64 %9, 255
%21 = select i1 %19, i1 %20, i1 false
br i1 %21, label %8, label %22
22: ; preds = %15, %8, %5
%23 = phi i32 [ 0, %5 ], [ 1, %8 ], [ 0, %15 ]
br label %24
24: ; preds = %1, %22
%25 = phi i32 [ %23, %22 ], [ 0, %1 ]
ret i32 %25
}