void coarsen1(struct vtx_data **graph, int nvtxs, int nedges,
              struct vtx_data ***pcgraph, int *pcnvtxs, int *pcnedges,
              int **pv2cv, int igeom, float **coords, float **ccoords,
              int using_ewgts) {
  extern double coarsen_time;
  extern double match_time;
  double time;
  int *v2cv;
  int *mflag;
  int cnvtxs;
  int nmerged;
  double seconds();
  int maxmatch();
  void makev2cv(), makefgraph();
  time = seconds();
  v2cv = smalloc((nvtxs + 1) * sizeof(int));
  mflag = smalloc((nvtxs + 1) * sizeof(int));
  nmerged = maxmatch(graph, nvtxs, nedges, mflag, using_ewgts, igeom, coords);
  match_time += seconds() - time;
  makev2cv(mflag, nvtxs, v2cv);
  sfree(mflag);
  cnvtxs = nvtxs - nmerged;
  makefgraph(graph, nvtxs, nedges, pcgraph, cnvtxs, pcnedges, v2cv, using_ewgts,
             igeom, coords, ccoords);
  *pcnvtxs = cnvtxs;
  *pv2cv = v2cv;
  coarsen_time += seconds() - time;
}


x86 assembly (clang, -O0):
<coarsen1>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    $0x0,%al
call   1030 <seconds@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x2,%rdi
mov    $0x0,%al
call   1080 <smalloc@plt>
cltq
mov    %rax,-0x48(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x2,%rdi
mov    $0x0,%al
call   1080 <smalloc@plt>
cltq
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x50(%rbp),%rcx
mov    0x30(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1060 <maxmatch@plt>
mov    %eax,-0x58(%rbp)
mov    $0x0,%al
call   1030 <seconds@plt>
subsd  -0x40(%rbp),%xmm0
mov    0x2dd2(%rip),%rax
addsd  (%rax),%xmm0
mov    0x2dc7(%rip),%rax
movsd  %xmm0,(%rax)
mov    -0x50(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x48(%rbp),%rdx
mov    $0x0,%al
call   1070 <makev2cv@plt>
mov    -0x50(%rbp),%rdi
mov    $0x0,%al
call   1040 <sfree@plt>
mov    -0x1c(%rbp),%eax
sub    -0x58(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x54(%rbp),%r8d
mov    -0x38(%rbp),%r9
mov    -0x48(%rbp),%r14
mov    0x30(%rbp),%ebx
mov    0x18(%rbp),%r11d
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
mov    %r14,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
mov    $0x0,%al
call   1050 <makefgraph@plt>
mov    -0x54(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x48(%rbp),%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <seconds@plt>
subsd  -0x40(%rbp),%xmm0
mov    0x2d37(%rip),%rax
addsd  (%rax),%xmm0
mov    0x2d2c(%rip),%rax
movsd  %xmm0,(%rax)
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<coarsen1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x18(%rsp)
mov    %r8,0x20(%rsp)
mov    %rcx,0x10(%rsp)
mov    %edx,%r12d
mov    %esi,%ebx
mov    %rdi,%rbp
mov    %rdi,0x8(%rsp)
xor    %eax,%eax
call   1030 <seconds@plt>
movsd  %xmm0,(%rsp)
movslq %ebx,%r15
lea    0x4(,%r15,4),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <smalloc@plt>
movslq %eax,%r14
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <smalloc@plt>
movslq %eax,%r13
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %r13,%rcx
mov    0x88(%rsp),%r8d
mov    0x70(%rsp),%r9d
xor    %eax,%eax
push   0x78(%rsp)
call   1060 <maxmatch@plt>
add    $0x10,%rsp
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <seconds@plt>
subsd  (%rsp),%xmm0
mov    0x2de4(%rip),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <makev2cv@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <sfree@plt>
mov    %r15d,%ebp
sub    %ebx,%ebp
sub    $0x8,%rsp
mov    0x10(%rsp),%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    0x18(%rsp),%rcx
mov    %ebp,%r8d
mov    0x20(%rsp),%r9
xor    %eax,%eax
push   0x80(%rsp)
push   0x80(%rsp)
mov    0x80(%rsp),%ebx
push   %rbx
mov    0xa0(%rsp),%ebx
push   %rbx
push   %r14
call   1050 <makefgraph@plt>
add    $0x30,%rsp
mov    0x20(%rsp),%rax
mov    %ebp,(%rax)
mov    0x60(%rsp),%rax
mov    %r14,(%rax)
xor    %eax,%eax
call   1030 <seconds@plt>
subsd  (%rsp),%xmm0
mov    0x2d5c(%rip),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.vtx_data = type opaque
@match_time = external global double
@coarsen_time = external global double
define void @coarsen1(%struct.vtx_data** %0, i32 %1, i32 %2, %struct.vtx_data*** %3, i32* %4, i32* %5, i32** %6, i32 %7, float** %8, float** %9, i32 %10) {
%12 = alloca %struct.vtx_data**
%13 = alloca i32
%14 = alloca i32
%15 = alloca %struct.vtx_data***
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32**
%19 = alloca i32
%20 = alloca float**
%21 = alloca float**
%22 = alloca i32
%23 = alloca double
%24 = alloca i32*
%25 = alloca i32*
%26 = alloca i32
%27 = alloca i32
store %struct.vtx_data** %0, %struct.vtx_data*** %12
store i32 %1, i32* %13
store i32 %2, i32* %14
store %struct.vtx_data*** %3, %struct.vtx_data**** %15
store i32* %4, i32** %16
store i32* %5, i32** %17
store i32** %6, i32*** %18
store i32 %7, i32* %19
store float** %8, float*** %20
store float** %9, float*** %21
store i32 %10, i32* %22
%28 = call double (...) @seconds()
store double %28, double* %23
%29 = load i32, i32* %13
%30 = add nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = mul i64 %31, 4
%33 = call i32 (i64, ...) bitcast (i32 (...)* @smalloc to i32 (i64, ...)*)(i64 %32)
%34 = sext i32 %33 to i64
%35 = inttoptr i64 %34 to i32*
store i32* %35, i32** %24
%36 = load i32, i32* %13
%37 = add nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = mul i64 %38, 4
%40 = call i32 (i64, ...) bitcast (i32 (...)* @smalloc to i32 (i64, ...)*)(i64 %39)
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to i32*
store i32* %42, i32** %25
%43 = load %struct.vtx_data**, %struct.vtx_data*** %12
%44 = load i32, i32* %13
%45 = load i32, i32* %14
%46 = load i32*, i32** %25
%47 = load i32, i32* %22
%48 = load i32, i32* %19
%49 = load float**, float*** %20
%50 = call i32 (%struct.vtx_data**, i32, i32, i32*, i32, i32, float**, ...) bitcast (i32 (...)* @maxmatch to i32 (%struct.vtx_data**, i32, i32, i32*, i32, i32, float**, ...)*)(%struct.vtx_data** %43, i32 %44, i32 %45, i32* %46, i32 %47, i32 %48, float** %49)
store i32 %50, i32* %27
%51 = call double (...) @seconds()
%52 = load double, double* %23
%53 = fsub double %51, %52
%54 = load double, double* @match_time
%55 = fadd double %54, %53
store double %55, double* @match_time
%56 = load i32*, i32** %25
%57 = load i32, i32* %13
%58 = load i32*, i32** %24
%59 = load i32*, i32** %25
%60 = call i32 (i32*, ...) bitcast (i32 (...)* @sfree to i32 (i32*, ...)*)(i32* %59)
%61 = load i32, i32* %13
%62 = load i32, i32* %27
%63 = sub nsw i32 %61, %62
store i32 %63, i32* %26
%64 = load %struct.vtx_data**, %struct.vtx_data*** %12
%65 = load i32, i32* %13
%66 = load i32, i32* %14
%67 = load %struct.vtx_data***, %struct.vtx_data**** %15
%68 = load i32, i32* %26
%69 = load i32*, i32** %17
%70 = load i32*, i32** %24
%71 = load i32, i32* %22
%72 = load i32, i32* %19
%73 = load float**, float*** %20
%74 = load float**, float*** %21
%75 = load i32, i32* %26
%76 = load i32*, i32** %16
store i32 %75, i32* %76
%77 = load i32*, i32** %24
%78 = load i32**, i32*** %18
store i32* %77, i32** %78
%79 = call double (...) @seconds()
%80 = load double, double* %23
%81 = fsub double %79, %80
%82 = load double, double* @coarsen_time
%83 = fadd double %82, %81
store double %83, double* @coarsen_time
ret void
}

LLVM IR (-O2):
%struct.vtx_data = type opaque
@match_time = external global double
@coarsen_time = external global double
define void @coarsen1(%struct.vtx_data** %0, i32 %1, i32 %2, %struct.vtx_data*** %3, i32* nocapture writeonly %4, i32* %5, i32** nocapture writeonly %6, i32 %7, float** %8, float** %9, i32 %10) {
%12 = tail call double (...) @seconds()
%13 = add nsw i32 %1, 1
%14 = sext i32 %13 to i64
%15 = shl nsw i64 %14, 2
%16 = tail call i32 (i64, ...) bitcast (i32 (...)* @smalloc to i32 (i64, ...)*)(i64 %15)
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = tail call i32 (i64, ...) bitcast (i32 (...)* @smalloc to i32 (i64, ...)*)(i64 %15)
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = tail call i32 (%struct.vtx_data**, i32, i32, i32*, i32, i32, float**, ...) bitcast (i32 (...)* @maxmatch to i32 (%struct.vtx_data**, i32, i32, i32*, i32, i32, float**, ...)*)(%struct.vtx_data** %0, i32 %1, i32 %2, i32* %21, i32 %10, i32 %7, float** %8)
%23 = tail call double (...) @seconds()
%24 = fsub double %23, %12
%25 = load double, double* @match_time
%26 = fadd double %25, %24
store double %26, double* @match_time
tail call void (i32*, i32, i32*, ...) bitcast (void (...)* @makev2cv to void (i32*, i32, i32*, ...)*)(i32* %21, i32 %1, i32* %18)
%27 = tail call i32 (i32*, ...) bitcast (i32 (...)* @sfree to i32 (i32*, ...)*)(i32* %21)
%28 = sub nsw i32 %1, %22
tail call void (%struct.vtx_data**, i32, i32, %struct.vtx_data***, i32, i32*, i32*, i32, i32, float**, float**, ...) bitcast (void (...)* @makefgraph to void (%struct.vtx_data**, i32, i32, %struct.vtx_data***, i32, i32*, i32*, i32, i32, float**, float**, ...)*)(%struct.vtx_data** %0, i32 %1, i32 %2, %struct.vtx_data*** %3, i32 %28, i32* %5, i32* %18, i32 %10, i32 %7, float** %8, float** %9)
store i32 %28, i32* %4
store i32* %18, i32** %6
%29 = tail call double (...) @seconds()
%30 = fsub double %29, %12
%31 = load double, double* @coarsen_time
%32 = fadd double %31, %30
store double %32, double* @coarsen_time
ret void
}