#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 vertex {
  int dummy;
};
struct mesh {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ face_new(struct vertex *, struct vertex *, struct vertex *);
int /*<<< orphan*/ mesh_addFace(struct mesh *, int /*<<< orphan*/);
void mesh_connectEdges(struct mesh *m, struct vertex *v0, struct vertex *v1,
                       struct vertex *v0copy, struct vertex *v1copy) {
  mesh_addFace(m, face_new(v1, v1copy, v0));
  mesh_addFace(m, face_new(v0, v1copy, v0copy));
}


x86 assembly (clang, -O0):
<mesh_connectEdges>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <face_new@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
call   1040 <mesh_addFace@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <face_new@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
call   1040 <mesh_addFace@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mesh_connectEdges>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r15
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%r12
mov    %rdx,%rdi
mov    %r8,%rsi
mov    %rbx,%rdx
call   1030 <face_new@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1040 <mesh_addFace@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <face_new@plt>
mov    %r12,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <mesh_addFace@plt>

LLVM IR (-O0):
%struct.mesh = type { i32 }
%struct.vertex = type { i32 }
define void @mesh_connectEdges(%struct.mesh* %0, %struct.vertex* %1, %struct.vertex* %2, %struct.vertex* %3, %struct.vertex* %4) {
%6 = alloca %struct.mesh*
%7 = alloca %struct.vertex*
%8 = alloca %struct.vertex*
%9 = alloca %struct.vertex*
%10 = alloca %struct.vertex*
store %struct.mesh* %0, %struct.mesh** %6
store %struct.vertex* %1, %struct.vertex** %7
store %struct.vertex* %2, %struct.vertex** %8
store %struct.vertex* %3, %struct.vertex** %9
store %struct.vertex* %4, %struct.vertex** %10
%11 = load %struct.mesh*, %struct.mesh** %6
%12 = load %struct.vertex*, %struct.vertex** %8
%13 = load %struct.vertex*, %struct.vertex** %10
%14 = load %struct.vertex*, %struct.vertex** %7
%15 = call i32 @face_new(%struct.vertex* %12, %struct.vertex* %13, %struct.vertex* %14)
%16 = call i32 @mesh_addFace(%struct.mesh* %11, i32 %15)
%17 = load %struct.mesh*, %struct.mesh** %6
%18 = load %struct.vertex*, %struct.vertex** %7
%19 = load %struct.vertex*, %struct.vertex** %10
%20 = load %struct.vertex*, %struct.vertex** %9
%21 = call i32 @face_new(%struct.vertex* %18, %struct.vertex* %19, %struct.vertex* %20)
%22 = call i32 @mesh_addFace(%struct.mesh* %17, i32 %21)
ret void
}

LLVM IR (-O2):
%struct.mesh = type { i32 }
%struct.vertex = type { i32 }
define void @mesh_connectEdges(%struct.mesh* %0, %struct.vertex* %1, %struct.vertex* %2, %struct.vertex* %3, %struct.vertex* %4) {
%6 = tail call i32 @face_new(%struct.vertex* %2, %struct.vertex* %4, %struct.vertex* %1)
%7 = tail call i32 @mesh_addFace(%struct.mesh* %0, i32 %6)
%8 = tail call i32 @face_new(%struct.vertex* %1, %struct.vertex* %4, %struct.vertex* %3)
%9 = tail call i32 @mesh_addFace(%struct.mesh* %0, i32 %8)
ret void
}