; LLVM IR from shellphish/how2heap :: malloc_playground (main)

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

@stderr = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@stdin = external global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@stdout = external global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [99 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @print_mcheck_status(i32 noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @report_mcheck_fail(i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca [1000 x i8], align 16
  %7 = alloca [1000 x i8], align 16
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %14 = load ptr, ptr @stderr, align 8, !tbaa !9
  %15 = call i32 @getpid() #6
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef @.str.8, i32 noundef %15) #6
  call void @llvm.lifetime.start.p0(i64 1000, ptr %6) #6
  br label %17

17:                                               ; preds = %147, %2
  br label %18

18:                                               ; preds = %17
  %19 = load ptr, ptr @stderr, align 8, !tbaa !9
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str.9) #6
  %21 = getelementptr inbounds [1000 x i8], ptr %6, i64 0, i64 0
  %22 = load ptr, ptr @stdin, align 8, !tbaa !9
  %23 = call ptr @fgets(ptr noundef %21, i32 noundef 1000, ptr noundef %22)
  call void @llvm.lifetime.start.p0(i64 1000, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %24 = getelementptr inbounds [1000 x i8], ptr %6, i64 0, i64 0
  %25 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %26 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %24, ptr noundef @.str.10, ptr noundef %25, ptr noundef %8, ptr noundef %9) #6
  store i32 %26, ptr %10, align 4, !tbaa !5
  %27 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %28 = call i32 @strcmp(ptr noundef %27, ptr noundef @.str.11) #7
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %36

30:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %31 = load i64, ptr %8, align 8, !tbaa !11
  %32 = call noalias ptr @malloc(i64 noundef %31) #8
  store ptr %32, ptr %11, align 8, !tbaa !9
  %33 = load ptr, ptr @stderr, align 8, !tbaa !9
  %34 = load ptr, ptr %11, align 8, !tbaa !9
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.12, ptr noundef %34) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %147

36:                                               ; preds = %18
  %37 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %38 = call i32 @strcmp(ptr noundef %37, ptr noundef @.str.13) #7
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %45

40:                                               ; preds = %36
  %41 = load i64, ptr %8, align 8, !tbaa !11
  %42 = inttoptr i64 %41 to ptr
  call void @free(ptr noundef %42) #6
  %43 = load ptr, ptr @stderr, align 8, !tbaa !9
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str.14) #6
  br label %146

45:                                               ; preds = %36
  %46 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %47 = call i32 @strcmp(ptr noundef %46, ptr noundef @.str.15) #7
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %78

49:                                               ; preds = %45
  %50 = load i32, ptr %10, align 4, !tbaa !5
  %51 = icmp eq i32 %50, 2
  br i1 %51, label %52, label %53

52:                                               ; preds = %49
  store i64 1, ptr %9, align 8, !tbaa !11
  br label %53

53:                                               ; preds = %52, %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %54 = load i64, ptr %8, align 8, !tbaa !11
  %55 = inttoptr i64 %54 to ptr
  store ptr %55, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %74, %53
  %57 = load i32, ptr %13, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = load i64, ptr %9, align 8, !tbaa !11
  %60 = icmp slt i64 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %77

62:                                               ; preds = %56
  %63 = load ptr, ptr @stderr, align 8, !tbaa !9
  %64 = load ptr, ptr %12, align 8, !tbaa !9
  %65 = load i32, ptr %13, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i64, ptr %64, i64 %66
  %68 = load ptr, ptr %12, align 8, !tbaa !9
  %69 = load i32, ptr %13, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i64, ptr %68, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !11
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.16, ptr noundef %67, i64 noundef %72) #6
  br label %74

74:                                               ; preds = %62
  %75 = load i32, ptr %13, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %13, align 4, !tbaa !5
  br label %56, !llvm.loop !13

77:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %145

78:                                               ; preds = %45
  %79 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %80 = call i32 @strcmp(ptr noundef %79, ptr noundef @.str.17) #7
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %82, label %88

82:                                               ; preds = %78
  %83 = load ptr, ptr @stderr, align 8, !tbaa !9
  %84 = load i64, ptr %8, align 8, !tbaa !11
  %85 = inttoptr i64 %84 to ptr
  %86 = call i64 @malloc_usable_size(ptr noundef %85) #6
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.18, i64 noundef %86) #6
  br label %144

88:                                               ; preds = %78
  %89 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %90 = call i32 @strcmp(ptr noundef %89, ptr noundef @.str.19) #7
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %88
  call void @malloc_stats() #6
  br label %143

93:                                               ; preds = %88
  %94 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %95 = call i32 @strcmp(ptr noundef %94, ptr noundef @.str.20) #7
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %97, label %100

