#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, char **, char **, int, int);
int main() {
  {
    char *friends1[5] = {"A1", "A2", "A3", "A4", "A5"};
    char *fTowns1[8] = {"A1", "X1", "A2", "X2", "A3", "X3", "A4", "X4"};
    char *distTable1[8] = {"X1", "100.0", "X2", "200.0",
                           "X3", "250.0", "X4", "300.0"};
    dotest(friends1, 5, fTowns1, distTable1, 8, 889);
  }
  {
    char *friends1[2] = {"B1", "B2"};
    char *fTowns1[10] = {"B1", "Y1", "B2", "Y2", "B3",
                         "Y3", "B4", "Y4", "B5", "Y5"};
    char *distTable1[10] = {"Y1",   "50.0", "Y2",    "70.0", "Y3",
                            "90.0", "Y4",   "110.0", "Y5",   "150.0"};
    dotest(friends1, 2, fTowns1, distTable1, 10, 168);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xeae(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xea6(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe9e(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe96(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe8e(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
lea    0x2b63(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0x2b8b(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    -0xb0(%rbp),%rcx
mov    $0x5,%esi
mov    $0x8,%r8d
mov    $0x379,%r9d
call   1030 <dotest@plt>
mov    0x2b95(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0x2b8f(%rip),%rax
mov    %rax,-0xb8(%rbp)
lea    -0x110(%rbp),%rdi
lea    0x2b82(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0x160(%rbp),%rdi
lea    0x2bba(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x110(%rbp),%rdx
lea    -0x160(%rbp),%rcx
mov    $0x2,%esi
mov    $0xa,%r8d
mov    $0xa8,%r9d
call   1030 <dotest@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xd8,%rsp
lea    0xee2(%rip),%rax
mov    %rax,(%rsp)
lea    0xeda(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xed1(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xec8(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xebf(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0x2bc7(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0x2ba8(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0x2b89(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0x2b6a(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0x2bcb(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0x2baf(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0x2b93(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2b77(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rsp,%rdi
lea    0x80(%rsp),%rdx
lea    0x30(%rsp),%rcx
mov    $0x5,%esi
mov    $0x8,%r8d
mov    $0x379,%r9d
call   1030 <dotest@plt>
movaps 0x2b85(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0x2bca(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0x2bab(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0x2b8c(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0x2b6d(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0x2b4e(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0x2bcf(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0x2bb3(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0x2b97(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0x2b7b(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2b5f(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rsp,%rdi
lea    0x80(%rsp),%rdx
lea    0x30(%rsp),%rcx
mov    $0x2,%esi
mov    $0xa,%r8d
mov    $0xa8,%r9d
call   1030 <dotest@plt>
xor    %eax,%eax
add    $0xd8,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"A1\00"
@.str.1 = [3 x i8] c"A2\00"
@.str.2 = [3 x i8] c"A3\00"
@.str.3 = [3 x i8] c"A4\00"
@.str.4 = [3 x i8] c"A5\00"
@.str.5 = [3 x i8] c"X1\00"
@.str.6 = [3 x i8] c"X2\00"
@.str.7 = [3 x i8] c"X3\00"
@.str.8 = [3 x i8] c"X4\00"
@__const.main.fTowns1 = [8 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0)]
@.str.9 = [6 x i8] c"100.0\00"
@.str.10 = [6 x i8] c"200.0\00"
@.str.11 = [6 x i8] c"250.0\00"
@.str.12 = [6 x i8] c"300.0\00"
@__const.main.distTable1 = [8 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0)]
@.str.13 = [3 x i8] c"B1\00"
@.str.14 = [3 x i8] c"B2\00"
@__const.main.friends1 = [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i32 0, i32 0)]
@.str.15 = [3 x i8] c"Y1\00"
@.str.16 = [3 x i8] c"Y2\00"
@.str.17 = [3 x i8] c"B3\00"
@.str.18 = [3 x i8] c"Y3\00"
@.str.19 = [3 x i8] c"B4\00"
@.str.20 = [3 x i8] c"Y4\00"
@.str.21 = [3 x i8] c"B5\00"
@.str.22 = [3 x i8] c"Y5\00"
@__const.main.fTowns1.23 = [10 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i32 0, i32 0)]
@.str.24 = [5 x i8] c"50.0\00"
@.str.25 = [5 x i8] c"70.0\00"
@.str.26 = [5 x i8] c"90.0\00"
@.str.27 = [6 x i8] c"110.0\00"
@.str.28 = [6 x i8] c"150.0\00"
@__const.main.distTable1.29 = [10 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i32 0, i32 0)]
define i32 @main() {
%1 = alloca [5 x i8*]
%2 = alloca [8 x i8*]
%3 = alloca [8 x i8*]
%4 = alloca [2 x i8*]
%5 = alloca [10 x i8*]
%6 = alloca [10 x i8*]
%7 = bitcast [5 x i8*]* %1 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 ([3 x i8], [3 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 ([3 x i8], [3 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 ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 4
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8** %13
%14 = bitcast [8 x i8*]* %2 to i8*
%15 = bitcast [8 x i8*]* %3 to i8*
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
%17 = getelementptr inbounds [8 x i8*], [8 x i8*]* %2, i64 0, i64 0
%18 = getelementptr inbounds [8 x i8*], [8 x i8*]* %3, i64 0, i64 0
%19 = call i32 @dotest(i8** %16, i32 5, i8** %17, i8** %18, i32 8, i32 889)
%20 = bitcast [2 x i8*]* %4 to i8*
%21 = bitcast [10 x i8*]* %5 to i8*
%22 = bitcast [10 x i8*]* %6 to i8*
%23 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
%24 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 0
%25 = getelementptr inbounds [10 x i8*], [10 x i8*]* %6, i64 0, i64 0
%26 = call i32 @dotest(i8** %23, i32 2, i8** %24, i8** %25, i32 10, i32 168)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"A1\00"
@.str.1 = [3 x i8] c"A2\00"
@.str.2 = [3 x i8] c"A3\00"
@.str.3 = [3 x i8] c"A4\00"
@.str.4 = [3 x i8] c"A5\00"
@.str.5 = [3 x i8] c"X1\00"
@.str.6 = [3 x i8] c"X2\00"
@.str.7 = [3 x i8] c"X3\00"
@.str.8 = [3 x i8] c"X4\00"
@__const.main.fTowns1 = [8 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0)]
@.str.9 = [6 x i8] c"100.0\00"
@.str.10 = [6 x i8] c"200.0\00"
@.str.11 = [6 x i8] c"250.0\00"
@.str.12 = [6 x i8] c"300.0\00"
@__const.main.distTable1 = [8 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0)]
@.str.13 = [3 x i8] c"B1\00"
@.str.14 = [3 x i8] c"B2\00"
@__const.main.friends1 = [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i32 0, i32 0)]
@.str.15 = [3 x i8] c"Y1\00"
@.str.16 = [3 x i8] c"Y2\00"
@.str.17 = [3 x i8] c"B3\00"
@.str.18 = [3 x i8] c"Y3\00"
@.str.19 = [3 x i8] c"B4\00"
@.str.20 = [3 x i8] c"Y4\00"
@.str.21 = [3 x i8] c"B5\00"
@.str.22 = [3 x i8] c"Y5\00"
@__const.main.fTowns1.23 = [10 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i32 0, i32 0)]
@.str.24 = [5 x i8] c"50.0\00"
@.str.25 = [5 x i8] c"70.0\00"
@.str.26 = [5 x i8] c"90.0\00"
@.str.27 = [6 x i8] c"110.0\00"
@.str.28 = [6 x i8] c"150.0\00"
@__const.main.distTable1.29 = [10 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i32 0, i32 0)]
define i32 @main() {
%1 = alloca [5 x i8*]
%2 = alloca [8 x i8*]
%3 = alloca [8 x i8*]
%4 = alloca [2 x i8*]
%5 = alloca [10 x i8*]
%6 = alloca [10 x i8*]
%7 = bitcast [5 x i8*]* %1 to i8*
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 4
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %12
%13 = bitcast [8 x i8*]* %2 to i8*
%14 = bitcast [8 x i8*]* %3 to i8*
%15 = getelementptr inbounds [8 x i8*], [8 x i8*]* %2, i64 0, i64 0
%16 = getelementptr inbounds [8 x i8*], [8 x i8*]* %3, i64 0, i64 0
%17 = call i32 @dotest(i8** %8, i32 5, i8** %15, i8** %16, i32 8, i32 889)
%18 = bitcast [2 x i8*]* %4 to i8*
%19 = bitcast [10 x i8*]* %5 to i8*
%20 = bitcast [10 x i8*]* %6 to i8*
%21 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
%22 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 0
%23 = getelementptr inbounds [10 x i8*], [10 x i8*]* %6, i64 0, i64 0
%24 = call i32 @dotest(i8** %21, i32 2, i8** %22, i8** %23, i32 10, i32 168)
ret i32 0
}