#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 diGraph {
  int dummy;
};
struct dgNode {
  int dummy;
};
struct bfGraph {
  int dummy;
};

/* Variables and functions */
int bfCheckGraph(struct bfGraph *);
int /*<<< orphan*/ bfGraphFree(struct bfGraph **);
struct bfGraph *bfGraphFromRangeGraph(struct diGraph *,
                                      int (*)(struct dgEdge *, int *, int *),
                                      struct dgNode *, struct dgNode *, int,
                                      int);
int dgAddedRangeConsistent(struct diGraph *rangeGraph, struct dgNode *a,
                           struct dgNode *b, int abMin, int abMax,
                           int (*findEdgeRange)(struct dgEdge *edge,
                                                int *retMin, int *retMax)) {
  struct bfGraph *bfGraph;
  int ok;
  bfGraph =
      bfGraphFromRangeGraph(rangeGraph, findEdgeRange, a, b, abMin, abMax);
  ok = bfCheckGraph(bfGraph);
  bfGraphFree(&bfGraph);
  return ok;
}


x86 assembly (clang, -O0):
<dgAddedRangeConsistent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1050 <bfGraphFromRangeGraph@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <bfCheckGraph@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <bfGraphFree@plt>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgAddedRangeConsistent>:
push   %rbx
sub    $0x10,%rsp
mov    %r8d,%eax
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %r9,%rsi
mov    %eax,%r9d
call   1050 <bfGraphFromRangeGraph@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
call   1040 <bfCheckGraph@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
call   1030 <bfGraphFree@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.diGraph = type { i32 }
%struct.dgNode = type { i32 }
%struct.dgEdge = type opaque
%struct.bfGraph = type { i32 }
%struct.dgEdge.0 = type opaque
define i32 @dgAddedRangeConsistent(%struct.diGraph* %0, %struct.dgNode* %1, %struct.dgNode* %2, i32 %3, i32 %4, i32 (%struct.dgEdge*, i32*, i32*)* %5) {
%7 = alloca %struct.diGraph*
%8 = alloca %struct.dgNode*
%9 = alloca %struct.dgNode*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32 (%struct.dgEdge*, i32*, i32*)*
%13 = alloca %struct.bfGraph*
%14 = alloca i32
store %struct.diGraph* %0, %struct.diGraph** %7
store %struct.dgNode* %1, %struct.dgNode** %8
store %struct.dgNode* %2, %struct.dgNode** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 (%struct.dgEdge*, i32*, i32*)* %5, i32 (%struct.dgEdge*, i32*, i32*)** %12
%15 = load %struct.diGraph*, %struct.diGraph** %7
%16 = load i32 (%struct.dgEdge*, i32*, i32*)*, i32 (%struct.dgEdge*, i32*, i32*)** %12
%17 = bitcast i32 (%struct.dgEdge*, i32*, i32*)* %16 to i32 (%struct.dgEdge.0*, i32*, i32*)*
%18 = load %struct.dgNode*, %struct.dgNode** %8
%19 = load %struct.dgNode*, %struct.dgNode** %9
%20 = load i32, i32* %10
%21 = load i32, i32* %11
%22 = call %struct.bfGraph* @bfGraphFromRangeGraph(%struct.diGraph* %15, i32 (%struct.dgEdge.0*, i32*, i32*)* %17, %struct.dgNode* %18, %struct.dgNode* %19, i32 %20, i32 %21)
store %struct.bfGraph* %22, %struct.bfGraph** %13
%23 = load %struct.bfGraph*, %struct.bfGraph** %13
%24 = call i32 @bfCheckGraph(%struct.bfGraph* %23)
store i32 %24, i32* %14
%25 = call i32 @bfGraphFree(%struct.bfGraph** %13)
%26 = load i32, i32* %14
ret i32 %26
}

LLVM IR (-O2):
%struct.diGraph = type { i32 }
%struct.dgNode = type { i32 }
%struct.dgEdge = type opaque
%struct.bfGraph = type { i32 }
%struct.dgEdge.0 = type opaque
define i32 @dgAddedRangeConsistent(%struct.diGraph* %0, %struct.dgNode* %1, %struct.dgNode* %2, i32 %3, i32 %4, i32 (%struct.dgEdge*, i32*, i32*)* %5) {
%7 = alloca %struct.bfGraph*
%8 = bitcast %struct.bfGraph** %7 to i8*
%9 = bitcast i32 (%struct.dgEdge*, i32*, i32*)* %5 to i32 (%struct.dgEdge.0*, i32*, i32*)*
%10 = tail call %struct.bfGraph* @bfGraphFromRangeGraph(%struct.diGraph* %0, i32 (%struct.dgEdge.0*, i32*, i32*)* %9, %struct.dgNode* %1, %struct.dgNode* %2, i32 %3, i32 %4)
store %struct.bfGraph* %10, %struct.bfGraph** %7
%11 = tail call i32 @bfCheckGraph(%struct.bfGraph* %10)
%12 = call i32 @bfGraphFree(%struct.bfGraph** %7)
ret i32 %11
}