; LLVM IR from seppo0010/rlite :: src (rlite)

; 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.rlite = type { i64, i64, i32, ptr, i64, i64, i64, ptr, i32, i32, i32, i32, ptr, i64, i64, ptr, i64, i64, ptr, ptr, ptr, ptr }
%struct.rl_memory_driver = type { ptr, i64 }
%struct.rl_file_driver = type { ptr, ptr, i32 }

@.str.19 = external hidden unnamed_addr constant [9 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 willreturn memory(read)
declare i64 @strlen(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: nounwind
declare void @free(ptr noundef) #2

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_open(ptr noundef %0, ptr noundef %1, i32 noundef %2) #4 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %14 = call noalias ptr @malloc(i64 noundef 160) #6
  store ptr %14, ptr %9, align 8, !tbaa !5
  %15 = load ptr, ptr %9, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %18, label %17

17:                                               ; preds = %3
  store i32 4, ptr %8, align 4, !tbaa !9
  br label %179

18:                                               ; preds = %3
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.rlite, ptr %19, i32 0, i32 20
  store ptr null, ptr %20, align 8, !tbaa !11
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.rlite, ptr %21, i32 0, i32 19
  store ptr null, ptr %22, align 8, !tbaa !14
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.rlite, ptr %23, i32 0, i32 12
  store ptr null, ptr %24, align 8, !tbaa !15
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.rlite, ptr %25, i32 0, i32 3
  store ptr null, ptr %26, align 8, !tbaa !16
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.rlite, ptr %27, i32 0, i32 10
  store i32 0, ptr %28, align 8, !tbaa !17
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.rlite, ptr %29, i32 0, i32 9
  store i32 0, ptr %30, align 4, !tbaa !18
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.rlite, ptr %31, i32 0, i32 6
  store i64 1024, ptr %32, align 8, !tbaa !19
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.rlite, ptr %33, i32 0, i32 18
  store ptr null, ptr %34, align 8, !tbaa !20
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.rlite, ptr %35, i32 0, i32 15
  store ptr null, ptr %36, align 8, !tbaa !21
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.rlite, ptr %37, i32 0, i32 16
  store i64 0, ptr %38, align 8, !tbaa !22
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.rlite, ptr %39, i32 0, i32 17
  store i64 0, ptr %40, align 8, !tbaa !23
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.rlite, ptr %41, i32 0, i32 14
  store i64 0, ptr %42, align 8, !tbaa !24
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.rlite, ptr %43, i32 0, i32 13
  store i64 0, ptr %44, align 8, !tbaa !25
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.rlite, ptr %45, i32 0, i32 4
  store i64 0, ptr %46, align 8, !tbaa !26
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.rlite, ptr %47, i32 0, i32 1
  store i64 0, ptr %48, align 8, !tbaa !27
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.rlite, ptr %49, i32 0, i32 11
  store i32 0, ptr %50, align 4, !tbaa !28
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.rlite, ptr %51, i32 0, i32 2
  store i32 0, ptr %52, align 8, !tbaa !29
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.rlite, ptr %53, i32 0, i32 7
  store ptr null, ptr %54, align 8, !tbaa !30
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.rlite, ptr %55, i32 0, i32 8
  store i32 -1, ptr %56, align 8, !tbaa !31
  %57 = call noalias ptr @malloc(i64 noundef 128) #6
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.rlite, ptr %58, i32 0, i32 15
  store ptr %57, ptr %59, align 8, !tbaa !21
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.rlite, ptr %60, i32 0, i32 15
  %62 = load ptr, ptr %61, align 8, !tbaa !21
  %63 = icmp ne ptr %62, null
  br i1 %63, label %65, label %64

64:                                               ; preds = %18
  store i32 4, ptr %8, align 4, !tbaa !9
  br label %179

65:                                               ; preds = %18
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.rlite, ptr %66, i32 0, i32 14
  store i64 0, ptr %67, align 8, !tbaa !24
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.rlite, ptr %68, i32 0, i32 13
  store i64 16, ptr %69, align 8, !tbaa !25
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.rlite, ptr %70, i32 0, i32 17
  store i64 0, ptr %71, align 8, !tbaa !23
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = and i32 %72, 2
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %75, label %87

75:                                               ; preds = %65
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.rlite, ptr %76, i32 0, i32 16
  store i64 8, ptr %77, align 8, !tbaa !22
  %78 = call noalias ptr @malloc(i64 noundef 64) #6
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.rlite, ptr %79, i32 0, i32 18
  store ptr %78, ptr %80, align 8, !tbaa !20
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.rlite, ptr %81, i32 0, i32 18
  %83 = load ptr, ptr %82, align 8, !tbaa !20
  %84 = icmp ne ptr %83, null
  br i1 %84, label %86, label %85

85:                                               ; preds = %75
  store i32 4, ptr %8, align 4, !tbaa !9
  br label %179

86:                                               ; preds = %75
  br label %90

87:                                               ; preds = %65
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.rlite, ptr %88, i32 0, i32 16
  store i64 0, ptr %89, align 8, !tbaa !22
  br label %90

90:                                               ; preds = %87, %86
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = call i32 @strcmp(ptr noundef %91, ptr noundef @.str.19) #7
  %93 = icmp eq i32 %92, 0
  br i1 %93, label %94, label %112

94:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %95 = call noalias ptr @malloc(i64 noundef 16) #6
  store ptr %95, ptr %10, align 8, !tbaa !5
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 4, ptr %8, align 4, !tbaa !9
  store i32 2, ptr %11, align 4
  br label %109

99:                                               ; preds = %94
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.rlite, ptr %100, i32 0, i32 8
  store i32 0, ptr %101, align 8, !tbaa !31
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.rlite, ptr %103, i32 0, i32 7
  store ptr %102, ptr %104, align 8, !tbaa !30
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.rl_memory_driver, ptr %105, i32 0, i32 0
  store ptr null, ptr %106, align 8, !tbaa !32
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.rl_memory_driver, ptr %107, i32 0, i32 1
  store i64 0, ptr %108, align 8, !tbaa !34
  store i32 0, ptr %11, align 4
  br label %109

109:                                              ; preds = %99, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %110 = load i32, ptr %11, align 4
  switch i32 %110, label %190 [
    i32 0, label %111
    i32 2, label %179
  ]

111:                                              ; preds = %109
  br label %170

112:                                              ; preds = %90
  %113 = load i32, ptr %7, align 4, !tbaa !9
  %114 = and i32 %113, 4
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %116, label %132

116:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %117 = load i32, ptr %7, align 4, !tbaa !9
  %118 = and i32 %117, 2
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %116
  store i32 2, ptr %12, align 4, !tbaa !9
  br label %122

121:                                              ; preds = %116
  store i32 4, ptr %12, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %121, %120
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = load i32, ptr %12, align 4, !tbaa !9
  %125 = call i32 @access(ptr noundef %123, i32 noundef %124) #5
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %128

127:                                              ; preds = %122
  store i32 5, ptr %8, align 4, !tbaa !9
  store i32 2, ptr %11, align 4
  br label %129

128:                                              ; preds = %122
  store i32 0, ptr %11, align 4
  br label %129

129:                                              ; preds = %128, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %130 = load i32, ptr %11, align 4
  switch i32 %130, label %190 [
    i32 0, label %131
    i32 2, label %179
  ]

131:                                              ; preds = %129
  br label %132

132:                                              ; preds = %131, %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %133 = call noalias ptr @malloc(i64 noundef 24) #6
  store ptr %133, ptr %13, align 8, !tbaa !5
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 4, ptr %8, align 4, !tbaa !9
  store i32 2, ptr %11, align 4
  br label %167

137:                                              ; preds = %132
  %138 = load ptr, ptr %13, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.rl_file_driver, ptr %138, i32 0, i32 0
  store ptr null, ptr %139, align 8, !tbaa !35
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = call i64 @strlen(ptr noundef %140) #7
  %142 = add i64 %141, 1
  %143 = mul i64 1, %142
  %144 = call noalias ptr @malloc(i64 noundef %143) #6
  %145 = load ptr, ptr %13, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.rl_file_driver, ptr %145, i32 0, i32 1
  store ptr %144, ptr %146, align 8, !tbaa !37
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.rl_file_driver, ptr %147, i32 0, i32 1
  %149 = load ptr, ptr %148, align 8, !tbaa !37
  %150 = icmp ne ptr %149, null
  br i1 %150, label %153, label %151

151:                                              ; preds = %137
  %152 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %152) #5
  store i32 4, ptr %8, align 4, !tbaa !9
  store i32 2, ptr %11, align 4
  br label %167

153:                                              ; preds = %137
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.rl_file_driver, ptr %154, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8, !tbaa !37
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = call ptr @strcpy(ptr noundef %156, ptr noundef %157) #5
  %159 = load i32, ptr %7, align 4, !tbaa !9
  %160 = load ptr, ptr %13, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.rl_file_driver, ptr %160, i32 0, i32 2
  store i32 %159, ptr %161, align 8, !tbaa !38
  %162 = load ptr, ptr %13, align 8, !tbaa !5
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.rlite, ptr %163, i32 0, i32 7
  store ptr %162, ptr %164, align 8, !tbaa !30
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.rlite, ptr %165, i32 0, i32 8
  store i32 1, ptr %166, align 8, !tbaa !31
  store i32 0, ptr %11, align 4
  br label %167

167:                                              ; preds = %153, %151, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %168 = load i32, ptr %11, align 4
  switch i32 %168, label %190 [
    i32 0, label %169
    i32 2, label %179
  ]

169:                                              ; preds = %167
  br label %170

170:                                              ; preds = %169, %111
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = call i32 @rl_read_header(ptr noundef %171)
  store i32 %172, ptr %8, align 4, !tbaa !9
  %173 = load i32, ptr %8, align 4, !tbaa !9
  %174 = icmp ne i32 0, %173
  br i1 %174, label %175, label %176

175:                                              ; preds = %170
  br label %179

176:                                              ; preds = %170
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %177, ptr %178, align 8, !tbaa !5
  br label %179

179:                                              ; preds = %176, %175, %167, %129, %109, %85, %64, %17
  %180 = load i32, ptr %8, align 4, !tbaa !9
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %188

182:                                              ; preds = %179
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = icmp ne ptr %183, null
  br i1 %184, label %185, label %188

185:                                              ; preds = %182
  %186 = load ptr, ptr %9, align 8, !tbaa !5
  %187 = call i32 @rl_close(ptr noundef %186)
  br label %188

188:                                              ; preds = %185, %182, %179
  %189 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %189, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %190

190:                                              ; preds = %188, %167, %129, %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %191 = load i32, ptr %4, align 4
  ret i32 %191
}

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

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

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_read_header(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_close(ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nounwind allocsize(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 = { 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 }
attributes #6 = { nounwind allocsize(0) }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 144}
!12 = !{!"rlite", !13, i64 0, !13, i64 8, !10, i64 16, !6, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !6, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !6, i64 80, !13, i64 88, !13, i64 96, !6, i64 104, !13, i64 112, !13, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !6, i64 136}
!15 = !{!12, !6, i64 80}
!16 = !{!12, !6, i64 24}
!17 = !{!12, !10, i64 72}
!18 = !{!12, !10, i64 68}
!19 = !{!12, !13, i64 48}
!20 = !{!12, !6, i64 128}
!21 = !{!12, !6, i64 104}
!22 = !{!12, !13, i64 112}
!23 = !{!12, !13, i64 120}
!24 = !{!12, !13, i64 96}
!25 = !{!12, !13, i64 88}
!26 = !{!12, !13, i64 32}
!27 = !{!12, !13, i64 8}
!28 = !{!12, !10, i64 76}
!29 = !{!12, !10, i64 16}
!30 = !{!12, !6, i64 56}
!31 = !{!12, !10, i64 64}
!32 = !{!33, !6, i64 0}
!33 = !{!"", !6, i64 0, !13, i64 8}
!34 = !{!33, !13, i64 8}
!35 = !{!36, !6, i64 0}
!36 = !{!"", !6, i64 0, !6, i64 8, !10, i64 16}
!37 = !{!36, !6, i64 8}
!38 = !{!36, !10, 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"

@.str.19 = external hidden unnamed_addr constant [9 x i8], align 1

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_open(ptr nocapture noundef readonly %0, ptr nocapture noundef writeonly %1, i32 noundef %2) local_unnamed_addr #3 {
  %4 = tail call noalias dereferenceable_or_null(160) ptr @malloc(i64 noundef 160) #8
  %.not102 = icmp eq ptr %4, null
  br i1 %.not102, label %.thread98, label %5

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %4, i64 136
  %7 = getelementptr inbounds i8, ptr %4, i64 80
  store ptr null, ptr %7, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %4, i64 24
  store ptr null, ptr %8, align 8, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %4, i64 48
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %6, i8 0, i64 16, i1 false)
  store i64 1024, ptr %9, align 8, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %4, i64 128
  %11 = getelementptr inbounds i8, ptr %4, i64 104
  %12 = getelementptr inbounds i8, ptr %4, i64 112
  %13 = getelementptr inbounds i8, ptr %4, i64 88
  %14 = getelementptr inbounds i8, ptr %4, i64 32
  store i64 0, ptr %14, align 8, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 0, ptr %15, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %4, i64 16
  store i32 0, ptr %16, align 8, !tbaa !16
  %17 = getelementptr inbounds i8, ptr %4, i64 56
  store ptr null, ptr %17, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %4, i64 64
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %13, i8 0, i64 48, i1 false)
  store <4 x i32> <i32 -1, i32 0, i32 0, i32 0>, ptr %18, align 8, !tbaa !18
  %19 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #8
  store ptr %19, ptr %11, align 8, !tbaa !19
  %.not = icmp eq ptr %19, null
  br i1 %.not, label %.thread93, label %20

20:                                               ; preds = %5
  %21 = getelementptr inbounds i8, ptr %4, i64 96
  %22 = getelementptr inbounds i8, ptr %4, i64 120
  store i64 0, ptr %21, align 8, !tbaa !20
  store i64 16, ptr %13, align 8, !tbaa !21
  store i64 0, ptr %22, align 8, !tbaa !22
  %23 = and i32 %2, 2
  %.not78 = icmp eq i32 %23, 0
  br i1 %.not78, label %26, label %24

24:                                               ; preds = %20
  store i64 8, ptr %12, align 8, !tbaa !23
  %25 = tail call noalias dereferenceable_or_null(64) ptr @malloc(i64 noundef 64) #8
  store ptr %25, ptr %10, align 8, !tbaa !24
  %.not79 = icmp eq ptr %25, null
  br i1 %.not79, label %.thread93, label %27

26:                                               ; preds = %20
  store i64 0, ptr %12, align 8, !tbaa !23
  br label %27

27:                                               ; preds = %24, %26
  %28 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.19) #9
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  %calloc = tail call dereferenceable_or_null(16) ptr @calloc(i64 1, i64 16)
  %.not84 = icmp eq ptr %calloc, null
  br i1 %.not84, label %.thread93, label %.thread

.thread:                                          ; preds = %30
  store i32 0, ptr %18, align 8, !tbaa !25
  store ptr %calloc, ptr %17, align 8, !tbaa !17
  br label %47

31:                                               ; preds = %27
  %32 = and i32 %2, 4
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %31
  %. = select i1 %.not78, i32 4, i32 2
  %35 = tail call i32 @access(ptr noundef %0, i32 noundef %.) #10
  %.not81 = icmp eq i32 %35, 0
  br i1 %.not81, label %36, label %.thread93

36:                                               ; preds = %34, %31
  %37 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #8
  %.not82 = icmp eq ptr %37, null
  br i1 %.not82, label %.thread93, label %38

38:                                               ; preds = %36
  store ptr null, ptr %37, align 8, !tbaa !26
  %39 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #9
  %40 = add i64 %39, 1
  %41 = tail call noalias ptr @malloc(i64 noundef %40) #8
  %42 = getelementptr inbounds i8, ptr %37, i64 8
  store ptr %41, ptr %42, align 8, !tbaa !28
  %.not83 = icmp eq ptr %41, null
  br i1 %.not83, label %43, label %44

43:                                               ; preds = %38
  tail call void @free(ptr noundef nonnull %37) #10
  br label %.thread93

44:                                               ; preds = %38
  %45 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %41, ptr noundef nonnull dereferenceable(1) %0) #10
  %46 = getelementptr inbounds i8, ptr %37, i64 16
  store i32 %2, ptr %46, align 8, !tbaa !29
  store ptr %37, ptr %17, align 8, !tbaa !17
  store i32 1, ptr %18, align 8, !tbaa !25
  br label %47

47:                                               ; preds = %44, %.thread
  %48 = tail call i32 @rl_read_header(ptr noundef nonnull %4)
  %.not85 = icmp eq i32 %48, 0
  br i1 %.not85, label %49, label %.thread93

49:                                               ; preds = %47
  store ptr %4, ptr %1, align 8, !tbaa !30
  br label %.thread98

.thread93:                                        ; preds = %47, %5, %24, %34, %30, %43, %36
  %.4 = phi i32 [ %48, %47 ], [ 5, %34 ], [ 4, %5 ], [ 4, %24 ], [ 4, %30 ], [ 4, %43 ], [ 4, %36 ]
  %50 = tail call i32 @rl_close(ptr noundef nonnull %4)
  br label %.thread98

.thread98:                                        ; preds = %3, %49, %.thread93
  %.4101 = phi i32 [ %.4, %.thread93 ], [ 4, %3 ], [ 0, %49 ]
  ret i32 %.4101
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @access(ptr nocapture noundef readonly, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_read_header(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_close(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #7

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 = { 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 = { 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 #5 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { 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, !11, i64 80}
!6 = !{!"rlite", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !11, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !11, i64 80, !7, i64 88, !7, i64 96, !11, i64 104, !7, i64 112, !7, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !11, i64 24}
!13 = !{!6, !7, i64 48}
!14 = !{!6, !7, i64 32}
!15 = !{!6, !7, i64 8}
!16 = !{!6, !10, i64 16}
!17 = !{!6, !11, i64 56}
!18 = !{!10, !10, i64 0}
!19 = !{!6, !11, i64 104}
!20 = !{!6, !7, i64 96}
!21 = !{!6, !7, i64 88}
!22 = !{!6, !7, i64 120}
!23 = !{!6, !7, i64 112}
!24 = !{!6, !11, i64 128}
!25 = !{!6, !10, i64 64}
!26 = !{!27, !11, i64 0}
!27 = !{!"", !11, i64 0, !11, i64 8, !10, i64 16}
!28 = !{!27, !11, i64 8}
!29 = !{!27, !10, i64 16}
!30 = !{!11, !11, i64 0}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass