#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 /*<<< orphan*/ Z_DEFAULT_COMPRESSION;
int deflateInit(TYPE_1__ *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void testdeflateInit(z_streamp strm) {
  int ret;
  ret = deflateInit(strm, Z_DEFAULT_COMPRESSION);
  if (strm->state == NULL || ret != 0)
    printf("deflateInit(): Error: %d\n", ret);
  printf("deflateInit: %d\n", ret);
}


x86 assembly (clang, -O0):
<testdeflateInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1040 <deflateInit@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1159 <testdeflateInit+0x39>
cmpl   $0x0,-0xc(%rbp)
je     1168 <testdeflateInit+0x48>
mov    -0xc(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testdeflateInit>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1040 <deflateInit@plt>
mov    %eax,%ebp
cmpq   $0x0,(%rbx)
je     1140 <testdeflateInit+0x20>
test   %ebp,%ebp
je     114e <testdeflateInit+0x2e>
lea    0xeb9(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32* }
@Z_DEFAULT_COMPRESSION = global i32 0
@.str = [26 x i8] c"deflateInit(): Error: %d\0A\00"
@.str.1 = [17 x i8] c"deflateInit: %d\0A\00"
define void @testdeflateInit(%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 = load i32, i32* @Z_DEFAULT_COMPRESSION
%6 = call i32 @deflateInit(%struct.TYPE_4__* %4, i32 %5)
store i32 %6, i32* %3
%7 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = load i32*, i32** %8
%10 = icmp eq i32* %9, null
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 ([26 x i8], [26 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 ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %18)
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32* }
@Z_DEFAULT_COMPRESSION = global i32 0
@.str = [26 x i8] c"deflateInit(): Error: %d\0A\00"
@.str.1 = [17 x i8] c"deflateInit: %d\0A\00"
define void @testdeflateInit(%struct.TYPE_4__* %0) {
%2 = load i32, i32* @Z_DEFAULT_COMPRESSION
%3 = tail call i32 @deflateInit(%struct.TYPE_4__* %0, i32 %2)
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%5 = load i32*, i32** %4
%6 = icmp eq i32* %5, null
%7 = icmp ne i32 %3, 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 ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %11
11: ; preds = %1, %9
%12 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}