#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_one_longer_list(void) {
  int num_arrays = 1;
  int sizes[] = {10};
  int a0[] = {3, 2, 0, 5, 8, 9, 6, 3, 2, 0};
  int *a[] = {a0};
  int expected[] = {7, 0, 2, 3, 5, 6, 8, 9};
  int *result;
  result = array_merge(num_arrays, sizes, a);
  _assert_true((int)(arrays_match(8, result, expected)),
               "arrays_match(8, 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",
               49);
}


x86 assembly (clang, -O0):
<test_one_longer_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x1,-0x4(%rbp)
mov    0xeab(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1050 <array_merge@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rsi
lea    -0x60(%rbp),%rdx
mov    $0x8,%edi
call   1060 <arrays_match@plt>
mov    %eax,%edi
lea    0xe90(%rip),%rsi
lea    0xeab(%rip),%rdx
mov    $0x31,%ecx
call   1040 <_assert_true@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_one_longer_list>:
sub    $0x68,%rsp
movl   $0xa,0x4(%rsp)
mov    0xedd(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rax
mov    %rax,0x8(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    $0x1,%edi
call   1040 <array_merge@plt>
lea    0x40(%rsp),%rdx
mov    $0x8,%edi
mov    %rax,%rsi
call   1050 <arrays_match@plt>
lea    0xea1(%rip),%rsi
lea    0xebc(%rip),%rdx
mov    %eax,%edi
mov    $0x31,%ecx
call   1030 <_assert_true@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.test_one_longer_list.sizes = [1 x i32] [i32 10]
@__const.test_one_longer_list.a0 = [10 x i32] [i32 3, i32 2, i32 0, i32 5, i32 8, i32 9, i32 6, i32 3, i32 2, i32 0]
@__const.test_one_longer_list.expected = [8 x i32] [i32 7, i32 0, i32 2, i32 3, i32 5, i32 6, i32 8, i32 9]
@.str = [34 x i8] c"arrays_match(8, 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_one_longer_list() {
%1 = alloca i32
%2 = alloca [1 x i32]
%3 = alloca [10 x i32]
%4 = alloca [1 x i32*]
%5 = alloca [8 x i32]
%6 = alloca i32*
store i32 1, i32* %1
%7 = bitcast [1 x i32]* %2 to i8*
%8 = bitcast [10 x i32]* %3 to i8*
%9 = getelementptr inbounds [1 x i32*], [1 x i32*]* %4, i64 0, i64 0
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
store i32* %10, i32** %9
%11 = bitcast [8 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 [8 x i32], [8 x i32]* %5, i64 0, i64 0
%18 = call i64 @arrays_match(i32 8, 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 49)
ret void
}

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