#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 LZ4_decompress_fast(char const *, char *, int);
int LZ4_decompress_fast_extDict(char const *, char *, int, char const *, int);
int LZ4_decompress_fast_usingDict(const char *source, char *dest,
                                  int originalSize, const char *dictStart,
                                  int dictSize) {
  if (dictSize == 0 || dictStart + dictSize == dest)
    return LZ4_decompress_fast(source, dest, originalSize);
  return LZ4_decompress_fast_extDict(source, dest, originalSize, dictStart,
                                     dictSize);
}


x86 assembly (clang, -O0):
<LZ4_decompress_fast_usingDict>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     115a <LZ4_decompress_fast_usingDict+0x3a>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
add    %rcx,%rax
cmp    -0x18(%rbp),%rax
jne    1172 <LZ4_decompress_fast_usingDict+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <LZ4_decompress_fast@plt>
mov    %eax,-0x4(%rbp)
jmp    118d <LZ4_decompress_fast_usingDict+0x6d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
call   1040 <LZ4_decompress_fast_extDict@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_decompress_fast_usingDict>:
test   %r8d,%r8d
je     1135 <LZ4_decompress_fast_usingDict+0x15>
movslq %r8d,%rax
add    %rcx,%rax
cmp    %rsi,%rax
je     1135 <LZ4_decompress_fast_usingDict+0x15>
jmp    1040 <LZ4_decompress_fast_extDict@plt>
jmp    1030 <LZ4_decompress_fast@plt>

LLVM IR (-O0):
define i32 @LZ4_decompress_fast_usingDict(i8* %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %21, label %14
14: ; preds = %5
%15 = load i8*, i8** %10
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8*, i8** %8
%20 = icmp eq i8* %18, %19
br i1 %20, label %21, label %26
21: ; preds = %14, %5
%22 = load i8*, i8** %7
%23 = load i8*, i8** %8
%24 = load i32, i32* %9
%25 = call i32 @LZ4_decompress_fast(i8* %22, i8* %23, i32 %24)
store i32 %25, i32* %6
br label %33
26: ; preds = %14
%27 = load i8*, i8** %7
%28 = load i8*, i8** %8
%29 = load i32, i32* %9
%30 = load i8*, i8** %10
%31 = load i32, i32* %11
%32 = call i32 @LZ4_decompress_fast_extDict(i8* %27, i8* %28, i32 %29, i8* %30, i32 %31)
store i32 %32, i32* %6
br label %33
33: ; preds = %26, %21
%34 = load i32, i32* %6
ret i32 %34
}

LLVM IR (-O2):
define i32 @LZ4_decompress_fast_usingDict(i8* %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = icmp eq i32 %4, 0
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = icmp eq i8* %8, %1
%10 = select i1 %6, i1 true, i1 %9
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = tail call i32 @LZ4_decompress_fast(i8* %0, i8* %1, i32 %2)
br label %15
13: ; preds = %5
%14 = tail call i32 @LZ4_decompress_fast_extDict(i8* %0, i8* %1, i32 %2, i8* %3, i32 %4)
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
ret i32 %16
}