97:                                               ; preds = %93
  %98 = load ptr, ptr @stdout, align 8, !tbaa !9
  %99 = call i32 @malloc_info(i32 noundef 0, ptr noundef %98) #6
  br label %142

100:                                              ; preds = %93
  %101 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %102 = call i32 @strcmp(ptr noundef %101, ptr noundef @.str.21) #7
  %103 = icmp eq i32 %102, 0
  br i1 %103, label %104, label %111

104:                                              ; preds = %100
  %105 = load ptr, ptr @stderr, align 8, !tbaa !9
  %106 = call i32 @mcheck(ptr noundef @report_mcheck_fail) #6
  %107 = icmp eq i32 %106, 0
  %108 = zext i1 %107 to i64
  %109 = select i1 %107, ptr @.str.23, ptr @.str.24
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef @.str.22, ptr noundef %109) #6
  br label %141

111:                                              ; preds = %100
  %112 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %113 = call i32 @strcmp(ptr noundef %112, ptr noundef @.str.25) #7
  %114 = icmp eq i32 %113, 0
  br i1 %114, label %115, label %122

115:                                              ; preds = %111
  %116 = load ptr, ptr @stderr, align 8, !tbaa !9
  %117 = call i32 @mcheck_pedantic(ptr noundef @report_mcheck_fail) #6
  %118 = icmp eq i32 %117, 0
  %119 = zext i1 %118 to i64
  %120 = select i1 %118, ptr @.str.23, ptr @.str.24
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str.22, ptr noundef %120) #6
  br label %140

122:                                              ; preds = %111
  %123 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %124 = call i32 @strcmp(ptr noundef %123, ptr noundef @.str.26) #7
  %125 = icmp eq i32 %124, 0
  br i1 %125, label %126, label %137

126:                                              ; preds = %122
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = icmp sgt i32 %127, 1
  br i1 %128, label %129, label %133

129:                                              ; preds = %126
  %130 = load i64, ptr %8, align 8, !tbaa !11
  %131 = inttoptr i64 %130 to ptr
  %132 = call i32 @mprobe(ptr noundef %131) #6
  call void @print_mcheck_status(i32 noundef %132)
  br label %136

133:                                              ; preds = %126
  call void @mcheck_check_all()
  %134 = load ptr, ptr @stderr, align 8, !tbaa !9
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.27) #6
  br label %136

136:                                              ; preds = %133, %129
  br label %139

137:                                              ; preds = %122
  %138 = call i32 @puts(ptr noundef @.str.28)
  br label %139

139:                                              ; preds = %137, %136
  br label %140

140:                                              ; preds = %139, %115
  br label %141

141:                                              ; preds = %140, %104
  br label %142

142:                                              ; preds = %141, %97
  br label %143

143:                                              ; preds = %142, %92
  br label %144

144:                                              ; preds = %143, %82
  br label %145

145:                                              ; preds = %144, %77
  br label %146

146:                                              ; preds = %145, %40
  br label %147

147:                                              ; preds = %146, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1000, ptr %7) #6
  br label %17
}

; Function Attrs: nounwind
declare i32 @getpid() #1

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

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #1

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

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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

; Function Attrs: nounwind
declare i64 @malloc_usable_size(ptr noundef) #1

; Function Attrs: nounwind
declare void @malloc_stats() #1

; Function Attrs: nounwind
declare i32 @malloc_info(i32 noundef, ptr noundef) #1

; Function Attrs: nounwind
declare i32 @mcheck(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @mcheck_pedantic(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @mprobe(ptr noundef) #1

declare void @mcheck_check_all() #3

declare i32 @puts(ptr noundef) #3

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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 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 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind allocsize(0) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [99 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @print_mcheck_status(i32 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @report_mcheck_fail(i32 noundef) #0

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #2 {
  %3 = alloca [1000 x i8], align 16
  %4 = alloca [1000 x i8], align 16
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = load ptr, ptr @stderr, align 8, !tbaa !5
  %8 = tail call i32 @getpid() #9
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str.8, i32 noundef %8) #10
  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %3) #9
  br label %10

10:                                               ; preds = %.loopexit, %2
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.9) #10
  %13 = load ptr, ptr @stdin, align 8, !tbaa !5
  %14 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1000, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %15 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.10, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6) #9
  %16 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.11) #11
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %23

18:                                               ; preds = %10
  %19 = load i64, ptr %5, align 8, !tbaa !9
  %20 = call noalias ptr @malloc(i64 noundef %19) #12
  %21 = load ptr, ptr @stderr, align 8, !tbaa !5
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull @.str.12, ptr noundef %20) #10
  br label %.loopexit

23:                                               ; preds = %10
  %24 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.13) #11
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %31

26:                                               ; preds = %23
  %27 = load i64, ptr %5, align 8, !tbaa !9
  %28 = inttoptr i64 %27 to ptr
  call void @free(ptr noundef %28) #9
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.14) #10
  br label %.loopexit

31:                                               ; preds = %23
  %32 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.15) #11
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %45

34:                                               ; preds = %31
  %35 = icmp eq i32 %15, 2
  br i1 %35, label %.thread, label %36

.thread:                                          ; preds = %34
  store i64 1, ptr %6, align 8, !tbaa !9
  br label %.lr.ph.preheader

36:                                               ; preds = %34
  %.pre = load i64, ptr %6, align 8, !tbaa !9
  %37 = icmp sgt i64 %.pre, 0
  br i1 %37, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %.thread, %36
  %.in = load i64, ptr %5, align 8, !tbaa !9
  %38 = inttoptr i64 %.in to ptr
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = getelementptr inbounds i64, ptr %38, i64 %indvars.iv
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.16, ptr noundef nonnull %40, i64 noundef %41) #10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %43 = load i64, ptr %6, align 8, !tbaa !9
  %44 = icmp sgt i64 %43, %indvars.iv.next
  br i1 %44, label %.lr.ph, label %.loopexit, !llvm.loop !11

45:                                               ; preds = %31
  %46 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.17) #11
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %54

48:                                               ; preds = %45
  %49 = load ptr, ptr @stderr, align 8, !tbaa !5
  %50 = load i64, ptr %5, align 8, !tbaa !9
  %51 = inttoptr i64 %50 to ptr
  %52 = call i64 @malloc_usable_size(ptr noundef %51) #9
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.18, i64 noundef %52) #10
  br label %.loopexit

54:                                               ; preds = %45
  %55 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.19) #11
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %54
  call void @malloc_stats() #9
  br label %.loopexit

58:                                               ; preds = %54
  %59 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.20) #11
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %64

61:                                               ; preds = %58
  %62 = load ptr, ptr @stdout, align 8, !tbaa !5
  %63 = call i32 @malloc_info(i32 noundef 0, ptr noundef %62) #9
  br label %.loopexit

64:                                               ; preds = %58
  %65 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.21) #11
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %73

67:                                               ; preds = %64
  %68 = load ptr, ptr @stderr, align 8, !tbaa !5
  %69 = call i32 @mcheck(ptr noundef nonnull @report_mcheck_fail) #9
  %70 = icmp eq i32 %69, 0
  %71 = select i1 %70, ptr @.str.23, ptr @.str.24
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.22, ptr noundef nonnull %71) #10
  br label %.loopexit

73:                                               ; preds = %64
  %74 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.25) #11
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %82

76:                                               ; preds = %73
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = call i32 @mcheck_pedantic(ptr noundef nonnull @report_mcheck_fail) #9
  %79 = icmp eq i32 %78, 0
  %80 = select i1 %79, ptr @.str.23, ptr @.str.24
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.22, ptr noundef nonnull %80) #10
  br label %.loopexit

82:                                               ; preds = %73
  %83 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.26) #11
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %94

85:                                               ; preds = %82
  %86 = icmp sgt i32 %15, 1
  br i1 %86, label %87, label %91

87:                                               ; preds = %85
  %88 = load i64, ptr %5, align 8, !tbaa !9
  %89 = inttoptr i64 %88 to ptr
  %90 = call i32 @mprobe(ptr noundef %89) #9
  call void @print_mcheck_status(i32 noundef %90)
  br label %.loopexit

91:                                               ; preds = %85
  call void @mcheck_check_all() #9
  %92 = load ptr, ptr @stderr, align 8, !tbaa !5
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef nonnull @.str.27) #10
  br label %.loopexit

94:                                               ; preds = %82
  %95 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.28)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %36, %26, %48, %61, %76, %87, %91, %94, %67, %57, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %4) #9
  br label %10
}

; Function Attrs: nounwind
declare i32 @getpid() local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: nounwind
declare i64 @malloc_usable_size(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @malloc_stats() local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @malloc_info(i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @mcheck(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @mcheck_pedantic(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @mprobe(ptr noundef) local_unnamed_addr #3

declare void @mcheck_check_all() local_unnamed_addr #8

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #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 = { 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 #2 = { noreturn 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 "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 memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 #7 = { 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 #8 = { "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 #9 = { nounwind }
attributes #10 = { cold nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind allocsize(0) }

!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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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