#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__ {
  int /*<<< orphan*/ *state;
};

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


x86 assembly (clang, -O0):
<testdeflateEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <deflateEnd@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1150 <testdeflateEnd+0x30>
cmpl   $0x0,-0xc(%rbp)
je     115f <testdeflateEnd+0x3f>
mov    -0xc(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testdeflateEnd>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <deflateEnd@plt>
mov    %eax,%ebp
cmpq   $0x0,(%rbx)
jne    1137 <testdeflateEnd+0x17>
test   %ebp,%ebp
je     1145 <testdeflateEnd+0x25>
lea    0xec2(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32* }
@.str = [25 x i8] c"deflateEnd(): Error: %d\0A\00"
@.str.1 = [16 x i8] c"deflateEnd: %d\0A\00"
define void @testdeflateEnd(%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 @deflateEnd(%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 i32*, i32** %7
%9 = icmp ne i32* %8, null
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10, %1
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret void
}

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