; LLVM IR from Nonoum/ECL :: tests (tests)

; 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.ECL_JH_RState = type { ptr, ptr, ptr, i8, 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: mustprogress nounwind uwtable
declare dso_local void @ECL_JH_RInit(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local zeroext i8 @ECL_JH_Read(ptr noundef, i8 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @ECL_JH_RJump(ptr noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i32 @ECL_JH_Read_E4(ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i32 @ECL_JH_Read_E6E3(ptr noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local i32 @ECL_ZeroDevourer_Decompress(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.ECL_JH_RState, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %21, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds i8, ptr %22, i64 %24
  store ptr %25, ptr %12, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load i32, ptr %7, align 4, !tbaa !9
  call void @ECL_JH_RInit(ptr noundef %10, ptr noundef %26, i32 noundef %27, i32 noundef 0)
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %34

30:                                               ; preds = %4
  %31 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 4
  %32 = load i8, ptr %31, align 1, !tbaa !11
  %33 = icmp ne i8 %32, 0
  br i1 %33, label %35, label %34

34:                                               ; preds = %30, %4
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %214

35:                                               ; preds = %30
  br label %36

36:                                               ; preds = %193, %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = ptrtoint ptr %37 to i64
  %40 = ptrtoint ptr %38 to i64
  %41 = sub i64 %39, %40
  %42 = trunc i64 %41 to i32
  store i32 %42, ptr %16, align 4, !tbaa !9
  %43 = load i32, ptr %16, align 4, !tbaa !9
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %46, label %45

45:                                               ; preds = %36
  store i32 2, ptr %13, align 4
  br label %191

46:                                               ; preds = %36
  %47 = call zeroext i8 @ECL_JH_Read(ptr noundef %10, i8 noundef zeroext 1)
  %48 = icmp ne i8 %47, 0
  br i1 %48, label %59, label %49

49:                                               ; preds = %46
  %50 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 4
  %51 = load i8, ptr %50, align 1, !tbaa !11
  %52 = icmp ne i8 %51, 0
  br i1 %52, label %53, label %57

53:                                               ; preds = %49
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  store i8 0, ptr %54, align 1, !tbaa !13
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i32 1
  store ptr %56, ptr %8, align 8, !tbaa !5
  br label %58

57:                                               ; preds = %49
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %191

58:                                               ; preds = %53
  br label %190

59:                                               ; preds = %46
  %60 = call zeroext i8 @ECL_JH_Read(ptr noundef %10, i8 noundef zeroext 2)
  %61 = zext i8 %60 to i32
  switch i32 %61, label %189 [
    i32 0, label %62
    i32 1, label %109
    i32 2, label %142
    i32 3, label %162
  ]

62:                                               ; preds = %59
  %63 = call zeroext i8 @ECL_JH_Read(ptr noundef %10, i8 noundef zeroext 2)
  %64 = zext i8 %63 to i32
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %66 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 1
  %67 = load ptr, ptr %66, align 8, !tbaa !14
  store ptr %67, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  %68 = load i32, ptr %14, align 4, !tbaa !9
  call void @ECL_JH_RJump(ptr noundef %10, i32 noundef %68)
  %69 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 4
  %70 = load i8, ptr %69, align 1, !tbaa !11
  %71 = icmp ne i8 %70, 0
  br i1 %71, label %72, label %104

72:                                               ; preds = %62
  %73 = load i32, ptr %14, align 4, !tbaa !9
  %74 = load i32, ptr %16, align 4, !tbaa !9
  %75 = icmp ult i32 %73, %74
  br i1 %75, label %76, label %104

76:                                               ; preds = %72
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = load i32, ptr %14, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds i8, ptr %77, i64 %79
  store i8 0, ptr %80, align 1, !tbaa !13
  br label %81

81:                                               ; preds = %95, %76
  %82 = load i32, ptr %18, align 4, !tbaa !9
  %83 = load i32, ptr %14, align 4, !tbaa !9
  %84 = icmp ult i32 %82, %83
  br i1 %84, label %85, label %98

85:                                               ; preds = %81
  %86 = load ptr, ptr %17, align 8, !tbaa !5
  %87 = load i32, ptr %18, align 4, !tbaa !9
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds i8, ptr %86, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !13
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = load i32, ptr %18, align 4, !tbaa !9
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds i8, ptr %91, i64 %93
  store i8 %90, ptr %94, align 1, !tbaa !13
  br label %95

95:                                               ; preds = %85
  %96 = load i32, ptr %18, align 4, !tbaa !9
  %97 = add i32 %96, 1
  store i32 %97, ptr %18, align 4, !tbaa !9
  br label %81, !llvm.loop !15

98:                                               ; preds = %81
  %99 = load i32, ptr %14, align 4, !tbaa !9
  %100 = add i32 %99, 1
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = zext i32 %100 to i64
  %103 = getelementptr inbounds i8, ptr %101, i64 %102
  store ptr %103, ptr %8, align 8, !tbaa !5
  br label %105

104:                                              ; preds = %72, %62
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %106

105:                                              ; preds = %98
  store i32 0, ptr %13, align 4
  br label %106

106:                                              ; preds = %105, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %107 = load i32, ptr %13, align 4
  switch i32 %107, label %191 [
    i32 0, label %108
  ]

108:                                              ; preds = %106
  br label %189

109:                                              ; preds = %59
  %110 = call zeroext i8 @ECL_JH_Read(ptr noundef %10, i8 noundef zeroext 4)
  %111 = zext i8 %110 to i32
  %112 = add nsw i32 %111, 5
  store i32 %112, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %113 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 1
  %114 = load ptr, ptr %113, align 8, !tbaa !14
  store ptr %114, ptr %19, align 8, !tbaa !5
  %115 = load i32, ptr %14, align 4, !tbaa !9
  call void @ECL_JH_RJump(ptr noundef %10, i32 noundef %115)
  %116 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 4
  %117 = load i8, ptr %116, align 1, !tbaa !11
  %118 = icmp ne i8 %117, 0
  br i1 %118, label %119, label %137

119:                                              ; preds = %109
  %120 = load i32, ptr %14, align 4, !tbaa !9
  %121 = load i32, ptr %16, align 4, !tbaa !9
  %122 = icmp ult i32 %120, %121
  br i1 %122, label %123, label %137

123:                                              ; preds = %119
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = load i32, ptr %14, align 4, !tbaa !9
  %126 = zext i32 %125 to i64
  %127 = getelementptr inbounds i8, ptr %124, i64 %126
  store i8 0, ptr %127, align 1, !tbaa !13
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = load ptr, ptr %19, align 8, !tbaa !5
  %130 = load i32, ptr %14, align 4, !tbaa !9
  %131 = zext i32 %130 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %128, ptr align 1 %129, i64 %131, i1 false)
  %132 = load i32, ptr %14, align 4, !tbaa !9
  %133 = add i32 %132, 1
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = zext i32 %133 to i64
  %136 = getelementptr inbounds i8, ptr %134, i64 %135
  store ptr %136, ptr %8, align 8, !tbaa !5
  br label %138

137:                                              ; preds = %119, %109
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %139

138:                                              ; preds = %123
  store i32 0, ptr %13, align 4
  br label %139

139:                                              ; preds = %138, %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  %140 = load i32, ptr %13, align 4
  switch i32 %140, label %191 [
    i32 0, label %141
  ]

141:                                              ; preds = %139
  br label %189

142:                                              ; preds = %59
  %143 = call i32 @ECL_JH_Read_E4(ptr noundef %10)
  %144 = add i32 %143, 9
  store i32 %144, ptr %15, align 4, !tbaa !9
  %145 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 4
  %146 = load i8, ptr %145, align 1, !tbaa !11
  %147 = icmp ne i8 %146, 0
  br i1 %147, label %148, label %160

148:                                              ; preds = %142
  %149 = load i32, ptr %15, align 4, !tbaa !9
  %150 = load i32, ptr %16, align 4, !tbaa !9
  %151 = icmp ule i32 %149, %150
  br i1 %151, label %152, label %160

152:                                              ; preds = %148
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  %154 = load i32, ptr %15, align 4, !tbaa !9
  %155 = zext i32 %154 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %153, i8 0, i64 %155, i1 false)
  %156 = load i32, ptr %15, align 4, !tbaa !9
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  %158 = zext i32 %156 to i64
  %159 = getelementptr inbounds i8, ptr %157, i64 %158
  store ptr %159, ptr %8, align 8, !tbaa !5
  br label %161

160:                                              ; preds = %148, %142
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %191

161:                                              ; preds = %152
  br label %189

162:                                              ; preds = %59
  %163 = call i32 @ECL_JH_Read_E6E3(ptr noundef %10)
  %164 = add i32 %163, 1
  store i32 %164, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %165 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 1
  %166 = load ptr, ptr %165, align 8, !tbaa !14
  store ptr %166, ptr %20, align 8, !tbaa !5
  %167 = load i32, ptr %14, align 4, !tbaa !9
  call void @ECL_JH_RJump(ptr noundef %10, i32 noundef %167)
  %168 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 4
  %169 = load i8, ptr %168, align 1, !tbaa !11
  %170 = icmp ne i8 %169, 0
  br i1 %170, label %171, label %184

171:                                              ; preds = %162
  %172 = load i32, ptr %14, align 4, !tbaa !9
  %173 = load i32, ptr %16, align 4, !tbaa !9
  %174 = icmp ule i32 %172, %173
  br i1 %174, label %175, label %184

175:                                              ; preds = %171
  %176 = load ptr, ptr %8, align 8, !tbaa !5
  %177 = load ptr, ptr %20, align 8, !tbaa !5
  %178 = load i32, ptr %14, align 4, !tbaa !9
  %179 = zext i32 %178 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %176, ptr align 1 %177, i64 %179, i1 false)
  %180 = load i32, ptr %14, align 4, !tbaa !9
  %181 = load ptr, ptr %8, align 8, !tbaa !5
  %182 = zext i32 %180 to i64
  %183 = getelementptr inbounds i8, ptr %181, i64 %182
  store ptr %183, ptr %8, align 8, !tbaa !5
  br label %185

184:                                              ; preds = %171, %162
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %186

185:                                              ; preds = %175
  store i32 0, ptr %13, align 4
  br label %186

186:                                              ; preds = %185, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  %187 = load i32, ptr %13, align 4
  switch i32 %187, label %191 [
    i32 0, label %188
  ]

188:                                              ; preds = %186
  br label %189

189:                                              ; preds = %188, %161, %141, %108, %59
  br label %190

190:                                              ; preds = %189, %58
  store i32 0, ptr %13, align 4
  br label %191

191:                                              ; preds = %190, %186, %160, %139, %106, %57, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %192 = load i32, ptr %13, align 4
  switch i32 %192, label %214 [
    i32 0, label %193
    i32 2, label %194
  ]

193:                                              ; preds = %191
  br label %36, !llvm.loop !17

194:                                              ; preds = %191
  %195 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 1
  %196 = load ptr, ptr %195, align 8, !tbaa !14
  %197 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 2
  %198 = load ptr, ptr %197, align 8, !tbaa !18
  %199 = icmp eq ptr %196, %198
  br i1 %199, label %200, label %210

200:                                              ; preds = %194
  %201 = getelementptr inbounds %struct.ECL_JH_RState, ptr %10, i32 0, i32 4
  %202 = load i8, ptr %201, align 1, !tbaa !11
  %203 = icmp ne i8 %202, 0
  br i1 %203, label %204, label %210

204:                                              ; preds = %200
  %205 = load ptr, ptr %8, align 8, !tbaa !5
  %206 = load ptr, ptr %11, align 8, !tbaa !5
  %207 = ptrtoint ptr %205 to i64
  %208 = ptrtoint ptr %206 to i64
  %209 = sub i64 %207, %208
  br label %211

210:                                              ; preds = %200, %194
  br label %211

211:                                              ; preds = %210, %204
  %212 = phi i64 [ %209, %204 ], [ 0, %210 ]
  %213 = trunc i64 %212 to i32
  store i32 %213, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %214

214:                                              ; preds = %211, %191, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  %215 = load i32, ptr %5, align 4
  ret i32 %215
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !7, i64 25}
!12 = !{!"_ZTS13ECL_JH_RState", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 25}
!13 = !{!7, !7, i64 0}
!14 = !{!12, !6, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!12, !6, i64 16}


; 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.ECL_JH_RState = type { ptr, ptr, ptr, i8, i8 }

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

; 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 nounwind uwtable
declare dso_local void @ECL_JH_RInit(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local zeroext i8 @ECL_JH_Read(ptr noundef, i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @ECL_JH_RJump(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i32 @ECL_JH_Read_E4(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i32 @ECL_JH_Read_E6E3(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local i32 @ECL_ZeroDevourer_Decompress(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #1 {
  %5 = alloca %struct.ECL_JH_RState, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @ECL_JH_RInit(ptr noundef nonnull %5, ptr noundef %0, i32 noundef %1, i32 noundef 0)
  %6 = icmp ne ptr %2, null
  %7 = getelementptr inbounds i8, ptr %5, i64 25
  %8 = load i8, ptr %7, align 1
  %9 = icmp ne i8 %8, 0
  %or.cond = select i1 %6, i1 %9, i1 false
  br i1 %or.cond, label %.preheader, label %.thread100

.preheader:                                       ; preds = %4
  %10 = zext i32 %3 to i64
  %11 = getelementptr inbounds i8, ptr %2, i64 %10
  %12 = ptrtoint ptr %11 to i64
  %.not109 = icmp eq i32 %3, 0
  br i1 %.not109, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %13 = getelementptr inbounds i8, ptr %5, i64 8
  br label %14

14:                                               ; preds = %.lr.ph, %106
  %15 = phi i32 [ %3, %.lr.ph ], [ %109, %106 ]
  %.062110 = phi ptr [ %2, %.lr.ph ], [ %.567, %106 ]
  %.062110112 = ptrtoint ptr %.062110 to i64
  %16 = call zeroext i8 @ECL_JH_Read(ptr noundef nonnull %5, i8 noundef zeroext 1)
  %.not79 = icmp eq i8 %16, 0
  br i1 %.not79, label %17, label %21

17:                                               ; preds = %14
  %18 = load i8, ptr %7, align 1, !tbaa !5
  %.not80 = icmp eq i8 %18, 0
  br i1 %.not80, label %.thread100, label %19

19:                                               ; preds = %17
  store i8 0, ptr %.062110, align 1, !tbaa !10
  %20 = getelementptr inbounds i8, ptr %.062110, i64 1
  br label %106

21:                                               ; preds = %14
  %22 = call zeroext i8 @ECL_JH_Read(ptr noundef nonnull %5, i8 noundef zeroext 2)
  switch i8 %22, label %106 [
    i8 0, label %23
    i8 1, label %80
    i8 2, label %92
    i8 3, label %99
  ]

23:                                               ; preds = %21
  %24 = call zeroext i8 @ECL_JH_Read(ptr noundef nonnull %5, i8 noundef zeroext 2)
  %25 = zext i8 %24 to i32
  %26 = add nuw nsw i32 %25, 1
  %27 = load ptr, ptr %13, align 8, !tbaa !11
  call void @ECL_JH_RJump(ptr noundef nonnull %5, i32 noundef %26)
  %28 = load i8, ptr %7, align 1, !tbaa !5
  %.not86 = icmp ne i8 %28, 0
  %29 = icmp ult i32 %26, %15
  %or.cond88 = and i1 %29, %.not86
  br i1 %or.cond88, label %iter.check, label %.thread100

iter.check:                                       ; preds = %23
  %30 = ptrtoint ptr %27 to i64
  %31 = zext nneg i32 %26 to i64
  %32 = getelementptr inbounds i8, ptr %.062110, i64 %31
  store i8 0, ptr %32, align 1, !tbaa !10
  %min.iters.check = icmp ult i8 %24, 7
  %33 = sub i64 %.062110112, %30
  %diff.check = icmp ult i64 %33, 32
  %or.cond121 = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond121, label %vec.epilog.scalar.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check113 = icmp ult i8 %24, 31
  br i1 %min.iters.check113, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %31, 480
  %34 = getelementptr inbounds i8, ptr %27, i64 16
  %wide.load = load <16 x i8>, ptr %27, align 1, !tbaa !10
  %wide.load114 = load <16 x i8>, ptr %34, align 1, !tbaa !10
  %35 = getelementptr inbounds i8, ptr %.062110, i64 16
  store <16 x i8> %wide.load, ptr %.062110, align 1, !tbaa !10
  store <16 x i8> %wide.load114, ptr %35, align 1, !tbaa !10
  %36 = icmp eq i64 %n.vec, 32
  br i1 %36, label %middle.block, label %vector.body.1, !llvm.loop !12

vector.body.1:                                    ; preds = %vector.ph
  %37 = getelementptr inbounds i8, ptr %27, i64 32
  %38 = getelementptr inbounds i8, ptr %27, i64 48
  %wide.load.1 = load <16 x i8>, ptr %37, align 1, !tbaa !10
  %wide.load114.1 = load <16 x i8>, ptr %38, align 1, !tbaa !10
  %39 = getelementptr inbounds i8, ptr %.062110, i64 32
  %40 = getelementptr inbounds i8, ptr %.062110, i64 48
  store <16 x i8> %wide.load.1, ptr %39, align 1, !tbaa !10
  store <16 x i8> %wide.load114.1, ptr %40, align 1, !tbaa !10
  %41 = icmp eq i64 %n.vec, 64
  br i1 %41, label %middle.block, label %vector.body.2, !llvm.loop !12

vector.body.2:                                    ; preds = %vector.body.1
  %42 = getelementptr inbounds i8, ptr %27, i64 64
  %43 = getelementptr inbounds i8, ptr %27, i64 80
  %wide.load.2 = load <16 x i8>, ptr %42, align 1, !tbaa !10
  %wide.load114.2 = load <16 x i8>, ptr %43, align 1, !tbaa !10
  %44 = getelementptr inbounds i8, ptr %.062110, i64 64
  %45 = getelementptr inbounds i8, ptr %.062110, i64 80
  store <16 x i8> %wide.load.2, ptr %44, align 1, !tbaa !10
  store <16 x i8> %wide.load114.2, ptr %45, align 1, !tbaa !10
  %46 = icmp eq i64 %n.vec, 96
  br i1 %46, label %middle.block, label %vector.body.3, !llvm.loop !12

vector.body.3:                                    ; preds = %vector.body.2
  %47 = getelementptr inbounds i8, ptr %27, i64 96
  %48 = getelementptr inbounds i8, ptr %27, i64 112
  %wide.load.3 = load <16 x i8>, ptr %47, align 1, !tbaa !10
  %wide.load114.3 = load <16 x i8>, ptr %48, align 1, !tbaa !10
  %49 = getelementptr inbounds i8, ptr %.062110, i64 96
  %50 = getelementptr inbounds i8, ptr %.062110, i64 112
  store <16 x i8> %wide.load.3, ptr %49, align 1, !tbaa !10
  store <16 x i8> %wide.load114.3, ptr %50, align 1, !tbaa !10
  %51 = icmp eq i64 %n.vec, 128
  br i1 %51, label %middle.block, label %vector.body.4, !llvm.loop !12

vector.body.4:                                    ; preds = %vector.body.3
  %52 = getelementptr inbounds i8, ptr %27, i64 128
  %53 = getelementptr inbounds i8, ptr %27, i64 144
  %wide.load.4 = load <16 x i8>, ptr %52, align 1, !tbaa !10
  %wide.load114.4 = load <16 x i8>, ptr %53, align 1, !tbaa !10
  %54 = getelementptr inbounds i8, ptr %.062110, i64 128
  %55 = getelementptr inbounds i8, ptr %.062110, i64 144
  store <16 x i8> %wide.load.4, ptr %54, align 1, !tbaa !10
  store <16 x i8> %wide.load114.4, ptr %55, align 1, !tbaa !10
  %56 = icmp eq i64 %n.vec, 160
  br i1 %56, label %middle.block, label %vector.body.5, !llvm.loop !12

vector.body.5:                                    ; preds = %vector.body.4
  %57 = getelementptr inbounds i8, ptr %27, i64 160
  %58 = getelementptr inbounds i8, ptr %27, i64 176
  %wide.load.5 = load <16 x i8>, ptr %57, align 1, !tbaa !10
  %wide.load114.5 = load <16 x i8>, ptr %58, align 1, !tbaa !10
  %59 = getelementptr inbounds i8, ptr %.062110, i64 160
  %60 = getelementptr inbounds i8, ptr %.062110, i64 176
  store <16 x i8> %wide.load.5, ptr %59, align 1, !tbaa !10
  store <16 x i8> %wide.load114.5, ptr %60, align 1, !tbaa !10
  %61 = icmp eq i64 %n.vec, 192
  br i1 %61, label %middle.block, label %vector.body.6, !llvm.loop !12

vector.body.6:                                    ; preds = %vector.body.5
  %62 = getelementptr inbounds i8, ptr %27, i64 192
  %63 = getelementptr inbounds i8, ptr %27, i64 208
  %wide.load.6 = load <16 x i8>, ptr %62, align 1, !tbaa !10
  %wide.load114.6 = load <16 x i8>, ptr %63, align 1, !tbaa !10
  %64 = getelementptr inbounds i8, ptr %.062110, i64 192
  %65 = getelementptr inbounds i8, ptr %.062110, i64 208
  store <16 x i8> %wide.load.6, ptr %64, align 1, !tbaa !10
  store <16 x i8> %wide.load114.6, ptr %65, align 1, !tbaa !10
  %66 = icmp eq i64 %n.vec, 224
  br i1 %66, label %middle.block, label %vector.body.7, !llvm.loop !12

vector.body.7:                                    ; preds = %vector.body.6
  %67 = getelementptr inbounds i8, ptr %27, i64 224
  %68 = getelementptr inbounds i8, ptr %27, i64 240
  %wide.load.7 = load <16 x i8>, ptr %67, align 1, !tbaa !10
  %wide.load114.7 = load <16 x i8>, ptr %68, align 1, !tbaa !10
  %69 = getelementptr inbounds i8, ptr %.062110, i64 224
  %70 = getelementptr inbounds i8, ptr %.062110, i64 240
  store <16 x i8> %wide.load.7, ptr %69, align 1, !tbaa !10
  store <16 x i8> %wide.load114.7, ptr %70, align 1, !tbaa !10
  br label %middle.block

middle.block:                                     ; preds = %vector.body.7, %vector.body.6, %vector.body.5, %vector.body.4, %vector.body.3, %vector.body.2, %vector.body.1, %vector.ph
  %cmp.n = icmp eq i64 %n.vec, %31
  br i1 %cmp.n, label %.thread, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %31, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %vec.epilog.scalar.ph.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec116 = and i64 %31, 504
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index117 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next119, %vec.epilog.vector.body ]
  %71 = getelementptr inbounds i8, ptr %27, i64 %index117
  %wide.load118 = load <8 x i8>, ptr %71, align 1, !tbaa !10
  %72 = getelementptr inbounds i8, ptr %.062110, i64 %index117
  store <8 x i8> %wide.load118, ptr %72, align 1, !tbaa !10
  %index.next119 = add nuw i64 %index117, 8
  %73 = icmp eq i64 %index.next119, %n.vec116
  br i1 %73, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !16

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n120 = icmp eq i64 %n.vec116, %31
  br i1 %cmp.n120, label %.thread, label %vec.epilog.scalar.ph.preheader

vec.epilog.scalar.ph.preheader:                   ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec116, %vec.epilog.middle.block ]
  br label %vec.epilog.scalar.ph

vec.epilog.scalar.ph:                             ; preds = %vec.epilog.scalar.ph.preheader, %vec.epilog.scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %vec.epilog.scalar.ph ], [ %indvars.iv.ph, %vec.epilog.scalar.ph.preheader ]
  %74 = getelementptr inbounds i8, ptr %27, i64 %indvars.iv
  %75 = load i8, ptr %74, align 1, !tbaa !10
  %76 = getelementptr inbounds i8, ptr %.062110, i64 %indvars.iv
  store i8 %75, ptr %76, align 1, !tbaa !10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %31
  br i1 %exitcond.not, label %.thread, label %vec.epilog.scalar.ph, !llvm.loop !17

.thread:                                          ; preds = %vec.epilog.scalar.ph, %vec.epilog.middle.block, %middle.block
  %77 = add nuw nsw i32 %25, 2
  %78 = zext nneg i32 %77 to i64
  %79 = getelementptr inbounds i8, ptr %.062110, i64 %78
  br label %106

80:                                               ; preds = %21
  %81 = call zeroext i8 @ECL_JH_Read(ptr noundef nonnull %5, i8 noundef zeroext 4)
  %82 = zext i8 %81 to i32
  %83 = add nuw nsw i32 %82, 5
  %84 = load ptr, ptr %13, align 8, !tbaa !11
  call void @ECL_JH_RJump(ptr noundef nonnull %5, i32 noundef %83)
  %85 = load i8, ptr %7, align 1, !tbaa !5
  %.not85 = icmp ne i8 %85, 0
  %86 = icmp ult i32 %83, %15
  %or.cond89 = and i1 %86, %.not85
  br i1 %or.cond89, label %.thread94, label %.thread100

.thread94:                                        ; preds = %80
  %87 = zext nneg i32 %83 to i64
  %88 = getelementptr inbounds i8, ptr %.062110, i64 %87
  store i8 0, ptr %88, align 1, !tbaa !10
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %.062110, ptr noundef nonnull align 1 dereferenceable(1) %84, i64 %87, i1 false)
  %89 = add nuw nsw i32 %82, 6
  %90 = zext nneg i32 %89 to i64
  %91 = getelementptr inbounds i8, ptr %.062110, i64 %90
  br label %106

92:                                               ; preds = %21
  %93 = call i32 @ECL_JH_Read_E4(ptr noundef nonnull %5)
  %94 = add i32 %93, 9
  %95 = load i8, ptr %7, align 1, !tbaa !5
  %.not83 = icmp eq i8 %95, 0
  %.not84 = icmp ugt i32 %94, %15
  %or.cond90 = select i1 %.not83, i1 true, i1 %.not84
  br i1 %or.cond90, label %.thread100, label %96

96:                                               ; preds = %92
  %97 = zext i32 %94 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %.062110, i8 0, i64 %97, i1 false)
  %98 = getelementptr inbounds i8, ptr %.062110, i64 %97
  br label %106

99:                                               ; preds = %21
  %100 = call i32 @ECL_JH_Read_E6E3(ptr noundef nonnull %5)
  %101 = add i32 %100, 1
  %102 = load ptr, ptr %13, align 8, !tbaa !11
  call void @ECL_JH_RJump(ptr noundef nonnull %5, i32 noundef %101)
  %103 = load i8, ptr %7, align 1, !tbaa !5
  %.not81 = icmp eq i8 %103, 0
  %.not82 = icmp ugt i32 %101, %15
  %or.cond91 = or i1 %.not82, %.not81
  br i1 %or.cond91, label %.thread100, label %.thread97

.thread97:                                        ; preds = %99
  %104 = zext i32 %101 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.062110, ptr align 1 %102, i64 %104, i1 false)
  %105 = getelementptr inbounds i8, ptr %.062110, i64 %104
  br label %106

106:                                              ; preds = %19, %96, %21, %.thread, %.thread94, %.thread97
  %.567 = phi ptr [ %.062110, %21 ], [ %98, %96 ], [ %20, %19 ], [ %79, %.thread ], [ %91, %.thread94 ], [ %105, %.thread97 ]
  %107 = ptrtoint ptr %.567 to i64
  %108 = sub i64 %12, %107
  %109 = trunc i64 %108 to i32
  %.not = icmp eq i32 %109, 0
  br i1 %.not, label %._crit_edge.loopexit, label %14

._crit_edge.loopexit:                             ; preds = %106
  %.pre = load i8, ptr %7, align 1
  %110 = icmp ne i8 %.pre, 0
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader, %._crit_edge.loopexit
  %111 = phi i1 [ %110, %._crit_edge.loopexit ], [ true, %.preheader ]
  %.062.lcssa = phi ptr [ %.567, %._crit_edge.loopexit ], [ %2, %.preheader ]
  %112 = getelementptr inbounds i8, ptr %5, i64 8
  %113 = load ptr, ptr %112, align 8, !tbaa !11
  %114 = getelementptr inbounds i8, ptr %5, i64 16
  %115 = load ptr, ptr %114, align 8, !tbaa !18
  %116 = icmp eq ptr %113, %115
  %or.cond7 = select i1 %116, i1 %111, i1 false
  %117 = ptrtoint ptr %.062.lcssa to i64
  %118 = ptrtoint ptr %2 to i64
  %119 = sub i64 %117, %118
  %120 = trunc i64 %119 to i32
  %121 = select i1 %or.cond7, i32 %120, i32 0
  br label %.thread100

.thread100:                                       ; preds = %99, %80, %23, %92, %17, %4, %._crit_edge
  %.6 = phi i32 [ %121, %._crit_edge ], [ 0, %4 ], [ 0, %17 ], [ 0, %92 ], [ 0, %23 ], [ 0, %80 ], [ 0, %99 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  ret i32 %.6
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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, !8, i64 25}
!6 = !{!"_ZTS13ECL_JH_RState", !7, i64 0, !7, i64 8, !7, i64 16, !8, i64 24, !8, i64 25}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!8, !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = distinct !{!12, !13, !14, !15}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !13, !14, !15}
!17 = distinct !{!17, !13, !14}
!18 = !{!6, !7, i64 16}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass