#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 **inArray(char **, int, char **, int, int *);
char *joinStringsStringArray(char **, int);
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
void dotest(char **u, int szu, char **v, int szv, char *expr) {
  int lg;
  char **act = inArray(u, szu, v, szv, &lg);
  char *sact = joinStringsStringArray(act, lg);
  if (strcmp(sact, expr) != 0) {
    printf("Error. Expected \n%s\n but got \n%s\n", expr, sact);
  }
}


x86 assembly (clang, -O0):
<dotest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    -0x2c(%rbp),%r8
call   1060 <inArray@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1030 <joinStringsStringArray@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11b0 <dotest+0x70>
mov    -0x28(%rbp),%rsi
mov    -0x40(%rbp),%rdx
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotest>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
lea    0x4(%rsp),%r8
call   1060 <inArray@plt>
mov    0x4(%rsp),%esi
mov    %rax,%rdi
call   1030 <joinStringsStringArray@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1182 <dotest+0x42>
lea    0xe89(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [34 x i8] c"Error. Expected \0A%s\0A but got \0A%s\0A\00"
define void @dotest(i8** %0, i32 %1, i8** %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to i8*
%8 = call i8** @inArray(i8** %0, i32 %1, i8** %2, i32 %3, i32* %6)
%9 = load i32, i32* %6
%10 = call i8* @joinStringsStringArray(i8** %8, i32 %9)
%11 = call i64 @strcmp(i8* %10, i8* %4)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %5
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %10)
br label %15
15: ; preds = %13, %5
ret void
}