#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 check_duplicates(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  int rc;
  char full_str[11];
  strcpy(full_str, "0691874532");
  if ((rc = check_duplicates(full_str)) == 1) {
    printf("%s contains duplicates\n", full_str);
  } else {
    printf("%s contains no duplicates\n", full_str);
  }
  strcpy(full_str, "0681874132");
  if ((rc = check_duplicates(full_str)) == 1) {
    printf("%s contains duplicates\n", full_str);
  } else {
    printf("%s contains no duplicates\n", full_str);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1f(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x1f(%rbp),%rdi
call   1050 <check_duplicates@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x1,%eax
jne    1180 <main+0x50>
lea    -0x1f(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
jmp    1190 <main+0x60>
lea    -0x1f(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1f(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x1f(%rbp),%rdi
call   1050 <check_duplicates@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x1,%eax
jne    11ca <main+0x9a>
lea    -0x1f(%rbp),%rsi
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
jmp    11da <main+0xaa>
lea    -0x1f(%rbp),%rsi
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rsi
lea    0x5(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1050 <check_duplicates@plt>
cmp    $0x1,%eax
lea    0xeac(%rip),%r15
lea    0xebd(%rip),%rbx
mov    %rbx,%rdi
cmove  %r15,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
lea    0xec2(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1050 <check_duplicates@plt>
cmp    $0x1,%eax
cmove  %r15,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"0691874532\00"
@.str.1 = [24 x i8] c"%s contains duplicates\0A\00"
@.str.2 = [27 x i8] c"%s contains no duplicates\0A\00"
@.str.3 = [11 x i8] c"0681874132\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [11 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%11 = call i32 @check_duplicates(i8* %10)
store i32 %11, i32* %6
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %19
16: ; preds = %2
%17 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %16, %13
%20 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%21 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%22 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%23 = call i32 @check_duplicates(i8* %22)
store i32 %23, i32* %6
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%27 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %26)
br label %31
28: ; preds = %19
%29 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%30 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %28, %25
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@.str = [11 x i8] c"0691874532\00"
@.str.1 = [24 x i8] c"%s contains duplicates\0A\00"
@.str.2 = [27 x i8] c"%s contains no duplicates\0A\00"
@.str.3 = [11 x i8] c"0681874132\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [11 x i8]
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @check_duplicates(i8* %4)
%7 = icmp eq i32 %6, 1
%8 = select i1 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 @printf(i8* %8, i8* %4)
%10 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @check_duplicates(i8* %4)
%12 = icmp eq i32 %11, 1
%13 = select i1 %12, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 @printf(i8* %13, i8* %4)
ret i32 0
}