#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*/ find_shortest_unique_prefix(char const **, int,
                                               int /*<<< orphan*/ *);
int main() {
  const char *strings[] = {"hello", "he", "hell", NULL};
  find_shortest_unique_prefix(strings, 3, NULL);
  const char *strings2[] = {"hello", "he", "hell", "world", NULL};
  find_shortest_unique_prefix(strings2, 4, NULL);
  const char *strings3[] = {"hello", "he", "hell", "heaaa", NULL};
  find_shortest_unique_prefix(strings3, 4, NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x2cce(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ccb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cc8(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cc5(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x3,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <find_shortest_unique_prefix@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
lea    0xe80(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe7b(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe73(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe6d(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x4,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <find_shortest_unique_prefix@plt>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
lea    0xe32(%rip),%rax
mov    %rax,-0x80(%rbp)
lea    0xe2d(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    0xe25(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xe25(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x4,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <find_shortest_unique_prefix@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
movaps 0x2ced(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0x2cd1(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
lea    0x60(%rsp),%rdi
mov    $0x3,%esi
xor    %edx,%edx
call   1030 <find_shortest_unique_prefix@plt>
movq   $0x0,0x50(%rsp)
lea    0xeab(%rip),%r14
mov    %r14,0x30(%rsp)
lea    0xea5(%rip),%r15
mov    %r15,0x38(%rsp)
lea    0xe9c(%rip),%rbx
mov    %rbx,0x40(%rsp)
lea    0xe95(%rip),%rax
mov    %rax,0x48(%rsp)
lea    0x30(%rsp),%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <find_shortest_unique_prefix@plt>
movq   $0x0,0x20(%rsp)
mov    %r14,(%rsp)
mov    %r15,0x8(%rsp)
mov    %rbx,0x10(%rsp)
lea    0xe67(%rip),%rax
mov    %rax,0x18(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <find_shortest_unique_prefix@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [3 x i8] c"he\00"
@.str.2 = [5 x i8] c"hell\00"
@__const.main.strings = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [6 x i8] c"world\00"
@.str.4 = [6 x i8] c"heaaa\00"
define i32 @main() {
%1 = alloca [4 x i8*]
%2 = alloca [5 x i8*]
%3 = alloca [5 x i8*]
%4 = bitcast [4 x i8*]* %1 to i8*
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%6 = call i32 @find_shortest_unique_prefix(i8** %5, i32 3, i32* null)
%7 = bitcast [5 x i8*]* %2 to i8*
%8 = bitcast i8* %7 to [5 x i8*]*
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 0
%14 = call i32 @find_shortest_unique_prefix(i8** %13, i32 4, i32* null)
%15 = bitcast [5 x i8*]* %3 to i8*
%16 = bitcast i8* %15 to [5 x i8*]*
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8** %17
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8** %18
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8** %19
%20 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8** %20
%21 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 0
%22 = call i32 @find_shortest_unique_prefix(i8** %21, i32 4, i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [3 x i8] c"he\00"
@.str.2 = [5 x i8] c"hell\00"
@__const.main.strings = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [6 x i8] c"world\00"
@.str.4 = [6 x i8] c"heaaa\00"
define i32 @main() {
%1 = alloca [4 x i8*]
%2 = alloca [5 x i8*]
%3 = alloca [5 x i8*]
%4 = bitcast [4 x i8*]* %1 to i8*
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%6 = call i32 @find_shortest_unique_prefix(i8** %5, i32 3, i32* null)
%7 = bitcast [5 x i8*]* %2 to i8*
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 4
%9 = bitcast i8** %8 to i64*
store i64 0, i64* %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %13
%14 = call i32 @find_shortest_unique_prefix(i8** %10, i32 4, i32* null)
%15 = bitcast [5 x i8*]* %3 to i8*
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 4
%17 = bitcast i8** %16 to i64*
store i64 0, i64* %17
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %18
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %19
%20 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %20
%21 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %21
%22 = call i32 @find_shortest_unique_prefix(i8** %18, i32 4, i32* null)
ret i32 0
}