#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 */
typedef size_t uLongf;

/* Variables and functions */
int /*<<< orphan*/ errAbort(char *, long long, int /*<<< orphan*/);
int uncompress(void *, size_t *, void *, size_t);
int /*<<< orphan*/ zlibErrorMessage(int);
size_t zUncompress(void *compressed, size_t compressedSize, void *uncompBuf,
                   size_t uncompBufSize) {
  uLongf uncSize = uncompBufSize;
  int err = uncompress(uncompBuf, &uncSize, compressed, compressedSize);
  if (err != 0)
    errAbort("Couldn't zUncompress %lld bytes: %s", (long long)compressedSize,
             zlibErrorMessage(err));
  return uncSize;
}


x86 assembly (clang, -O0):
<zUncompress>:
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    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x28(%rbp),%rsi
call   1030 <uncompress@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     1194 <zUncompress+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x2c(%rbp),%edi
call   1050 <zlibErrorMessage@plt>
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
lea    0xe71(%rip),%rdi
call   1040 <errAbort@plt>
mov    -0x28(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zUncompress>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %rcx,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %rdx,%rdi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1030 <uncompress@plt>
test   %eax,%eax
je     116f <zUncompress+0x3f>
mov    %eax,%edi
call   1050 <zlibErrorMessage@plt>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <errAbort@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Couldn't zUncompress %lld bytes: %s\00"
define i64 @zUncompress(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%11 = load i64, i64* %8
store i64 %11, i64* %9
%12 = load i8*, i8** %7
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = call i32 @uncompress(i8* %12, i64* %9, i8* %13, i64 %14)
store i32 %15, i32* %10
%16 = load i32, i32* %10
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %4
%19 = load i64, i64* %6
%20 = load i32, i32* %10
%21 = call i32 @zlibErrorMessage(i32 %20)
%22 = call i32 @errAbort(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %19, i32 %21)
br label %23
23: ; preds = %18, %4
%24 = load i64, i64* %9
ret i64 %24
}

LLVM IR (-O2):
@.str = [36 x i8] c"Couldn't zUncompress %lld bytes: %s\00"
define i64 @zUncompress(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i64
%6 = bitcast i64* %5 to i8*
store i64 %3, i64* %5
%7 = call i32 @uncompress(i8* %2, i64* %5, i8* %0, i64 %1)
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = call i32 @zlibErrorMessage(i32 %7)
%11 = call i32 @errAbort(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %1, i32 %10)
br label %12
12: ; preds = %9, %4
%13 = load i64, i64* %5
ret i64 %13
}