; LLVM IR from beagleboard/librobotcontrol :: library/src/pru (pru)

; 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 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [52 x i8], align 1

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

12:                                               ; preds = %2
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = icmp ne i32 %13, 1
  br i1 %14, label %15, label %18

15:                                               ; preds = %12
  %16 = load ptr, ptr @stderr, align 8, !tbaa !9
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef @.str) #6
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

18:                                               ; preds = %12, %2
  %19 = load ptr, ptr %5, align 8, !tbaa !9
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %24

21:                                               ; preds = %18
  %22 = load ptr, ptr @stderr, align 8, !tbaa !9
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef @.str.1) #6
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

24:                                               ; preds = %18
  %25 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %25, i8 0, i64 64, i1 false)
  %26 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %26, i64 noundef 64, ptr noundef @.str.2, ptr noundef %27) #6
  %29 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  %30 = call i32 @access(ptr noundef %29, i32 noundef 0) #6
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %36

32:                                               ; preds = %24
  %33 = load ptr, ptr @stderr, align 8, !tbaa !9
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.3, ptr noundef %34) #6
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

36:                                               ; preds = %24
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = call i32 @rc_pru_stop(i32 noundef %37)
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %36
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

41:                                               ; preds = %36
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %41
  %45 = call i32 (ptr, i32, ...) @open(ptr noundef @.str.4, i32 noundef 1)
  store i32 %45, ptr %6, align 4, !tbaa !5
  br label %48

46:                                               ; preds = %41
  %47 = call i32 (ptr, i32, ...) @open(ptr noundef @.str.5, i32 noundef 1)
  store i32 %47, ptr %6, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %46, %44
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = icmp eq i32 %49, -1
  br i1 %50, label %51, label %54

51:                                               ; preds = %48
  call void @perror(ptr noundef @.str.6)
  %52 = load ptr, ptr @stderr, align 8, !tbaa !9
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef @.str.7) #6
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

54:                                               ; preds = %48
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = load ptr, ptr %5, align 8, !tbaa !9
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = call i64 @strlen(ptr noundef %57) #7
  %59 = call i64 @write(i32 noundef %55, ptr noundef %56, i64 noundef %58)
  %60 = trunc i64 %59 to i32
  store i32 %60, ptr %7, align 4, !tbaa !5
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = call i32 @close(i32 noundef %61)
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = icmp eq i32 %63, -1
  br i1 %64, label %65, label %66

65:                                               ; preds = %54
  call void @perror(ptr noundef @.str.8)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

66:                                               ; preds = %54
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %71

69:                                               ; preds = %66
  %70 = call i32 (ptr, i32, ...) @open(ptr noundef @.str.9, i32 noundef 1)
  store i32 %70, ptr %6, align 4, !tbaa !5
  br label %73

71:                                               ; preds = %66
  %72 = call i32 (ptr, i32, ...) @open(ptr noundef @.str.10, i32 noundef 1)
  store i32 %72, ptr %6, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %71, %69
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = icmp eq i32 %74, -1
  br i1 %75, label %76, label %79

76:                                               ; preds = %73
  call void @perror(ptr noundef @.str.6)
  %77 = load ptr, ptr @stderr, align 8, !tbaa !9
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.11) #6
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

79:                                               ; preds = %73
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = call i64 @write(i32 noundef %80, ptr noundef @.str.12, i64 noundef 5)
  %82 = trunc i64 %81 to i32
  store i32 %82, ptr %7, align 4, !tbaa !5
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = call i32 @close(i32 noundef %83)
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = icmp eq i32 %85, -1
  br i1 %86, label %87, label %88

87:                                               ; preds = %79
  call void @perror(ptr noundef @.str.13)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

88:                                               ; preds = %79
  call void @rc_usleep(i32 noundef 250000)
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %91, label %93

