; ModuleID = 'Graphiti'
source_filename = "Graphiti"

%struct.map = type { %struct.map_node*, i32 }
%struct.map_node = type { i8*, i8*, %struct.map_node* }
%struct.list = type { i32, %struct.list_node* }
%struct.list_node = type { i8*, %struct.list_node* }
%struct.graph = type { i32, i32, %struct.vertex* }
%struct.vertex = type { %struct.edge*, %struct.vertex*, %struct.map* }
%struct.edge = type { %struct.vertex*, %struct.vertex*, %struct.edge*, i8* }

@fmt = private unnamed_addr constant [4 x i8] c"%d\0A\00"
@fmt.1 = private unnamed_addr constant [4 x i8] c"%g\0A\00"
@fmt.2 = private unnamed_addr constant [4 x i8] c"%s\0A\00"
@str = private unnamed_addr constant [6 x i8] c"state\00"
@str.3 = private unnamed_addr constant [8 x i8] c"Vermont\00"
@str.4 = private unnamed_addr constant [4 x i8] c"age\00"
@str.5 = private unnamed_addr constant [3 x i8] c"88\00"
@str.6 = private unnamed_addr constant [5 x i8] c"name\00"
@str.7 = private unnamed_addr constant [11 x i8] c"John Smith\00"
@str.8 = private unnamed_addr constant [6 x i8] c"state\00"
@str.9 = private unnamed_addr constant [8 x i8] c"Vermont\00"
@str.10 = private unnamed_addr constant [4 x i8] c"age\00"
@str.11 = private unnamed_addr constant [3 x i8] c"88\00"
@str.12 = private unnamed_addr constant [5 x i8] c"name\00"
@str.13 = private unnamed_addr constant [11 x i8] c"Mary Smith\00"
@str.14 = private unnamed_addr constant [10 x i8] c"spouse_of\00"
@str.15 = private unnamed_addr constant [10 x i8] c"spouse_of\00"
@str.16 = private unnamed_addr constant [6 x i8] c"state\00"
@str.17 = private unnamed_addr constant [9 x i8] c"New York\00"
@str.18 = private unnamed_addr constant [4 x i8] c"age\00"
@str.19 = private unnamed_addr constant [3 x i8] c"50\00"
@str.20 = private unnamed_addr constant [5 x i8] c"name\00"
@str.21 = private unnamed_addr constant [10 x i8] c"Amy Green\00"
@str.22 = private unnamed_addr constant [6 x i8] c"state\00"
@str.23 = private unnamed_addr constant [9 x i8] c"New York\00"
@str.24 = private unnamed_addr constant [4 x i8] c"age\00"
@str.25 = private unnamed_addr constant [3 x i8] c"53\00"
@str.26 = private unnamed_addr constant [5 x i8] c"name\00"
@str.27 = private unnamed_addr constant [10 x i8] c"Bob Green\00"
@str.28 = private unnamed_addr constant [6 x i8] c"state\00"
@str.29 = private unnamed_addr constant [9 x i8] c"New York\00"
@str.30 = private unnamed_addr constant [4 x i8] c"age\00"
@str.31 = private unnamed_addr constant [3 x i8] c"15\00"
@str.32 = private unnamed_addr constant [5 x i8] c"name\00"
@str.33 = private unnamed_addr constant [12 x i8] c"Ellie Green\00"
@str.34 = private unnamed_addr constant [10 x i8] c"father_of\00"
@str.35 = private unnamed_addr constant [10 x i8] c"mother_of\00"
@str.36 = private unnamed_addr constant [10 x i8] c"spouse_of\00"
@str.37 = private unnamed_addr constant [10 x i8] c"father_of\00"
@str.38 = private unnamed_addr constant [10 x i8] c"mother_of\00"
@str.39 = private unnamed_addr constant [6 x i8] c"state\00"
@str.40 = private unnamed_addr constant [11 x i8] c"California\00"
@str.41 = private unnamed_addr constant [4 x i8] c"age\00"
@str.42 = private unnamed_addr constant [3 x i8] c"45\00"
@str.43 = private unnamed_addr constant [5 x i8] c"name\00"
@str.44 = private unnamed_addr constant [12 x i8] c"Steve Green\00"
@str.45 = private unnamed_addr constant [6 x i8] c"state\00"
@str.46 = private unnamed_addr constant [11 x i8] c"California\00"
@str.47 = private unnamed_addr constant [4 x i8] c"age\00"
@str.48 = private unnamed_addr constant [3 x i8] c"18\00"
@str.49 = private unnamed_addr constant [5 x i8] c"name\00"
@str.50 = private unnamed_addr constant [13 x i8] c"Martha Green\00"
@str.51 = private unnamed_addr constant [10 x i8] c"father_of\00"
@str.52 = private unnamed_addr constant [11 x i8] c"brother_of\00"
@str.53 = private unnamed_addr constant [10 x i8] c"father_of\00"
@str.54 = private unnamed_addr constant [26 x i8] c"This is the Green Family!\00"
@str.55 = private unnamed_addr constant [26 x i8] c"This is the Smith Family!\00"
@str.56 = private unnamed_addr constant [32 x i8] c"This is the Green-Smith Family!\00"
@str.57 = private unnamed_addr constant [56 x i8] c"Bob Green is both in the Smith Family and Green Family!\00"
@str.58 = private unnamed_addr constant [10 x i8] c"ex_spouse\00"
@str.59 = private unnamed_addr constant [33 x i8] c"Caroline and Bob got divorced...\00"
@str.60 = private unnamed_addr constant [24 x i8] c"* relationship change *\00"
@str.61 = private unnamed_addr constant [54 x i8] c"Caroline and Bob don't want a relationship anymore...\00"
@str.62 = private unnamed_addr constant [30 x i8] c"* deleted relationship edge *\00"

