; LLVM IR from stivalaa/EstimNetDirected :: src (configparser)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.param_config_s = type { i32, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr }
%struct.string_pair_s = type { ptr, ptr }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @free_param_config_struct(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.param_config_s, ptr %4, i32 0, i32 1
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  call void @free(ptr noundef %6) #3
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.param_config_s, ptr %7, i32 0, i32 2
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  call void @free(ptr noundef %9) #3
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.param_config_s, ptr %10, i32 0, i32 4
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  call void @free(ptr noundef %12) #3
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.param_config_s, ptr %13, i32 0, i32 9
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  call void @free(ptr noundef %15) #3
  store i32 0, ptr %3, align 4, !tbaa !15
  br label %16

16:                                               ; preds = %30, %1
  %17 = load i32, ptr %3, align 4, !tbaa !15
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.param_config_s, ptr %18, i32 0, i32 5
  %20 = load i32, ptr %19, align 8, !tbaa !16
  %21 = icmp ult i32 %17, %20
  br i1 %21, label %22, label %33

22:                                               ; preds = %16
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.param_config_s, ptr %23, i32 0, i32 7
  %25 = load ptr, ptr %24, align 8, !tbaa !17
  %26 = load i32, ptr %3, align 4, !tbaa !15
  %27 = zext i32 %26 to i64
  %28 = getelementptr inbounds ptr, ptr %25, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  call void @free(ptr noundef %29) #3
  br label %30

30:                                               ; preds = %22
  %31 = load i32, ptr %3, align 4, !tbaa !15
  %32 = add i32 %31, 1
  store i32 %32, ptr %3, align 4, !tbaa !15
  br label %16, !llvm.loop !18

33:                                               ; preds = %16
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.param_config_s, ptr %34, i32 0, i32 8
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  call void @free(ptr noundef %36) #3
  store i32 0, ptr %3, align 4, !tbaa !15
  br label %37

37:                                               ; preds = %51, %33
  %38 = load i32, ptr %3, align 4, !tbaa !15
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.param_config_s, ptr %39, i32 0, i32 12
  %41 = load i32, ptr %40, align 8, !tbaa !21
  %42 = icmp ult i32 %38, %41
  br i1 %42, label %43, label %54

43:                                               ; preds = %37
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.param_config_s, ptr %44, i32 0, i32 14
  %46 = load ptr, ptr %45, align 8, !tbaa !22
  %47 = load i32, ptr %3, align 4, !tbaa !15
  %48 = zext i32 %47 to i64
  %49 = getelementptr inbounds ptr, ptr %46, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  call void @free(ptr noundef %50) #3
  br label %51

51:                                               ; preds = %43
  %52 = load i32, ptr %3, align 4, !tbaa !15
  %53 = add i32 %52, 1
  store i32 %53, ptr %3, align 4, !tbaa !15
  br label %37, !llvm.loop !23

54:                                               ; preds = %37
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.param_config_s, ptr %55, i32 0, i32 15
  %57 = load ptr, ptr %56, align 8, !tbaa !24
  call void @free(ptr noundef %57) #3
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.param_config_s, ptr %58, i32 0, i32 16
  %60 = load ptr, ptr %59, align 8, !tbaa !25
  call void @free(ptr noundef %60) #3
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.param_config_s, ptr %61, i32 0, i32 18
  %63 = load ptr, ptr %62, align 8, !tbaa !26
  call void @free(ptr noundef %63) #3
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.param_config_s, ptr %64, i32 0, i32 23
  %66 = load ptr, ptr %65, align 8, !tbaa !27
  call void @free(ptr noundef %66) #3
  store i32 0, ptr %3, align 4, !tbaa !15
  br label %67

67:                                               ; preds = %90, %54
  %68 = load i32, ptr %3, align 4, !tbaa !15
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.param_config_s, ptr %69, i32 0, i32 19
  %71 = load i32, ptr %70, align 8, !tbaa !28
  %72 = icmp ult i32 %68, %71
  br i1 %72, label %73, label %93

73:                                               ; preds = %67
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.param_config_s, ptr %74, i32 0, i32 21
  %76 = load ptr, ptr %75, align 8, !tbaa !29
  %77 = load i32, ptr %3, align 4, !tbaa !15
  %78 = zext i32 %77 to i64
  %79 = getelementptr inbounds %struct.string_pair_s, ptr %76, i64 %78
  %80 = getelementptr inbounds %struct.string_pair_s, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !30
  call void @free(ptr noundef %81) #3
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.param_config_s, ptr %82, i32 0, i32 21
  %84 = load ptr, ptr %83, align 8, !tbaa !29
  %85 = load i32, ptr %3, align 4, !tbaa !15
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds %struct.string_pair_s, ptr %84, i64 %86
  %88 = getelementptr inbounds %struct.string_pair_s, ptr %87, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !32
  call void @free(ptr noundef %89) #3
  br label %90

90:                                               ; preds = %73
  %91 = load i32, ptr %3, align 4, !tbaa !15
  %92 = add i32 %91, 1
  store i32 %92, ptr %3, align 4, !tbaa !15
  br label %67, !llvm.loop !33

93:                                               ; preds = %67
  %94 = load ptr, ptr %2, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.param_config_s, ptr %94, i32 0, i32 22
  %96 = load ptr, ptr %95, align 8, !tbaa !34
  call void @free(ptr noundef %96) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"param_config_s", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !11, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !11, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 16}
