; LLVM IR from beagleboard/librobotcontrol :: library/src/pru (encoder_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"

@shared_mem_32bit_ptr = external hidden global ptr, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [67 x i8], align 1
@init_flag = external hidden global i32, align 4
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @rc_encoder_pru_init() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %4 = call ptr @rc_pru_shared_mem_ptr()
  store ptr %4, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %5 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %10

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

10:                                               ; preds = %0
  %11 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %12 = getelementptr inbounds i32, ptr %11, i64 16
  store volatile i32 42, ptr %12, align 4, !tbaa !9
  %13 = call i32 @rc_pru_start(i32 noundef 0, ptr noundef @.str.1)
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %15, label %18

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

18:                                               ; preds = %10
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %29, %18
  %20 = load i32, ptr %2, align 4, !tbaa !9
  %21 = icmp slt i32 %20, 40
  br i1 %21, label %22, label %32

22:                                               ; preds = %19
  %23 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %24 = getelementptr inbounds i32, ptr %23, i64 16
  %25 = load volatile i32, ptr %24, align 4, !tbaa !9
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %22
  store i32 1, ptr @init_flag, align 4, !tbaa !9
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %38

28:                                               ; preds = %22
  call void @rc_usleep(i32 noundef 100000)
  br label %29

29:                                               ; preds = %28
  %30 = load i32, ptr %2, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !9
  br label %19, !llvm.loop !11

32:                                               ; preds = %19
  %33 = load ptr, ptr @stderr, align 8, !tbaa !5
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.3, ptr noundef @.str.1) #4
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.4, i32 noundef 0) #4
  %37 = call i32 @rc_pru_stop(i32 noundef 0)
  store i32 0, ptr @init_flag, align 4, !tbaa !9
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %38

38:                                               ; preds = %32, %27, %15, %7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %39 = load i32, ptr %1, align 4
  ret i32 %39
}

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

declare ptr @rc_pru_shared_mem_ptr() #2

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

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

declare void @rc_usleep(i32 noundef) #2

declare i32 @rc_pru_stop(i32 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"

@shared_mem_32bit_ptr = external hidden local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [67 x i8], align 1
@init_flag = external hidden local_unnamed_addr global i32, align 4
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @rc_encoder_pru_init() local_unnamed_addr #0 {
  %1 = tail call ptr @rc_pru_shared_mem_ptr() #3
  store ptr %1, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %2 = icmp eq ptr %1, null
  br i1 %2, label %3, label %6

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) #4
  store i32 0, ptr @init_flag, align 4, !tbaa !9
  br label %179

6:                                                ; preds = %0
  %7 = getelementptr inbounds i8, ptr %1, i64 64
  store volatile i32 42, ptr %7, align 4, !tbaa !9
  %8 = tail call i32 @rc_pru_start(i32 noundef 0, ptr noundef nonnull @.str.1) #3
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %.preheader.preheader, label %13

.preheader.preheader:                             ; preds = %6
  %9 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 64
  %11 = load volatile i32, ptr %10, align 4, !tbaa !9
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %16, label %.preheader.1

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

16:                                               ; preds = %.preheader.39, %.preheader.38, %.preheader.37, %.preheader.36, %.preheader.35, %.preheader.34, %.preheader.33, %.preheader.32, %.preheader.31, %.preheader.30, %.preheader.29, %.preheader.28, %.preheader.27, %.preheader.26, %.preheader.25, %.preheader.24, %.preheader.23, %.preheader.22, %.preheader.21, %.preheader.20, %.preheader.19, %.preheader.18, %.preheader.17, %.preheader.16, %.preheader.15, %.preheader.14, %.preheader.13, %.preheader.12, %.preheader.11, %.preheader.10, %.preheader.9, %.preheader.8, %.preheader.7, %.preheader.6, %.preheader.5, %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  store i32 1, ptr @init_flag, align 4, !tbaa !9
  br label %179

.preheader.1:                                     ; preds = %.preheader.preheader
  tail call void @rc_usleep(i32 noundef 100000) #3
  %17 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 64
  %19 = load volatile i32, ptr %18, align 4, !tbaa !9
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %16, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  tail call void @rc_usleep(i32 noundef 100000) #3
  %21 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 64
  %23 = load volatile i32, ptr %22, align 4, !tbaa !9
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %16, label %.preheader.3

.preheader.3:                                     ; preds = %.preheader.2
  tail call void @rc_usleep(i32 noundef 100000) #3
  %25 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 64
  %27 = load volatile i32, ptr %26, align 4, !tbaa !9
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %16, label %.preheader.4

.preheader.4:                                     ; preds = %.preheader.3
  tail call void @rc_usleep(i32 noundef 100000) #3
  %29 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %29, i64 64
  %31 = load volatile i32, ptr %30, align 4, !tbaa !9
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %16, label %.preheader.5

.preheader.5:                                     ; preds = %.preheader.4
  tail call void @rc_usleep(i32 noundef 100000) #3
  %33 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 64
  %35 = load volatile i32, ptr %34, align 4, !tbaa !9
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %16, label %.preheader.6

.preheader.6:                                     ; preds = %.preheader.5
  tail call void @rc_usleep(i32 noundef 100000) #3
  %37 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 64
  %39 = load volatile i32, ptr %38, align 4, !tbaa !9
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %16, label %.preheader.7

.preheader.7:                                     ; preds = %.preheader.6
  tail call void @rc_usleep(i32 noundef 100000) #3
  %41 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 64
  %43 = load volatile i32, ptr %42, align 4, !tbaa !9
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %16, label %.preheader.8

.preheader.8:                                     ; preds = %.preheader.7
  tail call void @rc_usleep(i32 noundef 100000) #3
  %45 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 64
  %47 = load volatile i32, ptr %46, align 4, !tbaa !9
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %16, label %.preheader.9

.preheader.9:                                     ; preds = %.preheader.8
  tail call void @rc_usleep(i32 noundef 100000) #3
  %49 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 64
  %51 = load volatile i32, ptr %50, align 4, !tbaa !9
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %16, label %.preheader.10

.preheader.10:                                    ; preds = %.preheader.9
  tail call void @rc_usleep(i32 noundef 100000) #3
  %53 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 64
  %55 = load volatile i32, ptr %54, align 4, !tbaa !9
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %16, label %.preheader.11

.preheader.11:                                    ; preds = %.preheader.10
  tail call void @rc_usleep(i32 noundef 100000) #3
  %57 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 64
  %59 = load volatile i32, ptr %58, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %16, label %.preheader.12

.preheader.12:                                    ; preds = %.preheader.11
  tail call void @rc_usleep(i32 noundef 100000) #3
  %61 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 64
  %63 = load volatile i32, ptr %62, align 4, !tbaa !9
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %16, label %.preheader.13

.preheader.13:                                    ; preds = %.preheader.12
  tail call void @rc_usleep(i32 noundef 100000) #3
  %65 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %65, i64 64
  %67 = load volatile i32, ptr %66, align 4, !tbaa !9
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %16, label %.preheader.14

.preheader.14:                                    ; preds = %.preheader.13
  tail call void @rc_usleep(i32 noundef 100000) #3
  %69 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 64
  %71 = load volatile i32, ptr %70, align 4, !tbaa !9
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %16, label %.preheader.15

.preheader.15:                                    ; preds = %.preheader.14
  tail call void @rc_usleep(i32 noundef 100000) #3
  %73 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i64 64
  %75 = load volatile i32, ptr %74, align 4, !tbaa !9
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %16, label %.preheader.16

.preheader.16:                                    ; preds = %.preheader.15
  tail call void @rc_usleep(i32 noundef 100000) #3
  %77 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %77, i64 64
  %79 = load volatile i32, ptr %78, align 4, !tbaa !9
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %16, label %.preheader.17

.preheader.17:                                    ; preds = %.preheader.16
  tail call void @rc_usleep(i32 noundef 100000) #3
  %81 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 64
  %83 = load volatile i32, ptr %82, align 4, !tbaa !9
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %16, label %.preheader.18

.preheader.18:                                    ; preds = %.preheader.17
  tail call void @rc_usleep(i32 noundef 100000) #3
  %85 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %86 = getelementptr inbounds i8, ptr %85, i64 64
  %87 = load volatile i32, ptr %86, align 4, !tbaa !9
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %16, label %.preheader.19

