#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 *,
                                size_t);
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);
  ((void)0);
  return LZ4_decompress_fast_extDict(source, dest, originalSize, dictStart,
                                     (size_t)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
movslq -0x2c(%rbp),%r8
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     1136 <LZ4_decompress_fast_usingDict+0x16>
movslq %r8d,%r8
lea    (%rcx,%r8,1),%rax
cmp    %rsi,%rax
je     1136 <LZ4_decompress_fast_usingDict+0x16>
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 %34
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 = sext i32 %31 to i64
%33 = call i32 @LZ4_decompress_fast_extDict(i8* %27, i8* %28, i32 %29, i8* %30, i64 %32)
store i32 %33, i32* %6
br label %34
34: ; preds = %26, %21
%35 = load i32, i32* %6
ret i32 %35
}

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
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = sext i32 %4 to i64
%9 = getelementptr inbounds i8, i8* %3, i64 %8
%10 = icmp eq i8* %9, %1
br i1 %10, label %11, label %13
11: ; preds = %7, %5
%12 = tail call i32 @LZ4_decompress_fast(i8* %0, i8* %1, i32 %2)
br label %15
13: ; preds = %7
%14 = tail call i32 @LZ4_decompress_fast_extDict(i8* %0, i8* %1, i32 %2, i8* %3, i64 %8)
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
ret i32 %16
}