#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);
scalar_t__ arrays_match(int, int *, int *);
int /*<<< orphan*/ mergesort(int, int *);
void test_ordered(void) {
  int a[] = {0, 2, 3, 5, 6, 8, 9};
  int expected[] = {0, 2, 3, 5, 6, 8, 9};
  mergesort(7, a);
  _assert_true((int)(arrays_match(7, a, expected)),
               "arrays_match(7, a, 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/mergesort/mergesort_test.c",
               57);
}


x86 assembly (clang, -O0):
<test_ordered>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb9(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeaf(%rip),%eax
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x7,%edi
call   1030 <mergesort@plt>
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x7,%edi
call   1050 <arrays_match@plt>
mov    %eax,%edi
lea    0xe87(%rip),%rsi
lea    0xe9d(%rip),%rdx
mov    $0x39,%ecx
call   1040 <_assert_true@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ordered>:
push   %rbx
sub    $0x40,%rsp
movups 0xed0(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xeb8(%rip),%xmm1
movaps %xmm1,0x20(%rsp)
movups %xmm0,0xc(%rsp)
movaps %xmm1,(%rsp)
lea    0x20(%rsp),%rbx
mov    $0x7,%edi
mov    %rbx,%rsi
call   1030 <mergesort@plt>
mov    %rsp,%rdx
mov    $0x7,%edi
mov    %rbx,%rsi
call   1050 <arrays_match@plt>
lea    0xe9d(%rip),%rsi
lea    0xeb3(%rip),%rdx
mov    %eax,%edi
mov    $0x39,%ecx
call   1040 <_assert_true@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_ordered.a = [7 x i32] [i32 0, i32 2, i32 3, i32 5, i32 6, i32 8, i32 9]
@__const.test_ordered.expected = [7 x i32] [i32 0, i32 2, i32 3, i32 5, i32 6, i32 8, i32 9]
@.str = [29 x i8] c"arrays_match(7, a, expected)\00"
@.str.1 = [167 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/mergesort/mergesort_test.c\00"
define void @test_ordered() {
%1 = alloca [7 x i32]
%2 = alloca [7 x i32]
%3 = bitcast [7 x i32]* %1 to i8*
%4 = bitcast [7 x i32]* %2 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%6 = call i32 @mergesort(i32 7, i32* %5)
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%9 = call i64 @arrays_match(i32 7, i32* %7, i32* %8)
%10 = trunc i64 %9 to i32
%11 = call i32 @_assert_true(i32 %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0), i32 57)
ret void
}

LLVM IR (-O2):
@__const.test_ordered.expected = [7 x i32] [i32 0, i32 2, i32 3, i32 5, i32 6, i32 8, i32 9]
@.str = [29 x i8] c"arrays_match(7, a, expected)\00"
@.str.1 = [167 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/mergesort/mergesort_test.c\00"
define void @test_ordered() {
%1 = alloca [7 x i32]
%2 = alloca [7 x i32]
%3 = bitcast [7 x i32]* %1 to i8*
%4 = bitcast [7 x i32]* %2 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%6 = call i32 @mergesort(i32 7, i32* %5)
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%8 = call i64 @arrays_match(i32 7, i32* %5, i32* %7)
%9 = trunc i64 %8 to i32
%10 = call i32 @_assert_true(i32 %9, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0), i32 57)
ret void
}