#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 */
char *longestCommonPrefix(char **, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *s[] = {"asdfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
               "asdfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
               "asdfccccccccccccccccccccccccccccccccccccccccccccc",
               "asdfddddddddddddddddddddddddddddddddddddddddd",
               "asdfeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
               "asdfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"};
  char *p = longestCommonPrefix(s, 6);
  printf("%s\n", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1050 <memset@plt>
lea    0xea3(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xefe(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xf25(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xf48(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xf67(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x6,%esi
call   1030 <longestCommonPrefix@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xf7f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0xed5(%rip),%rax
mov    %rax,(%rsp)
lea    0xf05(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xf2f(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xf55(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xf77(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xf95(%rip),%rax
mov    %rax,0x28(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <longestCommonPrefix@plt>
lea    0xfb5(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [59 x i8] c"asdfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
@.str.1 = [54 x i8] c"asdfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\00"
@.str.2 = [50 x i8] c"asdfccccccccccccccccccccccccccccccccccccccccccccc\00"
@.str.3 = [46 x i8] c"asdfddddddddddddddddddddddddddddddddddddddddd\00"
@.str.4 = [42 x i8] c"asdfeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\00"
@.str.5 = [57 x i8] c"asdfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
@.str.6 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i8*]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [6 x i8*]* %6 to i8*
%9 = bitcast i8* %8 to [6 x i8*]*
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 0
store i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 1
store i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 2
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 3
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i32 0, i32 0), i8** %13
%14 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 4
store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i32 0, i32 0), i8** %14
%15 = getelementptr inbounds [6 x i8*], [6 x i8*]* %9, i32 0, i32 5
store i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i32 0, i32 0), i8** %15
%16 = getelementptr inbounds [6 x i8*], [6 x i8*]* %6, i64 0, i64 0
%17 = call i8* @longestCommonPrefix(i8** %16, i32 6)
store i8* %17, i8** %7
%18 = load i8*, i8** %7
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [59 x i8] c"asdfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
@.str.1 = [54 x i8] c"asdfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\00"
@.str.2 = [50 x i8] c"asdfccccccccccccccccccccccccccccccccccccccccccccc\00"
@.str.3 = [46 x i8] c"asdfddddddddddddddddddddddddddddddddddddddddd\00"
@.str.4 = [42 x i8] c"asdfeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\00"
@.str.5 = [57 x i8] c"asdfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
@.str.6 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i8*]
%4 = bitcast [6 x i8*]* %3 to i8*
%5 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 3
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 4
store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 5
store i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), i8** %10
%11 = call i8* @longestCommonPrefix(i8** %5, i32 6)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %11)
ret i32 0
}