#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_multiple_copies_of_longer_list_different_orders(void) {
  int num_arrays = 9;
  int sizes[] = {10, 10, 10, 10, 10, 10, 10, 10, 10};
  int a0[] = {3, 2, 0, 5, 8, 9, 6, 3, 2, 0};
  int a1[] = {5, 8, 9, 3, 2, 0, 6, 3, 2, 0};
  int a2[] = {8, 5, 0, 2, 3, 0, 2, 3, 6, 9};
  int *a[] = {a0, a1, a2, a0, a1, a2, a0, a1, a2};
  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",
               75);
}


x86 assembly (clang, -O0):
<test_multiple_copies_of_longer_list_different_orders>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x9,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0xc0(%rbp),%rdi
lea    0xeee(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x60(%rbp),%rax
mov    %rax,-0x110(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x108(%rbp)
lea    -0xc0(%rbp),%rax
mov    %rax,-0x100(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0xf8(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0xf0(%rbp)
lea    -0xc0(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0xe0(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0xd8(%rbp)
lea    -0xc0(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    0xe98(%rip),%rax
mov    %rax,-0x130(%rbp)
mov    0xe92(%rip),%rax
mov    %rax,-0x128(%rbp)
mov    0xe8c(%rip),%rax
mov    %rax,-0x120(%rbp)
mov    0xe86(%rip),%rax
mov    %rax,-0x118(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x110(%rbp),%rdx
call   1050 <array_merge@plt>
mov    %rax,-0x138(%rbp)
mov    -0x138(%rbp),%rsi
lea    -0x130(%rbp),%rdx
mov    $0x8,%edi
call   1060 <arrays_match@plt>
mov    %eax,%edi
lea    0xe4c(%rip),%rsi
lea    0xe67(%rip),%rdx
mov    $0x4b,%ecx
call   1040 <_assert_true@plt>
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_multiple_copies_of_longer_list_different_orders>:
sub    $0x138,%rsp
mov    0xee3(%rip),%eax
mov    %eax,0x70(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
mov    0xef0(%rip),%rax
mov    %rax,0x100(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
mov    0xef3(%rip),%rax
mov    %rax,0xd0(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
mov    0xef6(%rip),%rax
mov    %rax,0xa0(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
lea    0xe0(%rsp),%rax
mov    %rax,(%rsp)
lea    0xb0(%rsp),%rcx
mov    %rcx,0x8(%rsp)
lea    0x80(%rsp),%rdx
mov    %rdx,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rdx,0x28(%rsp)
mov    %rax,0x30(%rsp)
mov    %rcx,0x38(%rsp)
mov    %rdx,0x40(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
lea    0x50(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x9,%edi
call   1040 <array_merge@plt>
lea    0x110(%rsp),%rdx
mov    $0x8,%edi
mov    %rax,%rsi
call   1050 <arrays_match@plt>
lea    0xe70(%rip),%rsi
lea    0xe8b(%rip),%rdx
mov    %eax,%edi
mov    $0x4b,%ecx
call   1030 <_assert_true@plt>
add    $0x138,%rsp
ret

LLVM IR (-O0):
@__const.test_multiple_copies_of_longer_list_different_orders.sizes = [9 x i32] [i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10]
@__const.test_multiple_copies_of_longer_list_different_orders.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_multiple_copies_of_longer_list_different_orders.a1 = [10 x i32] [i32 5, i32 8, i32 9, i32 3, i32 2, i32 0, i32 6, i32 3, i32 2, i32 0]
@__const.test_multiple_copies_of_longer_list_different_orders.a2 = [10 x i32] [i32 8, i32 5, i32 0, i32 2, i32 3, i32 0, i32 2, i32 3, i32 6, i32 9]
@__const.test_multiple_copies_of_longer_list_different_orders.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_multiple_copies_of_longer_list_different_orders() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca [10 x i32]
%4 = alloca [10 x i32]
%5 = alloca [10 x i32]
%6 = alloca [9 x i32*]
%7 = alloca [8 x i32]
%8 = alloca i32*
store i32 9, i32* %1
%9 = bitcast [9 x i32]* %2 to i8*
%10 = bitcast [10 x i32]* %3 to i8*
%11 = bitcast [10 x i32]* %4 to i8*
%12 = bitcast [10 x i32]* %5 to i8*
%13 = getelementptr inbounds [9 x i32*], [9 x i32*]* %6, i64 0, i64 0
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
store i32* %14, i32** %13
%15 = getelementptr inbounds i32*, i32** %13, i64 1
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
store i32* %16, i32** %15
%17 = getelementptr inbounds i32*, i32** %15, i64 1
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
store i32* %18, i32** %17
%19 = getelementptr inbounds i32*, i32** %17, i64 1
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
store i32* %20, i32** %19
%21 = getelementptr inbounds i32*, i32** %19, i64 1
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
store i32* %22, i32** %21
%23 = getelementptr inbounds i32*, i32** %21, i64 1
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
store i32* %24, i32** %23
%25 = getelementptr inbounds i32*, i32** %23, i64 1
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
store i32* %26, i32** %25
%27 = getelementptr inbounds i32*, i32** %25, i64 1
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
store i32* %28, i32** %27
%29 = getelementptr inbounds i32*, i32** %27, i64 1
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
store i32* %30, i32** %29
%31 = bitcast [8 x i32]* %7 to i8*
%32 = load i32, i32* %1
%33 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%34 = getelementptr inbounds [9 x i32*], [9 x i32*]* %6, i64 0, i64 0
%35 = call i32* @array_merge(i32 %32, i32* %33, i32** %34)
store i32* %35, i32** %8
%36 = load i32*, i32** %8
%37 = getelementptr inbounds [8 x i32], [8 x i32]* %7, i64 0, i64 0
%38 = call i64 @arrays_match(i32 8, i32* %36, i32* %37)
%39 = trunc i64 %38 to i32
%40 = call i32 @_assert_true(i32 %39, 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 75)
ret void
}

LLVM IR (-O2):
@__const.test_multiple_copies_of_longer_list_different_orders.sizes = [9 x i32] [i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10]
@__const.test_multiple_copies_of_longer_list_different_orders.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_multiple_copies_of_longer_list_different_orders.a1 = [10 x i32] [i32 5, i32 8, i32 9, i32 3, i32 2, i32 0, i32 6, i32 3, i32 2, i32 0]
@__const.test_multiple_copies_of_longer_list_different_orders.a2 = [10 x i32] [i32 8, i32 5, i32 0, i32 2, i32 3, i32 0, i32 2, i32 3, i32 6, i32 9]
@__const.test_multiple_copies_of_longer_list_different_orders.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_multiple_copies_of_longer_list_different_orders() {
%1 = alloca [9 x i32]
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
%4 = alloca [10 x i32]
%5 = alloca [9 x i32*]
%6 = alloca [8 x i32]
%7 = bitcast [9 x i32]* %1 to i8*
%8 = bitcast [10 x i32]* %2 to i8*
%9 = bitcast [10 x i32]* %3 to i8*
%10 = bitcast [10 x i32]* %4 to i8*
%11 = bitcast [9 x i32*]* %5 to i8*
%12 = getelementptr inbounds [9 x i32*], [9 x i32*]* %5, i64 0, i64 0
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32* %13, i32** %12
%14 = getelementptr inbounds [9 x i32*], [9 x i32*]* %5, i64 0, i64 1
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
store i32* %15, i32** %14
%16 = getelementptr inbounds [9 x i32*], [9 x i32*]* %5, i64 0, i64 2
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
store i32* %17, i32** %16
%18 = getelementptr inbounds [9 x i32*], [9 x i32*]* %5, i64 0, i64 3
store i32* %13, i32** %18
%19 = getelementptr inbounds [9 x i32*], [9 x i32*]* %5, i64 0, i64 4
store i32* %15, i32** %19
%20 = getelementptr inbounds [9 x i32*], [9 x i32*]* %5, i64 0, i64 5
store i32* %17, i32** %20
%21 = getelementptr inbounds [9 x i32*], [9 x i32*]* %5, i64 0, i64 6
store i32* %13, i32** %21
%22 = getelementptr inbounds [9 x i32*], [9 x i32*]* %5, i64 0, i64 7
store i32* %15, i32** %22
%23 = getelementptr inbounds [9 x i32*], [9 x i32*]* %5, i64 0, i64 8
store i32* %17, i32** %23
%24 = bitcast [8 x i32]* %6 to i8*
%25 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%26 = call i32* @array_merge(i32 9, i32* %25, i32** %12)
%27 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%28 = call i64 @arrays_match(i32 8, i32* %26, i32* %27)
%29 = trunc i64 %28 to i32
%30 = call i32 @_assert_true(i32 %29, 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 75)
ret void
}