#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_4__ TYPE_1__;

/* Type definitions */
typedef TYPE_1__ *z_streamp;
struct TYPE_4__ {
  scalar_t__ state;
};

/* Variables and functions */
scalar_t__ Z_NULL;
int inflateEnd(TYPE_1__ *);
int /*<<< orphan*/ printf(char *, int);
void testinflateEnd(z_streamp strm) {
  int ret;
  ret = inflateEnd(strm);
  if (strm->state != Z_NULL || ret != 0)
    printf("inflateEnd(): Error: %d\n", ret);
  printf("inflateEnd: %d\n", ret);
}


x86 assembly (clang, -O0):
<testinflateEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <inflateEnd@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
jne    1159 <testinflateEnd+0x39>
cmpl   $0x0,-0xc(%rbp)
je     1168 <testinflateEnd+0x48>
mov    -0xc(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testinflateEnd>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <inflateEnd@plt>
mov    %eax,%ebp
mov    (%rbx),%rax
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%rax
jne    1140 <testinflateEnd+0x20>
test   %ebp,%ebp
je     114e <testinflateEnd+0x2e>
lea    0xeb9(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i64 }
@Z_NULL = global i64 0
@.str = [25 x i8] c"inflateEnd(): Error: %d\0A\00"
@.str.1 = [16 x i8] c"inflateEnd: %d\0A\00"
define void @testinflateEnd(%struct.TYPE_4__* %0) {
%2 = alloca %struct.TYPE_4__*
%3 = alloca i32
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %2
%4 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%5 = call i32 @inflateEnd(%struct.TYPE_4__* %4)
store i32 %5, i32* %3
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64, i64* @Z_NULL
%10 = icmp ne i64 %8, %9
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11, %1
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %18)
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i64 }
@Z_NULL = global i64 0
@.str = [25 x i8] c"inflateEnd(): Error: %d\0A\00"
@.str.1 = [16 x i8] c"inflateEnd: %d\0A\00"
define void @testinflateEnd(%struct.TYPE_4__* %0) {
%2 = tail call i32 @inflateEnd(%struct.TYPE_4__* %0)
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = load i64, i64* @Z_NULL
%6 = icmp ne i64 %4, %5
%7 = icmp ne i32 %2, 0
%8 = select i1 %6, i1 true, i1 %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %11
11: ; preds = %1, %9
%12 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}