#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_unordered_pair(void) {
  int a[] = {8, 5};
  int expected[] = {5, 8};
  mergesort(2, a);
  _assert_true((int)(arrays_match(2, a, expected)),
               "arrays_match(2, 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",
               43);
}


x86 assembly (clang, -O0):
<test_unordered_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rsi
mov    $0x2,%edi
call   1030 <mergesort@plt>
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x2,%edi
call   1050 <arrays_match@plt>
mov    %eax,%edi
lea    0xe99(%rip),%rsi
lea    0xeaf(%rip),%rdx
mov    $0x2b,%ecx
call   1040 <_assert_true@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_unordered_pair>:
push   %rbx
sub    $0x10,%rsp
movabs $0x500000008,%rax
mov    %rax,0x8(%rsp)
movabs $0x800000005,%rax
mov    %rax,(%rsp)
lea    0x8(%rsp),%rbx
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <mergesort@plt>
mov    %rsp,%rdx
mov    $0x2,%edi
mov    %rbx,%rsi
call   1050 <arrays_match@plt>
lea    0xe85(%rip),%rsi
lea    0xe9b(%rip),%rdx
mov    %eax,%edi
mov    $0x2b,%ecx
call   1040 <_assert_true@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_unordered_pair.a = [2 x i32] [i32 8, i32 5]
@__const.test_unordered_pair.expected = [2 x i32] [i32 5, i32 8]
@.str = [29 x i8] c"arrays_match(2, 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_unordered_pair() {
%1 = alloca [2 x i32]
%2 = alloca [2 x i32]
%3 = bitcast [2 x i32]* %1 to i8*
%4 = bitcast [2 x i32]* %2 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%6 = call i32 @mergesort(i32 2, i32* %5)
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%9 = call i64 @arrays_match(i32 2, 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 43)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"arrays_match(2, 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_unordered_pair() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 21474836488, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 34359738373, i64* %2
%5 = bitcast i64* %1 to i32*
%6 = call i32 @mergesort(i32 2, i32* %5)
%7 = bitcast i64* %2 to i32*
%8 = call i64 @arrays_match(i32 2, 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 43)
ret void
}