#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void write_edge_to_xgmml(FILE *f, char sourceheader, int sourceid,
                         char targetheader, int targetid, int directed) {
  fprintf(f,
          "\t<edge id=\"%c%d-%c%d\" label=\"%c%d-%c%d\" source=\"%c%d\" "
          "target=\"%c%d\" cy:directed=\"%d\">\n",
          sourceheader, sourceid, targetheader, targetid, sourceheader,
          sourceid, targetheader, targetid, sourceheader, sourceid,
          targetheader, targetid, directed);
  fprintf(
      f,
      "\t\t<att name=\"shared name\" value=\"%c%d-%c%d\" type=\"string\"/>\n",
      sourceheader, sourceid, targetheader, targetid);
  fprintf(
      f, "\t\t<att name=\"shared interaction\" value=\"\" type=\"string\"/>\n");
  fprintf(f, "\t\t<att name=\"name\" value=\"%c%d-%c%d\" type=\"string\"/>\n",
          sourceheader, sourceid, targetheader, targetid);
  fprintf(f, "\t\t<att name=\"selected\" value=\"0\" type=\"boolean\"/>\n");
  fprintf(f, "\t\t<att name=\"interaction\" value=\"\" type=\"string\"/>\n");
  fprintf(f, "\t\t<att name=\"weight\" value=\"8\" type=\"integer\"/>\n");
  fprintf(f, "\t</edge>\n");
}


x86 assembly (clang, -O0):
<write_edge_to_xgmml>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %cl,%al
mov    %sil,%cl
mov    %rdi,-0x30(%rbp)
mov    %cl,-0x31(%rbp)
mov    %edx,-0x38(%rbp)
mov    %al,-0x39(%rbp)
mov    %r8d,-0x40(%rbp)
mov    %r9d,-0x44(%rbp)
mov    -0x30(%rbp),%rdi
movsbl -0x31(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsbl -0x39(%rbp),%r8d
mov    -0x40(%rbp),%r9d
movsbl -0x31(%rbp),%eax
mov    -0x38(%rbp),%r13d
movsbl -0x39(%rbp),%r12d
mov    -0x40(%rbp),%r15d
movsbl -0x31(%rbp),%r14d
mov    -0x38(%rbp),%ebx
movsbl -0x39(%rbp),%r11d
mov    -0x40(%rbp),%r10d
mov    -0x44(%rbp),%esi
mov    %esi,-0x48(%rbp)
lea    0xe82(%rip),%rsi
mov    %eax,(%rsp)
mov    -0x48(%rbp),%eax
mov    %r13d,0x8(%rsp)
mov    %r12d,0x10(%rsp)
mov    %r15d,0x18(%rsp)
mov    %r14d,0x20(%rsp)
mov    %ebx,0x28(%rsp)
mov    %r11d,0x30(%rsp)
mov    %r10d,0x38(%rsp)
mov    %eax,0x40(%rsp)
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x30(%rbp),%rdi
movsbl -0x31(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsbl -0x39(%rbp),%r8d
mov    -0x40(%rbp),%r9d
lea    0xe8b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x30(%rbp),%rdi
movsbl -0x31(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsbl -0x39(%rbp),%r8d
mov    -0x40(%rbp),%r9d
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xef3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xf14(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xf36(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xf55(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_edge_to_xgmml>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r9d,%r10d
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%r13d
mov    %rdi,%rbx
sub    $0x8,%rsp
lea    0xeba(%rip),%rsi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
push   %r10
push   %r14
push   %r15
push   %r12
push   %r13
push   %r14
push   %r15
push   %r12
push   %r13
call   1030 <fprintf@plt>
add    $0x50,%rsp
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xf01(%rip),%rdi
mov    $0x3a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf23(%rip),%rsi
mov    %rbx,%rdi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xf3c(%rip),%rdi
mov    $0x32,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf56(%rip),%rdi
mov    $0x33,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf71(%rip),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf89(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [87 x i8] c"\09<edge id=\22%c%d-%c%d\22 label=\22%c%d-%c%d\22 source=\22%c%d\22 target=\22%c%d\22 cy:directed=\22%d\22>\0A\00"
@.str.1 = [61 x i8] c"\09\09<att name=\22shared name\22 value=\22%c%d-%c%d\22 type=\22string\22/>\0A\00"
@.str.2 = [59 x i8] c"\09\09<att name=\22shared interaction\22 value=\22\22 type=\22string\22/>\0A\00"
@.str.3 = [54 x i8] c"\09\09<att name=\22name\22 value=\22%c%d-%c%d\22 type=\22string\22/>\0A\00"
@.str.4 = [51 x i8] c"\09\09<att name=\22selected\22 value=\220\22 type=\22boolean\22/>\0A\00"
@.str.5 = [52 x i8] c"\09\09<att name=\22interaction\22 value=\22\22 type=\22string\22/>\0A\00"
@.str.6 = [49 x i8] c"\09\09<att name=\22weight\22 value=\228\22 type=\22integer\22/>\0A\00"
@.str.7 = [10 x i8] c"\09</edge>\0A\00"
define void @write_edge_to_xgmml(i32* %0, i8 signext %1, i32 %2, i8 signext %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i8
%9 = alloca i32
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i8 %1, i8* %8
store i32 %2, i32* %9
store i8 %3, i8* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i8, i8* %8
%15 = sext i8 %14 to i32
%16 = load i32, i32* %9
%17 = load i8, i8* %10
%18 = sext i8 %17 to i32
%19 = load i32, i32* %11
%20 = load i8, i8* %8
%21 = sext i8 %20 to i32
%22 = load i32, i32* %9
%23 = load i8, i8* %10
%24 = sext i8 %23 to i32
%25 = load i32, i32* %11
%26 = load i8, i8* %8
%27 = sext i8 %26 to i32
%28 = load i32, i32* %9
%29 = load i8, i8* %10
%30 = sext i8 %29 to i32
%31 = load i32, i32* %11
%32 = load i32, i32* %12
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %18, i32 %19, i32 %21, i32 %22, i32 %24, i32 %25, i32 %27, i32 %28, i32 %30, i32 %31, i32 %32)
%34 = load i32*, i32** %7
%35 = load i8, i8* %8
%36 = sext i8 %35 to i32
%37 = load i32, i32* %9
%38 = load i8, i8* %10
%39 = sext i8 %38 to i32
%40 = load i32, i32* %11
%41 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 %36, i32 %37, i32 %39, i32 %40)
%42 = load i32*, i32** %7
%43 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%44 = load i32*, i32** %7
%45 = load i8, i8* %8
%46 = sext i8 %45 to i32
%47 = load i32, i32* %9
%48 = load i8, i8* %10
%49 = sext i8 %48 to i32
%50 = load i32, i32* %11
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0), i32 %46, i32 %47, i32 %49, i32 %50)
%52 = load i32*, i32** %7
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
%54 = load i32*, i32** %7
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %54, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%56 = load i32*, i32** %7
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %56, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0))
%58 = load i32*, i32** %7
%59 = call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [87 x i8] c"\09<edge id=\22%c%d-%c%d\22 label=\22%c%d-%c%d\22 source=\22%c%d\22 target=\22%c%d\22 cy:directed=\22%d\22>\0A\00"
@.str.1 = [61 x i8] c"\09\09<att name=\22shared name\22 value=\22%c%d-%c%d\22 type=\22string\22/>\0A\00"
@.str.2 = [59 x i8] c"\09\09<att name=\22shared interaction\22 value=\22\22 type=\22string\22/>\0A\00"
@.str.3 = [54 x i8] c"\09\09<att name=\22name\22 value=\22%c%d-%c%d\22 type=\22string\22/>\0A\00"
@.str.4 = [51 x i8] c"\09\09<att name=\22selected\22 value=\220\22 type=\22boolean\22/>\0A\00"
@.str.5 = [52 x i8] c"\09\09<att name=\22interaction\22 value=\22\22 type=\22string\22/>\0A\00"
@.str.6 = [49 x i8] c"\09\09<att name=\22weight\22 value=\228\22 type=\22integer\22/>\0A\00"
@.str.7 = [10 x i8] c"\09</edge>\0A\00"
define void @write_edge_to_xgmml(i32* nocapture %0, i8 signext %1, i32 %2, i8 signext %3, i32 %4, i32 %5) {
%7 = sext i8 %1 to i32
%8 = sext i8 %3 to i32
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %2, i32 %8, i32 %4, i32 %7, i32 %2, i32 %8, i32 %4, i32 %7, i32 %2, i32 %8, i32 %4, i32 %5)
%10 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %2, i32 %8, i32 %4)
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i64 58, i64 1, i32* %0)
%12 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0), i32 %7, i32 %2, i32 %8, i32 %4)
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0), i64 50, i64 1, i32* %0)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i64 51, i64 1, i32* %0)
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i64 48, i64 1, i32* %0)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i64 9, i64 1, i32* %0)
ret void
}