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

/* Type definitions */
struct TYPE_3__ {
  void *opaque;
  void *zfree;
  void *zalloc;
};
typedef TYPE_1__ z_stream;

/* Variables and functions */
char *ZLIB_VERSION;
void *Z_NULL;
int Z_VERSION_ERROR;
int inflateInit(TYPE_1__ *);
int /*<<< orphan*/ printf(char *, char *, ...);
char *zlibVersion();
int main(int argc, char **argv) {
  z_stream strm;
  int n;
  strm.zalloc = Z_NULL;
  strm.zfree = Z_NULL;
  strm.opaque = Z_NULL;
  n = inflateInit(&strm);
  if (n == Z_VERSION_ERROR) {
    printf("Version mismatch: Compiled with %s, runtime has %s\n", ZLIB_VERSION,
           zlibVersion());
  } else {
    printf("zlib version %s\n", zlibVersion());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e6f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
call   1040 <inflateInit@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2e5a(%rip),%rcx
cmp    (%rcx),%eax
jne    11bd <main+0x8d>
mov    0x2e3b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1050 <zlibVersion@plt>
mov    -0x38(%rbp),%rsi
mov    %rax,%rdx
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d5 <main+0xa5>
mov    $0x0,%al
call   1050 <zlibVersion@plt>
mov    %rax,%rsi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0x2e9c(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x18(%rsp)
mov    %rax,0x10(%rsp)
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <inflateInit@plt>
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%eax
jne    118a <main+0x5a>
mov    0x2e66(%rip),%rax
mov    (%rax),%rbx
xor    %eax,%eax
call   1050 <zlibVersion@plt>
lea    0xe85(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11a2 <main+0x72>
xor    %eax,%eax
call   1050 <zlibVersion@plt>
lea    0xe9c(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i8*, i8*, i8* }
@Z_NULL = global i8* null
@Z_VERSION_ERROR = global i32 0
@.str = [52 x i8] c"Version mismatch: Compiled with %s, runtime has %s\0A\00"
@ZLIB_VERSION = global i8* null
@.str.1 = [17 x i8] c"zlib version %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.TYPE_3__
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8*, i8** @Z_NULL
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 2
store i8* %8, i8** %9
%10 = load i8*, i8** @Z_NULL
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 1
store i8* %10, i8** %11
%12 = load i8*, i8** @Z_NULL
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
store i8* %12, i8** %13
%14 = call i32 @inflateInit(%struct.TYPE_3__* %6)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = load i32, i32* @Z_VERSION_ERROR
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load i8*, i8** @ZLIB_VERSION
%20 = call i8* (...) @zlibVersion()
%21 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %20)
br label %25
22: ; preds = %2
%23 = call i8* (...) @zlibVersion()
%24 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %22, %18
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i8*, i8*, i8* }
@Z_NULL = global i8* null
@Z_VERSION_ERROR = global i32 0
@.str = [52 x i8] c"Version mismatch: Compiled with %s, runtime has %s\0A\00"
@ZLIB_VERSION = global i8* null
@.str.1 = [17 x i8] c"zlib version %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.TYPE_3__
%4 = bitcast %struct.TYPE_3__* %3 to i8*
%5 = load i8*, i8** @Z_NULL
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 2
store i8* %5, i8** %6
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 1
store i8* %5, i8** %7
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
store i8* %5, i8** %8
%9 = call i32 @inflateInit(%struct.TYPE_3__* %3)
%10 = load i32, i32* @Z_VERSION_ERROR
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** @ZLIB_VERSION
%14 = call i8* (...) @zlibVersion()
%15 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
br label %19
16: ; preds = %2
%17 = call i8* (...) @zlibVersion()
%18 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %16, %12
ret i32 0
}