; LLVM IR from marcinbor85/microshell :: src/src (ush)

; 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.ush_object = type { ptr, i32, i32, i32, ptr, i64, i64, i32, i64, i64, i64, i8, ptr, ptr, ptr, %struct.ush_node_object, ptr, ptr, ptr, i64, i64, ptr, i64, i32, i32, ptr, ptr, ptr, i64, i64, i64 }
%struct.ush_node_object = type { ptr, i64, ptr, ptr, ptr, ptr }
%struct.ush_descriptor = type { ptr, ptr, i64, ptr, i64, i64, ptr, ptr }

@__const.ush_printf.error_format = external hidden unnamed_addr constant [18 x i8], align 16
@__const.ush_printf.error_overflow = external hidden unnamed_addr constant [20 x i8], align 16
@.str = external hidden unnamed_addr constant [3 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare void @ush_write_pointer(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @ush_printf(ptr noundef %0, ptr noundef %1, ...) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [1 x %struct.__va_list_tag], align 16
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca [18 x i8], align 16
  %13 = alloca [20 x i8], align 16
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.ush_object, ptr %16, i32 0, i32 4
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.ush_object, ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !15
  %22 = getelementptr inbounds %struct.ush_descriptor, ptr %21, i32 0, i32 3
  %23 = load ptr, ptr %22, align 8, !tbaa !16
  %24 = icmp ne ptr %18, %23
  br i1 %24, label %25, label %38

25:                                               ; preds = %2
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.ush_object, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !15
  %29 = getelementptr inbounds %struct.ush_descriptor, ptr %28, i32 0, i32 3
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  %31 = getelementptr inbounds i8, ptr %30, i64 0
  store i8 0, ptr %31, align 1, !tbaa !18
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ush_object, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = getelementptr inbounds %struct.ush_descriptor, ptr %35, i32 0, i32 3
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  call void @ush_write_pointer(ptr noundef %32, ptr noundef %37, i32 noundef 1)
  br label %43

38:                                               ; preds = %2
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ush_object, ptr %39, i32 0, i32 1
  store i32 13, ptr %40, align 8, !tbaa !19
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.ush_object, ptr %41, i32 0, i32 2
  store i32 1, ptr %42, align 4, !tbaa !20
  br label %43

43:                                               ; preds = %38, %25
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #7
  %44 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %5, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %44)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ush_object, ptr %45, i32 0, i32 4
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = call i64 @strlen(ptr noundef %47) #8
  store i64 %48, ptr %6, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ush_object, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !15
  %52 = getelementptr inbounds %struct.ush_descriptor, ptr %51, i32 0, i32 4
  %53 = load i64, ptr %52, align 8, !tbaa !22
  %54 = load i64, ptr %6, align 8, !tbaa !21
  %55 = sub i64 %53, %54
  store i64 %55, ptr %7, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.ush_object, ptr %56, i32 0, i32 4
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = load i64, ptr %6, align 8, !tbaa !21
  %60 = getelementptr inbounds i8, ptr %58, i64 %59
  %61 = load i64, ptr %7, align 8, !tbaa !21
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %5, i64 0, i64 0
  %64 = call i32 @vsnprintf(ptr noundef %60, i64 noundef %61, ptr noundef %62, ptr noundef %63) #7
  store i32 %64, ptr %8, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ush_object, ptr %65, i32 0, i32 4
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = load i64, ptr %6, align 8, !tbaa !21
  %69 = getelementptr inbounds i8, ptr %67, i64 %68
  %70 = call i64 @strlen(ptr noundef %69) #8
  %71 = trunc i64 %70 to i32
  store i32 %71, ptr %9, align 4, !tbaa !23
  %72 = load i32, ptr %9, align 4, !tbaa !23
  %73 = sext i32 %72 to i64
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.ush_object, ptr %74, i32 0, i32 5
  %76 = load i64, ptr %75, align 8, !tbaa !24
  %77 = add i64 %76, %73
  store i64 %77, ptr %75, align 8, !tbaa !24
  %78 = load i32, ptr %8, align 4, !tbaa !23
  %79 = icmp slt i32 %78, 0
  br i1 %79, label %84, label %80

80:                                               ; preds = %43
  %81 = load i32, ptr %8, align 4, !tbaa !23
  %82 = load i32, ptr %9, align 4, !tbaa !23
  %83 = icmp sgt i32 %81, %82
  br i1 %83, label %84, label %155

84:                                               ; preds = %80, %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 18, ptr %12) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 16 @__const.ush_printf.error_format, i64 18, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr %13) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 @__const.ush_printf.error_overflow, i64 20, i1 false)
  %85 = load i32, ptr %8, align 4, !tbaa !23
  %86 = icmp slt i32 %85, 0
  br i1 %86, label %87, label %89

87:                                               ; preds = %84
  %88 = getelementptr inbounds [18 x i8], ptr %12, i64 0, i64 0
  store ptr %88, ptr %11, align 8, !tbaa !5
  store i32 18, ptr %10, align 4, !tbaa !23
  br label %91

89:                                               ; preds = %84
  %90 = getelementptr inbounds [20 x i8], ptr %13, i64 0, i64 0
  store ptr %90, ptr %11, align 8, !tbaa !5
  store i32 20, ptr %10, align 4, !tbaa !23
  br label %91

91:                                               ; preds = %89, %87
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.ush_object, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !15
  %95 = getelementptr inbounds %struct.ush_descriptor, ptr %94, i32 0, i32 4
  %96 = load i64, ptr %95, align 8, !tbaa !22
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.ush_object, ptr %97, i32 0, i32 4
  %99 = load ptr, ptr %98, align 8, !tbaa !9
  %100 = call i64 @strlen(ptr noundef %99) #8
  %101 = sub i64 %96, %100
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  %103 = call i64 @strlen(ptr noundef %102) #8
  %104 = icmp uge i64 %101, %103
  br i1 %104, label %105, label %129

105:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ush_object, ptr %106, i32 0, i32 4
  %108 = load ptr, ptr %107, align 8, !tbaa !9
  %109 = call i64 @strlen(ptr noundef %108) #8
  store i64 %109, ptr %14, align 8, !tbaa !21
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ush_object, ptr %110, i32 0, i32 4
  %112 = load ptr, ptr %111, align 8, !tbaa !9
  %113 = load i64, ptr %14, align 8, !tbaa !21
  %114 = getelementptr inbounds i8, ptr %112, i64 %113
  %115 = load i32, ptr %10, align 4, !tbaa !23
  %116 = sext i32 %115 to i64
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %114, i64 noundef %116, ptr noundef @.str, ptr noundef %117) #7
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.ush_object, ptr %119, i32 0, i32 4
  %121 = load ptr, ptr %120, align 8, !tbaa !9
  %122 = load i64, ptr %14, align 8, !tbaa !21
  %123 = getelementptr inbounds i8, ptr %121, i64 %122
  %124 = call i64 @strlen(ptr noundef %123) #8
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.ush_object, ptr %125, i32 0, i32 5
  %127 = load i64, ptr %126, align 8, !tbaa !24
  %128 = add i64 %127, %124
  store i64 %128, ptr %126, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %154

129:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.ush_object, ptr %130, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8, !tbaa !15
  %133 = getelementptr inbounds %struct.ush_descriptor, ptr %132, i32 0, i32 4
  %134 = load i64, ptr %133, align 8, !tbaa !22
  %135 = load i32, ptr %10, align 4, !tbaa !23
  %136 = sext i32 %135 to i64
  %137 = sub i64 %134, %136
  store i64 %137, ptr %15, align 8, !tbaa !21
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.ush_object, ptr %138, i32 0, i32 4
  %140 = load ptr, ptr %139, align 8, !tbaa !9
  %141 = load i64, ptr %15, align 8, !tbaa !21
  %142 = getelementptr inbounds i8, ptr %140, i64 %141
  %143 = load i32, ptr %10, align 4, !tbaa !23
  %144 = sext i32 %143 to i64
  %145 = load ptr, ptr %11, align 8, !tbaa !5
  %146 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %142, i64 noundef %144, ptr noundef @.str, ptr noundef %145) #7
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ush_object, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !15
  %150 = getelementptr inbounds %struct.ush_descriptor, ptr %149, i32 0, i32 4
  %151 = load i64, ptr %150, align 8, !tbaa !22
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.ush_object, ptr %152, i32 0, i32 5
  store i64 %151, ptr %153, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %154

154:                                              ; preds = %129, %105
  call void @llvm.lifetime.end.p0(i64 20, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 18, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %155

155:                                              ; preds = %154, %80
  %156 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %5, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %156)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  ret void
}

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

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

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

; 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) #6

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

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

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 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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: readwrite) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"ush_object", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24, !12, i64 32, !12, i64 40, !11, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !13, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !14, i64 112, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !12, i64 192, !6, i64 200, !12, i64 208, !11, i64 216, !11, i64 220, !6, i64 224, !6, i64 232, !6, i64 240, !12, i64 248, !12, i64 256, !12, i64 264}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!"ush_node_object", !6, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!15 = !{!10, !6, i64 0}
!16 = !{!17, !6, i64 24}
!17 = !{!"ush_descriptor", !6, i64 0, !6, i64 8, !12, i64 16, !6, i64 24, !12, i64 32, !12, i64 40, !6, i64 48, !6, i64 56}
!18 = !{!7, !7, i64 0}
!19 = !{!10, !11, i64 8}
!20 = !{!10, !11, i64 12}
!21 = !{!12, !12, i64 0}
!22 = !{!17, !12, i64 32}
!23 = !{!11, !11, i64 0}
!24 = !{!10, !12, i64 32}


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

@__const.ush_printf.error_format = external hidden unnamed_addr constant [18 x i8], align 16
@__const.ush_printf.error_overflow = external hidden unnamed_addr constant [20 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1

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

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

declare void @ush_write_pointer(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @ush_printf(ptr noundef %0, ptr nocapture noundef readonly %1, ...) local_unnamed_addr #2 {
  %3 = alloca [1 x %struct.__va_list_tag], align 16
  %4 = alloca [18 x i8], align 16
  %5 = alloca [20 x i8], align 16
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr %0, align 8, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %8, i64 24
  %10 = load ptr, ptr %9, align 8, !tbaa !15
  %.not = icmp eq ptr %7, %10
  br i1 %.not, label %15, label %11

11:                                               ; preds = %2
  store i8 0, ptr %10, align 1, !tbaa !17
  %12 = load ptr, ptr %0, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %12, i64 24
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  tail call void @ush_write_pointer(ptr noundef nonnull %0, ptr noundef %14, i32 noundef 1) #7
  br label %18

15:                                               ; preds = %2
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 13, ptr %16, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 1, ptr %17, align 4, !tbaa !19
  br label %18

18:                                               ; preds = %15, %11
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @llvm.va_start.p0(ptr nonnull %3)
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %19) #8
  %21 = load ptr, ptr %0, align 8, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %21, i64 32
  %23 = load i64, ptr %22, align 8, !tbaa !20
  %24 = sub i64 %23, %20
  %25 = getelementptr inbounds i8, ptr %19, i64 %20
  %26 = call i32 @vsnprintf(ptr noundef %25, i64 noundef %24, ptr noundef %1, ptr noundef nonnull %3) #7
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 %20
  %29 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %28) #8
  %sext = shl i64 %29, 32
  %30 = ashr exact i64 %sext, 32
  %31 = getelementptr inbounds i8, ptr %0, i64 32
  %32 = load i64, ptr %31, align 8, !tbaa !21
  %33 = add i64 %30, %32
  store i64 %33, ptr %31, align 8, !tbaa !21
  %34 = icmp slt i32 %26, 0
  %35 = trunc i64 %29 to i32
  %36 = icmp sgt i32 %26, %35
  %or.cond = select i1 %34, i1 true, i1 %36
  br i1 %or.cond, label %37, label %60

37:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 18, ptr nonnull %4) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(18) %4, ptr noundef nonnull align 16 dereferenceable(18) @__const.ush_printf.error_format, i64 18, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %5) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %5, ptr noundef nonnull align 16 dereferenceable(20) @__const.ush_printf.error_overflow, i64 20, i1 false)
  %. = select i1 %34, ptr %4, ptr %5
  %.45 = select i1 %34, i64 18, i64 20
  %38 = load ptr, ptr %0, align 8, !tbaa !14
  %39 = getelementptr inbounds i8, ptr %38, i64 32
  %40 = load i64, ptr %39, align 8, !tbaa !20
  %41 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %27) #8
  %42 = sub i64 %40, %41
  %43 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.) #8
  %.not43 = icmp ult i64 %42, %43
  br i1 %.not43, label %52, label %44

44:                                               ; preds = %37
  %45 = getelementptr inbounds i8, ptr %27, i64 %41
  %46 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %45, i64 noundef %.45, ptr noundef nonnull @.str, ptr noundef nonnull %.) #7
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i64 %41
  %49 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %48) #8
  %50 = load i64, ptr %31, align 8, !tbaa !21
  %51 = add i64 %50, %49
  br label %59

52:                                               ; preds = %37
  %53 = sub i64 %40, %.45
  %54 = getelementptr inbounds i8, ptr %27, i64 %53
  %55 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %54, i64 noundef %.45, ptr noundef nonnull @.str, ptr noundef nonnull %.) #7
  %56 = load ptr, ptr %0, align 8, !tbaa !14
  %57 = getelementptr inbounds i8, ptr %56, i64 32
  %58 = load i64, ptr %57, align 8, !tbaa !20
  br label %59

59:                                               ; preds = %52, %44
  %storemerge = phi i64 [ %58, %52 ], [ %51, %44 ]
  store i64 %storemerge, ptr %31, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 18, ptr nonnull %4) #7
  br label %60

60:                                               ; preds = %18, %59
  call void @llvm.va_end.p0(ptr nonnull %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  ret void
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

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

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 nocallback nofree nosync nounwind willreturn }
attributes #4 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !7, i64 24}
!6 = !{!"ush_object", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !7, i64 24, !11, i64 32, !11, i64 40, !10, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !12, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !13, i64 112, !7, i64 160, !7, i64 168, !7, i64 176, !11, i64 184, !11, i64 192, !7, i64 200, !11, i64 208, !10, i64 216, !10, i64 220, !7, i64 224, !7, i64 232, !7, i64 240, !11, i64 248, !11, i64 256, !11, i64 264}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"_Bool", !8, i64 0}
!13 = !{!"ush_node_object", !7, i64 0, !11, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!14 = !{!6, !7, i64 0}
!15 = !{!16, !7, i64 24}
!16 = !{!"ush_descriptor", !7, i64 0, !7, i64 8, !11, i64 16, !7, i64 24, !11, i64 32, !11, i64 40, !7, i64 48, !7, i64 56}
!17 = !{!8, !8, i64 0}
!18 = !{!6, !10, i64 8}
!19 = !{!6, !10, i64 12}
!20 = !{!16, !11, i64 32}
!21 = !{!6, !11, i64 32}


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