.preheader.19:                                    ; preds = %.preheader.18
  tail call void @rc_usleep(i32 noundef 100000) #3
  %89 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %89, i64 64
  %91 = load volatile i32, ptr %90, align 4, !tbaa !9
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %16, label %.preheader.20

.preheader.20:                                    ; preds = %.preheader.19
  tail call void @rc_usleep(i32 noundef 100000) #3
  %93 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i64 64
  %95 = load volatile i32, ptr %94, align 4, !tbaa !9
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %16, label %.preheader.21

.preheader.21:                                    ; preds = %.preheader.20
  tail call void @rc_usleep(i32 noundef 100000) #3
  %97 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %98 = getelementptr inbounds i8, ptr %97, i64 64
  %99 = load volatile i32, ptr %98, align 4, !tbaa !9
  %100 = icmp eq i32 %99, 0
  br i1 %100, label %16, label %.preheader.22

.preheader.22:                                    ; preds = %.preheader.21
  tail call void @rc_usleep(i32 noundef 100000) #3
  %101 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %102 = getelementptr inbounds i8, ptr %101, i64 64
  %103 = load volatile i32, ptr %102, align 4, !tbaa !9
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %16, label %.preheader.23

.preheader.23:                                    ; preds = %.preheader.22
  tail call void @rc_usleep(i32 noundef 100000) #3
  %105 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %106 = getelementptr inbounds i8, ptr %105, i64 64
  %107 = load volatile i32, ptr %106, align 4, !tbaa !9
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %16, label %.preheader.24

.preheader.24:                                    ; preds = %.preheader.23
  tail call void @rc_usleep(i32 noundef 100000) #3
  %109 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %109, i64 64
  %111 = load volatile i32, ptr %110, align 4, !tbaa !9
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %16, label %.preheader.25

.preheader.25:                                    ; preds = %.preheader.24
  tail call void @rc_usleep(i32 noundef 100000) #3
  %113 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %114 = getelementptr inbounds i8, ptr %113, i64 64
  %115 = load volatile i32, ptr %114, align 4, !tbaa !9
  %116 = icmp eq i32 %115, 0
  br i1 %116, label %16, label %.preheader.26

.preheader.26:                                    ; preds = %.preheader.25
  tail call void @rc_usleep(i32 noundef 100000) #3
  %117 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %118 = getelementptr inbounds i8, ptr %117, i64 64
  %119 = load volatile i32, ptr %118, align 4, !tbaa !9
  %120 = icmp eq i32 %119, 0
  br i1 %120, label %16, label %.preheader.27

.preheader.27:                                    ; preds = %.preheader.26
  tail call void @rc_usleep(i32 noundef 100000) #3
  %121 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %121, i64 64
  %123 = load volatile i32, ptr %122, align 4, !tbaa !9
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %16, label %.preheader.28

.preheader.28:                                    ; preds = %.preheader.27
  tail call void @rc_usleep(i32 noundef 100000) #3
  %125 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %126 = getelementptr inbounds i8, ptr %125, i64 64
  %127 = load volatile i32, ptr %126, align 4, !tbaa !9
  %128 = icmp eq i32 %127, 0
  br i1 %128, label %16, label %.preheader.29

.preheader.29:                                    ; preds = %.preheader.28
  tail call void @rc_usleep(i32 noundef 100000) #3
  %129 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %130 = getelementptr inbounds i8, ptr %129, i64 64
  %131 = load volatile i32, ptr %130, align 4, !tbaa !9
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %16, label %.preheader.30

.preheader.30:                                    ; preds = %.preheader.29
  tail call void @rc_usleep(i32 noundef 100000) #3
  %133 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %134 = getelementptr inbounds i8, ptr %133, i64 64
  %135 = load volatile i32, ptr %134, align 4, !tbaa !9
  %136 = icmp eq i32 %135, 0
  br i1 %136, label %16, label %.preheader.31

.preheader.31:                                    ; preds = %.preheader.30
  tail call void @rc_usleep(i32 noundef 100000) #3
  %137 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %138 = getelementptr inbounds i8, ptr %137, i64 64
  %139 = load volatile i32, ptr %138, align 4, !tbaa !9
  %140 = icmp eq i32 %139, 0
  br i1 %140, label %16, label %.preheader.32

