#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*/ assert(int);
int /*<<< orphan*/ printf(char *, int, int);
int tour(char **, int, char **, char **, int);
void dotest(char **arrFriends, int szArrFriends, char **ftwns, char **townsDist,
            int szFTwns, int expr) {
  int act = tour(arrFriends, szArrFriends, ftwns, townsDist, szFTwns);
  if (act != expr)
    printf("Expected %d, got %d\n", expr, act);
  assert(act == expr);
}


x86 assembly (clang, -O0):
<dotest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1050 <tour@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     1188 <dotest+0x58>
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotest>:
push   %rbp
push   %rbx
push   %rax
mov    %r9d,%ebx
call   1050 <tour@plt>
mov    %eax,%ebp
cmp    %ebx,%eax
je     1151 <dotest+0x21>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
xor    %edi,%edi
cmp    %ebx,%ebp
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <assert@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"Expected %d, got %d\0A\00"
define void @dotest(i8** %0, i32 %1, i8** %2, i8** %3, i32 %4, i32 %5) {
%7 = tail call i32 @tour(i8** %0, i32 %1, i8** %2, i8** %3, i32 %4)
%8 = icmp eq i32 %7, %5
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
br label %11
11: ; preds = %9, %6
%12 = zext i1 %8 to i32
%13 = tail call i32 @assert(i32 %12)
ret void
}