// File: rossy[P]crossc/SPIRV-Cross/spirv_cpp.cpp
// Function: spirv_cross::CompilerCPP::emit_c_linkage()
void CompilerCPP::emit_c_linkage()
{
	statement("");

	statement("spirv_cross_shader_t *spirv_cross_construct(void)");
	begin_scope();
	statement("return new ", impl_type, "();");
	end_scope();

	statement("");
	statement("void spirv_cross_destruct(spirv_cross_shader_t *shader)");
	begin_scope();
	statement("delete static_cast<", impl_type, "*>(shader);");
	end_scope();

	statement("");
	statement("void spirv_cross_invoke(spirv_cross_shader_t *shader)");
	begin_scope();
	statement("static_cast<", impl_type, "*>(shader)->invoke();");
	end_scope();

	statement("");
	statement("static const struct spirv_cross_interface vtable =");
	begin_scope();
	statement("spirv_cross_construct,");
	statement("spirv_cross_destruct,");
	statement("spirv_cross_invoke,");
	end_scope_decl();

	statement("");
	statement("const struct spirv_cross_interface *",
	          interface_name.empty() ? string("spirv_cross_get_interface") : interface_name, "(void)");
	begin_scope();
	statement("return &vtable;");
	end_scope();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
leaq 0x130d33(%rip), %rsi    # 0x13e89e
callq 0xedf0
movq -0x48(%rbp), %rdi
leaq 0x130886(%rip), %rsi    # 0x13e401
callq 0x107c0
movq -0x48(%rbp), %rdi
callq 0x5c200
movq -0x48(%rbp), %rdi
movq %rdi, %rdx
addq $0x7a0, %rdx            # imm = 0x7A0
leaq 0x130895(%rip), %rsi    # 0x13e433
leaq 0x13b4ff(%rip), %rcx    # 0x1490a4
callq 0x108e0
movq -0x48(%rbp), %rdi
callq 0x876c0
movq -0x48(%rbp), %rdi
leaq 0x130ce0(%rip), %rsi    # 0x13e89e
callq 0xedf0
movq -0x48(%rbp), %rdi
leaq 0x130871(%rip), %rsi    # 0x13e43f
callq 0x10a10
movq -0x48(%rbp), %rdi
callq 0x5c200
movq -0x48(%rbp), %rdi
movq %rdi, %rdx
addq $0x7a0, %rdx            # imm = 0x7A0
leaq 0x130886(%rip), %rsi    # 0x13e477
leaq 0x130893(%rip), %rcx    # 0x13e48b
callq 0x10b30
movq -0x48(%rbp), %rdi
callq 0x876c0
movq -0x48(%rbp), %rdi
leaq 0x130c8d(%rip), %rsi    # 0x13e89e
callq 0xedf0
movq -0x48(%rbp), %rdi
leaq 0x130876(%rip), %rsi    # 0x13e497
callq 0x10c60
movq -0x48(%rbp), %rdi
callq 0x5c200
movq -0x48(%rbp), %rdi
movq %rdi, %rdx
addq $0x7a0, %rdx            # imm = 0x7A0
leaq 0x13083a(%rip), %rsi    # 0x13e47e
leaq 0x130882(%rip), %rcx    # 0x13e4cd
callq 0x10d80
movq -0x48(%rbp), %rdi
callq 0x876c0
movq -0x48(%rbp), %rdi
leaq 0x130c3a(%rip), %rsi    # 0x13e89e
callq 0xedf0
movq -0x48(%rbp), %rdi
leaq 0x13086f(%rip), %rsi    # 0x13e4e3
callq 0x10eb0
movq -0x48(%rbp), %rdi
callq 0x5c200
movq -0x48(%rbp), %rdi
leaq 0x130889(%rip), %rsi    # 0x13e516
callq 0x10fd0
movq -0x48(%rbp), %rdi
leaq 0x130890(%rip), %rsi    # 0x13e52d
callq 0x110f0
movq -0x48(%rbp), %rdi
leaq 0x130896(%rip), %rsi    # 0x13e543
callq 0x11210
movq -0x48(%rbp), %rdi
callq 0x5c350
movq -0x48(%rbp), %rdi
leaq 0x130bd8(%rip), %rsi    # 0x13e89e
callq 0xedf0
movq -0x48(%rbp), %rdi
addq $0x7e8, %rdi            # imm = 0x7E8
callq 0x75f0
movb $0x0, -0x2a(%rbp)
testb $0x1, %al
jne 0xdce5
jmp 0xdd0e
leaq -0x29(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x7650
movq -0x50(%rbp), %rdx
movb $0x1, -0x2a(%rbp)
leaq 0x13087b(%rip), %rsi    # 0x13e57c
leaq -0x28(%rbp), %rdi
callq 0x7520
jmp 0xdd0c
jmp 0xdd26
movq -0x48(%rbp), %rsi
addq $0x7e8, %rsi            # imm = 0x7E8
leaq -0x28(%rbp), %rdi
callq 0x7170
jmp 0xdd24
jmp 0xdd26
movq -0x48(%rbp), %rdi
leaq 0x130826(%rip), %rsi    # 0x13e557
leaq 0x1306f4(%rip), %rcx    # 0x13e42c
leaq -0x28(%rbp), %rdx
callq 0x11330
jmp 0xdd43
leaq -0x28(%rbp), %rdi
callq 0x7708
testb $0x1, -0x2a(%rbp)
jne 0xdd54
jmp 0xdd5d
leaq -0x29(%rbp), %rdi
callq 0x73d0
movq -0x48(%rbp), %rdi
callq 0x5c200
movq -0x48(%rbp), %rdi
leaq 0x130825(%rip), %rsi    # 0x13e596
callq 0x11460
movq -0x48(%rbp), %rdi
callq 0x876c0
addq $0x50, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xdda8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x7708
testb $0x1, -0x2a(%rbp)
jne 0xddb0
jmp 0xddb9
leaq -0x29(%rbp), %rdi
callq 0x73d0
jmp 0xddbb
movq -0x38(%rbp), %rdi
callq 0x7640
nopw %cs:(%rax,%rax)