#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 */
struct gff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gffClose(struct gff *);
scalar_t__ gffOpen(struct gff *, char *);
scalar_t__ gffReadDna(struct gff *);
scalar_t__ gffReadGenes(struct gff *);
int gffOpenAndRead(struct gff *gff, char *fileName) {
  if (gffOpen(gff, fileName))
    if (gffReadDna(gff))
      if (gffReadGenes(gff))
        return 1;
  gffClose(gff);
  return 0;
}


x86 assembly (clang, -O0):
<gffOpenAndRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <gffOpen@plt>
cmp    $0x0,%rax
je     11a3 <gffOpenAndRead+0x63>
mov    -0x10(%rbp),%rdi
call   1050 <gffReadDna@plt>
cmp    $0x0,%rax
je     119e <gffOpenAndRead+0x5e>
mov    -0x10(%rbp),%rdi
call   1060 <gffReadGenes@plt>
cmp    $0x0,%rax
je     1199 <gffOpenAndRead+0x59>
movl   $0x1,-0x4(%rbp)
jmp    11b3 <gffOpenAndRead+0x73>
jmp    119e <gffOpenAndRead+0x5e>
jmp    11a3 <gffOpenAndRead+0x63>
mov    -0x10(%rbp),%rdi
call   1030 <gffClose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gffOpenAndRead>:
push   %rbx
mov    %rdi,%rbx
call   1040 <gffOpen@plt>
test   %rax,%rax
je     1172 <gffOpenAndRead+0x32>
mov    %rbx,%rdi
call   1050 <gffReadDna@plt>
test   %rax,%rax
je     1172 <gffOpenAndRead+0x32>
mov    %rbx,%rdi
call   1060 <gffReadGenes@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1172 <gffOpenAndRead+0x32>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <gffClose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.gff = type { i32 }
define i32 @gffOpenAndRead(%struct.gff* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.gff*
%5 = alloca i8*
store %struct.gff* %0, %struct.gff** %4
store i8* %1, i8** %5
%6 = load %struct.gff*, %struct.gff** %4
%7 = load i8*, i8** %5
%8 = call i64 @gffOpen(%struct.gff* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %2
%11 = load %struct.gff*, %struct.gff** %4
%12 = call i64 @gffReadDna(%struct.gff* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load %struct.gff*, %struct.gff** %4
%16 = call i64 @gffReadGenes(%struct.gff* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 1, i32* %3
br label %24
19: ; preds = %14
br label %20
20: ; preds = %19, %10
br label %21
21: ; preds = %20, %2
%22 = load %struct.gff*, %struct.gff** %4
%23 = call i32 @gffClose(%struct.gff* %22)
store i32 0, i32* %3
br label %24
24: ; preds = %21, %18
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
%struct.gff = type { i32 }
define i32 @gffOpenAndRead(%struct.gff* %0, i8* %1) {
%3 = tail call i64 @gffOpen(%struct.gff* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call i64 @gffReadDna(%struct.gff* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i64 @gffReadGenes(%struct.gff* %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %5, %8, %2
%12 = tail call i32 @gffClose(%struct.gff* %0)
br label %13
13: ; preds = %8, %11
%14 = phi i32 [ 0, %11 ], [ 1, %8 ]
ret i32 %14
}