#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ RB_XMLDB_Generate_String(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void RB_XMLDB_Generate_Link(FILE *dest, char *dest_name, char *filename,
                            char *labelname, char *linkname) {
  (dest_name = dest_name);
  ;
  (filename = filename);
  ;
  fprintf(dest, "<link linkend=\"%s\">", labelname);
  RB_XMLDB_Generate_String(dest, linkname);
  fprintf(dest, "</link>");
}


x86 assembly (clang, -O0):
<RB_XMLDB_Generate_Link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xea5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <RB_XMLDB_Generate_String@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RB_XMLDB_Generate_Link>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <RB_XMLDB_Generate_String@plt>
lea    0xeb7(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"<link linkend=\22%s\22>\00"
@.str.1 = [8 x i8] c"</link>\00"
define void @RB_XMLDB_Generate_Link(i32* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %7
store i8* %11, i8** %7
%12 = load i8*, i8** %8
store i8* %12, i8** %8
%13 = load i32*, i32** %6
%14 = load i8*, i8** %9
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32*, i32** %6
%17 = load i8*, i8** %10
%18 = call i32 @RB_XMLDB_Generate_String(i32* %16, i8* %17)
%19 = load i32*, i32** %6
%20 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"<link linkend=\22%s\22>\00"
@.str.1 = [8 x i8] c"</link>\00"
define void @RB_XMLDB_Generate_Link(i32* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* %3, i8* %4) {
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = tail call i32 @RB_XMLDB_Generate_String(i32* %0, i8* %4)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 7, i64 1, i32* %0)
ret void
}