#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 graph_display {
  int dummy;
};
struct bio_graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __finalize_step(struct graph_display *);
int /*<<< orphan*/ __preparation_step(struct graph_display *,
                                      struct bio_graph *);
int __simulation_step(struct graph_display *, int);
int graph_display_force_directed_progressive(struct graph_display *self,
                                             struct bio_graph *g,
                                             int iterator) {
  if (iterator == 0) {
    __preparation_step(self, g);
  }
  int i = __simulation_step(self, iterator);
  __finalize_step(self);
  return i;
}


x86 assembly (clang, -O0):
<graph_display_force_directed_progressive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    115a <graph_display_force_directed_progressive+0x2a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <__preparation_step@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <__simulation_step@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__finalize_step@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<graph_display_force_directed_progressive>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
test   %edx,%edx
jne    1144 <graph_display_force_directed_progressive+0x14>
mov    %rbx,%rdi
call   1050 <__preparation_step@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <__simulation_step@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <__finalize_step@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.graph_display = type { i32 }
%struct.bio_graph = type { i32 }
define i32 @graph_display_force_directed_progressive(%struct.graph_display* %0, %struct.bio_graph* %1, i32 %2) {
%4 = alloca %struct.graph_display*
%5 = alloca %struct.bio_graph*
%6 = alloca i32
%7 = alloca i32
store %struct.graph_display* %0, %struct.graph_display** %4
store %struct.bio_graph* %1, %struct.bio_graph** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load %struct.graph_display*, %struct.graph_display** %4
%12 = load %struct.bio_graph*, %struct.bio_graph** %5
%13 = call i32 @__preparation_step(%struct.graph_display* %11, %struct.bio_graph* %12)
br label %14
14: ; preds = %10, %3
%15 = load %struct.graph_display*, %struct.graph_display** %4
%16 = load i32, i32* %6
%17 = call i32 @__simulation_step(%struct.graph_display* %15, i32 %16)
store i32 %17, i32* %7
%18 = load %struct.graph_display*, %struct.graph_display** %4
%19 = call i32 @__finalize_step(%struct.graph_display* %18)
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
%struct.graph_display = type { i32 }
%struct.bio_graph = type { i32 }
define i32 @graph_display_force_directed_progressive(%struct.graph_display* %0, %struct.bio_graph* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @__preparation_step(%struct.graph_display* %0, %struct.bio_graph* %1)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @__simulation_step(%struct.graph_display* %0, i32 %2)
%9 = tail call i32 @__finalize_step(%struct.graph_display* %0)
ret i32 %8
}