#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*/ dotest(char **, int, int, char *);
int main() {
  {
    char *a1[] = {"zone", "abigail", "theta", "form",
                  "libe", "zas",     "theta", "abigail"};
    dotest(a1, 8, 2, "abigailtheta");
  }
  {
    char *a1[] = {"ejjjjmmtthh", "zxxuueeg", "aanlljrrrxx", "dqqqaaabbb",
                  "oocccffuucccjjjkkkjyyyeehh"};
    dotest(a1, 5, 1, "oocccffuucccjjjkkkjyyyeehh");
  }
  {
    char *arr[] = {};
    dotest(arr, 0, 3, "");
  }
  {
    char *arr[] = {"itvayloxrp", "wkppqsztdkmvcuwvereiupccauycnjutlv",
                   "vweqilsfytihvrzlaodfixoyxvyuyvgpck"};
    dotest(
        arr, 3, 2,
        "wkppqsztdkmvcuwvereiupccauycnjutlvvweqilsfytihvrzlaodfixoyxvyuyvgpck");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x40(%rbp),%rdi
lea    0x2c7a(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x8,%esi
mov    $0x2,%edx
lea    0xeb6(%rip),%rcx
call   1030 <dotest@plt>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xea7(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xea8(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    0xea6(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xea7(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xea7(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
lea    0xe8e(%rip),%rcx
call   1030 <dotest@plt>
lea    -0x78(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
lea    0xe4a(%rip),%rcx
call   1030 <dotest@plt>
mov    0x2c17(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0x2c11(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0x2c0b(%rip),%rax
mov    %rax,-0x80(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
lea    0xe7c(%rip),%rcx
call   1030 <dotest@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0x2cd5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2cb9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2c9d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2c81(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed1(%rip),%rcx
mov    %rsp,%rdi
mov    $0x8,%esi
mov    $0x2,%edx
call   1030 <dotest@plt>
lea    0xec5(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xec3(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xec3(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xec2(%rip),%rcx
mov    %rcx,0x20(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1030 <dotest@plt>
lea    0xe77(%rip),%rcx
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <dotest@plt>
mov    0x2c4a(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2c2e(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec0(%rip),%rcx
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <dotest@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"zone\00"
@.str.1 = [8 x i8] c"abigail\00"
@.str.2 = [6 x i8] c"theta\00"
@.str.3 = [5 x i8] c"form\00"
@.str.4 = [5 x i8] c"libe\00"
@.str.5 = [4 x i8] c"zas\00"
@__const.main.a1 = [8 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0)]
@.str.6 = [13 x i8] c"abigailtheta\00"
@.str.7 = [12 x i8] c"ejjjjmmtthh\00"
@.str.8 = [9 x i8] c"zxxuueeg\00"
@.str.9 = [12 x i8] c"aanlljrrrxx\00"
@.str.10 = [11 x i8] c"dqqqaaabbb\00"
@.str.11 = [27 x i8] c"oocccffuucccjjjkkkjyyyeehh\00"
@.str.12 = [1 x i8] zeroinitializer
@.str.13 = [11 x i8] c"itvayloxrp\00"
@.str.14 = [35 x i8] c"wkppqsztdkmvcuwvereiupccauycnjutlv\00"
@.str.15 = [35 x i8] c"vweqilsfytihvrzlaodfixoyxvyuyvgpck\00"
@__const.main.arr = [3 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.15, i32 0, i32 0)]
@.str.16 = [69 x i8] c"wkppqsztdkmvcuwvereiupccauycnjutlvvweqilsfytihvrzlaodfixoyxvyuyvgpck\00"
define i32 @main() {
%1 = alloca [8 x i8*]
%2 = alloca [5 x i8*]
%3 = alloca [0 x i8*]
%4 = alloca [3 x i8*]
%5 = bitcast [8 x i8*]* %1 to i8*
%6 = getelementptr inbounds [8 x i8*], [8 x i8*]* %1, i64 0, i64 0
%7 = call i32 @dotest(i8** %6, i32 8, i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%8 = bitcast [5 x i8*]* %2 to i8*
%9 = bitcast i8* %8 to [5 x i8*]*
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %9, i32 0, i32 0
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %9, i32 0, i32 1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %9, i32 0, i32 2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %9, i32 0, i32 3
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i32 0, i32 0), i8** %13
%14 = getelementptr inbounds [5 x i8*], [5 x i8*]* %9, i32 0, i32 4
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i32 0, i32 0), i8** %14
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 0
%16 = call i32 @dotest(i8** %15, i32 5, i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0))
%17 = bitcast [0 x i8*]* %3 to i8*
%18 = getelementptr inbounds [0 x i8*], [0 x i8*]* %3, i64 0, i64 0
%19 = call i32 @dotest(i8** %18, i32 0, i32 3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0))
%20 = bitcast [3 x i8*]* %4 to i8*
%21 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%22 = call i32 @dotest(i8** %21, i32 3, i32 2, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.16, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"zone\00"
@.str.1 = [8 x i8] c"abigail\00"
@.str.2 = [6 x i8] c"theta\00"
@.str.3 = [5 x i8] c"form\00"
@.str.4 = [5 x i8] c"libe\00"
@.str.5 = [4 x i8] c"zas\00"
@__const.main.a1 = [8 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0)]
@.str.6 = [13 x i8] c"abigailtheta\00"
@.str.7 = [12 x i8] c"ejjjjmmtthh\00"
@.str.8 = [9 x i8] c"zxxuueeg\00"
@.str.9 = [12 x i8] c"aanlljrrrxx\00"
@.str.10 = [11 x i8] c"dqqqaaabbb\00"
@.str.11 = [27 x i8] c"oocccffuucccjjjkkkjyyyeehh\00"
@.str.12 = [1 x i8] zeroinitializer
@.str.13 = [11 x i8] c"itvayloxrp\00"
@.str.14 = [35 x i8] c"wkppqsztdkmvcuwvereiupccauycnjutlv\00"
@.str.15 = [35 x i8] c"vweqilsfytihvrzlaodfixoyxvyuyvgpck\00"
@__const.main.arr = [3 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.15, i32 0, i32 0)]
@.str.16 = [69 x i8] c"wkppqsztdkmvcuwvereiupccauycnjutlvvweqilsfytihvrzlaodfixoyxvyuyvgpck\00"
define i32 @main() {
%1 = alloca [0 x i8*]
%2 = alloca [8 x i8*]
%3 = alloca [5 x i8*]
%4 = alloca [3 x i8*]
%5 = bitcast [8 x i8*]* %2 to i8*
%6 = getelementptr inbounds [8 x i8*], [8 x i8*]* %2, i64 0, i64 0
%7 = call i32 @dotest(i8** %6, i32 8, i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%8 = bitcast [5 x i8*]* %3 to i8*
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 3
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 4
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i8** %13
%14 = call i32 @dotest(i8** %9, i32 5, i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0))
%15 = bitcast [0 x i8*]* %1 to i8*
%16 = getelementptr inbounds [0 x i8*], [0 x i8*]* %1, i64 0, i64 0
%17 = call i32 @dotest(i8** %16, i32 0, i32 3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0))
%18 = bitcast [3 x i8*]* %4 to i8*
%19 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%20 = call i32 @dotest(i8** %19, i32 3, i32 2, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.16, i64 0, i64 0))
ret i32 0
}