; LLVM IR from beagleboard/librobotcontrol :: services/robotcontrol/src (rc_startup_routine)

; 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 [47 x i8], align 1
@start_us = external hidden global i64, align 8
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [118 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [73 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [128 x i8], align 16
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 128, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %6 = call i32 @geteuid() #4
  %7 = icmp ne i32 %6, 0
  br i1 %7, label %8, label %11

8:                                                ; preds = %0
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %10 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef @.str) #4
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %121

11:                                               ; preds = %0
  %12 = call i64 @rc_nanos_since_boot()
  %13 = udiv i64 %12, 1000
  store i64 %13, ptr @start_us, align 8, !tbaa !9
  %14 = call i64 @rc_nanos_since_boot()
  %15 = uitofp i64 %14 to double
  %16 = fdiv double %15, 1.000000e+09
  store double %16, ptr %3, align 8, !tbaa !11
  %17 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %18 = load double, ptr %3, align 8, !tbaa !11
  %19 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %17, ptr noundef @.str.1, double noundef %18, ptr noundef @.str.2) #4
  %20 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %21 = call i32 @system(ptr noundef %20)
  %22 = call i32 @rc_model()
  store i32 %22, ptr %4, align 4, !tbaa !13
  %23 = load i32, ptr %4, align 4, !tbaa !13
  %24 = icmp ne i32 %23, 2
  br i1 %24, label %25, label %38

25:                                               ; preds = %11
  %26 = load i32, ptr %4, align 4, !tbaa !13
  %27 = icmp ne i32 %26, 4
  br i1 %27, label %28, label %38

28:                                               ; preds = %25
  %29 = load i32, ptr %4, align 4, !tbaa !13
  %30 = icmp ne i32 %29, 7
  br i1 %30, label %31, label %38

31:                                               ; preds = %28
  %32 = call i32 @system(ptr noundef @.str.3)
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %37

34:                                               ; preds = %31
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.4) #4
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %121

37:                                               ; preds = %31
  br label %38

38:                                               ; preds = %37, %28, %25, %11
  br label %39

39:                                               ; preds = %49, %38
  %40 = call i32 @set_gpio_permissions()
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %50

42:                                               ; preds = %39
  %43 = call i32 @check_timeout()
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %49

45:                                               ; preds = %42
  %46 = call i32 @system(ptr noundef @.str.5)
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.6) #4
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %121

49:                                               ; preds = %42
  call void @rc_usleep(i32 noundef 500000)
  br label %39, !llvm.loop !15

50:                                               ; preds = %39
  %51 = call i64 @rc_nanos_since_boot()
  %52 = uitofp i64 %51 to double
  %53 = fdiv double %52, 1.000000e+09
  store double %53, ptr %3, align 8, !tbaa !11
  %54 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %55 = load double, ptr %3, align 8, !tbaa !11
  %56 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %54, ptr noundef @.str.7, double noundef %55, ptr noundef @.str.2) #4
  %57 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %58 = call i32 @system(ptr noundef %57)
  br label %59

59:                                               ; preds = %69, %50
  %60 = call i32 @check_pwm()
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %70

62:                                               ; preds = %59
  %63 = call i32 @check_timeout()
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %69

65:                                               ; preds = %62
  %66 = call i32 @system(ptr noundef @.str.8)
  %67 = load ptr, ptr @stderr, align 8, !tbaa !5
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef @.str.9) #4
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %121

69:                                               ; preds = %62
  call void @rc_usleep(i32 noundef 500000)
  br label %59, !llvm.loop !17

70:                                               ; preds = %59
  %71 = call i64 @rc_nanos_since_boot()
  %72 = uitofp i64 %71 to double
  %73 = fdiv double %72, 1.000000e+09
  store double %73, ptr %3, align 8, !tbaa !11
  %74 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %75 = load double, ptr %3, align 8, !tbaa !11
  %76 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %74, ptr noundef @.str.10, double noundef %75, ptr noundef @.str.2) #4
  %77 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %78 = call i32 @system(ptr noundef %77)
  br label %79

79:                                               ; preds = %89, %70
  %80 = call i32 @check_eqep()
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %90

82:                                               ; preds = %79
  %83 = call i32 @check_timeout()
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %89

85:                                               ; preds = %82
  %86 = call i32 @system(ptr noundef @.str.11)
  %87 = load ptr, ptr @stderr, align 8, !tbaa !5
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef @.str.12) #4
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %121

89:                                               ; preds = %82
  call void @rc_usleep(i32 noundef 500000)
  br label %79, !llvm.loop !18

