; LLVM IR from jim-b/ECCSI-SAKKE :: es-demo-1 (main_addExampleCommunity)

; 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"

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [515 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [63 x i8], align 1
@__func__.main_addExampleCommunity = external hidden unnamed_addr constant [25 x i8], align 1
@stdout = external global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local signext i16 @main_addExampleCommunity() #0 {
  %1 = alloca i16, align 2
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca [1200 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 2, ptr %1) #6
  store i16 1, ptr %1, align 2, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store ptr null, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store ptr null, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store ptr null, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !11
  %9 = call noalias ptr @strdup(ptr noundef @.str) #6
  store ptr %9, ptr %2, align 8, !tbaa !9
  %10 = call noalias ptr @strdup(ptr noundef @.str.1) #6
  store ptr %10, ptr %3, align 8, !tbaa !9
  %11 = load ptr, ptr %2, align 8, !tbaa !9
  %12 = load ptr, ptr %2, align 8, !tbaa !9
  %13 = call i64 @strlen(ptr noundef %12) #7
  %14 = udiv i64 %13, 2
  %15 = call signext i16 @utils_convertHexStringToOctetString(ptr noundef %11, i64 noundef %14, ptr noundef %4, ptr noundef %5)
  %16 = load ptr, ptr %3, align 8, !tbaa !9
  %17 = load ptr, ptr %3, align 8, !tbaa !9
  %18 = call i64 @strlen(ptr noundef %17) #7
  %19 = udiv i64 %18, 2
  %20 = call signext i16 @utils_convertHexStringToOctetString(ptr noundef %16, i64 noundef %19, ptr noundef %6, ptr noundef %7)
  %21 = load ptr, ptr %6, align 8, !tbaa !9
  %22 = load i64, ptr %7, align 8, !tbaa !11
  %23 = load ptr, ptr %4, align 8, !tbaa !9
  %24 = load i64, ptr %5, align 8, !tbaa !11
  %25 = call zeroext i8 @community_store(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef @.str.3, ptr noundef @.str.4, ptr noundef @.str.5, ptr noundef @.str.6, i16 noundef signext 1, ptr noundef @.str.7, ptr noundef %21, i64 noundef %22, ptr noundef %23, i64 noundef %24, ptr noundef @.str.8)
  %26 = icmp ne i8 %25, 0
  br i1 %26, label %28, label %27

27:                                               ; preds = %0
  store i16 0, ptr %1, align 2, !tbaa !5
  br label %34

28:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 1200, ptr %8) #6
  %29 = getelementptr inbounds [1200 x i8], ptr %8, i64 0, i64 0
  %30 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %29, i64 noundef 1200, ptr noundef @.str.9, ptr noundef @.str.10, ptr noundef @__func__.main_addExampleCommunity, i32 noundef 122) #6
  %31 = load ptr, ptr @stdout, align 8, !tbaa !9
  %32 = getelementptr inbounds [1200 x i8], ptr %8, i64 0, i64 0
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.11, ptr noundef %32) #6
  call void @llvm.lifetime.end.p0(i64 1200, ptr %8) #6
  br label %34

34:                                               ; preds = %28, %27
  %35 = load ptr, ptr %2, align 8, !tbaa !9
  %36 = icmp ne ptr null, %35
  br i1 %36, label %37, label %42

37:                                               ; preds = %34
  %38 = load ptr, ptr %2, align 8, !tbaa !9
  %39 = load ptr, ptr %2, align 8, !tbaa !9
  %40 = call i64 @strlen(ptr noundef %39) #7
  call void @llvm.memset.p0.i64(ptr align 1 %38, i8 0, i64 %40, i1 false)
  %41 = load ptr, ptr %2, align 8, !tbaa !9
  call void @free(ptr noundef %41) #6
  br label %42

42:                                               ; preds = %37, %34
  %43 = load ptr, ptr %3, align 8, !tbaa !9
  %44 = icmp ne ptr null, %43
  br i1 %44, label %45, label %50

45:                                               ; preds = %42
  %46 = load ptr, ptr %3, align 8, !tbaa !9
  %47 = load ptr, ptr %3, align 8, !tbaa !9
  %48 = call i64 @strlen(ptr noundef %47) #7
  call void @llvm.memset.p0.i64(ptr align 1 %46, i8 0, i64 %48, i1 false)
  %49 = load ptr, ptr %3, align 8, !tbaa !9
  call void @free(ptr noundef %49) #6
  br label %50

50:                                               ; preds = %45, %42
  %51 = load ptr, ptr %4, align 8, !tbaa !9
  %52 = icmp ne ptr null, %51
  br i1 %52, label %53, label %57