91:                                               ; preds = %88
  %92 = call i32 (ptr, i32, ...) @open(ptr noundef @.str.9, i32 noundef 0)
  store i32 %92, ptr %6, align 4, !tbaa !5
  br label %95

93:                                               ; preds = %88
  %94 = call i32 (ptr, i32, ...) @open(ptr noundef @.str.10, i32 noundef 0)
  store i32 %94, ptr %6, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %93, %91
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = icmp eq i32 %96, -1
  br i1 %97, label %98, label %101

98:                                               ; preds = %95
  call void @perror(ptr noundef @.str.6)
  %99 = load ptr, ptr @stderr, align 8, !tbaa !9
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef @.str.11) #6
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

101:                                              ; preds = %95
  %102 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %102, i8 0, i64 64, i1 false)
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  %105 = call i64 @read(i32 noundef %103, ptr noundef %104, i64 noundef 64)
  %106 = trunc i64 %105 to i32
  store i32 %106, ptr %7, align 4, !tbaa !5
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = call i32 @close(i32 noundef %107)
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = icmp eq i32 %109, -1
  br i1 %110, label %111, label %112

111:                                              ; preds = %101
  call void @perror(ptr noundef @.str.14)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

112:                                              ; preds = %101
  %113 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  %114 = call i32 @strcmp(ptr noundef %113, ptr noundef @.str.15) #7
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %123

116:                                              ; preds = %112
  %117 = load ptr, ptr @stderr, align 8, !tbaa !9
  %118 = load i32, ptr %4, align 4, !tbaa !5
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %117, ptr noundef @.str.16, i32 noundef %118) #6
  %120 = load ptr, ptr @stderr, align 8, !tbaa !9
  %121 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.17, ptr noundef %121) #6
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

123:                                              ; preds = %112
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %124

124:                                              ; preds = %123, %116, %111, %98, %87, %76, %65, %51, %40, %32, %21, %15
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %125 = load i32, ptr %3, align 4
  ret i32 %125
}

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

; Function Attrs: nounwind
declare i32 @access(ptr noundef, i32 noundef) #2

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

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

declare void @perror(ptr noundef) #4

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

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

declare i32 @close(i32 noundef) #4

declare void @rc_usleep(i32 noundef) #4

declare i64 @read(i32 noundef, ptr noundef, i64 noundef) #4

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

; 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 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 #6 = { nounwind }
attributes #7 = { 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}


; 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 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [52 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @rc_pru_start(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca [64 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #7
  %or.cond = icmp ugt i32 %0, 1
  br i1 %or.cond, label %4, label %7

4:                                                ; preds = %2
  %5 = load ptr, ptr @stderr, align 8, !tbaa !5
  %6 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str) #8
  br label %65

7:                                                ; preds = %2
  %8 = icmp eq ptr %1, null
  br i1 %8, label %9, label %12

9:                                                ; preds = %7
  %10 = load ptr, ptr @stderr, align 8, !tbaa !5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.1) #8
  br label %65

12:                                               ; preds = %7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %3, i8 0, i64 64, i1 false)
  %13 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %3, i64 noundef 64, ptr noundef nonnull @.str.2, ptr noundef nonnull %1) #7
  %14 = call i32 @access(ptr noundef nonnull %3, i32 noundef 0) #7
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %18, label %15

15:                                               ; preds = %12
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.3, ptr noundef nonnull %1) #8
  br label %65

18:                                               ; preds = %12
  %19 = tail call i32 @rc_pru_stop(i32 noundef %0)
  %.not27 = icmp eq i32 %19, 0
  br i1 %.not27, label %20, label %65

20:                                               ; preds = %18
  %21 = icmp eq i32 %0, 0
  %.str.4..str.5 = select i1 %21, ptr @.str.4, ptr @.str.5
  %22 = tail call i32 (ptr, i32, ...) @open(ptr noundef nonnull %.str.4..str.5, i32 noundef 1) #7
  %23 = icmp eq i32 %22, -1
  br i1 %23, label %24, label %27