90:                                               ; preds = %79
  %91 = call i64 @rc_nanos_since_boot()
  %92 = uitofp i64 %91 to double
  %93 = fdiv double %92, 1.000000e+09
  store double %93, ptr %3, align 8, !tbaa !11
  %94 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %95 = load double, ptr %3, align 8, !tbaa !11
  %96 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %94, ptr noundef @.str.13, double noundef %95, ptr noundef @.str.2) #4
  %97 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %98 = call i32 @system(ptr noundef %97)
  br label %99

99:                                               ; preds = %109, %90
  %100 = call i32 @check_pru()
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %110

102:                                              ; preds = %99
  %103 = call i32 @check_timeout()
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %109

105:                                              ; preds = %102
  %106 = call i32 @system(ptr noundef @.str.14)
  %107 = load ptr, ptr @stderr, align 8, !tbaa !5
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef @.str.15) #4
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %121

109:                                              ; preds = %102
  call void @rc_usleep(i32 noundef 500000)
  br label %99, !llvm.loop !19

110:                                              ; preds = %99
  %111 = call i64 @rc_nanos_since_boot()
  %112 = uitofp i64 %111 to double
  %113 = fdiv double %112, 1.000000e+09
  store double %113, ptr %3, align 8, !tbaa !11
  %114 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %115 = load double, ptr %3, align 8, !tbaa !11
  %116 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %114, ptr noundef @.str.16, double noundef %115, ptr noundef @.str.2) #4
  %117 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %118 = call i32 @system(ptr noundef %117)
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  %120 = call i32 @system(ptr noundef @.str.18)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %121

121:                                              ; preds = %110, %105, %85, %65, %45, %34, %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %2) #4
  %122 = load i32, ptr %1, align 4
  ret i32 %122
}

; 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 @geteuid() #2

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

declare i64 @rc_nanos_since_boot() #3

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

declare i32 @system(ptr noundef) #3

declare i32 @rc_model() #3

declare void @rc_usleep(i32 noundef) #3

declare i32 @printf(ptr noundef, ...) #3

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

; Function Attrs: nounwind uwtable
declare hidden i32 @set_gpio_permissions() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @check_timeout() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @check_pwm() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @check_eqep() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @check_pru() #0

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 = { "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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


; 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 [47 x i8], align 1
@start_us = external hidden local_unnamed_addr global i64, align 8
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [118 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [73 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @main() local_unnamed_addr #0 {
  %1 = alloca [128 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %1) #6
  %2 = tail call i32 @geteuid() #6
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %6, label %3

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

6:                                                ; preds = %0
  %7 = tail call i64 @rc_nanos_since_boot() #6
  %8 = udiv i64 %7, 1000
  store i64 %8, ptr @start_us, align 8, !tbaa !9
  %9 = tail call i64 @rc_nanos_since_boot() #6
  %10 = uitofp i64 %9 to double
  %11 = fdiv double %10, 1.000000e+09
  %12 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %11, ptr noundef nonnull @.str.2) #6
  %13 = call i32 @system(ptr noundef nonnull %1) #6
  %14 = tail call i32 @rc_model() #6
  switch i32 %14, label %15 [
    i32 7, label %20
    i32 4, label %20
    i32 2, label %20
  ]

15:                                               ; preds = %6
  %16 = tail call i32 @system(ptr noundef nonnull @.str.3) #6
  %.not11 = icmp eq i32 %16, 0
  br i1 %.not11, label %20, label %17

17:                                               ; preds = %15
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.4) #7
  br label %75

20:                                               ; preds = %6, %6, %6, %15
  %21 = tail call i32 @set_gpio_permissions()
  %.not1220 = icmp eq i32 %21, 0
  br i1 %.not1220, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %20, %27
  %22 = tail call i32 @check_timeout()
  %.not19 = icmp eq i32 %22, 0
  br i1 %.not19, label %27, label %23

23:                                               ; preds = %.lr.ph
  %24 = tail call i32 @system(ptr noundef nonnull @.str.5) #6
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.6) #7
  br label %75

27:                                               ; preds = %.lr.ph
  tail call void @rc_usleep(i32 noundef 500000) #6
  %28 = tail call i32 @set_gpio_permissions()
  %.not12 = icmp eq i32 %28, 0
  br i1 %.not12, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %27, %20
  %29 = tail call i64 @rc_nanos_since_boot() #6
  %30 = uitofp i64 %29 to double
  %31 = fdiv double %30, 1.000000e+09
  %32 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.7, double noundef %31, ptr noundef nonnull @.str.2) #6
  %33 = call i32 @system(ptr noundef nonnull %1) #6
  %34 = tail call i32 @check_pwm()
  %.not1321 = icmp eq i32 %34, 0
  br i1 %.not1321, label %._crit_edge24, label %.lr.ph23

