#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 */
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  size_t avail_in;
  void *next_in;
  size_t avail_out;
  void *next_out;
};
typedef TYPE_1__ z_stream;

/* Variables and functions */
int /*<<< orphan*/ Z_FINISH;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ inflate(TYPE_1__ *, int /*<<< orphan*/);
int /*<<< orphan*/ inflateEnd(TYPE_1__ *);
int /*<<< orphan*/ inflateInit2(TYPE_1__ *, int);
void Gzip_inflate(void *restrict src, size_t src_len, void *restrict dst,
                  size_t dst_len) {
  z_stream stream = {
      .avail_in = src_len,
      .next_in = src,
      .avail_out = dst_len,
      .next_out = dst,
  };
  inflateInit2(&stream, 15 + 16);
  inflate(&stream, Z_FINISH);
  inflateEnd(&stream);
  assert(!stream.avail_out && !stream.avail_in);
}


x86 assembly (clang, -O0):
<Gzip_inflate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x1f,%esi
call   1040 <inflateInit2@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdi
call   1030 <inflate@plt>
lea    -0x40(%rbp),%rdi
call   1060 <inflateEnd@plt>
xor    %eax,%eax
cmpq   $0x0,-0x30(%rbp)
mov    %al,-0x41(%rbp)
jne    11be <Gzip_inflate+0x7e>
cmpq   $0x0,-0x40(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gzip_inflate>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,(%rsp)
mov    %rdi,0x8(%rsp)
mov    %rcx,0x10(%rsp)
mov    %rdx,0x18(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1f,%esi
call   1040 <inflateInit2@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <inflate@plt>
mov    %rbx,%rdi
call   1060 <inflateEnd@plt>
mov    0x10(%rsp),%rax
xor    %edi,%edi
or     (%rsp),%rax
sete   %dil
call   1050 <assert@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i64, i8*, i64, i8* }
@Z_FINISH = global i32 0
define void @Gzip_inflate(i8* noalias %0, i64 %1, i8* noalias %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca %struct.TYPE_5__
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 0
%11 = load i64, i64* %6
store i64 %11, i64* %10
%12 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 1
%13 = load i8*, i8** %5
store i8* %13, i8** %12
%14 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 2
%15 = load i64, i64* %8
store i64 %15, i64* %14
%16 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 3
%17 = load i8*, i8** %7
store i8* %17, i8** %16
%18 = call i32 @inflateInit2(%struct.TYPE_5__* %9, i32 31)
%19 = load i32, i32* @Z_FINISH
%20 = call i32 @inflate(%struct.TYPE_5__* %9, i32 %19)
%21 = call i32 @inflateEnd(%struct.TYPE_5__* %9)
%22 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 2
%23 = load i64, i64* %22
%24 = icmp ne i64 %23, 0
br i1 %24, label %30, label %25
25: ; preds = %4
%26 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 0
%27 = load i64, i64* %26
%28 = icmp ne i64 %27, 0
%29 = xor i1 %28, true
br label %30
30: ; preds = %25, %4
%31 = phi i1 [ false, %4 ], [ %29, %25 ]
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
ret void
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i64, i8*, i64, i8* }
@Z_FINISH = global i32 0
define void @Gzip_inflate(i8* noalias %0, i64 %1, i8* noalias %2, i64 %3) {
%5 = alloca %struct.TYPE_5__
%6 = bitcast %struct.TYPE_5__* %5 to i8*
%7 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 0
store i64 %1, i64* %7
%8 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 1
store i8* %0, i8** %8
%9 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 2
store i64 %3, i64* %9
%10 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i64 0, i32 3
store i8* %2, i8** %10
%11 = call i32 @inflateInit2(%struct.TYPE_5__* %5, i32 31)
%12 = load i32, i32* @Z_FINISH
%13 = call i32 @inflate(%struct.TYPE_5__* %5, i32 %12)
%14 = call i32 @inflateEnd(%struct.TYPE_5__* %5)
%15 = load i64, i64* %9
%16 = icmp eq i64 %15, 0
%17 = load i64, i64* %7
%18 = icmp eq i64 %17, 0
%19 = select i1 %16, i1 %18, i1 false
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret void
}