; LLVM IR from Discngine/fpocket :: src (descriptors)

; 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.s_desc = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, i32, [20 x i32], i32, i32, i32, float, float, i32, i32, i32, i32, i32, [255 x i8], [255 x i8], [8 x i8] }

; 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 uwtable
define dso_local void @set_aa_desc(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  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 4, ptr %5) #3
  store i32 -1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #3
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 0
  %11 = load i8, ptr %10, align 1, !tbaa !11
  store i8 %11, ptr %6, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 1
  %14 = load i8, ptr %13, align 1, !tbaa !11
  store i8 %14, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 2
  %17 = load i8, ptr %16, align 1, !tbaa !11
  store i8 %17, ptr %8, align 1, !tbaa !11
  %18 = load i8, ptr %6, align 1, !tbaa !11
  %19 = sext i8 %18 to i32
  switch i32 %19, label %89 [
    i32 65, label %20
    i32 67, label %43
    i32 71, label %44
    i32 72, label %57
    i32 73, label %58
    i32 76, label %59
    i32 77, label %66
    i32 80, label %67
    i32 83, label %74
    i32 84, label %75
    i32 86, label %88
  ]

20:                                               ; preds = %2
  %21 = load i8, ptr %7, align 1, !tbaa !11
  %22 = sext i8 %21 to i32
  %23 = icmp eq i32 %22, 76
  br i1 %23, label %24, label %25

24:                                               ; preds = %20
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %42

25:                                               ; preds = %20
  %26 = load i8, ptr %7, align 1, !tbaa !11
  %27 = sext i8 %26 to i32
  %28 = icmp eq i32 %27, 82
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %41

30:                                               ; preds = %25
  %31 = load i8, ptr %7, align 1, !tbaa !11
  %32 = sext i8 %31 to i32
  %33 = icmp eq i32 %32, 83
  br i1 %33, label %34, label %39

34:                                               ; preds = %30
  %35 = load i8, ptr %8, align 1, !tbaa !11
  %36 = sext i8 %35 to i32
  %37 = icmp eq i32 %36, 80
  br i1 %37, label %38, label %39

38:                                               ; preds = %34
  store i32 3, ptr %5, align 4, !tbaa !9
  br label %40

39:                                               ; preds = %34, %30
  store i32 2, ptr %5, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %39, %38
  br label %41

41:                                               ; preds = %40, %29
  br label %42

42:                                               ; preds = %41, %24
  br label %90

43:                                               ; preds = %2
  store i32 4, ptr %5, align 4, !tbaa !9
  br label %90

44:                                               ; preds = %2
  %45 = load i8, ptr %8, align 1, !tbaa !11
  %46 = sext i8 %45 to i32
  %47 = icmp eq i32 %46, 85
  br i1 %47, label %48, label %49

48:                                               ; preds = %44
  store i32 6, ptr %5, align 4, !tbaa !9
  br label %56

49:                                               ; preds = %44
  %50 = load i8, ptr %8, align 1, !tbaa !11
  %51 = sext i8 %50 to i32
  %52 = icmp eq i32 %51, 89
  br i1 %52, label %53, label %54

53:                                               ; preds = %49
  store i32 7, ptr %5, align 4, !tbaa !9
  br label %55

54:                                               ; preds = %49
  store i32 5, ptr %5, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %54, %53
  br label %56

56:                                               ; preds = %55, %48
  br label %90

57:                                               ; preds = %2
  store i32 8, ptr %5, align 4, !tbaa !9
  br label %90

58:                                               ; preds = %2
  store i32 9, ptr %5, align 4, !tbaa !9
  br label %90

59:                                               ; preds = %2
  %60 = load i8, ptr %7, align 1, !tbaa !11
  %61 = sext i8 %60 to i32
  %62 = icmp eq i32 %61, 89
  br i1 %62, label %63, label %64

63:                                               ; preds = %59
  store i32 11, ptr %5, align 4, !tbaa !9
  br label %65

64:                                               ; preds = %59
  store i32 10, ptr %5, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %64, %63
  br label %90

66:                                               ; preds = %2
  store i32 12, ptr %5, align 4, !tbaa !9
  br label %90

67:                                               ; preds = %2
  %68 = load i8, ptr %7, align 1, !tbaa !11
  %69 = sext i8 %68 to i32
  %70 = icmp eq i32 %69, 72
  br i1 %70, label %71, label %72

71:                                               ; preds = %67
  store i32 13, ptr %5, align 4, !tbaa !9
  br label %73

72:                                               ; preds = %67
  store i32 14, ptr %5, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %72, %71
  br label %90

74:                                               ; preds = %2
  store i32 15, ptr %5, align 4, !tbaa !9
  br label %90

