; LLVM IR from microbotsio/CodeCell :: src (sh2)

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

%struct.sh2_s = type { ptr, ptr, i8, i8, i8, i8, [17 x i8], [64 x %struct.anon], ptr, i32, %union.sh2_OpData_t, i8, i8, i8, ptr, ptr, ptr, ptr, [72 x i32], i16, i32, i32, i32 }
%struct.anon = type { i8, i8 }
%union.sh2_OpData_t = type { %struct.anon.4 }
%struct.anon.4 = type { i16, ptr, ptr, i16 }
%struct.sh2_Hal_s = type { ptr, ptr, ptr, ptr, ptr }

@_sh2 = external dso_local global %struct.sh2_s, align 8
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1

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

14:                                               ; preds = %3
  store i32 -2, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %113

15:                                               ; preds = %3
  call void @llvm.memset.p0.i64(ptr align 8 @_sh2, i8 0, i64 560, i1 false)
  %16 = load ptr, ptr %8, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.sh2_s, ptr %16, i32 0, i32 2
  store volatile i8 0, ptr %17, align 8, !tbaa !9
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.sh2_s, ptr %18, i32 0, i32 5
  store i8 -1, ptr %19, align 1, !tbaa !14
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.sh2_s, ptr %21, i32 0, i32 0
  store ptr %20, ptr %22, align 8, !tbaa !15
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.sh2_s, ptr %24, i32 0, i32 14
  store ptr %23, ptr %25, align 8, !tbaa !16
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.sh2_s, ptr %27, i32 0, i32 15
  store ptr %26, ptr %28, align 8, !tbaa !17
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.sh2_s, ptr %29, i32 0, i32 16
  store ptr null, ptr %30, align 8, !tbaa !18
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.sh2_s, ptr %31, i32 0, i32 17
  store ptr null, ptr %32, align 8, !tbaa !19
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.sh2_s, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = call ptr @shtp_open(ptr noundef %35)
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.sh2_s, ptr %37, i32 0, i32 1
  store ptr %36, ptr %38, align 8, !tbaa !20
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.sh2_s, ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %15
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %113

44:                                               ; preds = %15
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.sh2_s, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !20
  call void @shtp_setEventCallback(ptr noundef %47, ptr noundef @shtpEventCallback, ptr noundef @_sh2)
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.sh2_s, ptr %48, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = call i32 @shtp_listenAdvert(ptr noundef %50, i16 noundef zeroext 2, ptr noundef @sensorhubAdvertHdlr, ptr noundef @_sh2)
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.sh2_s, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !20
  %55 = call i32 @shtp_listenChan(ptr noundef %54, i16 noundef zeroext 2, ptr noundef @.str, ptr noundef @sensorhubControlHdlr, ptr noundef @_sh2)
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.sh2_s, ptr %56, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !20
  %59 = call i32 @shtp_listenChan(ptr noundef %58, i16 noundef zeroext 2, ptr noundef @.str.1, ptr noundef @sensorhubInputNormalHdlr, ptr noundef @_sh2)
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.sh2_s, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  %63 = call i32 @shtp_listenChan(ptr noundef %62, i16 noundef zeroext 2, ptr noundef @.str.2, ptr noundef @sensorhubInputWakeHdlr, ptr noundef @_sh2)
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.sh2_s, ptr %64, i32 0, i32 1
  %66 = load ptr, ptr %65, align 8, !tbaa !20
  %67 = call i32 @shtp_listenChan(ptr noundef %66, i16 noundef zeroext 2, ptr noundef @.str.3, ptr noundef @sensorhubInputGyroRvHdlr, ptr noundef @_sh2)
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.sh2_s, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !20
  %71 = call i32 @shtp_listenAdvert(ptr noundef %70, i16 noundef zeroext 1, ptr noundef @executableAdvertHdlr, ptr noundef @_sh2)
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.sh2_s, ptr %72, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  %75 = call i32 @shtp_listenChan(ptr noundef %74, i16 noundef zeroext 1, ptr noundef @.str.4, ptr noundef @executabLEDeviceHdlr, ptr noundef @_sh2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.sh2_s, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !15
  %79 = getelementptr inbounds %struct.sh2_Hal_s, ptr %78, i32 0, i32 4
  %80 = load ptr, ptr %79, align 8, !tbaa !21
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.sh2_s, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !15
  %84 = call i32 %80(ptr noundef %83)
  store i32 %84, ptr %10, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %85 = load i32, ptr %10, align 4, !tbaa !23
  store i32 %85, ptr %11, align 4, !tbaa !23
  br label %86

86:                                               ; preds = %99, %44
  %87 = load i32, ptr %11, align 4, !tbaa !23
  %88 = load i32, ptr %10, align 4, !tbaa !23
  %89 = sub i32 %87, %88
  %90 = icmp ult i32 %89, 200000
  br i1 %90, label %91, label %97

91:                                               ; preds = %86
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.sh2_s, ptr %92, i32 0, i32 2
  %94 = load volatile i8, ptr %93, align 8, !tbaa !9, !range !24, !noundef !25
  %95 = trunc i8 %94 to i1
  %96 = xor i1 %95, true
  br label %97

97:                                               ; preds = %91, %86
  %98 = phi i1 [ false, %86 ], [ %96, %91 ]
  br i1 %98, label %99, label %112

99:                                               ; preds = %97
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.sh2_s, ptr %100, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !20
  call void @shtp_service(ptr noundef %102)
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.sh2_s, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !15
  %106 = getelementptr inbounds %struct.sh2_Hal_s, ptr %105, i32 0, i32 4
  %107 = load ptr, ptr %106, align 8, !tbaa !21
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.sh2_s, ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !15
  %111 = call i32 %107(ptr noundef %110)
  store i32 %111, ptr %11, align 4, !tbaa !23
  br label %86, !llvm.loop !26

112:                                              ; preds = %97
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %113

113:                                              ; preds = %112, %43, %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %114 = load i32, ptr %4, align 4
  ret i32 %114
}

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

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

