; LLVM IR from OpenFAST/openfast :: modules/map/src (maperror)

; 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.__va_list_tag = type { i32, i32, ptr, ptr }
%struct.tagbstring = type { i32, i32, ptr }

@MAP_ERROR_STRING = external dso_local constant [132 x [256 x i8]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 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

declare ptr @bformat(ptr noundef, ...) #1

declare i32 @bconcat(ptr noundef, ptr noundef) #1

declare i32 @btrunc(ptr noundef, i32 noundef) #1

declare void @copy_target_string(ptr noundef, ptr noundef) #1

declare i32 @bdestroy(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 uwtable
define dso_local void @set_universal_error_with_message(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ...) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca [1 x %struct.__va_list_tag], align 16
  %10 = alloca ptr, 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 i32, align 4
  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
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call ptr (ptr, ...) @bformat(ptr noundef @.str, ptr noundef %18)
  store ptr %19, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 16, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %4
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = call i64 @strlen(ptr noundef %21) #7
  %23 = mul i64 2, %22
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %17, align 4, !tbaa !9
  %25 = load i32, ptr %17, align 4, !tbaa !9
  %26 = icmp slt i32 %25, 16
  br i1 %26, label %27, label %28

27:                                               ; preds = %20
  store i32 16, ptr %17, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %27, %20
  %29 = load i32, ptr %17, align 4, !tbaa !9
  %30 = add nsw i32 %29, 2
  %31 = call ptr @bfromcstralloc(i32 noundef %30, ptr noundef @.str.4)
  store ptr %31, ptr %11, align 8, !tbaa !5
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %42, label %34

34:                                               ; preds = %28
  store i32 1, ptr %17, align 4, !tbaa !9
  %35 = load i32, ptr %17, align 4, !tbaa !9
  %36 = add nsw i32 %35, 2
  %37 = call ptr @bfromcstralloc(i32 noundef %36, ptr noundef @.str.4)
  store ptr %37, ptr %11, align 8, !tbaa !5
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %41, label %40

40:                                               ; preds = %34
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %97

41:                                               ; preds = %34
  br label %42

42:                                               ; preds = %41, %28
  br label %43

43:                                               ; preds = %94, %42
  br label %44

44:                                               ; preds = %43
  %45 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %9, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %45)
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.tagbstring, ptr %46, i32 0, i32 2
  %48 = load ptr, ptr %47, align 8, !tbaa !11
  %49 = load i32, ptr %17, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  %51 = sext i32 %50 to i64
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %9, i64 0, i64 0
  %54 = call i32 @vsnprintf(ptr noundef %48, i64 noundef %51, ptr noundef %52, ptr noundef %53) #6
  store i32 %54, ptr %16, align 4, !tbaa !9
  %55 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %9, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %55)
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.tagbstring, ptr %56, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  %59 = load i32, ptr %17, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %58, i64 %60
  store i8 0, ptr %61, align 1, !tbaa !13
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.tagbstring, ptr %62, i32 0, i32 2
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  %65 = call i64 @strlen(ptr noundef %64) #7
  %66 = trunc i64 %65 to i32
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.tagbstring, ptr %67, i32 0, i32 1
  store i32 %66, ptr %68, align 4, !tbaa !14
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.tagbstring, ptr %69, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !14
  %72 = load i32, ptr %17, align 4, !tbaa !9
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %74, label %75

74:                                               ; preds = %44
  br label %95

75:                                               ; preds = %44
  %76 = load i32, ptr %16, align 4, !tbaa !9
  %77 = load i32, ptr %17, align 4, !tbaa !9
  %78 = icmp sgt i32 %76, %77
  br i1 %78, label %79, label %81

79:                                               ; preds = %75
  %80 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %80, ptr %17, align 4, !tbaa !9
  br label %85

81:                                               ; preds = %75
  %82 = load i32, ptr %17, align 4, !tbaa !9
  %83 = load i32, ptr %17, align 4, !tbaa !9
  %84 = add nsw i32 %83, %82
  store i32 %84, ptr %17, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %81, %79
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = load i32, ptr %17, align 4, !tbaa !9
  %88 = add nsw i32 %87, 2
  %89 = call i32 @balloc(ptr noundef %86, i32 noundef %88)
  %90 = icmp ne i32 0, %89
  br i1 %90, label %91, label %94

