#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 */
long long *ann(int);
char *array2StringLongLong(long long *, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
void dotestAnn(int n, long long *exp) {
  char *s1 = array2StringLongLong(exp, n);
  long long *act = ann(n);
  char *s2 = array2StringLongLong(act, n);
  if (strcmp(s1, s2) != 0)
    printf("Error. Expected %s\n but got %s\n", s1, s2);
  assert(strcmp(s1, s2) == 0);
  free(s1);
  s1 = NULL;
  free(s2);
  s2 = NULL;
}


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

x86 assembly (clang, -O2):
<dotestAnn>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsi,%rdi
mov    %ebx,%esi
call   1080 <array2StringLongLong@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1050 <ann@plt>
mov    %rax,%rdi
mov    %ebx,%esi
call   1080 <array2StringLongLong@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11a9 <dotestAnn+0x49>
lea    0xe62(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1070 <assert@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

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