#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 *array2StringInt(int *, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
char *sumOfDivided(int *, int);
void dotest(int *lst, int l, char *sexpr) {
  char *sact = sumOfDivided(lst, l);
  char *slst = array2StringInt(lst, l);
  if (strcmp(sact, sexpr) != 0)
    printf("Error. Expected %s but got %s\n", sexpr, sact);
  assert(strcmp(sact, sexpr) == 0);
  if (l != 0) {
    free(slst);
    slst = NULL;
  }
}


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    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <sumOfDivided@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <array2StringInt@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11be <dotest+0x5e>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe47(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
cmpl   $0x0,-0xc(%rbp)
je     11f7 <dotest+0x97>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x28(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotest>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %esi,%r15d
mov    %rdi,%rbx
call   1080 <sumOfDivided@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r15d,%esi
call   1040 <array2StringInt@plt>
mov    %rax,%r14
mov    %rbp,%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11a9 <dotest+0x49>
lea    0xe62(%rip),%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1070 <assert@plt>
test   %r15d,%r15d
je     11d7 <dotest+0x77>
mov    %r14,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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