declare ptr @shtp_open(ptr noundef) #3

declare void @shtp_setEventCallback(ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @shtpEventCallback(ptr noundef, i32 noundef) #0

declare i32 @shtp_listenAdvert(ptr noundef, i16 noundef zeroext, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @sensorhubAdvertHdlr(ptr noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef) #0

declare i32 @shtp_listenChan(ptr noundef, i16 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @sensorhubControlHdlr(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @sensorhubInputNormalHdlr(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @sensorhubInputWakeHdlr(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @sensorhubInputGyroRvHdlr(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @executableAdvertHdlr(ptr noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @executabLEDeviceHdlr(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef) #0

declare void @shtp_service(ptr noundef) #3

; 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !11, i64 16}
!10 = !{!"sh2_s", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 17, !7, i64 18, !7, i64 19, !7, i64 20, !7, i64 37, !6, i64 168, !12, i64 176, !7, i64 184, !7, i64 216, !7, i64 217, !7, i64 218, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !7, i64 256, !13, i64 544, !12, i64 548, !12, i64 552, !12, i64 556}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !7, i64 19}
!15 = !{!10, !6, i64 0}
!16 = !{!10, !6, i64 224}
!17 = !{!10, !6, i64 232}
!18 = !{!10, !6, i64 240}
!19 = !{!10, !6, i64 248}
!20 = !{!10, !6, i64 8}
!21 = !{!22, !6, i64 32}
!22 = !{!"sh2_Hal_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!23 = !{!12, !12, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = distinct !{!26, !27}
!27 = !{!"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"

%struct.sh2_s = type { ptr, ptr, i8, i8, i8, i8, [17 x i8], [64 x %struct.anon], ptr, i32, %union.sh2_OpData_t, i8, i8, i8, ptr, ptr, ptr, ptr, [72 x i32], i16, i32, i32, i32 }
%struct.anon = type { i8, i8 }
%union.sh2_OpData_t = type { %struct.anon.4 }
%struct.anon.4 = type { i16, ptr, ptr, i16 }

@_sh2 = external dso_local global %struct.sh2_s, align 8
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -2, 1) i32 @sh2_open(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %.critedge, label %5

5:                                                ; preds = %3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(560) getelementptr inbounds (i8, ptr @_sh2, i64 8), i8 0, i64 552, i1 false)
  store volatile i8 0, ptr getelementptr inbounds (i8, ptr @_sh2, i64 16), align 8, !tbaa !5
  store i8 -1, ptr getelementptr inbounds (i8, ptr @_sh2, i64 19), align 1, !tbaa !13
  store ptr %0, ptr @_sh2, align 8, !tbaa !14
  store ptr %1, ptr getelementptr inbounds (i8, ptr @_sh2, i64 224), align 8, !tbaa !15
  store ptr %2, ptr getelementptr inbounds (i8, ptr @_sh2, i64 232), align 8, !tbaa !16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_sh2, i64 240), i8 0, i64 16, i1 false)
  %6 = tail call ptr @shtp_open(ptr noundef nonnull %0) #3
  store ptr %6, ptr getelementptr inbounds (i8, ptr @_sh2, i64 8), align 8, !tbaa !17
  %7 = icmp eq ptr %6, null
  br i1 %7, label %.critedge, label %8

8:                                                ; preds = %5
  tail call void @shtp_setEventCallback(ptr noundef nonnull %6, ptr noundef nonnull @shtpEventCallback, ptr noundef nonnull @_sh2) #3
  %9 = load ptr, ptr getelementptr inbounds (i8, ptr @_sh2, i64 8), align 8, !tbaa !17
  %10 = tail call i32 @shtp_listenAdvert(ptr noundef %9, i16 noundef zeroext 2, ptr noundef nonnull @sensorhubAdvertHdlr, ptr noundef nonnull @_sh2) #3
  %11 = load ptr, ptr getelementptr inbounds (i8, ptr @_sh2, i64 8), align 8, !tbaa !17
  %12 = tail call i32 @shtp_listenChan(ptr noundef %11, i16 noundef zeroext 2, ptr noundef nonnull @.str, ptr noundef nonnull @sensorhubControlHdlr, ptr noundef nonnull @_sh2) #3
  %13 = load ptr, ptr getelementptr inbounds (i8, ptr @_sh2, i64 8), align 8, !tbaa !17
  %14 = tail call i32 @shtp_listenChan(ptr noundef %13, i16 noundef zeroext 2, ptr noundef nonnull @.str.1, ptr noundef nonnull @sensorhubInputNormalHdlr, ptr noundef nonnull @_sh2) #3
  %15 = load ptr, ptr getelementptr inbounds (i8, ptr @_sh2, i64 8), align 8, !tbaa !17
  %16 = tail call i32 @shtp_listenChan(ptr noundef %15, i16 noundef zeroext 2, ptr noundef nonnull @.str.2, ptr noundef nonnull @sensorhubInputWakeHdlr, ptr noundef nonnull @_sh2) #3
  %17 = load ptr, ptr getelementptr inbounds (i8, ptr @_sh2, i64 8), align 8, !tbaa !17
  %18 = tail call i32 @shtp_listenChan(ptr noundef %17, i16 noundef zeroext 2, ptr noundef nonnull @.str.3, ptr noundef nonnull @sensorhubInputGyroRvHdlr, ptr noundef nonnull @_sh2) #3
  %19 = load ptr, ptr getelementptr inbounds (i8, ptr @_sh2, i64 8), align 8, !tbaa !17
  %20 = tail call i32 @shtp_listenAdvert(ptr noundef %19, i16 noundef zeroext 1, ptr noundef nonnull @executableAdvertHdlr, ptr noundef nonnull @_sh2) #3
  %21 = load ptr, ptr getelementptr inbounds (i8, ptr @_sh2, i64 8), align 8, !tbaa !17
  %22 = tail call i32 @shtp_listenChan(ptr noundef %21, i16 noundef zeroext 1, ptr noundef nonnull @.str.4, ptr noundef nonnull @executabLEDeviceHdlr, ptr noundef nonnull @_sh2) #3
  %23 = load ptr, ptr @_sh2, align 8, !tbaa !14
  %24 = getelementptr inbounds i8, ptr %23, i64 32
  %25 = load ptr, ptr %24, align 8, !tbaa !18
  %26 = tail call i32 %25(ptr noundef %23) #3
  br label %27

27:                                               ; preds = %8, %30
  %28 = load volatile i8, ptr getelementptr inbounds (i8, ptr @_sh2, i64 16), align 8, !tbaa !5, !range !20, !noundef !21
  %29 = trunc nuw i8 %28 to i1
  br i1 %29, label %.critedge, label %30

30:                                               ; preds = %27
  %31 = load ptr, ptr getelementptr inbounds (i8, ptr @_sh2, i64 8), align 8, !tbaa !17
  tail call void @shtp_service(ptr noundef %31) #3
  %32 = load ptr, ptr @_sh2, align 8, !tbaa !14
  %33 = getelementptr inbounds i8, ptr %32, i64 32
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %35 = tail call i32 %34(ptr noundef %32) #3
  %36 = sub i32 %35, %26
  %37 = icmp ult i32 %36, 200000
  br i1 %37, label %27, label %.critedge, !llvm.loop !22

.critedge:                                        ; preds = %27, %30, %5, %3
  %.031 = phi i32 [ -2, %3 ], [ -1, %5 ], [ 0, %30 ], [ 0, %27 ]
  ret i32 %.031
}

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

declare ptr @shtp_open(ptr noundef) local_unnamed_addr #2

declare void @shtp_setEventCallback(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @shtpEventCallback(ptr noundef, i32 noundef) #0

declare i32 @shtp_listenAdvert(ptr noundef, i16 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @sensorhubAdvertHdlr(ptr noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef) #0

declare i32 @shtp_listenChan(ptr noundef, i16 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @sensorhubControlHdlr(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @sensorhubInputNormalHdlr(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @sensorhubInputWakeHdlr(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @sensorhubInputGyroRvHdlr(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @executableAdvertHdlr(ptr noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @executabLEDeviceHdlr(ptr noundef, ptr noundef, i16 noundef zeroext, i32 noundef) #0

declare void @shtp_service(ptr noundef) local_unnamed_addr #2

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 nounwind willreturn memory(argmem: write) }
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 }

!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, !10, i64 16}
!6 = !{!"sh2_s", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 17, !8, i64 18, !8, i64 19, !8, i64 20, !8, i64 37, !7, i64 168, !11, i64 176, !8, i64 184, !8, i64 216, !8, i64 217, !8, i64 218, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !8, i64 256, !12, i64 544, !11, i64 548, !11, i64 552, !11, i64 556}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_Bool", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!6, !8, i64 19}
!14 = !{!6, !7, i64 0}
!15 = !{!6, !7, i64 224}
!16 = !{!6, !7, i64 232}
!17 = !{!6, !7, i64 8}
!18 = !{!19, !7, i64 32}
!19 = !{!"sh2_Hal_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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