; LLVM IR from kmxz/overlayfs-tools :: sh (create_shell_script)

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

@var_names = external dso_local global [5 x ptr], align 16
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [59 x i8], align 1
@vars = external dso_local global [5 x ptr], align 16
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @create_shell_script(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = call i32 @mkstemps(ptr noundef %9, i32 noundef 3)
  store i32 %10, ptr %4, align 4, !tbaa !9
  %11 = load i32, ptr %4, align 4, !tbaa !9
  %12 = icmp slt i32 %11, 0
  br i1 %12, label %13, label %14

13:                                               ; preds = %1
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %114

14:                                               ; preds = %1
  %15 = load i32, ptr %4, align 4, !tbaa !9
  %16 = call i32 @fchmod(i32 noundef %15, i32 noundef 448) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %17 = load i32, ptr %4, align 4, !tbaa !9
  %18 = call noalias ptr @fdopen(i32 noundef %17, ptr noundef @.str.5) #4
  store ptr %18, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %14
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %113

22:                                               ; preds = %14
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef @.str.6) #4
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef @.str.7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %27 = call i64 @time(ptr noundef %7) #4
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = call ptr @ctime(ptr noundef %7) #4
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str.8, ptr noundef %29) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %63, %22
  %32 = load i32, ptr %8, align 4, !tbaa !9
  %33 = icmp slt i32 %32, 5
  br i1 %33, label %35, label %34

34:                                               ; preds = %31
  store i32 2, ptr %5, align 4
  br label %66

35:                                               ; preds = %31
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [5 x ptr], ptr @vars, i64 0, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %62

41:                                               ; preds = %35
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [5 x ptr], ptr @var_names, i64 0, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.9, ptr noundef %46) #4
  %48 = load i32, ptr %8, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [5 x ptr], ptr @vars, i64 0, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = call i32 @quote(ptr noundef %51, ptr noundef %52)
  %54 = icmp slt i32 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %41
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %66

56:                                               ; preds = %41
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = call i32 @fputc(i32 noundef 10, ptr noundef %57)
  %59 = icmp eq i32 %58, -1
  br i1 %59, label %60, label %61

60:                                               ; preds = %56
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %66

61:                                               ; preds = %56
  br label %62

62:                                               ; preds = %61, %35
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %8, align 4, !tbaa !9
  br label %31, !llvm.loop !11

66:                                               ; preds = %60, %55, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %67 = load i32, ptr %5, align 4
  switch i32 %67, label %112 [
    i32 2, label %68
  ]

68:                                               ; preds = %66
  %69 = load ptr, ptr getelementptr inbounds ([5 x ptr], ptr @vars, i64 0, i64 3), align 8, !tbaa !5
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %89

71:                                               ; preds = %68
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef @.str.10) #4
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.11) #4
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef @.str.12) #4
  %78 = load ptr, ptr getelementptr inbounds ([5 x ptr], ptr @vars, i64 0, i64 3), align 8, !tbaa !5
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = call i32 @quote(ptr noundef %78, ptr noundef %79)
  %81 = icmp slt i32 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %71
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %112

83:                                               ; preds = %71
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = call i32 @fputc(i32 noundef 10, ptr noundef %84)
  %86 = icmp eq i32 %85, -1
  br i1 %86, label %87, label %88

87:                                               ; preds = %83
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %112

88:                                               ; preds = %83
  br label %89

89:                                               ; preds = %88, %68
  %90 = load ptr, ptr getelementptr inbounds ([5 x ptr], ptr @vars, i64 0, i64 4), align 16, !tbaa !5
  %91 = icmp ne ptr %90, null
  br i1 %91, label %92, label %110

92:                                               ; preds = %89
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %93, ptr noundef @.str.13) #4
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef @.str.14) #4
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef @.str.15) #4
  %99 = load ptr, ptr getelementptr inbounds ([5 x ptr], ptr @vars, i64 0, i64 4), align 16, !tbaa !5
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = call i32 @quote(ptr noundef %99, ptr noundef %100)
  %102 = icmp slt i32 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %92
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %112

104:                                              ; preds = %92
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = call i32 @fputc(i32 noundef 10, ptr noundef %105)
  %107 = icmp eq i32 %106, -1
  br i1 %107, label %108, label %109

108:                                              ; preds = %104
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %112

109:                                              ; preds = %104
  br label %110

110:                                              ; preds = %109, %89
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %111, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %112

112:                                              ; preds = %110, %108, %103, %87, %82, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %113

113:                                              ; preds = %112, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %114

114:                                              ; preds = %113, %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %115 = load ptr, ptr %2, align 8
  ret ptr %115
}

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

declare i32 @mkstemps(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind
declare i32 @fchmod(i32 noundef, i32 noundef) #3

; Function Attrs: nounwind
declare noalias ptr @fdopen(i32 noundef, ptr noundef) #3

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

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

; Function Attrs: nounwind
declare ptr @ctime(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @quote(ptr noundef, ptr noundef) #0

declare i32 @fputc(i32 noundef, ptr noundef) #2

; 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 = { "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 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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"

@var_names = external dso_local local_unnamed_addr global [5 x ptr], align 16
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [59 x i8], align 1
@vars = external dso_local local_unnamed_addr global [5 x ptr], align 16
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @create_shell_script(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca i64, align 8
  %3 = tail call i32 @mkstemps(ptr noundef %0, i32 noundef 3) #5
  %4 = icmp slt i32 %3, 0
  br i1 %4, label %93, label %5

5:                                                ; preds = %1
  %6 = tail call i32 @fchmod(i32 noundef %3, i32 noundef 448) #5
  %7 = tail call noalias ptr @fdopen(i32 noundef %3, ptr noundef nonnull @.str.5) #5
  %8 = icmp eq ptr %7, null
  br i1 %8, label %93, label %9

9:                                                ; preds = %5
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.6) #5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %12 = call i64 @time(ptr noundef nonnull %2) #5
  %13 = call ptr @ctime(ptr noundef nonnull %2) #5
  %14 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.8, ptr noundef %13) #5
  %15 = load ptr, ptr @vars, align 16, !tbaa !5
  %.not = icmp eq ptr %15, null
  br i1 %.not, label %25, label %16

16:                                               ; preds = %9
  %17 = load ptr, ptr @var_names, align 16, !tbaa !5
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.9, ptr noundef %17) #5
  %19 = load ptr, ptr @vars, align 16, !tbaa !5
  %20 = call i32 @quote(ptr noundef %19, ptr noundef nonnull %7)
  %21 = icmp slt i32 %20, 0
  br i1 %21, label %.loopexit, label %22

22:                                               ; preds = %16
  %23 = call i32 @fputc(i32 noundef 10, ptr noundef nonnull %7)
  %24 = icmp eq i32 %23, -1
  br i1 %24, label %.loopexit, label %25

25:                                               ; preds = %9, %22
  %26 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 8), align 8, !tbaa !5
  %.not.1 = icmp eq ptr %26, null
  br i1 %.not.1, label %36, label %27

27:                                               ; preds = %25
  %28 = load ptr, ptr getelementptr inbounds (i8, ptr @var_names, i64 8), align 8, !tbaa !5
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.9, ptr noundef %28) #5
  %30 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 8), align 8, !tbaa !5
  %31 = call i32 @quote(ptr noundef %30, ptr noundef nonnull %7)
  %32 = icmp slt i32 %31, 0
  br i1 %32, label %.loopexit, label %33

33:                                               ; preds = %27
  %34 = call i32 @fputc(i32 noundef 10, ptr noundef nonnull %7)
  %35 = icmp eq i32 %34, -1
  br i1 %35, label %.loopexit, label %36

36:                                               ; preds = %33, %25
  %37 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 16), align 16, !tbaa !5
  %.not.2 = icmp eq ptr %37, null
  br i1 %.not.2, label %47, label %38

38:                                               ; preds = %36
  %39 = load ptr, ptr getelementptr inbounds (i8, ptr @var_names, i64 16), align 16, !tbaa !5
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.9, ptr noundef %39) #5
  %41 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 16), align 16, !tbaa !5
  %42 = call i32 @quote(ptr noundef %41, ptr noundef nonnull %7)
  %43 = icmp slt i32 %42, 0
  br i1 %43, label %.loopexit, label %44

44:                                               ; preds = %38
  %45 = call i32 @fputc(i32 noundef 10, ptr noundef nonnull %7)
  %46 = icmp eq i32 %45, -1
  br i1 %46, label %.loopexit, label %47

47:                                               ; preds = %44, %36
  %48 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 24), align 8, !tbaa !5
  %.not.3 = icmp eq ptr %48, null
  br i1 %.not.3, label %58, label %49

49:                                               ; preds = %47
  %50 = load ptr, ptr getelementptr inbounds (i8, ptr @var_names, i64 24), align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.9, ptr noundef %50) #5
  %52 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 24), align 8, !tbaa !5
  %53 = call i32 @quote(ptr noundef %52, ptr noundef nonnull %7)
  %54 = icmp slt i32 %53, 0
  br i1 %54, label %.loopexit, label %55

55:                                               ; preds = %49
  %56 = call i32 @fputc(i32 noundef 10, ptr noundef nonnull %7)
  %57 = icmp eq i32 %56, -1
  br i1 %57, label %.loopexit, label %58

58:                                               ; preds = %55, %47
  %59 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 32), align 16, !tbaa !5
  %.not.4 = icmp eq ptr %59, null
  br i1 %.not.4, label %.critedge, label %60

60:                                               ; preds = %58
  %61 = load ptr, ptr getelementptr inbounds (i8, ptr @var_names, i64 32), align 16, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.9, ptr noundef %61) #5
  %63 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 32), align 16, !tbaa !5
  %64 = call i32 @quote(ptr noundef %63, ptr noundef nonnull %7)
  %65 = icmp slt i32 %64, 0
  br i1 %65, label %.loopexit, label %66

66:                                               ; preds = %60
  %67 = call i32 @fputc(i32 noundef 10, ptr noundef nonnull %7)
  %68 = icmp eq i32 %67, -1
  br i1 %68, label %.loopexit, label %.critedge

.critedge:                                        ; preds = %66, %58
  %69 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 24), align 8, !tbaa !5
  %.not32 = icmp eq ptr %69, null
  br i1 %.not32, label %80, label %70

70:                                               ; preds = %.critedge
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.10) #5
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.11) #5
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.12) #5
  %74 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 24), align 8, !tbaa !5
  %75 = call i32 @quote(ptr noundef %74, ptr noundef nonnull %7)
  %76 = icmp slt i32 %75, 0
  br i1 %76, label %.loopexit, label %77

77:                                               ; preds = %70
  %78 = call i32 @fputc(i32 noundef 10, ptr noundef nonnull %7)
  %79 = icmp eq i32 %78, -1
  br i1 %79, label %.loopexit, label %80

80:                                               ; preds = %77, %.critedge
  %81 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 32), align 16, !tbaa !5
  %.not33 = icmp eq ptr %81, null
  br i1 %.not33, label %92, label %82

82:                                               ; preds = %80
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.13) #5
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.14) #5
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.15) #5
  %86 = load ptr, ptr getelementptr inbounds (i8, ptr @vars, i64 32), align 16, !tbaa !5
  %87 = call i32 @quote(ptr noundef %86, ptr noundef nonnull %7)
  %88 = icmp slt i32 %87, 0
  br i1 %88, label %.loopexit, label %89

89:                                               ; preds = %82
  %90 = call i32 @fputc(i32 noundef 10, ptr noundef nonnull %7)
  %91 = icmp eq i32 %90, -1
  br i1 %91, label %.loopexit, label %92

92:                                               ; preds = %89, %80
  br label %.loopexit

.loopexit:                                        ; preds = %16, %22, %27, %33, %38, %44, %49, %55, %60, %66, %89, %82, %77, %70, %92
  %.1 = phi ptr [ %7, %92 ], [ null, %70 ], [ null, %77 ], [ null, %82 ], [ null, %89 ], [ null, %66 ], [ null, %60 ], [ null, %55 ], [ null, %49 ], [ null, %44 ], [ null, %38 ], [ null, %33 ], [ null, %27 ], [ null, %22 ], [ null, %16 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  br label %93

93:                                               ; preds = %.loopexit, %5, %1
  %.3 = phi ptr [ null, %1 ], [ %.1, %.loopexit ], [ null, %5 ]
  ret ptr %.3
}

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

declare i32 @mkstemps(ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @quote(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; 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 = { "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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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"}


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