declare i32 @printf(i8*, ...)

declare i32 @printbig(i32)

declare %struct.map* @printm(%struct.map*)

declare %struct.list* @printl(%struct.list*)

declare %struct.graph* @printg(%struct.graph*)

declare %struct.list* @make_list()

declare i32 @size(%struct.list*)

declare i8* @list_get(%struct.list*, i32)

declare i32 @add_tail(%struct.list*, i8*)

declare i32 @list_set_int(%struct.list*, i32, i32)

declare i32 @add_head_int(%struct.list*, i32)

declare i32 @remove_head_int(%struct.list*)

declare i32 @add_tail_int(%struct.list*, i32)

declare %struct.map* @list_set_map(%struct.list*, i32, %struct.map*)

declare i32 @add_head_map(%struct.list*, %struct.map*)

declare %struct.map* @remove_head_map(%struct.list*)

declare i32 @add_tail_map(%struct.list*, %struct.map*)

declare i8* @list_set_str(%struct.list*, i32, i8*)

declare i32 @add_head_str(%struct.list*, i8*)

declare i8* @remove_head_str(%struct.list*)

declare i32 @add_tail_str(%struct.list*, i8*)

declare double @list_set_dec(%struct.list*, i32, double)

declare i32 @add_head_dec(%struct.list*, double)

declare double @remove_head_dec(%struct.list*)

declare i32 @add_tail_dec(%struct.list*, double)

declare %struct.map* @make_map()

declare i32 @contains_key(%struct.map*, i8*)

declare i32 @contains_value(%struct.map*, i8*)

declare i32 @put(%struct.map*, i8*, i8*)

declare i8* @map_get(%struct.map*, i8*)

declare i32 @remove_node(%struct.map*, i8*)

declare i32 @is_equal(%struct.map*, %struct.map*)

declare %struct.graph* @new_graph()

declare %struct.graph* @add_vertex(%struct.graph*, %struct.map*)