.preheader.32:                                    ; preds = %.preheader.31
  tail call void @rc_usleep(i32 noundef 100000) #3
  %141 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %142 = getelementptr inbounds i8, ptr %141, i64 64
  %143 = load volatile i32, ptr %142, align 4, !tbaa !9
  %144 = icmp eq i32 %143, 0
  br i1 %144, label %16, label %.preheader.33

.preheader.33:                                    ; preds = %.preheader.32
  tail call void @rc_usleep(i32 noundef 100000) #3
  %145 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %146 = getelementptr inbounds i8, ptr %145, i64 64
  %147 = load volatile i32, ptr %146, align 4, !tbaa !9
  %148 = icmp eq i32 %147, 0
  br i1 %148, label %16, label %.preheader.34

.preheader.34:                                    ; preds = %.preheader.33
  tail call void @rc_usleep(i32 noundef 100000) #3
  %149 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %150 = getelementptr inbounds i8, ptr %149, i64 64
  %151 = load volatile i32, ptr %150, align 4, !tbaa !9
  %152 = icmp eq i32 %151, 0
  br i1 %152, label %16, label %.preheader.35

.preheader.35:                                    ; preds = %.preheader.34
  tail call void @rc_usleep(i32 noundef 100000) #3
  %153 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %154 = getelementptr inbounds i8, ptr %153, i64 64
  %155 = load volatile i32, ptr %154, align 4, !tbaa !9
  %156 = icmp eq i32 %155, 0
  br i1 %156, label %16, label %.preheader.36

.preheader.36:                                    ; preds = %.preheader.35
  tail call void @rc_usleep(i32 noundef 100000) #3
  %157 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %158 = getelementptr inbounds i8, ptr %157, i64 64
  %159 = load volatile i32, ptr %158, align 4, !tbaa !9
  %160 = icmp eq i32 %159, 0
  br i1 %160, label %16, label %.preheader.37

.preheader.37:                                    ; preds = %.preheader.36
  tail call void @rc_usleep(i32 noundef 100000) #3
  %161 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %162 = getelementptr inbounds i8, ptr %161, i64 64
  %163 = load volatile i32, ptr %162, align 4, !tbaa !9
  %164 = icmp eq i32 %163, 0
  br i1 %164, label %16, label %.preheader.38

.preheader.38:                                    ; preds = %.preheader.37
  tail call void @rc_usleep(i32 noundef 100000) #3
  %165 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %166 = getelementptr inbounds i8, ptr %165, i64 64
  %167 = load volatile i32, ptr %166, align 4, !tbaa !9
  %168 = icmp eq i32 %167, 0
  br i1 %168, label %16, label %.preheader.39

.preheader.39:                                    ; preds = %.preheader.38
  tail call void @rc_usleep(i32 noundef 100000) #3
  %169 = load ptr, ptr @shared_mem_32bit_ptr, align 8, !tbaa !5
  %170 = getelementptr inbounds i8, ptr %169, i64 64
  %171 = load volatile i32, ptr %170, align 4, !tbaa !9
  %172 = icmp eq i32 %171, 0
  br i1 %172, label %16, label %173

173:                                              ; preds = %.preheader.39
  tail call void @rc_usleep(i32 noundef 100000) #3
  %174 = load ptr, ptr @stderr, align 8, !tbaa !5
  %175 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %174, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1) #4
  %176 = load ptr, ptr @stderr, align 8, !tbaa !5
  %177 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %176, ptr noundef nonnull @.str.4, i32 noundef 0) #4
  %178 = tail call i32 @rc_pru_stop(i32 noundef 0) #3
  store i32 0, ptr @init_flag, align 4, !tbaa !9
  br label %179

179:                                              ; preds = %173, %16, %13, %3
  %.03 = phi i32 [ -1, %3 ], [ -1, %13 ], [ 0, %16 ], [ -1, %173 ]
  ret i32 %.03
}

declare ptr @rc_pru_shared_mem_ptr() local_unnamed_addr #1

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

declare i32 @rc_pru_start(i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @rc_usleep(i32 noundef) local_unnamed_addr #1

declare i32 @rc_pru_stop(i32 noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { nounwind }
attributes #4 = { 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 = !{!"int", !7, i64 0}


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