; LLVM IR from jim-b/ECCSI-SAKKE :: 4u2change (msdb)

; 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 [3 x i8], align 1
@stdout = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [52 x i8], align 1

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

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

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

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

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

declare i32 @fclose(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @openCommunityFile(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden signext i16 @parseDataAttribute(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local signext i16 @msdb_communityGetRevoked(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [16 x i8], align 16
  %7 = alloca i16, align 2
  %8 = alloca [1200 x i8], align 16
  %9 = alloca [1200 x i8], align 16
  %10 = alloca [1200 x i8], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #6
  store i16 1, ptr %7, align 2, !tbaa !9
  %11 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %11, i8 0, i64 8, i1 false)
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = icmp eq ptr null, %12
  br i1 %13, label %14, label %20

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1200, ptr %8) #6
  %15 = getelementptr inbounds [1200 x i8], ptr %8, i64 0, i64 0
  %16 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %15, i64 noundef 1200, ptr noundef @.str, ptr noundef @.str.53) #6
  %17 = load ptr, ptr @stdout, align 8, !tbaa !5
  %18 = getelementptr inbounds [1200 x i8], ptr %8, i64 0, i64 0
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str.2, ptr noundef %18) #6
  call void @llvm.lifetime.end.p0(i64 1200, ptr %8) #6
  br label %55

20:                                               ; preds = %2
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = call ptr @openCommunityFile(ptr noundef %21)
  store ptr %22, ptr %5, align 8, !tbaa !5
  %23 = icmp ne ptr null, %22
  br i1 %23, label %24, label %48

24:                                               ; preds = %20
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = call signext i16 @parseDataAttribute(ptr noundef %25, ptr noundef @.str.54, ptr noundef %6)
  %27 = icmp ne i16 %26, 0
  br i1 %27, label %38, label %28

28:                                               ; preds = %24
  %29 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  %30 = call i32 @strcasecmp(ptr noundef %29, ptr noundef @.str.55) #7
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %34

32:                                               ; preds = %28
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  store i16 1, ptr %33, align 2, !tbaa !9
  br label %36

34:                                               ; preds = %28
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  store i16 0, ptr %35, align 2, !tbaa !9
  br label %36

36:                                               ; preds = %34, %32
  store i16 0, ptr %7, align 2, !tbaa !9
  %37 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %37, i8 0, i64 16, i1 false)
  br label %45

38:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 1200, ptr %9) #6
  %39 = getelementptr inbounds [1200 x i8], ptr %9, i64 0, i64 0
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %39, i64 noundef 1200, ptr noundef @.str.56, ptr noundef %40) #6
  %42 = load ptr, ptr @stdout, align 8, !tbaa !5
  %43 = getelementptr inbounds [1200 x i8], ptr %9, i64 0, i64 0
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.2, ptr noundef %43) #6
  call void @llvm.lifetime.end.p0(i64 1200, ptr %9) #6
  br label %45

45:                                               ; preds = %38, %36
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = call i32 @fclose(ptr noundef %46)
  br label %54

48:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 1200, ptr %10) #6
  %49 = getelementptr inbounds [1200 x i8], ptr %10, i64 0, i64 0
  %50 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %49, i64 noundef 1200, ptr noundef @.str, ptr noundef @.str.57) #6
  %51 = load ptr, ptr @stdout, align 8, !tbaa !5
  %52 = getelementptr inbounds [1200 x i8], ptr %10, i64 0, i64 0
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef @.str.2, ptr noundef %52) #6
  call void @llvm.lifetime.end.p0(i64 1200, ptr %10) #6
  br label %54

54:                                               ; preds = %48, %45
  br label %55

55:                                               ; preds = %54, %14
  %56 = load i16, ptr %7, align 2, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret i16 %56
}

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcasecmp(ptr noundef, ptr noundef) #5

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 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 #5 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !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 [3 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [52 x i8], align 1

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @openCommunityFile(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden signext i16 @parseDataAttribute(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local signext range(i16 0, 2) i16 @msdb_communityGetRevoked(ptr noundef %0, ptr nocapture noundef writeonly %1) local_unnamed_addr #3 {
  %3 = alloca [16 x i8], align 16
  %4 = alloca [1200 x i8], align 16
  %5 = alloca [1200 x i8], align 16
  %6 = alloca [1200 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  store i64 0, ptr %3, align 16
  %7 = icmp eq ptr %0, null
  br i1 %7, label %8, label %12

8:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %4) #5
  %9 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %4, i64 noundef 1200, ptr noundef nonnull @.str, ptr noundef nonnull @.str.53) #5
  %10 = load ptr, ptr @stdout, align 8, !tbaa !5
  %11 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.2, ptr noundef nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %4) #5
  br label %29

12:                                               ; preds = %2
  %13 = tail call ptr @openCommunityFile(ptr noundef nonnull %0)
  %.not = icmp eq ptr %13, null
  br i1 %.not, label %25, label %14

14:                                               ; preds = %12
  %15 = call signext i16 @parseDataAttribute(ptr noundef nonnull %13, ptr noundef nonnull @.str.54, ptr noundef nonnull %3)
  %.not9 = icmp eq i16 %15, 0
  br i1 %.not9, label %16, label %19

16:                                               ; preds = %14
  %17 = call i32 @strcasecmp(ptr noundef nonnull %3, ptr noundef nonnull @.str.55) #6
  %18 = icmp eq i32 %17, 0
  %. = zext i1 %18 to i16
  store i16 %., ptr %1, align 2, !tbaa !9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  br label %23

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

23:                                               ; preds = %19, %16
  %.0 = phi i16 [ 1, %19 ], [ 0, %16 ]
  %24 = call i32 @fclose(ptr noundef nonnull %13)
  br label %29

25:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %6) #5
  %26 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 1200, ptr noundef nonnull @.str, ptr noundef nonnull @.str.57) #5
  %27 = load ptr, ptr @stdout, align 8, !tbaa !5
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.2, ptr noundef nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %6) #5
  br label %29

29:                                               ; preds = %23, %25, %8
  %.1 = phi i16 [ 1, %8 ], [ %.0, %23 ], [ 1, %25 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  ret i16 %.1
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @strcasecmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4

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


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