declare %struct.graph* @add_edge(%struct.graph*, %struct.map*, %struct.map*)

declare %struct.graph* @add_wedge(%struct.graph*, %struct.map*, i8*, %struct.map*)

declare %struct.graph* @delete_edge(%struct.graph*, %struct.map*, %struct.map*)

declare %struct.graph* @delete_vertex(%struct.graph*, %struct.map*)

declare %struct.graph* @union_graph(%struct.graph*, %struct.graph*)

declare %struct.graph* @intersection_graph(%struct.graph*, %struct.graph*)

declare %struct.graph* @add(%struct.graph*, %struct.graph*)

declare %struct.list* @_get_edges(%struct.graph*, %struct.map*)

declare %struct.list* @get_edge_neighbors(%struct.graph*, %struct.map*)

declare %struct.list* @get_all_vertices(%struct.graph*)

declare i8* @concat_string(i8*, i8*)

declare i32 @length(i8*)

declare i8* @get_char(i8*, i32)

declare i32 @str_comp(i8*, i8*)

declare %struct.list* @concat(%struct.list*, %struct.list*)

define i32 @main() {
entry:
  %__l = alloca i32
  %__nodes = alloca %struct.list*
  %__i = alloca i32
  %smith_fam = alloca %struct.graph*
  %green_fam = alloca %struct.graph*
  %smith_green = alloca %struct.graph*
  %m1 = alloca %struct.map*
  %m2 = alloca %struct.map*
  %m3 = alloca %struct.map*
  %m4 = alloca %struct.map*
  %m5 = alloca %struct.map*
  %m6 = alloca %struct.map*
  %m7 = alloca %struct.map*
  %make_map = call %struct.map* @make_map()
  %put = call i32 @put(%struct.map* %make_map, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i32 0, i32 0))
  %put1 = call i32 @put(%struct.map* %make_map, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i32 0, i32 0))
  %put2 = call i32 @put(%struct.map* %make_map, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.6, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.7, i32 0, i32 0))
  store %struct.map* %make_map, %struct.map** %m1
  %make_map3 = call %struct.map* @make_map()
  %put4 = call i32 @put(%struct.map* %make_map3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.8, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.9, i32 0, i32 0))
  %put5 = call i32 @put(%struct.map* %make_map3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.10, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.11, i32 0, i32 0))
  %put6 = call i32 @put(%struct.map* %make_map3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.12, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.13, i32 0, i32 0))
  store %struct.map* %make_map3, %struct.map** %m2
  %new_graph = call %struct.graph* @new_graph()
  %m17 = load %struct.map*, %struct.map** %m1
  %m28 = load %struct.map*, %struct.map** %m2
  %add_wedge = call %struct.graph* @add_wedge(%struct.graph* %new_graph, %struct.map* %m17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.14, i32 0, i32 0), %struct.map* %m28)
  %m29 = load %struct.map*, %struct.map** %m2
  %m110 = load %struct.map*, %struct.map** %m1
  %add_wedge11 = call %struct.graph* @add_wedge(%struct.graph* %new_graph, %struct.map* %m29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.15, i32 0, i32 0), %struct.map* %m110)
  store %struct.graph* %new_graph, %struct.graph** %smith_fam
  %make_map12 = call %struct.map* @make_map()
  %put13 = call i32 @put(%struct.map* %make_map12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.16, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.17, i32 0, i32 0))
  %put14 = call i32 @put(%struct.map* %make_map12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.18, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.19, i32 0, i32 0))
  %put15 = call i32 @put(%struct.map* %make_map12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.20, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.21, i32 0, i32 0))
  store %struct.map* %make_map12, %struct.map** %m3
  %make_map16 = call %struct.map* @make_map()
  %put17 = call i32 @put(%struct.map* %make_map16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.22, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.23, i32 0, i32 0))
  %put18 = call i32 @put(%struct.map* %make_map16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.24, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.25, i32 0, i32 0))
  %put19 = call i32 @put(%struct.map* %make_map16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.26, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.27, i32 0, i32 0))
  store %struct.map* %make_map16, %struct.map** %m4
  %make_map20 = call %struct.map* @make_map()
  %put21 = call i32 @put(%struct.map* %make_map20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.28, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.29, i32 0, i32 0))
  %put22 = call i32 @put(%struct.map* %make_map20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.30, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.31, i32 0, i32 0))
  %put23 = call i32 @put(%struct.map* %make_map20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.32, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.33, i32 0, i32 0))
  store %struct.map* %make_map20, %struct.map** %m5
  %smith_fam24 = load %struct.graph*, %struct.graph** %smith_fam
  %m125 = load %struct.map*, %struct.map** %m1
  %m326 = load %struct.map*, %struct.map** %m3
  %graph_add_wedge = call %struct.graph* @add_wedge(%struct.graph* %smith_fam24, %struct.map* %m125, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.34, i32 0, i32 0), %struct.map* %m326)
  %smith_fam27 = load %struct.graph*, %struct.graph** %smith_fam
  %m228 = load %struct.map*, %struct.map** %m2
  %m329 = load %struct.map*, %struct.map** %m3
  %graph_add_wedge30 = call %struct.graph* @add_wedge(%struct.graph* %smith_fam27, %struct.map* %m228, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.35, i32 0, i32 0), %struct.map* %m329)
  %smith_fam31 = load %struct.graph*, %struct.graph** %smith_fam
  %m332 = load %struct.map*, %struct.map** %m3
  %m433 = load %struct.map*, %struct.map** %m4
  %graph_add_wedge34 = call %struct.graph* @add_wedge(%struct.graph* %smith_fam31, %struct.map* %m332, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.36, i32 0, i32 0), %struct.map* %m433)
  %smith_fam35 = load %struct.graph*, %struct.graph** %smith_fam
  %m436 = load %struct.map*, %struct.map** %m4
  %m737 = load %struct.map*, %struct.map** %m7
  %graph_add_wedge38 = call %struct.graph* @add_wedge(%struct.graph* %smith_fam35, %struct.map* %m436, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.37, i32 0, i32 0), %struct.map* %m737)
  %smith_fam39 = load %struct.graph*, %struct.graph** %smith_fam
  %m340 = load %struct.map*, %struct.map** %m3
  %m741 = load %struct.map*, %struct.map** %m7
  %graph_add_wedge42 = call %struct.graph* @add_wedge(%struct.graph* %smith_fam39, %struct.map* %m340, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.38, i32 0, i32 0), %struct.map* %m741)
  %make_map43 = call %struct.map* @make_map()
  %put44 = call i32 @put(%struct.map* %make_map43, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.39, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.40, i32 0, i32 0))
  %put45 = call i32 @put(%struct.map* %make_map43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.41, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.42, i32 0, i32 0))
  %put46 = call i32 @put(%struct.map* %make_map43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.43, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.44, i32 0, i32 0))
  store %struct.map* %make_map43, %struct.map** %m5
  %make_map47 = call %struct.map* @make_map()
  %put48 = call i32 @put(%struct.map* %make_map47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.45, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.46, i32 0, i32 0))
  %put49 = call i32 @put(%struct.map* %make_map47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.47, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.48, i32 0, i32 0))
  %put50 = call i32 @put(%struct.map* %make_map47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.49, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.50, i32 0, i32 0))
  store %struct.map* %make_map47, %struct.map** %m6
  %new_graph51 = call %struct.graph* @new_graph()
  %m552 = load %struct.map*, %struct.map** %m5
  %m653 = load %struct.map*, %struct.map** %m6
  %add_wedge54 = call %struct.graph* @add_wedge(%struct.graph* %new_graph51, %struct.map* %m552, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.51, i32 0, i32 0), %struct.map* %m653)
  store %struct.graph* %new_graph51, %struct.graph** %green_fam
  %new_graph55 = call %struct.graph* @new_graph()
  %m356 = load %struct.map*, %struct.map** %m3
  %m557 = load %struct.map*, %struct.map** %m5
  %add_wedge58 = call %struct.graph* @add_wedge(%struct.graph* %new_graph55, %struct.map* %m356, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.52, i32 0, i32 0), %struct.map* %m557)
  store %struct.graph* %new_graph55, %struct.graph** %green_fam
  %new_graph59 = call %struct.graph* @new_graph()
  %m360 = load %struct.map*, %struct.map** %m3
  %m761 = load %struct.map*, %struct.map** %m7
  %add_wedge62 = call %struct.graph* @add_wedge(%struct.graph* %new_graph59, %struct.map* %m360, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.53, i32 0, i32 0), %struct.map* %m761)
  store %struct.graph* %new_graph59, %struct.graph** %green_fam
  %smith_fam63 = load %struct.graph*, %struct.graph** %smith_fam
  %green_fam64 = load %struct.graph*, %struct.graph** %green_fam
  %graph_union = call %struct.graph* @union_graph(%struct.graph* %smith_fam63, %struct.graph* %green_fam64)
  store %struct.graph* %graph_union, %struct.graph** %smith_green
  %printf = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @fmt.2, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.54, i32 0, i32 0))
  %green_fam65 = load %struct.graph*, %struct.graph** %green_fam
  %printg = call %struct.graph* @printg(%struct.graph* %green_fam65)
  %printf66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @fmt.2, i32 0, i32 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.55, i32 0, i32 0))
  %smith_fam67 = load %struct.graph*, %struct.graph** %smith_fam
  %printg68 = call %struct.graph* @printg(%struct.graph* %smith_fam67)
  %printf69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @fmt.2, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str.56, i32 0, i32 0))
  %smith_green70 = load %struct.graph*, %struct.graph** %smith_green
  %printg71 = call %struct.graph* @printg(%struct.graph* %smith_green70)
  %smith_fam72 = load %struct.graph*, %struct.graph** %smith_fam
  %green_fam73 = load %struct.graph*, %struct.graph** %green_fam
  %graph_intersection = call %struct.graph* @intersection_graph(%struct.graph* %smith_fam72, %struct.graph* %green_fam73)
  store %struct.graph* %graph_intersection, %struct.graph** %smith_green
  %printf74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @fmt.2, i32 0, i32 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @str.57, i32 0, i32 0))
  %smith_fam75 = load %struct.graph*, %struct.graph** %smith_fam
  %m376 = load %struct.map*, %struct.map** %m3
  %m477 = load %struct.map*, %struct.map** %m4
  %graph_add_wedge78 = call %struct.graph* @add_wedge(%struct.graph* %smith_fam75, %struct.map* %m376, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.58, i32 0, i32 0), %struct.map* %m477)
  %printf79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @fmt.2, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str.59, i32 0, i32 0))
  %printf80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @fmt.2, i32 0, i32 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.60, i32 0, i32 0))
  %smith_fam81 = load %struct.graph*, %struct.graph** %smith_fam
  %printg82 = call %struct.graph* @printg(%struct.graph* %smith_fam81)
  %smith_fam83 = load %struct.graph*, %struct.graph** %smith_fam
  %m384 = load %struct.map*, %struct.map** %m3
  %m485 = load %struct.map*, %struct.map** %m4
  %graph_del_edge = call %struct.graph* @delete_edge(%struct.graph* %smith_fam83, %struct.map* %m384, %struct.map* %m485)
  %printf86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @fmt.2, i32 0, i32 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @str.61, i32 0, i32 0))
  %printf87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @fmt.2, i32 0, i32 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.62, i32 0, i32 0))
  %smith_fam88 = load %struct.graph*, %struct.graph** %smith_fam
  %printg89 = call %struct.graph* @printg(%struct.graph* %smith_fam88)
  ret i32 0
}
