#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_true(int, char *, char *, int);
int *array_merge(int /*<<< orphan*/, int *, int **);
scalar_t__ arrays_match(int, int *, int *);
void test_empty_list(void) {
  int *a[] = {};
  int sizes[] = {};
  int expected[] = {0};
  int *result;
  result = array_merge(0, sizes, a);
  _assert_true((int)(arrays_match(1, result, expected)),
               "arrays_match(1, result, expected)",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/"
               "Lab_3_starter/refs/heads/master/array_merge/array_merge_test.c",
               25);
}


x86 assembly (clang, -O0):
<test_empty_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0xc(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %edi,%edi
call   1050 <array_merge@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1060 <arrays_match@plt>
mov    %eax,%edi
lea    0xe7a(%rip),%rsi
lea    0xe95(%rip),%rdx
mov    $0x19,%ecx
call   1040 <_assert_true@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_empty_list>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    %rsp,%rdx
xor    %edi,%edi
mov    %rdx,%rsi
call   1040 <array_merge@plt>
lea    0x4(%rsp),%rdx
mov    $0x1,%edi
mov    %rax,%rsi
call   1050 <arrays_match@plt>
lea    0xea1(%rip),%rsi
lea    0xebc(%rip),%rdx
mov    %eax,%edi
mov    $0x19,%ecx
call   1030 <_assert_true@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [34 x i8] c"arrays_match(1, result, expected)\00"
@.str.1 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/Lab_3_starter/refs/heads/master/array_merge/array_merge_test.c\00"
define void @test_empty_list() {
%1 = alloca [0 x i32*]
%2 = alloca [0 x i32]
%3 = alloca [1 x i32]
%4 = alloca i32*
%5 = bitcast [0 x i32*]* %1 to i8*
%6 = bitcast [0 x i32]* %2 to i8*
%7 = bitcast [1 x i32]* %3 to i8*
%8 = getelementptr inbounds [0 x i32], [0 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [0 x i32*], [0 x i32*]* %1, i64 0, i64 0
%10 = call i32* @array_merge(i32 0, i32* %8, i32** %9)
store i32* %10, i32** %4
%11 = load i32*, i32** %4
%12 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%13 = call i64 @arrays_match(i32 1, i32* %11, i32* %12)
%14 = trunc i64 %13 to i32
%15 = call i32 @_assert_true(i32 %14, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0), i32 25)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"arrays_match(1, result, expected)\00"
@.str.1 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/Lab_3_starter/refs/heads/master/array_merge/array_merge_test.c\00"
define void @test_empty_list() {
%1 = alloca [0 x i32*]
%2 = alloca [1 x i32]
%3 = bitcast [0 x i32*]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 0, i32* %5
%6 = bitcast [0 x i32*]* %1 to i32*
%7 = getelementptr inbounds [0 x i32*], [0 x i32*]* %1, i64 0, i64 0
%8 = call i32* @array_merge(i32 0, i32* %6, i32** %7)
%9 = call i64 @arrays_match(i32 1, i32* %8, i32* %5)
%10 = trunc i64 %9 to i32
%11 = call i32 @_assert_true(i32 %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0), i32 25)
ret void
}