#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 */
char *Ptngc_warnmalloc_x(size_t const, char *, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ ms_inner(void *, size_t const, int /*<<< orphan*/,
                            size_t const,
                            int (*)(void const *, void const *, void const *),
                            void *, char *);
void Ptngc_merge_sort(void *base, const size_t nmemb, const size_t size,
                      int (*compar)(const void *v1, const void *v2,
                                    const void *private),
                      void *private) {
  char *warr = Ptngc_warnmalloc_x(
      nmemb * size,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/ctk3b/mdtraj/refs/heads/master/mdtraj/formats/"
      "tng/src/compression/merge_sort.c",
      87);
  ms_inner(base, size, 0, nmemb, compar, private, warr);
  free(warr);
}


x86 assembly (clang, -O0):
<Ptngc_merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
lea    0xea4(%rip),%rsi
mov    $0x57,%edx
call   1050 <Ptngc_warnmalloc_x@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
xor    %edx,%edx
mov    %rax,(%rsp)
call   1040 <ms_inner@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ptngc_merge_sort>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %rsi,%r12
mov    %rdi,%r13
mov    %rdx,%rdi
imul   %rsi,%rdi
lea    0xea8(%rip),%rsi
mov    $0x57,%edx
call   1050 <Ptngc_warnmalloc_x@plt>
mov    %rax,%rbp
mov    %rax,(%rsp)
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1040 <ms_inner@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ctk3b/mdtraj/refs/heads/master/mdtraj/formats/tng/src/compression/merge_sort.c\00"
define void @Ptngc_merge_sort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*, i8*)* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32 (i8*, i8*, i8*)*
%10 = alloca i8*
%11 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i32 (i8*, i8*, i8*)* %3, i32 (i8*, i8*, i8*)** %9
store i8* %4, i8** %10
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = mul i64 %12, %13
%15 = call i8* @Ptngc_warnmalloc_x(i64 %14, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 87)
store i8* %15, i8** %11
%16 = load i8*, i8** %6
%17 = load i64, i64* %8
%18 = load i64, i64* %7
%19 = load i32 (i8*, i8*, i8*)*, i32 (i8*, i8*, i8*)** %9
%20 = load i8*, i8** %10
%21 = load i8*, i8** %11
%22 = call i32 @ms_inner(i8* %16, i64 %17, i32 0, i64 %18, i32 (i8*, i8*, i8*)* %19, i8* %20, i8* %21)
%23 = load i8*, i8** %11
%24 = call i32 @free(i8* %23)
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ctk3b/mdtraj/refs/heads/master/mdtraj/formats/tng/src/compression/merge_sort.c\00"
define void @Ptngc_merge_sort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*, i8*)* %3, i8* %4) {
%6 = mul i64 %2, %1
%7 = tail call i8* @Ptngc_warnmalloc_x(i64 %6, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 87)
%8 = tail call i32 @ms_inner(i8* %0, i64 %2, i32 0, i64 %1, i32 (i8*, i8*, i8*)* %3, i8* %4, i8* %7)
%9 = tail call i32 @free(i8* %7)
ret void
}