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


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

x86 assembly (clang, -O2):
<testinflateInit>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <inflateInit@plt>
mov    %eax,%ebp
cmpq   $0x0,(%rbx)
je     1137 <testinflateInit+0x17>
test   %ebp,%ebp
je     1145 <testinflateInit+0x25>
lea    0xec2(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xece(%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 = [26 x i8] c"inflateInit(): Error: %d\0A\00"
@.str.1 = [17 x i8] c"inflateInit: %d\0A\00"
define void @testinflateInit(%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 @inflateInit(%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 eq 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 ([26 x i8], [26 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 ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32* }
@.str = [26 x i8] c"inflateInit(): Error: %d\0A\00"
@.str.1 = [17 x i8] c"inflateInit: %d\0A\00"
define void @testinflateInit(%struct.TYPE_4__* %0) {
%2 = tail call i32 @inflateInit(%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 eq 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 ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %10
10: ; preds = %1, %8
%11 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}