#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*/ Free(unsigned int *);
int /*<<< orphan*/ extractList_il(void *, unsigned int, unsigned int **,
                                  unsigned int *);
unsigned int *intersect_aux(unsigned int *, unsigned int, unsigned int *,
                            unsigned int, unsigned int *);
int merge_2_uncompressFst(void *ail, unsigned int id1, unsigned int id2,
                          unsigned int *noccs, unsigned int **occs) {
  unsigned int len1;
  unsigned int *arr1;
  extractList_il(ail, id1, &arr1, &len1);
  unsigned int len2;
  unsigned int *arr2;
  extractList_il(ail, id2, &arr2, &len2);
  *occs = intersect_aux(arr1, len1, arr2, len2, noccs);
  Free(arr2);
  return 0;
}


x86 assembly (clang, -O0):
<merge_2_uncompressFst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x30(%rbp),%rdx
lea    -0x24(%rbp),%rcx
call   1030 <extractList_il@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
lea    -0x40(%rbp),%rdx
lea    -0x34(%rbp),%rcx
call   1030 <extractList_il@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    -0x34(%rbp),%ecx
mov    -0x18(%rbp),%r8
call   1050 <intersect_aux@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x40(%rbp),%rdi
call   1040 <Free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_2_uncompressFst>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %edx,%ebp
mov    %rdi,%rbx
lea    0x10(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1030 <extractList_il@plt>
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <extractList_il@plt>
mov    0x10(%rsp),%rdi
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%rdx
mov    (%rsp),%ecx
mov    %r15,%r8
call   1050 <intersect_aux@plt>
mov    %rax,(%r14)
mov    0x8(%rsp),%rdi
call   1040 <Free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @merge_2_uncompressFst(i8* %0, i32 %1, i32 %2, i32* %3, i32** %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32**
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32** %4, i32*** %10
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = call i32 @extractList_il(i8* %15, i32 %16, i32** %12, i32* %11)
%18 = load i8*, i8** %6
%19 = load i32, i32* %8
%20 = call i32 @extractList_il(i8* %18, i32 %19, i32** %14, i32* %13)
%21 = load i32*, i32** %12
%22 = load i32, i32* %11
%23 = load i32*, i32** %14
%24 = load i32, i32* %13
%25 = load i32*, i32** %9
%26 = call i32* @intersect_aux(i32* %21, i32 %22, i32* %23, i32 %24, i32* %25)
%27 = load i32**, i32*** %10
store i32* %26, i32** %27
%28 = load i32*, i32** %14
%29 = call i32 @Free(i32* %28)
ret i32 0
}

LLVM IR (-O2):
define i32 @merge_2_uncompressFst(i8* %0, i32 %1, i32 %2, i32* %3, i32** nocapture writeonly %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = bitcast i32* %6 to i8*
%11 = bitcast i32** %7 to i8*
%12 = call i32 @extractList_il(i8* %0, i32 %1, i32** %7, i32* %6)
%13 = bitcast i32* %8 to i8*
%14 = bitcast i32** %9 to i8*
%15 = call i32 @extractList_il(i8* %0, i32 %2, i32** %9, i32* %8)
%16 = load i32*, i32** %7
%17 = load i32, i32* %6
%18 = load i32*, i32** %9
%19 = load i32, i32* %8
%20 = call i32* @intersect_aux(i32* %16, i32 %17, i32* %18, i32 %19, i32* %3)
store i32* %20, i32** %4
%21 = load i32*, i32** %9
%22 = call i32 @Free(i32* %21)
ret i32 0
}