24:                                               ; preds = %20
  tail call void @perror(ptr noundef nonnull @.str.6) #9
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.7) #8
  br label %65

27:                                               ; preds = %20
  %28 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #10
  %29 = tail call i64 @write(i32 noundef %22, ptr noundef nonnull %1, i64 noundef %28) #7
  %30 = tail call i32 @close(i32 noundef %22) #7
  %31 = and i64 %29, 4294967295
  %32 = icmp eq i64 %31, 4294967295
  br i1 %32, label %33, label %34

33:                                               ; preds = %27
  tail call void @perror(ptr noundef nonnull @.str.8) #9
  br label %65

34:                                               ; preds = %27
  %.str.9..str.10 = select i1 %21, ptr @.str.9, ptr @.str.10
  %35 = tail call i32 (ptr, i32, ...) @open(ptr noundef nonnull %.str.9..str.10, i32 noundef 1) #7
  %36 = icmp eq i32 %35, -1
  br i1 %36, label %37, label %40

37:                                               ; preds = %34
  tail call void @perror(ptr noundef nonnull @.str.6) #9
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.11) #8
  br label %65

40:                                               ; preds = %34
  %41 = tail call i64 @write(i32 noundef %35, ptr noundef nonnull @.str.12, i64 noundef 5) #7
  %42 = tail call i32 @close(i32 noundef %35) #7
  %43 = and i64 %41, 4294967295
  %44 = icmp eq i64 %43, 4294967295
  br i1 %44, label %45, label %46

45:                                               ; preds = %40
  tail call void @perror(ptr noundef nonnull @.str.13) #9
  br label %65

46:                                               ; preds = %40
  tail call void @rc_usleep(i32 noundef 250000) #7
  %.str.9..str.1030 = select i1 %21, ptr @.str.9, ptr @.str.10
  %47 = tail call i32 (ptr, i32, ...) @open(ptr noundef nonnull %.str.9..str.1030, i32 noundef 0) #7
  %48 = icmp eq i32 %47, -1
  br i1 %48, label %49, label %52

49:                                               ; preds = %46
  tail call void @perror(ptr noundef nonnull @.str.6) #9
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.11) #8
  br label %65

52:                                               ; preds = %46
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %3, i8 0, i64 64, i1 false)
  %53 = call i64 @read(i32 noundef %47, ptr noundef nonnull %3, i64 noundef 64) #7
  %54 = tail call i32 @close(i32 noundef %47) #7
  %55 = and i64 %53, 4294967295
  %56 = icmp eq i64 %55, 4294967295
  br i1 %56, label %57, label %58

57:                                               ; preds = %52
  tail call void @perror(ptr noundef nonnull @.str.14) #9
  br label %65

58:                                               ; preds = %52
  %59 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.15) #10
  %.not28 = icmp eq i32 %59, 0
  br i1 %.not28, label %65, label %60

60:                                               ; preds = %58
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str.16, i32 noundef %0) #8
  %63 = load ptr, ptr @stderr, align 8, !tbaa !5
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef nonnull @.str.17, ptr noundef nonnull %3) #8
  br label %65

65:                                               ; preds = %58, %18, %60, %57, %49, %45, %37, %33, %24, %15, %9, %4
  %.025 = phi i32 [ -1, %4 ], [ -1, %9 ], [ -1, %15 ], [ -1, %24 ], [ -1, %33 ], [ -1, %37 ], [ -1, %45 ], [ -1, %49 ], [ -1, %57 ], [ -1, %60 ], [ -1, %18 ], [ 0, %58 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #7
  ret i32 %.025
}

; 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 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

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

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

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

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

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

declare i32 @close(i32 noundef) local_unnamed_addr #6

declare void @rc_usleep(i32 noundef) local_unnamed_addr #6

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

; 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 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #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 = { "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 = { cold nounwind }
attributes #9 = { cold }
attributes #10 = { 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"}


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