#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__ CheckCharInArray(char *, int, char);
void IsolateUniqueChar(char arr[], char Uniqueletters[], int size,
                       int *CounterUniqueCharacters) {
  int i;
  for (i = 0; i < size; i++)
    if (CheckCharInArray(Uniqueletters, *CounterUniqueCharacters, arr[i]) == 0)
      Uniqueletters[(*CounterUniqueCharacters)++] = arr[i];
}


x86 assembly (clang, -O0):
<IsolateUniqueChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1194 <IsolateUniqueChar+0x84>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
call   1030 <CheckCharInArray@plt>
cmp    $0x0,%rax
jne    1181 <IsolateUniqueChar+0x71>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1186 <IsolateUniqueChar+0x76>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112e <IsolateUniqueChar+0x1e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsolateUniqueChar>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1165 <IsolateUniqueChar+0x55>
mov    %rcx,%r13
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
jmp    1139 <IsolateUniqueChar+0x29>
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r12
je     1165 <IsolateUniqueChar+0x55>
mov    0x0(%r13),%esi
movsbl (%r15,%rbx,1),%edx
mov    %r14,%rdi
call   1030 <CheckCharInArray@plt>
test   %rax,%rax
jne    1130 <IsolateUniqueChar+0x20>
movzbl (%r15,%rbx,1),%eax
movslq 0x0(%r13),%rcx
lea    0x1(%rcx),%edx
mov    %edx,0x0(%r13)
mov    %al,(%r14,%rcx,1)
jmp    1130 <IsolateUniqueChar+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @IsolateUniqueChar(i8* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
store i32 0, i32* %9
br label %10
10: ; preds = %38, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %7
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %41
14: ; preds = %10
%15 = load i8*, i8** %6
%16 = load i32*, i32** %8
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = call i64 @CheckCharInArray(i8* %15, i32 %17, i8 signext %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %37
25: ; preds = %14
%26 = load i8*, i8** %5
%27 = load i32, i32* %9
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = load i8*, i8** %6
%32 = load i32*, i32** %8
%33 = load i32, i32* %32
%34 = add nsw i32 %33, 1
store i32 %34, i32* %32
%35 = sext i32 %33 to i64
%36 = getelementptr inbounds i8, i8* %31, i64 %35
store i8 %30, i8* %36
br label %37
37: ; preds = %25, %14
br label %38
38: ; preds = %37
%39 = load i32, i32* %9
%40 = add nsw i32 %39, 1
store i32 %40, i32* %9
br label %10
41: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @IsolateUniqueChar(i8* nocapture %0, i8* %1, i32 %2, i32* nocapture %3) {
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %24
6: ; preds = %4
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %6, %21
%9 = phi i64 [ 0, %6 ], [ %22, %21 ]
%10 = load i32, i32* %3
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = tail call i64 @CheckCharInArray(i8* %1, i32 %10, i8 signext %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %8
%16 = load i8, i8* %11
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
%19 = sext i32 %17 to i64
%20 = getelementptr inbounds i8, i8* %1, i64 %19
store i8 %16, i8* %20
br label %21
21: ; preds = %8, %15
%22 = add nuw nsw i64 %9, 1
%23 = icmp eq i64 %22, %7
br i1 %23, label %24, label %8
24: ; preds = %21, %4
ret void
}