#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 *array2StringLongLong(long long *, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(char *);
long long *gap(int, long long, long long);
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
void dotest(int g, long long start, long long nd, char *expr) {
  long long *act = gap(g, start, nd);
  char *sact = array2StringLongLong(act, 2);
  if (strcmp(sact, expr) != 0)
    printf("step. Error. Expected \n%s\n but got \n%s\n", expr, sact);
  assert(strcmp(sact, expr) == 0);
  free(sact);
  sact = NULL;
}


x86 assembly (clang, -O0):
<dotest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <gap@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x2,%esi
call   1080 <array2StringLongLong@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11c8 <dotest+0x68>
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    0xe3d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x30(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotest>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
call   1040 <gap@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1080 <array2StringLongLong@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     119e <dotest+0x3e>
lea    0xe6d(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1070 <assert@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

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