#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 */

/* Variables and functions */
unsigned int cgate_gdome_di_createDocFromURI(unsigned int, char *, int,
                                             unsigned int);
unsigned int cgate_gdome_di_mkref();
unsigned int cgate_gdome_doc_createTextNode(unsigned int, unsigned int,
                                            unsigned int);
unsigned int cgate_gdome_doc_getElementById(unsigned int, unsigned int,
                                            unsigned int);
int /*<<< orphan*/ cgate_gdome_el_appendChild(unsigned int, unsigned int,
                                              unsigned int);
unsigned int cgate_gdome_extra_cast_text_to_node(unsigned int);
unsigned int cgate_gdome_extra_exc_new();
unsigned int cgate_gdome_str_mkref_dup(char *);
int /*<<< orphan*/ cgate_gdome_str_unref(unsigned int);
int main(int argc, char **argv) {
  unsigned int exc = cgate_gdome_extra_exc_new();
  unsigned int di = cgate_gdome_di_mkref();
  unsigned int doc =
      cgate_gdome_di_createDocFromURI(di, "example.html", 8, exc);
  unsigned int id = cgate_gdome_str_mkref_dup("content");
  unsigned int element = cgate_gdome_doc_getElementById(doc, id, exc);
  cgate_gdome_str_unref(id);
  unsigned int content = cgate_gdome_str_mkref_dup("Input");
  ;
  unsigned int text = cgate_gdome_doc_createTextNode(doc, content, exc);
  cgate_gdome_str_unref(content);
  unsigned int text_node = cgate_gdome_extra_cast_text_to_node(text);
  cgate_gdome_el_appendChild(element, text_node, exc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <cgate_gdome_extra_exc_new@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <cgate_gdome_di_mkref@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%ecx
lea    0xe39(%rip),%rsi
mov    $0x8,%edx
call   1070 <cgate_gdome_di_createDocFromURI@plt>
mov    %eax,-0x1c(%rbp)
lea    0xe32(%rip),%rdi
call   1050 <cgate_gdome_str_mkref_dup@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x14(%rbp),%edx
call   10a0 <cgate_gdome_doc_getElementById@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%edi
call   1040 <cgate_gdome_str_unref@plt>
lea    0xe12(%rip),%rdi
call   1050 <cgate_gdome_str_mkref_dup@plt>
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1090 <cgate_gdome_doc_createTextNode@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%edi
call   1040 <cgate_gdome_str_unref@plt>
mov    -0x2c(%rbp),%edi
call   10b0 <cgate_gdome_extra_cast_text_to_node@plt>
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1080 <cgate_gdome_el_appendChild@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1030 <cgate_gdome_extra_exc_new@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1060 <cgate_gdome_di_mkref@plt>
lea    0xe50(%rip),%rsi
mov    %eax,%edi
mov    $0x8,%edx
mov    %r12d,%ecx
call   1070 <cgate_gdome_di_createDocFromURI@plt>
mov    %eax,%r14d
lea    0xe44(%rip),%rdi
call   1050 <cgate_gdome_str_mkref_dup@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %eax,%esi
mov    %r12d,%edx
call   10a0 <cgate_gdome_doc_getElementById@plt>
mov    %eax,%r15d
mov    %ebp,%edi
call   1040 <cgate_gdome_str_unref@plt>
lea    0xe27(%rip),%rdi
call   1050 <cgate_gdome_str_mkref_dup@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %eax,%esi
mov    %r12d,%edx
call   1090 <cgate_gdome_doc_createTextNode@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1040 <cgate_gdome_str_unref@plt>
mov    %ebx,%edi
call   10b0 <cgate_gdome_extra_cast_text_to_node@plt>
mov    %r15d,%edi
mov    %eax,%esi
mov    %r12d,%edx
call   1080 <cgate_gdome_el_appendChild@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"example.html\00"
@.str.1 = [8 x i8] c"content\00"
@.str.2 = [6 x i8] c"Input\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i32 (...) @cgate_gdome_extra_exc_new()
store i32 %14, i32* %6
%15 = call i32 (...) @cgate_gdome_di_mkref()
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = call i32 @cgate_gdome_di_createDocFromURI(i32 %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 8, i32 %17)
store i32 %18, i32* %8
%19 = call i32 @cgate_gdome_str_mkref_dup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 %19, i32* %9
%20 = load i32, i32* %8
%21 = load i32, i32* %9
%22 = load i32, i32* %6
%23 = call i32 @cgate_gdome_doc_getElementById(i32 %20, i32 %21, i32 %22)
store i32 %23, i32* %10
%24 = load i32, i32* %9
%25 = call i32 @cgate_gdome_str_unref(i32 %24)
%26 = call i32 @cgate_gdome_str_mkref_dup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 %26, i32* %11
%27 = load i32, i32* %8
%28 = load i32, i32* %11
%29 = load i32, i32* %6
%30 = call i32 @cgate_gdome_doc_createTextNode(i32 %27, i32 %28, i32 %29)
store i32 %30, i32* %12
%31 = load i32, i32* %11
%32 = call i32 @cgate_gdome_str_unref(i32 %31)
%33 = load i32, i32* %12
%34 = call i32 @cgate_gdome_extra_cast_text_to_node(i32 %33)
store i32 %34, i32* %13
%35 = load i32, i32* %10
%36 = load i32, i32* %13
%37 = load i32, i32* %6
%38 = call i32 @cgate_gdome_el_appendChild(i32 %35, i32 %36, i32 %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"example.html\00"
@.str.1 = [8 x i8] c"content\00"
@.str.2 = [6 x i8] c"Input\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @cgate_gdome_extra_exc_new()
%4 = tail call i32 (...) @cgate_gdome_di_mkref()
%5 = tail call i32 @cgate_gdome_di_createDocFromURI(i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 8, i32 %3)
%6 = tail call i32 @cgate_gdome_str_mkref_dup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @cgate_gdome_doc_getElementById(i32 %5, i32 %6, i32 %3)
%8 = tail call i32 @cgate_gdome_str_unref(i32 %6)
%9 = tail call i32 @cgate_gdome_str_mkref_dup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @cgate_gdome_doc_createTextNode(i32 %5, i32 %9, i32 %3)
%11 = tail call i32 @cgate_gdome_str_unref(i32 %9)
%12 = tail call i32 @cgate_gdome_extra_cast_text_to_node(i32 %10)
%13 = tail call i32 @cgate_gdome_el_appendChild(i32 %7, i32 %12, i32 %3)
ret i32 0
}