#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 */

/* Type definitions */
typedef scalar_t__ gzFile;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ Z_NULL;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ gzopen(char *, char *);
int /*<<< orphan*/ stdout;
gzFile fileOpenGZ(char *fileName, char *mode) {
  gzFile gzfp;
  gzfp = gzopen(fileName, mode);
  if (gzfp == Z_NULL) {
    fprintf(stdout, "Error: Cannot Open the file %s\n", fileName);
    fflush(stdout);
    exit(EXIT_FAILURE);
  }
  return gzfp;
}


x86 assembly (clang, -O0):
<fileOpenGZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <gzopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2e74(%rip),%rcx
cmp    (%rcx),%rax
jne    11aa <fileOpenGZ+0x6a>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe77(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileOpenGZ>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <gzopen@plt>
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
je     1160 <fileOpenGZ+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e69(%rip),%r14
mov    (%r14),%edi
lea    0xe8f(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
call   1040 <fflush@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@Z_NULL = global i64 0
@stdout = global i32 0
@.str = [32 x i8] c"Error: Cannot Open the file %s\0A\00"
@EXIT_FAILURE = global i32 0
define i64 @fileOpenGZ(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i64 @gzopen(i8* %6, i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* @Z_NULL
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load i32, i32* @stdout
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @stdout
%17 = call i32 @fflush(i32 %16)
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %2
%21 = load i64, i64* %5
ret i64 %21
}

LLVM IR (-O2):
@Z_NULL = global i64 0
@stdout = global i32 0
@.str = [32 x i8] c"Error: Cannot Open the file %s\0A\00"
@EXIT_FAILURE = global i32 0
define i64 @fileOpenGZ(i8* %0, i8* %1) {
%3 = tail call i64 @gzopen(i8* %0, i8* %1)
%4 = load i64, i64* @Z_NULL
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret i64 %3
}