75:                                               ; preds = %2
  %76 = load i8, ptr %7, align 1, !tbaa !11
  %77 = sext i8 %76 to i32
  %78 = icmp eq i32 %77, 72
  br i1 %78, label %79, label %80

79:                                               ; preds = %75
  store i32 16, ptr %5, align 4, !tbaa !9
  br label %87

80:                                               ; preds = %75
  %81 = load i8, ptr %7, align 1, !tbaa !11
  %82 = sext i8 %81 to i32
  %83 = icmp eq i32 %82, 82
  br i1 %83, label %84, label %85

84:                                               ; preds = %80
  store i32 17, ptr %5, align 4, !tbaa !9
  br label %86

85:                                               ; preds = %80
  store i32 18, ptr %5, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %85, %84
  br label %87

87:                                               ; preds = %86, %79
  br label %90

88:                                               ; preds = %2
  store i32 19, ptr %5, align 4, !tbaa !9
  br label %90

89:                                               ; preds = %2
  br label %90

90:                                               ; preds = %89, %88, %87, %74, %73, %66, %65, %58, %57, %56, %43, %42
  %91 = load i32, ptr %5, align 4, !tbaa !9
  %92 = icmp ne i32 %91, -1
  br i1 %92, label %93, label %125

93:                                               ; preds = %90
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.s_desc, ptr %94, i32 0, i32 28
  %96 = load i32, ptr %5, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [20 x i32], ptr %95, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %98, align 4, !tbaa !9
  %101 = load i32, ptr %5, align 4, !tbaa !9
  %102 = call float @get_hydrophobicity_score_from_idx(i32 noundef %101)
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.s_desc, ptr %103, i32 0, i32 0
  %105 = load float, ptr %104, align 4, !tbaa !12
  %106 = fadd float %105, %102
  store float %106, ptr %104, align 4, !tbaa !12
  %107 = load i32, ptr %5, align 4, !tbaa !9
  %108 = call i32 @get_polarity_from_idx(i32 noundef %107)
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.s_desc, ptr %109, i32 0, i32 30
  %111 = load i32, ptr %110, align 4, !tbaa !15
  %112 = add nsw i32 %111, %108
  store i32 %112, ptr %110, align 4, !tbaa !15
  %113 = load i32, ptr %5, align 4, !tbaa !9
  %114 = call float @get_volume_score_from_idx(i32 noundef %113)
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.s_desc, ptr %115, i32 0, i32 1
  %117 = load float, ptr %116, align 4, !tbaa !16
  %118 = fadd float %117, %114
  store float %118, ptr %116, align 4, !tbaa !16
  %119 = load i32, ptr %5, align 4, !tbaa !9
  %120 = call i32 @get_charge_from_idx(i32 noundef %119)
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.s_desc, ptr %121, i32 0, i32 31
  %123 = load i32, ptr %122, align 4, !tbaa !17
  %124 = add nsw i32 %123, %120
  store i32 %124, ptr %122, align 4, !tbaa !17
  br label %125

125:                                              ; preds = %93, %90
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret void
}

declare float @get_hydrophobicity_score_from_idx(i32 noundef) #2

declare i32 @get_polarity_from_idx(i32 noundef) #2

declare float @get_volume_score_from_idx(i32 noundef) #2

declare i32 @get_charge_from_idx(i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"s_desc", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !14, i64 60, !14, i64 64, !14, i64 68, !14, i64 72, !14, i64 76, !14, i64 80, !14, i64 84, !14, i64 88, !14, i64 92, !14, i64 96, !14, i64 100, !14, i64 104, !10, i64 108, !7, i64 112, !10, i64 192, !10, i64 196, !10, i64 200, !14, i64 204, !14, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !7, i64 232, !7, i64 487, !7, i64 742}
!14 = !{!"float", !7, i64 0}
!15 = !{!13, !10, i64 196}
!16 = !{!13, !14, i64 4}
!17 = !{!13, !10, i64 200}


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

; Function Attrs: nounwind uwtable
define dso_local void @set_aa_desc(ptr nocapture noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = load i8, ptr %1, align 1, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 1
  %5 = load i8, ptr %4, align 1, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 2
  %7 = load i8, ptr %6, align 1, !tbaa !5
  switch i8 %3, label %45 [
    i8 65, label %8
    i8 67, label %24
    i8 71, label %13
    i8 72, label %14
    i8 73, label %15
    i8 76, label %16
    i8 77, label %18
    i8 80, label %19
    i8 83, label %21
    i8 84, label %22
    i8 86, label %23
  ]

8:                                                ; preds = %2
  switch i8 %5, label %10 [
    i8 76, label %24
    i8 82, label %9
  ]

9:                                                ; preds = %8
  br label %24

10:                                               ; preds = %8
  %11 = icmp eq i8 %5, 83
  %12 = icmp eq i8 %7, 80
  %or.cond = select i1 %11, i1 %12, i1 false
  %. = select i1 %or.cond, i32 3, i32 2
  br label %24

13:                                               ; preds = %2
  %switch.selectcmp = icmp eq i8 %7, 89
  %switch.select = select i1 %switch.selectcmp, i32 7, i32 5
  %switch.selectcmp34 = icmp eq i8 %7, 85
  %switch.select35 = select i1 %switch.selectcmp34, i32 6, i32 %switch.select
  br label %24

14:                                               ; preds = %2
  br label %24

15:                                               ; preds = %2
  br label %24

16:                                               ; preds = %2
  %17 = icmp eq i8 %5, 89
  %.29 = select i1 %17, i32 11, i32 10
  br label %24

18:                                               ; preds = %2
  br label %24

19:                                               ; preds = %2
  %20 = icmp eq i8 %5, 72
  %.30 = select i1 %20, i32 13, i32 14
  br label %24

21:                                               ; preds = %2
  br label %24

22:                                               ; preds = %2
  %switch.selectcmp36 = icmp eq i8 %5, 82
  %switch.select37 = select i1 %switch.selectcmp36, i32 17, i32 18
  %switch.selectcmp38 = icmp eq i8 %5, 72
  %switch.select39 = select i1 %switch.selectcmp38, i32 16, i32 %switch.select37
  br label %24

23:                                               ; preds = %2
  br label %24

24:                                               ; preds = %22, %13, %2, %23, %21, %18, %15, %14, %9, %8, %10, %16, %19
  %.0.ph = phi i32 [ %.30, %19 ], [ %.29, %16 ], [ %., %10 ], [ 0, %8 ], [ 1, %9 ], [ 8, %14 ], [ 9, %15 ], [ 12, %18 ], [ 15, %21 ], [ 19, %23 ], [ 4, %2 ], [ %switch.select35, %13 ], [ %switch.select39, %22 ]
  %25 = getelementptr inbounds i8, ptr %0, i64 112
  %26 = zext nneg i32 %.0.ph to i64
  %27 = getelementptr inbounds [20 x i32], ptr %25, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !8
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %27, align 4, !tbaa !8
  %30 = tail call float @get_hydrophobicity_score_from_idx(i32 noundef %.0.ph) #2
  %31 = load float, ptr %0, align 4, !tbaa !10
  %32 = fadd float %30, %31
  store float %32, ptr %0, align 4, !tbaa !10
  %33 = tail call i32 @get_polarity_from_idx(i32 noundef %.0.ph) #2
  %34 = getelementptr inbounds i8, ptr %0, i64 196
  %35 = load i32, ptr %34, align 4, !tbaa !13
  %36 = add nsw i32 %35, %33
  store i32 %36, ptr %34, align 4, !tbaa !13
  %37 = tail call float @get_volume_score_from_idx(i32 noundef %.0.ph) #2
  %38 = getelementptr inbounds i8, ptr %0, i64 4
  %39 = load float, ptr %38, align 4, !tbaa !14
  %40 = fadd float %37, %39
  store float %40, ptr %38, align 4, !tbaa !14
  %41 = tail call i32 @get_charge_from_idx(i32 noundef %.0.ph) #2
  %42 = getelementptr inbounds i8, ptr %0, i64 200
  %43 = load i32, ptr %42, align 4, !tbaa !15
  %44 = add nsw i32 %43, %41
  store i32 %44, ptr %42, align 4, !tbaa !15
  br label %45

45:                                               ; preds = %2, %24
  ret void
}

declare float @get_hydrophobicity_score_from_idx(i32 noundef) local_unnamed_addr #1

declare i32 @get_polarity_from_idx(i32 noundef) local_unnamed_addr #1

declare float @get_volume_score_from_idx(i32 noundef) local_unnamed_addr #1

declare i32 @get_charge_from_idx(i32 noundef) local_unnamed_addr #1

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 = { "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, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !12, i64 0}
!11 = !{!"s_desc", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !9, i64 108, !6, i64 112, !9, i64 192, !9, i64 196, !9, i64 200, !12, i64 204, !12, i64 208, !9, i64 212, !9, i64 216, !9, i64 220, !9, i64 224, !9, i64 228, !6, i64 232, !6, i64 487, !6, i64 742}
!12 = !{!"float", !6, i64 0}
!13 = !{!11, !9, i64 196}
!14 = !{!11, !12, i64 4}
!15 = !{!11, !9, i64 200}


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