#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_header(FILE *f) {
  fprintf(f, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
             "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\""
             " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
             "xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns"
             " http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd\">\n");
  fprintf(
      f,
      "<key id=\"d0\" for=\"node\" attr.name=\"color\" attr.type=\"string\">\n"
      "<default>yellow</default>\n</key>\n"
      "<key id=\"d1\" for=\"node\" attr.name=\"age\" attr.type=\"int\"/>\n"
      "<key id=\"d2\" for=\"edge\" attr.name=\"type\" attr.type=\"string\"/>\n"
      "<key id=\"d3\" for=\"node\" attr.name=\"firstName\" "
      "attr.type=\"string\"/>\n"
      "<key id=\"d4\" for=\"node\" attr.name=\"lastName\" "
      "attr.type=\"string\"/>\n"
      "<graph id=\"G\" edgedefault=\"directed\">\n");
}


x86 assembly (clang, -O0):
<write_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xfd0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_header>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x106,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xfd3(%rip),%rdi
mov    $0x182,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [263 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A<graphml xmlns=\22http://graphml.graphdrawing.org/xmlns\22 xmlns:xsi=\22http://www.w3.org/2001/XMLSchema-instance\22\0Axsi:schemaLocation=\22http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd\22>\0A\00"
@.str.1 = [387 x i8] c"<key id=\22d0\22 for=\22node\22 attr.name=\22color\22 attr.type=\22string\22>\0A<default>yellow</default>\0A</key>\0A<key id=\22d1\22 for=\22node\22 attr.name=\22age\22 attr.type=\22int\22/>\0A<key id=\22d2\22 for=\22edge\22 attr.name=\22type\22 attr.type=\22string\22/>\0A<key id=\22d3\22 for=\22node\22 attr.name=\22firstName\22 attr.type=\22string\22/>\0A<key id=\22d4\22 for=\22node\22 attr.name=\22lastName\22 attr.type=\22string\22/>\0A<graph id=\22G\22 edgedefault=\22directed\22>\0A\00"
define void @write_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([263 x i8], [263 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([387 x i8], [387 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [263 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A<graphml xmlns=\22http://graphml.graphdrawing.org/xmlns\22 xmlns:xsi=\22http://www.w3.org/2001/XMLSchema-instance\22\0Axsi:schemaLocation=\22http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd\22>\0A\00"
@.str.1 = [387 x i8] c"<key id=\22d0\22 for=\22node\22 attr.name=\22color\22 attr.type=\22string\22>\0A<default>yellow</default>\0A</key>\0A<key id=\22d1\22 for=\22node\22 attr.name=\22age\22 attr.type=\22int\22/>\0A<key id=\22d2\22 for=\22edge\22 attr.name=\22type\22 attr.type=\22string\22/>\0A<key id=\22d3\22 for=\22node\22 attr.name=\22firstName\22 attr.type=\22string\22/>\0A<key id=\22d4\22 for=\22node\22 attr.name=\22lastName\22 attr.type=\22string\22/>\0A<graph id=\22G\22 edgedefault=\22directed\22>\0A\00"
define void @write_header(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([263 x i8], [263 x i8]* @.str, i64 0, i64 0), i64 262, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([387 x i8], [387 x i8]* @.str.1, i64 0, i64 0), i64 386, i64 1, i32* %0)
ret void
}