#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 /*<<< orphan*/ printf(char *, char *);
scalar_t__ unique(char *);
scalar_t__ unique_no_array(char *);
int main() {
  char unique_str[] = "no duplicates\n";
  char dup_str[] = "not quite unique\n";
  if (unique(unique_str)) {
    printf("%s is unique\n", unique_str);
  } else {
    printf("%s is not unique\n", unique_str);
  }
  if (unique(dup_str)) {
    printf("%s is unique\n", dup_str);
  } else {
    printf("%s is not unique\n", dup_str);
  }
  if (unique_no_array(unique_str)) {
    printf("%s is unique\n", unique_str);
  } else {
    printf("%s is not unique\n", unique_str);
  }
  if (unique_no_array(dup_str)) {
    printf("%s is unique\n", dup_str);
  } else {
    printf("%s is not unique\n", dup_str);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xeb2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeaa(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x20(%rbp)
lea    -0x13(%rbp),%rdi
call   1050 <unique@plt>
cmp    $0x0,%rax
je     11b0 <main+0x80>
lea    -0x13(%rbp),%rsi
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
jmp    11c0 <main+0x90>
lea    -0x13(%rbp),%rsi
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <unique@plt>
cmp    $0x0,%rax
je     11e8 <main+0xb8>
lea    -0x30(%rbp),%rsi
lea    0xe31(%rip),%rdi
call   1040 <printf@plt>
jmp    11f8 <main+0xc8>
lea    -0x30(%rbp),%rsi
lea    0xe2a(%rip),%rdi
call   1040 <printf@plt>
lea    -0x13(%rbp),%rdi
call   1030 <unique_no_array@plt>
cmp    $0x0,%rax
je     1220 <main+0xf0>
lea    -0x13(%rbp),%rsi
lea    0xdf9(%rip),%rdi
call   1040 <printf@plt>
jmp    1230 <main+0x100>
lea    -0x13(%rbp),%rsi
lea    0xdf2(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <unique_no_array@plt>
cmp    $0x0,%rax
je     1258 <main+0x128>
lea    -0x30(%rbp),%rsi
lea    0xdc1(%rip),%rdi
call   1040 <printf@plt>
jmp    1268 <main+0x138>
lea    -0x30(%rbp),%rsi
lea    0xdba(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
movabs $0xa736574616369,%rax
mov    %rax,0x7(%rsp)
movabs $0x696c707564206f6e,%rax
70 6c 69
mov    %rax,(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movw   $0xa,0x20(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <unique@plt>
test   %rax,%rax
lea    0xe9d(%rip),%r12
lea    0xe88(%rip),%rbx
mov    %rbx,%rdi
cmove  %r12,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
lea    0x10(%rsp),%r15
mov    %r15,%rdi
call   1050 <unique@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmove  %r12,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <unique_no_array@plt>
test   %rax,%rax
mov    %rbx,%rdi
cmove  %r12,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <unique_no_array@plt>
test   %rax,%rax
cmove  %r12,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.unique_str = [15 x i8] c"no duplicates\0A\00"
@__const.main.dup_str = [18 x i8] c"not quite unique\0A\00"
@.str = [14 x i8] c"%s is unique\0A\00"
@.str.1 = [18 x i8] c"%s is not unique\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca [18 x i8]
store i32 0, i32* %1
%4 = bitcast [15 x i8]* %2 to i8*
%5 = bitcast [18 x i8]* %3 to i8*
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%7 = call i64 @unique(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %15
12: ; preds = %0
%13 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %9
%16 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%17 = call i64 @unique(i8* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %20)
br label %25
22: ; preds = %15
%23 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%24 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %22, %19
%26 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%27 = call i64 @unique_no_array(i8* %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%31 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %30)
br label %35
32: ; preds = %25
%33 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%34 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %33)
br label %35
35: ; preds = %32, %29
%36 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%37 = call i64 @unique_no_array(i8* %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%41 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %40)
br label %45
42: ; preds = %35
%43 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%44 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %43)
br label %45
45: ; preds = %42, %39
%46 = load i32, i32* %1
ret i32 %46
}

LLVM IR (-O2):
@__const.main.unique_str = [15 x i8] c"no duplicates\0A\00"
@__const.main.dup_str = [18 x i8] c"not quite unique\0A\00"
@.str = [14 x i8] c"%s is unique\0A\00"
@.str.1 = [18 x i8] c"%s is not unique\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [18 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%5 = call i64 @unique(i8* %3)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
%8 = call i32 @printf(i8* %7, i8* %3)
%9 = call i64 @unique(i8* %4)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
%12 = call i32 @printf(i8* %11, i8* %4)
%13 = call i64 @unique_no_array(i8* %3)
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
%16 = call i32 @printf(i8* %15, i8* %3)
%17 = call i64 @unique_no_array(i8* %4)
%18 = icmp eq i64 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
%20 = call i32 @printf(i8* %19, i8* %4)
ret i32 0
}