53:                                               ; preds = %50
  %54 = load ptr, ptr %4, align 8, !tbaa !9
  %55 = load i64, ptr %5, align 8, !tbaa !11
  call void @llvm.memset.p0.i64(ptr align 1 %54, i8 0, i64 %55, i1 false)
  %56 = load ptr, ptr %4, align 8, !tbaa !9
  call void @free(ptr noundef %56) #6
  br label %57

57:                                               ; preds = %53, %50
  %58 = load ptr, ptr %6, align 8, !tbaa !9
  %59 = icmp ne ptr null, %58
  br i1 %59, label %60, label %64

60:                                               ; preds = %57
  %61 = load ptr, ptr %6, align 8, !tbaa !9
  %62 = load i64, ptr %7, align 8, !tbaa !11
  call void @llvm.memset.p0.i64(ptr align 1 %61, i8 0, i64 %62, i1 false)
  %63 = load ptr, ptr %6, align 8, !tbaa !9
  call void @free(ptr noundef %63) #6
  br label %64

64:                                               ; preds = %60, %57
  %65 = load i16, ptr %1, align 2, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %1) #6
  ret i16 %65
}

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

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #2

declare signext i16 @utils_convertHexStringToOctetString(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

declare zeroext i8 @community_store(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i16 noundef signext, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 #4 = { nounwind willreturn memory(read) "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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}


; 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"

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [515 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [63 x i8], align 1
@__func__.main_addExampleCommunity = external hidden unnamed_addr constant [25 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local signext range(i16 0, 2) i16 @main_addExampleCommunity() local_unnamed_addr #0 {
  %1 = alloca ptr, align 8
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca [1200 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  store ptr null, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  store i64 0, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  store i64 0, ptr %4, align 8, !tbaa !9
  %6 = tail call noalias ptr @strdup(ptr noundef nonnull @.str) #8
  %7 = tail call noalias ptr @strdup(ptr noundef nonnull @.str.1) #8
  %8 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %6) #9
  %9 = lshr i64 %8, 1
  %10 = call signext i16 @utils_convertHexStringToOctetString(ptr noundef %6, i64 noundef %9, ptr noundef nonnull %1, ptr noundef nonnull %2) #8
  %11 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %7) #9
  %12 = lshr i64 %11, 1
  %13 = call signext i16 @utils_convertHexStringToOctetString(ptr noundef %7, i64 noundef %12, ptr noundef nonnull %3, ptr noundef nonnull %4) #8
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = load i64, ptr %4, align 8, !tbaa !9
  %16 = load ptr, ptr %1, align 8, !tbaa !5
  %17 = load i64, ptr %2, align 8, !tbaa !9
  %18 = call zeroext i8 @community_store(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i16 noundef signext 1, ptr noundef nonnull @.str.7, ptr noundef %14, i64 noundef %15, ptr noundef %16, i64 noundef %17, ptr noundef nonnull @.str.8) #8
  %.not = icmp eq i8 %18, 0
  br i1 %.not, label %23, label %19

19:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %5) #8
  %20 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %5, i64 noundef 1200, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.10, ptr noundef nonnull @__func__.main_addExampleCommunity, i32 noundef 122) #8
  %21 = load ptr, ptr @stdout, align 8, !tbaa !5
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull @.str.11, ptr noundef nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %5) #8
  br label %23

23:                                               ; preds = %0, %19
  %.0 = phi i16 [ 1, %19 ], [ 0, %0 ]
  %.not16 = icmp eq ptr %6, null
  br i1 %.not16, label %25, label %24

24:                                               ; preds = %23
  call void @free(ptr noundef nonnull %6) #8
  br label %25

25:                                               ; preds = %24, %23
  %.not17 = icmp eq ptr %7, null
  br i1 %.not17, label %27, label %26

26:                                               ; preds = %25
  call void @free(ptr noundef nonnull %7) #8
  br label %27

27:                                               ; preds = %26, %25
  %28 = load ptr, ptr %1, align 8, !tbaa !5
  %.not18 = icmp eq ptr %28, null
  br i1 %.not18, label %32, label %29

29:                                               ; preds = %27
  %30 = load i64, ptr %2, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %28, i8 0, i64 %30, i1 false)
  %31 = load ptr, ptr %1, align 8, !tbaa !5
  call void @free(ptr noundef %31) #8
  br label %32

32:                                               ; preds = %29, %27
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %.not19 = icmp eq ptr %33, null
  br i1 %.not19, label %37, label %34

34:                                               ; preds = %32
  %35 = load i64, ptr %4, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %33, i8 0, i64 %35, i1 false)
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  call void @free(ptr noundef %36) #8
  br label %37

37:                                               ; preds = %34, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret i16 %.0
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #2

declare signext i16 @utils_convertHexStringToOctetString(ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4

declare zeroext i8 @community_store(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i16 noundef signext, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #5

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn 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 #3 = { "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 #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 #5 = { nofree 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }

!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, !10, i64 0}
!10 = !{!"long", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass