#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, int *, int **);
scalar_t__ arrays_match(int, int *, int *);
void test_singleton_list(void) {
  int num_arrays = 1;
  int sizes[] = {1};
  int a0[] = {5};
  int *a[] = {a0};
  int expected[] = {1, 5};
  int *result;
  result = array_merge(num_arrays, sizes, a);
  _assert_true((int)(arrays_match(2, result, expected)),
               "arrays_match(2, 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",
               37);
}


x86 assembly (clang, -O0):
<test_singleton_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x1,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xeb6(%rip),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <array_merge@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x2,%edi
call   1050 <arrays_match@plt>
mov    %eax,%edi
lea    0xe7d(%rip),%rsi
lea    0xe98(%rip),%rdx
mov    $0x25,%ecx
call   1030 <_assert_true@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_singleton_list>:
sub    $0x18,%rsp
movl   $0x1,0x4(%rsp)
movl   $0x5,(%rsp)
mov    %rsp,%rax
mov    %rax,0x10(%rsp)
movabs $0x500000001,%rax
mov    %rax,0x8(%rsp)
lea    0x4(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    $0x1,%edi
call   1040 <array_merge@plt>
lea    0x8(%rsp),%rdx
mov    $0x2,%edi
mov    %rax,%rsi
call   1050 <arrays_match@plt>
lea    0xe79(%rip),%rsi
lea    0xe94(%rip),%rdx
mov    %eax,%edi
mov    $0x25,%ecx
call   1030 <_assert_true@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_singleton_list.sizes = [1 x i32] [i32 1]
@__const.test_singleton_list.a0 = [1 x i32] [i32 5]
@__const.test_singleton_list.expected = [2 x i32] [i32 1, i32 5]
@.str = [34 x i8] c"arrays_match(2, 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_singleton_list() {
%1 = alloca i32
%2 = alloca [1 x i32]
%3 = alloca [1 x i32]
%4 = alloca [1 x i32*]
%5 = alloca [2 x i32]
%6 = alloca i32*
store i32 1, i32* %1
%7 = bitcast [1 x i32]* %2 to i8*
%8 = bitcast [1 x i32]* %3 to i8*
%9 = getelementptr inbounds [1 x i32*], [1 x i32*]* %4, i64 0, i64 0
%10 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32* %10, i32** %9
%11 = bitcast [2 x i32]* %5 to i8*
%12 = load i32, i32* %1
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%14 = getelementptr inbounds [1 x i32*], [1 x i32*]* %4, i64 0, i64 0
%15 = call i32* @array_merge(i32 %12, i32* %13, i32** %14)
store i32* %15, i32** %6
%16 = load i32*, i32** %6
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%18 = call i64 @arrays_match(i32 2, i32* %16, i32* %17)
%19 = trunc i64 %18 to i32
%20 = call i32 @_assert_true(i32 %19, 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 37)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"arrays_match(2, 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_singleton_list() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = alloca [1 x i32*]
%4 = alloca i64
%5 = bitcast [1 x i32]* %1 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 1, i32* %6
%7 = bitcast [1 x i32]* %2 to i8*
%8 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 5, i32* %8
%9 = bitcast [1 x i32*]* %3 to i8*
%10 = getelementptr inbounds [1 x i32*], [1 x i32*]* %3, i64 0, i64 0
store i32* %8, i32** %10
%11 = bitcast i64* %4 to i8*
store i64 21474836481, i64* %4
%12 = call i32* @array_merge(i32 1, i32* %6, i32** %10)
%13 = bitcast i64* %4 to i32*
%14 = call i64 @arrays_match(i32 2, i32* %12, i32* %13)
%15 = trunc i64 %14 to i32
%16 = call i32 @_assert_true(i32 %15, 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 37)
ret void
}