!13 = !{!10, !6, i64 32}
!14 = !{!10, !6, i64 72}
!15 = !{!11, !11, i64 0}
!16 = !{!10, !11, i64 40}
!17 = !{!10, !6, i64 56}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!10, !6, i64 64}
!21 = !{!10, !11, i64 96}
!22 = !{!10, !6, i64 112}
!23 = distinct !{!23, !19}
!24 = !{!10, !6, i64 120}
!25 = !{!10, !6, i64 128}
!26 = !{!10, !6, i64 144}
!27 = !{!10, !6, i64 184}
!28 = !{!10, !11, i64 152}
!29 = !{!10, !6, i64 168}
!30 = !{!31, !6, i64 0}
!31 = !{!"string_pair_s", !6, i64 0, !6, i64 8}
!32 = !{!31, !6, i64 8}
!33 = distinct !{!33, !19}
!34 = !{!10, !6, i64 176}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.string_pair_s = type { ptr, ptr }

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @free_param_config_struct(ptr nocapture noundef readonly %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  tail call void @free(ptr noundef %3) #2
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = load ptr, ptr %4, align 8, !tbaa !11
  tail call void @free(ptr noundef %5) #2
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load ptr, ptr %6, align 8, !tbaa !12
  tail call void @free(ptr noundef %7) #2
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  %9 = load ptr, ptr %8, align 8, !tbaa !13
  tail call void @free(ptr noundef %9) #2
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  %11 = load i32, ptr %10, align 8, !tbaa !14
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %12 = getelementptr inbounds i8, ptr %0, i64 56
  br label %13

13:                                               ; preds = %.lr.ph, %13
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %13 ]
  %14 = load ptr, ptr %12, align 8, !tbaa !15
  %15 = getelementptr inbounds ptr, ptr %14, i64 %indvars.iv
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  tail call void @free(ptr noundef %16) #2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr %10, align 8, !tbaa !14
  %18 = zext i32 %17 to i64
  %19 = icmp ult i64 %indvars.iv.next, %18
  br i1 %19, label %13, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %13, %1
  %20 = getelementptr inbounds i8, ptr %0, i64 64
  %21 = load ptr, ptr %20, align 8, !tbaa !19
  tail call void @free(ptr noundef %21) #2
  %22 = getelementptr inbounds i8, ptr %0, i64 96
  %23 = load i32, ptr %22, align 8, !tbaa !20
  %.not35 = icmp eq i32 %23, 0
  br i1 %.not35, label %._crit_edge30, label %.lr.ph29

.lr.ph29:                                         ; preds = %._crit_edge
  %24 = getelementptr inbounds i8, ptr %0, i64 112
  br label %25

25:                                               ; preds = %.lr.ph29, %25
  %indvars.iv38 = phi i64 [ 0, %.lr.ph29 ], [ %indvars.iv.next39, %25 ]
  %26 = load ptr, ptr %24, align 8, !tbaa !21
  %27 = getelementptr inbounds ptr, ptr %26, i64 %indvars.iv38
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  tail call void @free(ptr noundef %28) #2
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %29 = load i32, ptr %22, align 8, !tbaa !20
  %30 = zext i32 %29 to i64
  %31 = icmp ult i64 %indvars.iv.next39, %30
  br i1 %31, label %25, label %._crit_edge30, !llvm.loop !22

._crit_edge30:                                    ; preds = %25, %._crit_edge
  %32 = getelementptr inbounds i8, ptr %0, i64 120
  %33 = load ptr, ptr %32, align 8, !tbaa !23
  tail call void @free(ptr noundef %33) #2
  %34 = getelementptr inbounds i8, ptr %0, i64 128
  %35 = load ptr, ptr %34, align 8, !tbaa !24
  tail call void @free(ptr noundef %35) #2
  %36 = getelementptr inbounds i8, ptr %0, i64 144
  %37 = load ptr, ptr %36, align 8, !tbaa !25
  tail call void @free(ptr noundef %37) #2
  %38 = getelementptr inbounds i8, ptr %0, i64 184
  %39 = load ptr, ptr %38, align 8, !tbaa !26
  tail call void @free(ptr noundef %39) #2
  %40 = getelementptr inbounds i8, ptr %0, i64 152
  %41 = load i32, ptr %40, align 8, !tbaa !27
  %.not36 = icmp eq i32 %41, 0
  br i1 %.not36, label %._crit_edge34, label %.lr.ph33

.lr.ph33:                                         ; preds = %._crit_edge30
  %42 = getelementptr inbounds i8, ptr %0, i64 168
  br label %43

43:                                               ; preds = %.lr.ph33, %43
  %indvars.iv41 = phi i64 [ 0, %.lr.ph33 ], [ %indvars.iv.next42, %43 ]
  %44 = load ptr, ptr %42, align 8, !tbaa !28
  %45 = getelementptr inbounds %struct.string_pair_s, ptr %44, i64 %indvars.iv41
  %46 = load ptr, ptr %45, align 8, !tbaa !29
  tail call void @free(ptr noundef %46) #2
  %47 = load ptr, ptr %42, align 8, !tbaa !28
  %48 = getelementptr inbounds %struct.string_pair_s, ptr %47, i64 %indvars.iv41, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !31
  tail call void @free(ptr noundef %49) #2
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %50 = load i32, ptr %40, align 8, !tbaa !27
  %51 = zext i32 %50 to i64
  %52 = icmp ult i64 %indvars.iv.next42, %51
  br i1 %52, label %43, label %._crit_edge34, !llvm.loop !32

._crit_edge34:                                    ; preds = %43, %._crit_edge30
  %53 = getelementptr inbounds i8, ptr %0, i64 176
  %54 = load ptr, ptr %53, align 8, !tbaa !33
  tail call void @free(ptr noundef %54) #2
  ret void
}

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"param_config_s", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !7, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 16}
!12 = !{!6, !10, i64 32}
!13 = !{!6, !10, i64 72}
!14 = !{!6, !7, i64 40}
!15 = !{!6, !10, i64 56}
!16 = !{!10, !10, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!6, !10, i64 64}
!20 = !{!6, !7, i64 96}
!21 = !{!6, !10, i64 112}
!22 = distinct !{!22, !18}
!23 = !{!6, !10, i64 120}
!24 = !{!6, !10, i64 128}
!25 = !{!6, !10, i64 144}
!26 = !{!6, !10, i64 184}
!27 = !{!6, !7, i64 152}
!28 = !{!6, !10, i64 168}
!29 = !{!30, !10, i64 0}
!30 = !{!"string_pair_s", !10, i64 0, !10, i64 8}
!31 = !{!30, !10, i64 8}
!32 = distinct !{!32, !18}
!33 = !{!6, !10, i64 176}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass