; LLVM IR from ihucos/plash :: stack (stack_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"

@.str = external hidden unnamed_addr constant [52 x i8], align 1
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@constinit = external hidden constant [3 x ptr], align 8
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [54 x i8], align 1
@__PRETTY_FUNCTION__.stack_main = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@constinit.9 = external hidden constant [3 x ptr], align 8
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @stack_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 i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca [3 x ptr], align 8
  %16 = alloca [5 x ptr], align 8
  %17 = alloca [3 x ptr], align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = icmp ne i32 %18, 3
  br i1 %19, label %20, label %23

20:                                               ; preds = %2
  %21 = load ptr, ptr @stderr, align 8, !tbaa !9
  %22 = call i32 @fputs(ptr noundef @.str, ptr noundef %21)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %160

23:                                               ; preds = %2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 @constinit, i64 24, i1 false), !tbaa.struct !11
  %24 = getelementptr inbounds [3 x ptr], ptr %15, i64 0, i64 0
  %25 = call ptr @pl_check_output(ptr noundef %24)
  %26 = call ptr @pl_firstline(ptr noundef %25)
  store ptr %26, ptr %11, align 8, !tbaa !9
  %27 = load ptr, ptr %11, align 8, !tbaa !9
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %23
  br label %31

30:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 44, ptr noundef @__PRETTY_FUNCTION__.stack_main) #8
  unreachable

31:                                               ; preds = %29
  %32 = load ptr, ptr %11, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %32, i64 0
  %34 = load i8, ptr %33, align 1, !tbaa !12
  %35 = sext i8 %34 to i32
  %36 = icmp eq i32 %35, 47
  br i1 %36, label %37, label %38

37:                                               ; preds = %31
  br label %39

38:                                               ; preds = %31
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.4, i32 noundef 45, ptr noundef @__PRETTY_FUNCTION__.stack_main) #8
  unreachable

39:                                               ; preds = %37
  store ptr @.str.1, ptr %16, align 8, !tbaa !9
  %40 = getelementptr inbounds ptr, ptr %16, i64 1
  store ptr @.str.6, ptr %40, align 8, !tbaa !9
  %41 = getelementptr inbounds ptr, ptr %16, i64 2
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = getelementptr inbounds ptr, ptr %42, i64 1
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  store ptr %44, ptr %41, align 8, !tbaa !9
  %45 = getelementptr inbounds ptr, ptr %16, i64 3
  store ptr @.str.7, ptr %45, align 8, !tbaa !9
  %46 = getelementptr inbounds ptr, ptr %16, i64 4
  store ptr null, ptr %46, align 8, !tbaa !9
  %47 = getelementptr inbounds [5 x ptr], ptr %16, i64 0, i64 0
  %48 = call ptr @pl_check_output(ptr noundef %47)
  %49 = call ptr @pl_firstline(ptr noundef %48)
  store ptr %49, ptr %10, align 8, !tbaa !9
  call void (...) @pl_unshare_user()
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 @constinit.9, i64 24, i1 false), !tbaa.struct !11
  %50 = getelementptr inbounds [3 x ptr], ptr %17, i64 0, i64 0
  %51 = call ptr @pl_check_output(ptr noundef %50)
  %52 = call ptr @pl_firstline(ptr noundef %51)
  store ptr %52, ptr %12, align 8, !tbaa !9
  %53 = load ptr, ptr %5, align 8, !tbaa !9
  %54 = getelementptr inbounds ptr, ptr %53, i64 2
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = call ptr @realpath(ptr noundef %55, ptr noundef null) #7
  store ptr %56, ptr %13, align 8, !tbaa !9
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %63

58:                                               ; preds = %39
  %59 = load ptr, ptr %5, align 8, !tbaa !9
  %60 = getelementptr inbounds ptr, ptr %59, i64 2
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.10, ptr noundef %61)
  br label %63

63:                                               ; preds = %58, %39
  %64 = load ptr, ptr %12, align 8, !tbaa !9
  %65 = call i32 @chmod(ptr noundef %64, i32 noundef 493) #7
  %66 = icmp eq i32 %65, -1
  br i1 %66, label %67, label %69

67:                                               ; preds = %63
  %68 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.11)
  br label %69

69:                                               ; preds = %67, %63
  %70 = load ptr, ptr %12, align 8, !tbaa !9
  %71 = call i32 @chdir(ptr noundef %70) #7
  %72 = icmp eq i32 %71, -1
  br i1 %72, label %73, label %75

73:                                               ; preds = %69
  %74 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.12)
  br label %75

75:                                               ; preds = %73, %69
  %76 = call i32 @mkdir(ptr noundef @.str.13, i32 noundef 493) #7
  %77 = icmp eq i32 %76, -1
  br i1 %77, label %78, label %80

78:                                               ; preds = %75
  %79 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.14)
  br label %80

80:                                               ; preds = %78, %75
  %81 = load ptr, ptr %13, align 8, !tbaa !9
  %82 = call i32 @rename(ptr noundef %81, ptr noundef @.str.15) #7
  %83 = icmp eq i32 %82, -1
  br i1 %83, label %84, label %89

84:                                               ; preds = %80
  %85 = load ptr, ptr %5, align 8, !tbaa !9
  %86 = getelementptr inbounds ptr, ptr %85, i64 2
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.16, ptr noundef %87)
  br label %89

89:                                               ; preds = %84, %80
  %90 = load ptr, ptr %11, align 8, !tbaa !9
  %91 = call i32 @chdir(ptr noundef %90) #7
  %92 = icmp eq i32 %91, -1
  br i1 %92, label %93, label %95

93:                                               ; preds = %89
  %94 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.12)
  br label %95

95:                                               ; preds = %93, %89
  %96 = call i32 (ptr, i32, ...) @open(ptr noundef @.str.17, i32 noundef 1025)
  store i32 %96, ptr %7, align 4, !tbaa !5
  %97 = icmp eq i32 %96, -1
  br i1 %97, label %98, label %100

98:                                               ; preds = %95
  %99 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.18)
  br label %100

100:                                              ; preds = %98, %95
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = call i64 @write(i32 noundef %101, ptr noundef @.str.19, i64 noundef 1)
  %103 = icmp ne i64 %102, 1
  br i1 %103, label %104, label %106

104:                                              ; preds = %100
  %105 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.20)
  br label %106

106:                                              ; preds = %104, %100
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = call i64 @lseek(i32 noundef %107, i64 noundef 0, i32 noundef 1) #7
  store i64 %108, ptr %6, align 8, !tbaa !13
  %109 = icmp eq i64 %108, -1
  br i1 %109, label %110, label %112

110:                                              ; preds = %106
  %111 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.21)
  br label %112

112:                                              ; preds = %110, %106
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = call i32 @close(i32 noundef %113)
  %115 = icmp eq i32 %114, -1
  br i1 %115, label %116, label %118

116:                                              ; preds = %112
  %117 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.22)
  br label %118

118:                                              ; preds = %116, %112
  %119 = load i64, ptr %6, align 8, !tbaa !13
  %120 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %9, ptr noundef @.str.23, i64 noundef %119) #7
  %121 = icmp eq i32 %120, -1
  br i1 %121, label %122, label %124

122:                                              ; preds = %118
  %123 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.24)
  br label %124

124:                                              ; preds = %122, %118
  %125 = load ptr, ptr %10, align 8, !tbaa !9
  %126 = load ptr, ptr %11, align 8, !tbaa !9
  %127 = call i64 @strlen(ptr noundef %126) #9
  %128 = getelementptr inbounds i8, ptr %125, i64 %127
  %129 = load i64, ptr %6, align 8, !tbaa !13
  %130 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %8, ptr noundef @.str.25, ptr noundef %128, i64 noundef %129) #7
  %131 = icmp eq i32 %130, -1
  br i1 %131, label %132, label %134

132:                                              ; preds = %124
  %133 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.24)
  br label %134

134:                                              ; preds = %132, %124
  %135 = call i32 @chdir(ptr noundef @.str.26) #7
  %136 = icmp eq i32 %135, -1
  br i1 %136, label %137, label %139

137:                                              ; preds = %134
  %138 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.12)
  br label %139

139:                                              ; preds = %137, %134
  %140 = load ptr, ptr %8, align 8, !tbaa !9
  %141 = load ptr, ptr %9, align 8, !tbaa !9
  %142 = call i32 @symlink(ptr noundef %140, ptr noundef %141) #7
  %143 = icmp eq i32 %142, -1
  br i1 %143, label %144, label %146

144:                                              ; preds = %139
  %145 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.27)
  br label %146

146:                                              ; preds = %144, %139
  %147 = load ptr, ptr %12, align 8, !tbaa !9
  %148 = load ptr, ptr %8, align 8, !tbaa !9
  %149 = call i32 @rename(ptr noundef %147, ptr noundef %148) #7
  %150 = icmp eq i32 %149, -1
  br i1 %150, label %151, label %153

151:                                              ; preds = %146
  %152 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.28)
  br label %153

153:                                              ; preds = %151, %146
  %154 = load ptr, ptr %9, align 8, !tbaa !9
  %155 = call i32 @puts(ptr noundef %154)
  %156 = icmp eq i32 %155, -1
  br i1 %156, label %157, label %159

157:                                              ; preds = %153
  %158 = call i32 (ptr, ...) @pl_fatal(ptr noundef @.str.29)
  br label %159

159:                                              ; preds = %157, %153
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %160

160:                                              ; preds = %159, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %161 = load i32, ptr %3, align 4
  ret i32 %161
}

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

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

declare ptr @pl_firstline(ptr noundef) #2

declare ptr @pl_check_output(ptr noundef) #2

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

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

declare void @pl_unshare_user(...) #2

; Function Attrs: nounwind
declare ptr @realpath(ptr noundef, ptr noundef) #5

declare i32 @pl_fatal(ptr noundef, ...) #2

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

; Function Attrs: nounwind
declare i32 @chdir(ptr noundef) #5

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

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

declare i32 @open(ptr noundef, i32 noundef, ...) #2

declare i64 @write(i32 noundef, ptr noundef, i64 noundef) #2

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

declare i32 @close(i32 noundef) #2

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

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

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

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


; 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 [52 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@constinit = external hidden local_unnamed_addr constant [3 x ptr], align 8
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [54 x i8], align 1
@__PRETTY_FUNCTION__.stack_main = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@constinit.9 = external hidden local_unnamed_addr constant [3 x ptr], align 8
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [5 x i8], align 1

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

8:                                                ; preds = %2
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %10 = tail call i32 @fputs(ptr noundef nonnull @.str, ptr noundef %9) #10
  br label %118

11:                                               ; preds = %2
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) @constinit, i64 24, i1 false), !tbaa.struct !9
  %12 = call ptr @pl_check_output(ptr noundef nonnull %5) #9
  %13 = call ptr @pl_firstline(ptr noundef %12) #9
  %.not20 = icmp eq ptr %13, null
  br i1 %.not20, label %14, label %15

14:                                               ; preds = %11
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 44, ptr noundef nonnull @__PRETTY_FUNCTION__.stack_main) #11
  unreachable

15:                                               ; preds = %11
  %16 = load i8, ptr %13, align 1, !tbaa !10
  %17 = icmp eq i8 %16, 47
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.4, i32 noundef 45, ptr noundef nonnull @__PRETTY_FUNCTION__.stack_main) #11
  unreachable

19:                                               ; preds = %15
  store ptr @.str.1, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr @.str.6, ptr %20, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %6, i64 16
  %22 = getelementptr inbounds i8, ptr %1, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  store ptr %23, ptr %21, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr @.str.7, ptr %24, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %6, i64 32
  store ptr null, ptr %25, align 8, !tbaa !5
  %26 = call ptr @pl_check_output(ptr noundef nonnull %6) #9
  %27 = call ptr @pl_firstline(ptr noundef %26) #9
  call void (...) @pl_unshare_user() #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) @constinit.9, i64 24, i1 false), !tbaa.struct !9
  %28 = call ptr @pl_check_output(ptr noundef nonnull %7) #9
  %29 = call ptr @pl_firstline(ptr noundef %28) #9
  %30 = getelementptr inbounds i8, ptr %1, i64 16
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = call ptr @realpath(ptr noundef %31, ptr noundef null) #9
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %37

34:                                               ; preds = %19
  %35 = load ptr, ptr %30, align 8, !tbaa !5
  %36 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.10, ptr noundef %35) #9
  br label %37

37:                                               ; preds = %34, %19
  %38 = call i32 @chmod(ptr noundef %29, i32 noundef 493) #9
  %39 = icmp eq i32 %38, -1
  br i1 %39, label %40, label %42

40:                                               ; preds = %37
  %41 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.11) #9
  br label %42

42:                                               ; preds = %40, %37
  %43 = call i32 @chdir(ptr noundef %29) #9
  %44 = icmp eq i32 %43, -1
  br i1 %44, label %45, label %47

45:                                               ; preds = %42
  %46 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.12) #9
  br label %47

47:                                               ; preds = %45, %42
  %48 = call i32 @mkdir(ptr noundef nonnull @.str.13, i32 noundef 493) #9
  %49 = icmp eq i32 %48, -1
  br i1 %49, label %50, label %52

50:                                               ; preds = %47
  %51 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.14) #9
  br label %52

52:                                               ; preds = %50, %47
  %53 = call i32 @rename(ptr noundef %32, ptr noundef nonnull @.str.15) #9
  %54 = icmp eq i32 %53, -1
  br i1 %54, label %55, label %58

55:                                               ; preds = %52
  %56 = load ptr, ptr %30, align 8, !tbaa !5
  %57 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.16, ptr noundef %56) #9
  br label %58

58:                                               ; preds = %55, %52
  %59 = call i32 @chdir(ptr noundef nonnull %13) #9
  %60 = icmp eq i32 %59, -1
  br i1 %60, label %61, label %63

61:                                               ; preds = %58
  %62 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.12) #9
  br label %63

63:                                               ; preds = %61, %58
  %64 = call i32 (ptr, i32, ...) @open(ptr noundef nonnull @.str.17, i32 noundef 1025) #9
  %65 = icmp eq i32 %64, -1
  br i1 %65, label %66, label %68

66:                                               ; preds = %63
  %67 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.18) #9
  br label %68

68:                                               ; preds = %66, %63
  %69 = call i64 @write(i32 noundef %64, ptr noundef nonnull @.str.19, i64 noundef 1) #9
  %.not21 = icmp eq i64 %69, 1
  br i1 %.not21, label %72, label %70

70:                                               ; preds = %68
  %71 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.20) #9
  br label %72

72:                                               ; preds = %70, %68
  %73 = call i64 @lseek(i32 noundef %64, i64 noundef 0, i32 noundef 1) #9
  %74 = icmp eq i64 %73, -1
  br i1 %74, label %75, label %77

75:                                               ; preds = %72
  %76 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.21) #9
  br label %77

77:                                               ; preds = %75, %72
  %78 = call i32 @close(i32 noundef %64) #9
  %79 = icmp eq i32 %78, -1
  br i1 %79, label %80, label %82

80:                                               ; preds = %77
  %81 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.22) #9
  br label %82

82:                                               ; preds = %80, %77
  %83 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.23, i64 noundef %73) #9
  %84 = icmp eq i32 %83, -1
  br i1 %84, label %85, label %87

85:                                               ; preds = %82
  %86 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.24) #9
  br label %87

87:                                               ; preds = %85, %82
  %88 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %13) #12
  %89 = getelementptr inbounds i8, ptr %27, i64 %88
  %90 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.25, ptr noundef %89, i64 noundef %73) #9
  %91 = icmp eq i32 %90, -1
  br i1 %91, label %92, label %94

92:                                               ; preds = %87
  %93 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.24) #9
  br label %94

94:                                               ; preds = %92, %87
  %95 = call i32 @chdir(ptr noundef nonnull @.str.26) #9
  %96 = icmp eq i32 %95, -1
  br i1 %96, label %97, label %99

97:                                               ; preds = %94
  %98 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.12) #9
  br label %99

99:                                               ; preds = %97, %94
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = call i32 @symlink(ptr noundef %100, ptr noundef %101) #9
  %103 = icmp eq i32 %102, -1
  br i1 %103, label %104, label %106

104:                                              ; preds = %99
  %105 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.27) #9
  br label %106

106:                                              ; preds = %104, %99
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = call i32 @rename(ptr noundef %29, ptr noundef %107) #9
  %109 = icmp eq i32 %108, -1
  br i1 %109, label %110, label %112

110:                                              ; preds = %106
  %111 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.28) #9
  br label %112

112:                                              ; preds = %110, %106
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %113)
  %115 = icmp eq i32 %114, -1
  br i1 %115, label %116, label %118

116:                                              ; preds = %112
  %117 = call i32 (ptr, ...) @pl_fatal(ptr noundef nonnull @.str.29) #9
  br label %118

118:                                              ; preds = %112, %116, %8
  %.0 = phi i32 [ 1, %8 ], [ 0, %116 ], [ 0, %112 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  ret i32 %.0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @fputs(ptr nocapture noundef readonly, ptr nocapture noundef) local_unnamed_addr #2

declare ptr @pl_firstline(ptr noundef) local_unnamed_addr #3

declare ptr @pl_check_output(ptr noundef) local_unnamed_addr #3

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

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

declare void @pl_unshare_user(...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef ptr @realpath(ptr nocapture noundef readonly, ptr noundef) local_unnamed_addr #2

declare i32 @pl_fatal(ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @chmod(ptr nocapture noundef readonly, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @chdir(ptr noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noundef i32 @mkdir(ptr nocapture noundef readonly, i32 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @rename(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #7

; Function Attrs: nofree
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #7

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #6

declare i32 @close(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @asprintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #6

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

; Function Attrs: nounwind
declare i32 @symlink(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

; 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 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 #7 = { nofree "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 = { 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 #9 = { nounwind }
attributes #10 = { cold }
attributes #11 = { noreturn nounwind }
attributes #12 = { 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 = !{i64 0, i64 24, !10}
!10 = !{!7, !7, i64 0}


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