.lr.ph23:                                         ; preds = %._crit_edge, %40
  %35 = tail call i32 @check_timeout()
  %.not18 = icmp eq i32 %35, 0
  br i1 %.not18, label %40, label %36

36:                                               ; preds = %.lr.ph23
  %37 = tail call i32 @system(ptr noundef nonnull @.str.8) #6
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.9) #7
  br label %75

40:                                               ; preds = %.lr.ph23
  tail call void @rc_usleep(i32 noundef 500000) #6
  %41 = tail call i32 @check_pwm()
  %.not13 = icmp eq i32 %41, 0
  br i1 %.not13, label %._crit_edge24, label %.lr.ph23, !llvm.loop !13

._crit_edge24:                                    ; preds = %40, %._crit_edge
  %42 = tail call i64 @rc_nanos_since_boot() #6
  %43 = uitofp i64 %42 to double
  %44 = fdiv double %43, 1.000000e+09
  %45 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.10, double noundef %44, ptr noundef nonnull @.str.2) #6
  %46 = call i32 @system(ptr noundef nonnull %1) #6
  %47 = tail call i32 @check_eqep()
  %.not1425 = icmp eq i32 %47, 0
  br i1 %.not1425, label %._crit_edge28, label %.lr.ph27

.lr.ph27:                                         ; preds = %._crit_edge24, %53
  %48 = tail call i32 @check_timeout()
  %.not17 = icmp eq i32 %48, 0
  br i1 %.not17, label %53, label %49

49:                                               ; preds = %.lr.ph27
  %50 = tail call i32 @system(ptr noundef nonnull @.str.11) #6
  %51 = load ptr, ptr @stderr, align 8, !tbaa !5
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.12) #7
  br label %75

53:                                               ; preds = %.lr.ph27
  tail call void @rc_usleep(i32 noundef 500000) #6
  %54 = tail call i32 @check_eqep()
  %.not14 = icmp eq i32 %54, 0
  br i1 %.not14, label %._crit_edge28, label %.lr.ph27, !llvm.loop !14

._crit_edge28:                                    ; preds = %53, %._crit_edge24
  %55 = tail call i64 @rc_nanos_since_boot() #6
  %56 = uitofp i64 %55 to double
  %57 = fdiv double %56, 1.000000e+09
  %58 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.13, double noundef %57, ptr noundef nonnull @.str.2) #6
  %59 = call i32 @system(ptr noundef nonnull %1) #6
  %60 = tail call i32 @check_pru()
  %.not1529 = icmp eq i32 %60, 0
  br i1 %.not1529, label %._crit_edge32, label %.lr.ph31

.lr.ph31:                                         ; preds = %._crit_edge28, %66
  %61 = tail call i32 @check_timeout()
  %.not16 = icmp eq i32 %61, 0
  br i1 %.not16, label %66, label %62

62:                                               ; preds = %.lr.ph31
  %63 = tail call i32 @system(ptr noundef nonnull @.str.14) #6
  %64 = load ptr, ptr @stderr, align 8, !tbaa !5
  %65 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef nonnull @.str.15) #7
  br label %75

66:                                               ; preds = %.lr.ph31
  tail call void @rc_usleep(i32 noundef 500000) #6
  %67 = tail call i32 @check_pru()
  %.not15 = icmp eq i32 %67, 0
  br i1 %.not15, label %._crit_edge32, label %.lr.ph31, !llvm.loop !15

._crit_edge32:                                    ; preds = %66, %._crit_edge28
  %68 = tail call i64 @rc_nanos_since_boot() #6
  %69 = uitofp i64 %68 to double
  %70 = fdiv double %69, 1.000000e+09
  %71 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.16, double noundef %70, ptr noundef nonnull @.str.2) #6
  %72 = call i32 @system(ptr noundef nonnull %1) #6
  %73 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  %74 = tail call i32 @system(ptr noundef nonnull @.str.18) #6
  br label %75

75:                                               ; preds = %._crit_edge32, %62, %49, %36, %23, %17, %3
  %.0 = phi i32 [ -1, %3 ], [ 0, %17 ], [ 0, %23 ], [ 0, %36 ], [ 0, %49 ], [ -1, %62 ], [ 0, %._crit_edge32 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %1) #6
  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: nounwind
declare i32 @geteuid() local_unnamed_addr #2

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

declare i64 @rc_nanos_since_boot() local_unnamed_addr #4

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

; Function Attrs: nofree
declare noundef i32 @system(ptr nocapture noundef readonly) local_unnamed_addr #5

declare i32 @rc_model() local_unnamed_addr #4

declare void @rc_usleep(i32 noundef) local_unnamed_addr #4

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @set_gpio_permissions() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @check_timeout() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @check_pwm() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @check_eqep() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @check_pru() local_unnamed_addr #0

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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { cold 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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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