91:                                               ; preds = %85
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = call i32 @bdestroy(ptr noundef %92)
  br label %95

94:                                               ; preds = %85
  br label %43

95:                                               ; preds = %91, %74
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96, %40
  %98 = load i32, ptr %7, align 4, !tbaa !9
  %99 = icmp uge i32 %98, 117
  br i1 %99, label %100, label %119

100:                                              ; preds = %97
  %101 = load i32, ptr %7, align 4, !tbaa !9
  %102 = sub i32 %101, 117
  %103 = add i32 %102, 1
  store i32 %103, ptr %14, align 4, !tbaa !9
  %104 = load i32, ptr %14, align 4, !tbaa !9
  %105 = load i32, ptr %7, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds [132 x [256 x i8]], ptr @MAP_ERROR_STRING, i64 0, i64 %106
  %108 = getelementptr inbounds [256 x i8], ptr %107, i64 0, i64 0
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.tagbstring, ptr %109, i32 0, i32 2
  %111 = load ptr, ptr %110, align 8, !tbaa !11
  %112 = call ptr (ptr, ...) @bformat(ptr noundef @.str.5, i32 noundef %104, ptr noundef %108, ptr noundef %111)
  store ptr %112, ptr %10, align 8, !tbaa !5
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = load i32, ptr %113, align 4, !tbaa !9
  %115 = icmp ule i32 %114, 1
  br i1 %115, label %116, label %118

116:                                              ; preds = %100
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 1, ptr %117, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %116, %100
  br label %154

119:                                              ; preds = %97
  %120 = load i32, ptr %7, align 4, !tbaa !9
  %121 = icmp uge i32 %120, 99
  br i1 %121, label %122, label %141

122:                                              ; preds = %119
  %123 = load i32, ptr %7, align 4, !tbaa !9
  %124 = sub i32 %123, 99
  %125 = add i32 %124, 1
  store i32 %125, ptr %14, align 4, !tbaa !9
  %126 = load i32, ptr %14, align 4, !tbaa !9
  %127 = load i32, ptr %7, align 4, !tbaa !9
  %128 = zext i32 %127 to i64
  %129 = getelementptr inbounds [132 x [256 x i8]], ptr @MAP_ERROR_STRING, i64 0, i64 %128
  %130 = getelementptr inbounds [256 x i8], ptr %129, i64 0, i64 0
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.tagbstring, ptr %131, i32 0, i32 2
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = call ptr (ptr, ...) @bformat(ptr noundef @.str.6, i32 noundef %126, ptr noundef %130, ptr noundef %133)
  store ptr %134, ptr %10, align 8, !tbaa !5
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = load i32, ptr %135, align 4, !tbaa !9
  %137 = icmp ule i32 %136, 2
  br i1 %137, label %138, label %140

138:                                              ; preds = %122
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 2, ptr %139, align 4, !tbaa !9
  br label %140

140:                                              ; preds = %138, %122
  br label %153

141:                                              ; preds = %119
  %142 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %142, ptr %14, align 4, !tbaa !9
  %143 = load i32, ptr %14, align 4, !tbaa !9
  %144 = load i32, ptr %7, align 4, !tbaa !9
  %145 = zext i32 %144 to i64
  %146 = getelementptr inbounds [132 x [256 x i8]], ptr @MAP_ERROR_STRING, i64 0, i64 %145
  %147 = getelementptr inbounds [256 x i8], ptr %146, i64 0, i64 0
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.tagbstring, ptr %148, i32 0, i32 2
  %150 = load ptr, ptr %149, align 8, !tbaa !11
  %151 = call ptr (ptr, ...) @bformat(ptr noundef @.str.7, i32 noundef %143, ptr noundef %147, ptr noundef %150)
  store ptr %151, ptr %10, align 8, !tbaa !5
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 3, ptr %152, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %141, %140
  br label %154

154:                                              ; preds = %153, %118
  %155 = load ptr, ptr %12, align 8, !tbaa !5
  %156 = load ptr, ptr %10, align 8, !tbaa !5
  %157 = call i32 @bconcat(ptr noundef %155, ptr noundef %156)
  store i32 %157, ptr %15, align 4, !tbaa !9
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  %159 = call i32 @btrunc(ptr noundef %158, i32 noundef 1023)
  store i32 %159, ptr %15, align 4, !tbaa !9
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = load ptr, ptr %12, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.tagbstring, ptr %161, i32 0, i32 2
  %163 = load ptr, ptr %162, align 8, !tbaa !11
  call void @copy_target_string(ptr noundef %160, ptr noundef %163)
  %164 = load ptr, ptr %10, align 8, !tbaa !5
  %165 = call i32 @bdestroy(ptr noundef %164)
  store i32 %165, ptr %15, align 4, !tbaa !9
  %166 = load ptr, ptr %12, align 8, !tbaa !5
  %167 = call i32 @bdestroy(ptr noundef %166)
  store i32 %167, ptr %15, align 4, !tbaa !9
  %168 = load ptr, ptr %11, align 8, !tbaa !5
  %169 = call i32 @bdestroy(ptr noundef %168)
  store i32 %169, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  ret void
}

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

declare ptr @bfromcstralloc(i32 noundef, ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #4

; Function Attrs: nounwind
declare i32 @vsnprintf(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #4

declare i32 @balloc(ptr noundef, i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"tagbstring", !10, i64 0, !10, i64 4, !6, i64 8}
!13 = !{!7, !7, i64 0}
!14 = !{!12, !10, i64 4}


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

@MAP_ERROR_STRING = external dso_local constant [132 x [256 x i8]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 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

declare ptr @bformat(ptr noundef, ...) local_unnamed_addr #1

declare i32 @bconcat(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @btrunc(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @copy_target_string(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @bdestroy(ptr noundef) 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: nounwind uwtable
define dso_local void @set_universal_error_with_message(ptr noundef %0, ptr nocapture noundef %1, i32 noundef %2, ptr nocapture noundef readonly %3, ...) local_unnamed_addr #2 {
  %5 = alloca [1 x %struct.__va_list_tag], align 16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  %6 = tail call ptr (ptr, ...) @bformat(ptr noundef nonnull @.str, ptr noundef %0) #7
  %7 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #8
  %.tr = trunc i64 %7 to i32
  %8 = shl i32 %.tr, 1
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %8, i32 16)
  %9 = add nuw nsw i32 %spec.store.select, 2
  %10 = tail call ptr @bfromcstralloc(i32 noundef %9, ptr noundef nonnull @.str.4) #7
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %11, label %13

11:                                               ; preds = %4
  %12 = tail call ptr @bfromcstralloc(i32 noundef 3, ptr noundef nonnull @.str.4) #7
  %.not58 = icmp eq ptr %12, null
  br i1 %.not58, label %.loopexit, label %13

13:                                               ; preds = %11, %4
  %.051 = phi ptr [ %10, %4 ], [ %12, %11 ]
  %.0 = phi i32 [ %spec.store.select, %4 ], [ 1, %11 ]
  %14 = getelementptr inbounds i8, ptr %.051, i64 8
  %15 = getelementptr inbounds i8, ptr %.051, i64 4
  br label %16

16:                                               ; preds = %28, %13
  %.1 = phi i32 [ %.0, %13 ], [ %.2, %28 ]
  call void @llvm.va_start.p0(ptr nonnull %5)
  %17 = load ptr, ptr %14, align 8, !tbaa !5
  %18 = add nsw i32 %.1, 1
  %19 = sext i32 %18 to i64
  %20 = call i32 @vsnprintf(ptr noundef %17, i64 noundef %19, ptr noundef %3, ptr noundef nonnull %5) #7
  call void @llvm.va_end.p0(ptr nonnull %5)
  %21 = load ptr, ptr %14, align 8, !tbaa !5
  %22 = sext i32 %.1 to i64
  %23 = getelementptr inbounds i8, ptr %21, i64 %22
  store i8 0, ptr %23, align 1, !tbaa !11
  %24 = load ptr, ptr %14, align 8, !tbaa !5
  %25 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %24) #8
  %26 = trunc i64 %25 to i32
  store i32 %26, ptr %15, align 4, !tbaa !12
  %27 = icmp sgt i32 %.1, %26
  br i1 %27, label %.loopexit, label %28

28:                                               ; preds = %16
  %29 = icmp sgt i32 %20, %.1
  %30 = shl nsw i32 %.1, 1
  %.2 = select i1 %29, i32 %20, i32 %30
  %31 = add nsw i32 %.2, 2
  %32 = call i32 @balloc(ptr noundef nonnull %.051, i32 noundef %31) #7
  %.not59 = icmp eq i32 %32, 0
  br i1 %.not59, label %16, label %33

33:                                               ; preds = %28
  %34 = call i32 @bdestroy(ptr noundef nonnull %.051) #7
  br label %.loopexit

.loopexit:                                        ; preds = %16, %11, %33
  %.152 = phi ptr [ %.051, %33 ], [ null, %11 ], [ %.051, %16 ]
  %35 = icmp ugt i32 %2, 116
  br i1 %35, label %36, label %45

36:                                               ; preds = %.loopexit
  %37 = add i32 %2, -116
  %38 = zext i32 %2 to i64
  %39 = getelementptr inbounds [132 x [256 x i8]], ptr @MAP_ERROR_STRING, i64 0, i64 %38
  %40 = getelementptr inbounds i8, ptr %.152, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = call ptr (ptr, ...) @bformat(ptr noundef nonnull @.str.5, i32 noundef %37, ptr noundef nonnull %39, ptr noundef %41) #7
  %43 = load i32, ptr %1, align 4, !tbaa !13
  %44 = icmp ult i32 %43, 2
  br i1 %44, label %.sink.split, label %62

45:                                               ; preds = %.loopexit
  %46 = icmp ugt i32 %2, 98
  br i1 %46, label %47, label %56

47:                                               ; preds = %45
  %48 = add nsw i32 %2, -98
  %49 = zext nneg i32 %2 to i64
  %50 = getelementptr inbounds [132 x [256 x i8]], ptr @MAP_ERROR_STRING, i64 0, i64 %49
  %51 = getelementptr inbounds i8, ptr %.152, i64 8
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = call ptr (ptr, ...) @bformat(ptr noundef nonnull @.str.6, i32 noundef %48, ptr noundef nonnull %50, ptr noundef %52) #7
  %54 = load i32, ptr %1, align 4, !tbaa !13
  %55 = icmp ult i32 %54, 3
  br i1 %55, label %.sink.split, label %62

56:                                               ; preds = %45
  %57 = zext nneg i32 %2 to i64
  %58 = getelementptr inbounds [132 x [256 x i8]], ptr @MAP_ERROR_STRING, i64 0, i64 %57
  %59 = getelementptr inbounds i8, ptr %.152, i64 8
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = call ptr (ptr, ...) @bformat(ptr noundef nonnull @.str.7, i32 noundef %2, ptr noundef nonnull %58, ptr noundef %60) #7
  br label %.sink.split

.sink.split:                                      ; preds = %47, %36, %56
  %.sink = phi i32 [ 3, %56 ], [ 1, %36 ], [ 2, %47 ]
  %.050.ph = phi ptr [ %61, %56 ], [ %42, %36 ], [ %53, %47 ]
  store i32 %.sink, ptr %1, align 4, !tbaa !13
  br label %62

62:                                               ; preds = %.sink.split, %47, %36
  %.050 = phi ptr [ %42, %36 ], [ %53, %47 ], [ %.050.ph, %.sink.split ]
  %63 = call i32 @bconcat(ptr noundef %6, ptr noundef %.050) #7
  %64 = call i32 @btrunc(ptr noundef %6, i32 noundef 1023) #7
  %65 = getelementptr inbounds i8, ptr %6, i64 8
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  call void @copy_target_string(ptr noundef %0, ptr noundef %66) #7
  %67 = call i32 @bdestroy(ptr noundef %.050) #7
  %68 = call i32 @bdestroy(ptr noundef %6) #7
  %69 = call i32 @bdestroy(ptr noundef nonnull %.152) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  ret void
}

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

declare ptr @bfromcstralloc(i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #4

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #4

declare i32 @balloc(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #3 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { 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, !10, i64 8}
!6 = !{!"tagbstring", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!8, !8, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!7, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass