; LLVM IR from clangen/musikcube :: src/3rdparty/win32_src/pdcurses (scr_dump)

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

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [94 x i8], align 1
@__PRETTY_FUNCTION__.putwin = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@_format_nine_ints = external hidden global ptr, align 8
@_format_three_ints = external hidden global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @putwin(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [16 x i8], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = icmp ne ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %2
  br label %14

13:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 124, ptr noundef @__PRETTY_FUNCTION__.putwin) #6
  unreachable

14:                                               ; preds = %12
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %22

17:                                               ; preds = %14
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call ptr @curses_version()
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef @.str.2, ptr noundef %19) #5
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %23, label %22

22:                                               ; preds = %17, %14
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %179

23:                                               ; preds = %17
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr @_format_nine_ints, align 8, !tbaa !5
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._win, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !9
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._win, ptr %29, i32 0, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !14
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._win, ptr %32, i32 0, i32 2
  %34 = load i32, ptr %33, align 8, !tbaa !15
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._win, ptr %35, i32 0, i32 3
  %37 = load i32, ptr %36, align 4, !tbaa !16
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._win, ptr %38, i32 0, i32 4
  %40 = load i32, ptr %39, align 8, !tbaa !17
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._win, ptr %41, i32 0, i32 5
  %43 = load i32, ptr %42, align 4, !tbaa !18
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._win, ptr %44, i32 0, i32 6
  %46 = load i32, ptr %45, align 8, !tbaa !19
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef %25, i32 noundef 2, i32 noundef 136, i32 noundef %28, i32 noundef %31, i32 noundef %34, i32 noundef %37, i32 noundef %40, i32 noundef %43, i32 noundef %46) #5
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %50, label %49

49:                                               ; preds = %23
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %179

50:                                               ; preds = %23
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load ptr, ptr @_format_nine_ints, align 8, !tbaa !5
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._win, ptr %53, i32 0, i32 9
  %55 = load i8, ptr %54, align 8, !tbaa !20, !range !21, !noundef !22
  %56 = trunc i8 %55 to i1
  %57 = zext i1 %56 to i32
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._win, ptr %58, i32 0, i32 10
  %60 = load i8, ptr %59, align 1, !tbaa !23, !range !21, !noundef !22
  %61 = trunc i8 %60 to i1
  %62 = zext i1 %61 to i32
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._win, ptr %63, i32 0, i32 11
  %65 = load i8, ptr %64, align 2, !tbaa !24, !range !21, !noundef !22
  %66 = trunc i8 %65 to i1
  %67 = zext i1 %66 to i32
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._win, ptr %68, i32 0, i32 12
  %70 = load i8, ptr %69, align 1, !tbaa !25, !range !21, !noundef !22
  %71 = trunc i8 %70 to i1
  %72 = zext i1 %71 to i32
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._win, ptr %73, i32 0, i32 13
  %75 = load i8, ptr %74, align 4, !tbaa !26, !range !21, !noundef !22
  %76 = trunc i8 %75 to i1
  %77 = zext i1 %76 to i32
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._win, ptr %78, i32 0, i32 14
  %80 = load i8, ptr %79, align 1, !tbaa !27, !range !21, !noundef !22
  %81 = trunc i8 %80 to i1
  %82 = zext i1 %81 to i32
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._win, ptr %83, i32 0, i32 15
  %85 = load i8, ptr %84, align 2, !tbaa !28, !range !21, !noundef !22
  %86 = trunc i8 %85 to i1
  %87 = zext i1 %86 to i32
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._win, ptr %88, i32 0, i32 19
  %90 = load i32, ptr %89, align 8, !tbaa !29
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._win, ptr %91, i32 0, i32 20
  %93 = load i32, ptr %92, align 4, !tbaa !30
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef %52, i32 noundef %57, i32 noundef %62, i32 noundef %67, i32 noundef %72, i32 noundef %77, i32 noundef %82, i32 noundef %87, i32 noundef %90, i32 noundef %93) #5
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %97, label %96

96:                                               ; preds = %50
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %179

97:                                               ; preds = %50
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = load ptr, ptr @_format_three_ints, align 8, !tbaa !5
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._win, ptr %100, i32 0, i32 21
  %102 = load i32, ptr %101, align 8, !tbaa !31
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._win, ptr %103, i32 0, i32 22
  %105 = load i32, ptr %104, align 4, !tbaa !32
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._win, ptr %106, i32 0, i32 23
  %108 = load i32, ptr %107, align 8, !tbaa !33
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef %99, i32 noundef %102, i32 noundef %105, i32 noundef %108) #5
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %112, label %111

111:                                              ; preds = %97
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %179

112:                                              ; preds = %97
  %113 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._win, ptr %114, i32 0, i32 7
  %116 = load i64, ptr %115, align 8, !tbaa !34
  call void @_stuff_chtype_into_eight_bytes(ptr noundef %113, i64 noundef %116)
  %117 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  %118 = getelementptr inbounds i8, ptr %117, i64 8
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._win, ptr %119, i32 0, i32 8
  %121 = load i64, ptr %120, align 8, !tbaa !35
  call void @_stuff_chtype_into_eight_bytes(ptr noundef %118, i64 noundef %121)
  %122 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = call i64 @fwrite(ptr noundef %122, i64 noundef 16, i64 noundef 1, ptr noundef %123)
  %125 = icmp ne i64 %124, 0
  br i1 %125, label %127, label %126

126:                                              ; preds = %112
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %179

127:                                              ; preds = %112
  store i32 0, ptr %7, align 4, !tbaa !36
  br label %128

128:                                              ; preds = %175, %127
  %129 = load i32, ptr %7, align 4, !tbaa !36
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct._win, ptr %130, i32 0, i32 2
  %132 = load i32, ptr %131, align 8, !tbaa !15
  %133 = icmp slt i32 %129, %132
  br i1 %133, label %134, label %143

134:                                              ; preds = %128
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._win, ptr %135, i32 0, i32 16
  %137 = load ptr, ptr %136, align 8, !tbaa !37
  %138 = load i32, ptr %7, align 4, !tbaa !36
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds ptr, ptr %137, i64 %139
  %141 = load ptr, ptr %140, align 8, !tbaa !5
  %142 = icmp ne ptr %141, null
  br label %143

143:                                              ; preds = %134, %128
  %144 = phi i1 [ false, %128 ], [ %142, %134 ]
  br i1 %144, label %145, label %178

145:                                              ; preds = %143
  store i32 0, ptr %8, align 4, !tbaa !36
  br label %146

146:                                              ; preds = %171, %145
  %147 = load i32, ptr %8, align 4, !tbaa !36
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct._win, ptr %148, i32 0, i32 3
  %150 = load i32, ptr %149, align 4, !tbaa !16
  %151 = icmp slt i32 %147, %150
  br i1 %151, label %152, label %174

152:                                              ; preds = %146
  %153 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct._win, ptr %154, i32 0, i32 16
  %156 = load ptr, ptr %155, align 8, !tbaa !37
  %157 = load i32, ptr %7, align 4, !tbaa !36
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds ptr, ptr %156, i64 %158
  %160 = load ptr, ptr %159, align 8, !tbaa !5
  %161 = load i32, ptr %8, align 4, !tbaa !36
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i64, ptr %160, i64 %162
  %164 = load i64, ptr %163, align 8, !tbaa !38
  call void @_stuff_chtype_into_eight_bytes(ptr noundef %153, i64 noundef %164)
  %165 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = call i64 @fwrite(ptr noundef %165, i64 noundef 8, i64 noundef 1, ptr noundef %166)
  %168 = icmp ne i64 %167, 0
  br i1 %168, label %170, label %169

169:                                              ; preds = %152
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %179

170:                                              ; preds = %152
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %8, align 4, !tbaa !36
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %8, align 4, !tbaa !36
  br label %146, !llvm.loop !39

174:                                              ; preds = %146
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %7, align 4, !tbaa !36
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %7, align 4, !tbaa !36
  br label %128, !llvm.loop !41

178:                                              ; preds = %143
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %179

179:                                              ; preds = %178, %169, %126, %111, %96, %49, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  %180 = load i32, ptr %3, align 4
  ret i32 %180
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare ptr @curses_version() #4

; Function Attrs: nounwind uwtable
declare hidden void @_stuff_chtype_into_eight_bytes(ptr noundef, i64 noundef) #0

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn 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 "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 = { "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 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_win", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !12, i64 32, !12, i64 40, !13, i64 48, !13, i64 49, !13, i64 50, !13, i64 51, !13, i64 52, !13, i64 53, !13, i64 54, !6, i64 56, !6, i64 64, !6, i64 72, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!10, !11, i64 4}
!15 = !{!10, !11, i64 8}
!16 = !{!10, !11, i64 12}
!17 = !{!10, !11, i64 16}
!18 = !{!10, !11, i64 20}
!19 = !{!10, !11, i64 24}
!20 = !{!10, !13, i64 48}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!10, !13, i64 49}
!24 = !{!10, !13, i64 50}
!25 = !{!10, !13, i64 51}
!26 = !{!10, !13, i64 52}
!27 = !{!10, !13, i64 53}
!28 = !{!10, !13, i64 54}
!29 = !{!10, !11, i64 80}
!30 = !{!10, !11, i64 84}
!31 = !{!10, !11, i64 88}
!32 = !{!10, !11, i64 92}
!33 = !{!10, !11, i64 96}
!34 = !{!10, !12, i64 32}
!35 = !{!10, !12, i64 40}
!36 = !{!11, !11, i64 0}
!37 = !{!10, !6, i64 56}
!38 = !{!12, !12, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = distinct !{!41, !40}


; 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 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [94 x i8], align 1
@__PRETTY_FUNCTION__.putwin = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@_format_nine_ints = external hidden local_unnamed_addr global ptr, align 8
@_format_three_ints = external hidden local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @putwin(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 124, ptr noundef nonnull @__PRETTY_FUNCTION__.putwin) #6
  unreachable

5:                                                ; preds = %2
  %6 = tail call ptr @curses_version() #5
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %1, ptr noundef nonnull @.str.2, ptr noundef %6) #5
  %.not43 = icmp eq i32 %7, 0
  br i1 %.not43, label %.critedge, label %8

8:                                                ; preds = %5
  %9 = load ptr, ptr @_format_nine_ints, align 8, !tbaa !5
  %10 = load i32, ptr %0, align 8, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %0, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load i32, ptr %13, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %0, i64 12
  %16 = load i32, ptr %15, align 4, !tbaa !16
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = load i32, ptr %17, align 8, !tbaa !17
  %19 = getelementptr inbounds i8, ptr %0, i64 20
  %20 = load i32, ptr %19, align 4, !tbaa !18
  %21 = getelementptr inbounds i8, ptr %0, i64 24
  %22 = load i32, ptr %21, align 8, !tbaa !19
  %23 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %1, ptr noundef %9, i32 noundef 2, i32 noundef 136, i32 noundef %10, i32 noundef %12, i32 noundef %14, i32 noundef %16, i32 noundef %18, i32 noundef %20, i32 noundef %22) #5
  %.not44 = icmp eq i32 %23, 0
  br i1 %.not44, label %.critedge, label %24

24:                                               ; preds = %8
  %25 = load ptr, ptr @_format_nine_ints, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %0, i64 48
  %27 = load i8, ptr %26, align 8, !tbaa !20, !range !21, !noundef !22
  %28 = zext nneg i8 %27 to i32
  %29 = getelementptr inbounds i8, ptr %0, i64 49
  %30 = load i8, ptr %29, align 1, !tbaa !23, !range !21, !noundef !22
  %31 = zext nneg i8 %30 to i32
  %32 = getelementptr inbounds i8, ptr %0, i64 50
  %33 = load i8, ptr %32, align 2, !tbaa !24, !range !21, !noundef !22
  %34 = zext nneg i8 %33 to i32
  %35 = getelementptr inbounds i8, ptr %0, i64 51
  %36 = load i8, ptr %35, align 1, !tbaa !25, !range !21, !noundef !22
  %37 = zext nneg i8 %36 to i32
  %38 = getelementptr inbounds i8, ptr %0, i64 52
  %39 = load i8, ptr %38, align 4, !tbaa !26, !range !21, !noundef !22
  %40 = zext nneg i8 %39 to i32
  %41 = getelementptr inbounds i8, ptr %0, i64 53
  %42 = load i8, ptr %41, align 1, !tbaa !27, !range !21, !noundef !22
  %43 = zext nneg i8 %42 to i32
  %44 = getelementptr inbounds i8, ptr %0, i64 54
  %45 = load i8, ptr %44, align 2, !tbaa !28, !range !21, !noundef !22
  %46 = zext nneg i8 %45 to i32
  %47 = getelementptr inbounds i8, ptr %0, i64 80
  %48 = load i32, ptr %47, align 8, !tbaa !29
  %49 = getelementptr inbounds i8, ptr %0, i64 84
  %50 = load i32, ptr %49, align 4, !tbaa !30
  %51 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %1, ptr noundef %25, i32 noundef %28, i32 noundef %31, i32 noundef %34, i32 noundef %37, i32 noundef %40, i32 noundef %43, i32 noundef %46, i32 noundef %48, i32 noundef %50) #5
  %.not45 = icmp eq i32 %51, 0
  br i1 %.not45, label %.critedge, label %52

52:                                               ; preds = %24
  %53 = load ptr, ptr @_format_three_ints, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %0, i64 88
  %55 = load i32, ptr %54, align 8, !tbaa !31
  %56 = getelementptr inbounds i8, ptr %0, i64 92
  %57 = load i32, ptr %56, align 4, !tbaa !32
  %58 = getelementptr inbounds i8, ptr %0, i64 96
  %59 = load i32, ptr %58, align 8, !tbaa !33
  %60 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %1, ptr noundef %53, i32 noundef %55, i32 noundef %57, i32 noundef %59) #5
  %.not46 = icmp eq i32 %60, 0
  br i1 %.not46, label %.critedge, label %61

61:                                               ; preds = %52
  %62 = getelementptr inbounds i8, ptr %0, i64 32
  %63 = load i64, ptr %62, align 8, !tbaa !34
  call void @_stuff_chtype_into_eight_bytes(ptr noundef nonnull %3, i64 noundef %63)
  %64 = getelementptr inbounds i8, ptr %3, i64 8
  %65 = getelementptr inbounds i8, ptr %0, i64 40
  %66 = load i64, ptr %65, align 8, !tbaa !35
  call void @_stuff_chtype_into_eight_bytes(ptr noundef nonnull %64, i64 noundef %66)
  %67 = call i64 @fwrite(ptr noundef nonnull %3, i64 noundef 16, i64 noundef 1, ptr noundef nonnull %1)
  %.not47 = icmp eq i64 %67, 0
  br i1 %.not47, label %.critedge, label %.preheader50

.preheader50:                                     ; preds = %61
  %68 = load i32, ptr %13, align 8, !tbaa !15
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %.lr.ph54, label %.critedge

.lr.ph54:                                         ; preds = %.preheader50
  %70 = getelementptr inbounds i8, ptr %0, i64 56
  br label %71

71:                                               ; preds = %.lr.ph54, %._crit_edge
  %72 = phi i32 [ %68, %.lr.ph54 ], [ %88, %._crit_edge ]
  %indvars.iv58 = phi i64 [ 0, %.lr.ph54 ], [ %indvars.iv.next59, %._crit_edge ]
  %73 = load ptr, ptr %70, align 8, !tbaa !36
  %74 = getelementptr inbounds ptr, ptr %73, i64 %indvars.iv58
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %.not48 = icmp eq ptr %75, null
  br i1 %.not48, label %.critedge, label %.preheader

.preheader:                                       ; preds = %71
  %76 = load i32, ptr %15, align 4, !tbaa !16
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %.lr.ph, label %._crit_edge

78:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %79 = load i32, ptr %15, align 4, !tbaa !16
  %80 = sext i32 %79 to i64
  %81 = icmp slt i64 %indvars.iv.next, %80
  br i1 %81, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !37

.lr.ph:                                           ; preds = %.preheader, %78
  %indvars.iv = phi i64 [ %indvars.iv.next, %78 ], [ 0, %.preheader ]
  %82 = load ptr, ptr %70, align 8, !tbaa !36
  %83 = getelementptr inbounds ptr, ptr %82, i64 %indvars.iv58
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  %85 = getelementptr inbounds i64, ptr %84, i64 %indvars.iv
  %86 = load i64, ptr %85, align 8, !tbaa !39
  call void @_stuff_chtype_into_eight_bytes(ptr noundef nonnull %3, i64 noundef %86)
  %87 = call i64 @fwrite(ptr noundef nonnull %3, i64 noundef 8, i64 noundef 1, ptr noundef nonnull %1)
  %.not49 = icmp eq i64 %87, 0
  br i1 %.not49, label %.critedge, label %78

._crit_edge.loopexit:                             ; preds = %78
  %.pre = load i32, ptr %13, align 8, !tbaa !15
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %88 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %72, %.preheader ]
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %89 = sext i32 %88 to i64
  %90 = icmp slt i64 %indvars.iv.next59, %89
  br i1 %90, label %71, label %.critedge, !llvm.loop !40

.critedge:                                        ; preds = %._crit_edge, %71, %.lr.ph, %.preheader50, %61, %52, %24, %8, %5
  %.041 = phi i32 [ -1, %5 ], [ -1, %8 ], [ -1, %24 ], [ -1, %52 ], [ -1, %61 ], [ 0, %.preheader50 ], [ -1, %.lr.ph ], [ 0, %71 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  ret i32 %.041
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare ptr @curses_version() local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @_stuff_chtype_into_eight_bytes(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn 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 = { 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 #4 = { "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 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_win", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !12, i64 32, !12, i64 40, !13, i64 48, !13, i64 49, !13, i64 50, !13, i64 51, !13, i64 52, !13, i64 53, !13, i64 54, !6, i64 56, !6, i64 64, !6, i64 72, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!10, !11, i64 4}
!15 = !{!10, !11, i64 8}
!16 = !{!10, !11, i64 12}
!17 = !{!10, !11, i64 16}
!18 = !{!10, !11, i64 20}
!19 = !{!10, !11, i64 24}
!20 = !{!10, !13, i64 48}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!10, !13, i64 49}
!24 = !{!10, !13, i64 50}
!25 = !{!10, !13, i64 51}
!26 = !{!10, !13, i64 52}
!27 = !{!10, !13, i64 53}
!28 = !{!10, !13, i64 54}
!29 = !{!10, !11, i64 80}
!30 = !{!10, !11, i64 84}
!31 = !{!10, !11, i64 88}
!32 = !{!10, !11, i64 92}
!33 = !{!10, !11, i64 96}
!34 = !{!10, !12, i64 32}
!35 = !{!10, !12, i64 40}
!36 = !{!10, !6, i64 56}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!12, !12, i64 0}
!40 = distinct !{!40, !38}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass