; LLVM IR from IOsonata/IOsonata :: src/sensors (accel_h3lis331dl)

; 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.__AccelSensor_Config = type <{ i32, i32, i32, i16, i32, i8, i32, ptr }>
%class.Device = type { ptr, i8, i32, ptr, ptr, i64, i8, ptr, i8, i32 }
%class.Sensor = type <{ ptr, i32, i32, i32, i32, i64, i8, [7 x i8], i64, i64, i32, i32, i32, i32, %"struct.std::atomic_flag", [7 x i8], %class.Device }>
%"struct.std::atomic_flag" = type { %"struct.std::__atomic_flag_base" }
%"struct.std::__atomic_flag_base" = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN15AccelH3lis331dl4InitERK20__AccelSensor_ConfigP11DeviceIntrfP5Timer(ptr noundef nonnull align 8 dereferenceable(156) %0, ptr noundef nonnull align 1 dereferenceable(31) %1, ptr noundef %2, ptr noundef %3) unnamed_addr #0 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %13 = load ptr, ptr %6, align 8
  %14 = load ptr, ptr %8, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %4
  store i1 false, ptr %5, align 1
  br label %264

17:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #3
  %18 = load ptr, ptr %13, align 8, !tbaa !9
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr %13, i64 %20
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN6Device9InterfaceEP11DeviceIntrf(ptr noundef nonnull align 8 dereferenceable(64) %21, ptr noundef %22)
  %23 = load ptr, ptr %13, align 8, !tbaa !9
  %24 = getelementptr i8, ptr %23, i64 -24
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr %13, i64 %25
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.__AccelSensor_Config, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 1, !tbaa !11
  %30 = load ptr, ptr %26, align 8, !tbaa !9
  %31 = getelementptr inbounds ptr, ptr %30, i64 6
  %32 = load ptr, ptr %31, align 8
  call void %32(ptr noundef nonnull align 8 dereferenceable(64) %26, i32 noundef %29)
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %42

35:                                               ; preds = %17
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = load ptr, ptr %13, align 8, !tbaa !9
  %38 = getelementptr i8, ptr %37, i64 -24
  %39 = load i64, ptr %38, align 8
  %40 = getelementptr inbounds i8, ptr %13, i64 %39
  %41 = getelementptr inbounds %class.Device, ptr %40, i32 0, i32 4
  store ptr %36, ptr %41, align 8, !tbaa !17
  br label %42

42:                                               ; preds = %35, %17
  %43 = load ptr, ptr %13, align 8, !tbaa !9
  %44 = getelementptr inbounds ptr, ptr %43, i64 28
  %45 = load ptr, ptr %44, align 8
  call void %45(ptr noundef nonnull align 8 dereferenceable(156) %13)
  %46 = load ptr, ptr %13, align 8, !tbaa !9
  %47 = getelementptr i8, ptr %46, i64 -24
  %48 = load i64, ptr %47, align 8
  %49 = getelementptr inbounds i8, ptr %13, i64 %48
  %50 = getelementptr inbounds %class.Device, ptr %49, i32 0, i32 3
  %51 = load ptr, ptr %50, align 8, !tbaa !22
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds ptr, ptr %52, i64 1
  %54 = load ptr, ptr %53, align 8
  %55 = call noundef i32 %54(ptr noundef nonnull align 8 dereferenceable(8) %51)
  %56 = icmp eq i32 %55, 6
  br i1 %56, label %73, label %57

57:                                               ; preds = %42
  %58 = load ptr, ptr %13, align 8, !tbaa !9
  %59 = getelementptr i8, ptr %58, i64 -24
  %60 = load i64, ptr %59, align 8
  %61 = getelementptr inbounds i8, ptr %13, i64 %60
  %62 = getelementptr inbounds %class.Device, ptr %61, i32 0, i32 2
  %63 = load i32, ptr %62, align 4, !tbaa !23
  %64 = icmp ne i32 %63, 24
  br i1 %64, label %65, label %107

65:                                               ; preds = %57
  %66 = load ptr, ptr %13, align 8, !tbaa !9
  %67 = getelementptr i8, ptr %66, i64 -24
  %68 = load i64, ptr %67, align 8
  %69 = getelementptr inbounds i8, ptr %13, i64 %68
  %70 = getelementptr inbounds %class.Device, ptr %69, i32 0, i32 2
  %71 = load i32, ptr %70, align 4, !tbaa !23
  %72 = icmp ne i32 %71, 25
  br i1 %72, label %73, label %107

73:                                               ; preds = %65, %42
  store i8 35, ptr %10, align 1, !tbaa !24
  %74 = load ptr, ptr %13, align 8, !tbaa !9
  %75 = getelementptr i8, ptr %74, i64 -24
  %76 = load i64, ptr %75, align 8
  %77 = getelementptr inbounds i8, ptr %13, i64 %76
  %78 = getelementptr inbounds %class.Device, ptr %77, i32 0, i32 3
  %79 = load ptr, ptr %78, align 8, !tbaa !22
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  %81 = getelementptr inbounds ptr, ptr %80, i64 22
  %82 = load ptr, ptr %81, align 8
  %83 = call noundef i32 %82(ptr noundef nonnull align 8 dereferenceable(344) %79)
  %84 = icmp eq i32 %83, 1
  br i1 %84, label %85, label %106

85:                                               ; preds = %73
  %86 = load ptr, ptr %13, align 8, !tbaa !9
  %87 = getelementptr i8, ptr %86, i64 -24
  %88 = load i64, ptr %87, align 8
  %89 = getelementptr inbounds i8, ptr %13, i64 %88
  %90 = load ptr, ptr %89, align 8, !tbaa !9
  %91 = getelementptr inbounds ptr, ptr %90, i64 11
  %92 = load ptr, ptr %91, align 8
  %93 = call noundef zeroext i8 %92(ptr noundef nonnull align 8 dereferenceable(64) %89, ptr noundef %10, i32 noundef 1)
  %94 = zext i8 %93 to i32
  %95 = or i32 %94, 1
  %96 = trunc i32 %95 to i8
  store i8 %96, ptr %11, align 1, !tbaa !24
  %97 = load ptr, ptr %13, align 8, !tbaa !9
  %98 = getelementptr i8, ptr %97, i64 -24
  %99 = load i64, ptr %98, align 8
  %100 = getelementptr inbounds i8, ptr %13, i64 %99
  %101 = load i8, ptr %11, align 1, !tbaa !24
  %102 = load ptr, ptr %100, align 8, !tbaa !9
  %103 = getelementptr inbounds ptr, ptr %102, i64 14
  %104 = load ptr, ptr %103, align 8
  %105 = call noundef zeroext i1 %104(ptr noundef nonnull align 8 dereferenceable(64) %100, ptr noundef %10, i32 noundef 1, i8 noundef zeroext %101)
  br label %106

106:                                              ; preds = %85, %73
  br label %107

107:                                              ; preds = %106, %65, %57
  store i8 15, ptr %10, align 1, !tbaa !24
  %108 = load ptr, ptr %13, align 8, !tbaa !9
  %109 = getelementptr i8, ptr %108, i64 -24
  %110 = load i64, ptr %109, align 8
  %111 = getelementptr inbounds i8, ptr %13, i64 %110
  %112 = load ptr, ptr %111, align 8, !tbaa !9
  %113 = getelementptr inbounds ptr, ptr %112, i64 11
  %114 = load ptr, ptr %113, align 8
  %115 = call noundef zeroext i8 %114(ptr noundef nonnull align 8 dereferenceable(64) %111, ptr noundef %10, i32 noundef 1)
  store i8 %115, ptr %11, align 1, !tbaa !24
  %116 = load i8, ptr %11, align 1, !tbaa !24
  %117 = zext i8 %116 to i32
  %118 = icmp ne i32 %117, 50
  br i1 %118, label %119, label %120

119:                                              ; preds = %107
  store i1 false, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %263

120:                                              ; preds = %107
  %121 = load ptr, ptr %13, align 8, !tbaa !9
  %122 = getelementptr i8, ptr %121, i64 -24
  %123 = load i64, ptr %122, align 8
  %124 = getelementptr inbounds i8, ptr %13, i64 %123
  %125 = load i8, ptr %11, align 1, !tbaa !24
  %126 = zext i8 %125 to i64
  call void @_ZN6Device8DeviceIDEm(ptr noundef nonnull align 8 dereferenceable(64) %124, i64 noundef %126)
  %127 = load ptr, ptr %13, align 8, !tbaa !9
  %128 = getelementptr i8, ptr %127, i64 -24
  %129 = load i64, ptr %128, align 8
  %130 = getelementptr inbounds i8, ptr %13, i64 %129
  call void @_ZN6Device5ValidEb(ptr noundef nonnull align 8 dereferenceable(64) %130, i1 noundef zeroext true)
  %131 = load ptr, ptr %13, align 8, !tbaa !9
  %132 = getelementptr inbounds ptr, ptr %131, i64 14
  %133 = load ptr, ptr %132, align 8
  %134 = call noundef i32 %133(ptr noundef nonnull align 8 dereferenceable(156) %13, i32 noundef 32767)
  store i8 35, ptr %10, align 1, !tbaa !24
  %135 = load ptr, ptr %13, align 8, !tbaa !9
  %136 = getelementptr i8, ptr %135, i64 -24
  %137 = load i64, ptr %136, align 8
  %138 = getelementptr inbounds i8, ptr %13, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !9
  %140 = getelementptr inbounds ptr, ptr %139, i64 11
  %141 = load ptr, ptr %140, align 8
  %142 = call noundef zeroext i8 %141(ptr noundef nonnull align 8 dereferenceable(64) %138, ptr noundef %10, i32 noundef 1)
  %143 = zext i8 %142 to i32
  %144 = and i32 %143, -129
  %145 = trunc i32 %144 to i8
  store i8 %145, ptr %11, align 1, !tbaa !24
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.__AccelSensor_Config, ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 1, !tbaa !25
  %149 = icmp eq i32 %148, 0
  br i1 %149, label %150, label %163

150:                                              ; preds = %120
  %151 = load ptr, ptr %13, align 8, !tbaa !9
  %152 = getelementptr i8, ptr %151, i64 -24
  %153 = load i64, ptr %152, align 8
  %154 = getelementptr inbounds i8, ptr %13, i64 %153
  %155 = load i8, ptr %11, align 1, !tbaa !24
  %156 = zext i8 %155 to i32
  %157 = or i32 %156, 128
  %158 = trunc i32 %157 to i8
  %159 = load ptr, ptr %154, align 8, !tbaa !9
  %160 = getelementptr inbounds ptr, ptr %159, i64 14
  %161 = load ptr, ptr %160, align 8
  %162 = call noundef zeroext i1 %161(ptr noundef nonnull align 8 dereferenceable(64) %154, ptr noundef %10, i32 noundef 1, i8 noundef zeroext %158)
  br label %163

163:                                              ; preds = %150, %120
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.__AccelSensor_Config, ptr %164, i32 0, i32 1
  %166 = load i32, ptr %165, align 1, !tbaa !25
  %167 = getelementptr inbounds %class.Sensor, ptr %13, i32 0, i32 3
  store i32 %166, ptr %167, align 8, !tbaa !26
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.__AccelSensor_Config, ptr %168, i32 0, i32 2
  %170 = load i32, ptr %169, align 1, !tbaa !31
  %171 = load ptr, ptr %13, align 8, !tbaa !9
  %172 = getelementptr inbounds ptr, ptr %171, i64 7
  %173 = load ptr, ptr %172, align 8
  %174 = call noundef i32 %173(ptr noundef nonnull align 8 dereferenceable(156) %13, i32 noundef %170)
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.__AccelSensor_Config, ptr %175, i32 0, i32 3
  %177 = load i16, ptr %176, align 1, !tbaa !32
  %178 = load ptr, ptr %13, align 8, !tbaa !9
  %179 = getelementptr inbounds ptr, ptr %178, i64 21
  %180 = load ptr, ptr %179, align 8
  %181 = call noundef zeroext i16 %180(ptr noundef nonnull align 8 dereferenceable(156) %13, i16 noundef zeroext %177)
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.__AccelSensor_Config, ptr %182, i32 0, i32 4
  %184 = load i32, ptr %183, align 1, !tbaa !33
  %185 = load ptr, ptr %13, align 8, !tbaa !9
  %186 = getelementptr inbounds ptr, ptr %185, i64 12
  %187 = load ptr, ptr %186, align 8
  %188 = call noundef i32 %187(ptr noundef nonnull align 8 dereferenceable(156) %13, i32 noundef %184)
  %189 = load ptr, ptr %7, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.__AccelSensor_Config, ptr %189, i32 0, i32 5
  %191 = load i8, ptr %190, align 1, !tbaa !34
  %192 = icmp ne i8 %191, 0
  br i1 %192, label %193, label %240

193:                                              ; preds = %163
  store i8 34, ptr %10, align 1, !tbaa !24
  %194 = load ptr, ptr %13, align 8, !tbaa !9
  %195 = getelementptr i8, ptr %194, i64 -24
  %196 = load i64, ptr %195, align 8
  %197 = getelementptr inbounds i8, ptr %13, i64 %196
  %198 = load ptr, ptr %197, align 8, !tbaa !9
  %199 = getelementptr inbounds ptr, ptr %198, i64 11
  %200 = load ptr, ptr %199, align 8
  %201 = call noundef zeroext i8 %200(ptr noundef nonnull align 8 dereferenceable(64) %197, ptr noundef %10, i32 noundef 1)
  %202 = zext i8 %201 to i32
  %203 = and i32 %202, -193
  %204 = trunc i32 %203 to i8
  store i8 %204, ptr %11, align 1, !tbaa !24
  %205 = load ptr, ptr %7, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.__AccelSensor_Config, ptr %205, i32 0, i32 6
  %207 = load i32, ptr %206, align 1, !tbaa !35
  %208 = icmp eq i32 %207, 0
  br i1 %208, label %209, label %214

209:                                              ; preds = %193
  %210 = load i8, ptr %11, align 1, !tbaa !24
  %211 = zext i8 %210 to i32
  %212 = or i32 %211, 128
  %213 = trunc i32 %212 to i8
  store i8 %213, ptr %11, align 1, !tbaa !24
  br label %214

214:                                              ; preds = %209, %193
  %215 = load ptr, ptr %13, align 8, !tbaa !9
  %216 = getelementptr i8, ptr %215, i64 -24
  %217 = load i64, ptr %216, align 8
  %218 = getelementptr inbounds i8, ptr %13, i64 %217
  %219 = load i8, ptr %11, align 1, !tbaa !24
  %220 = load ptr, ptr %218, align 8, !tbaa !9
  %221 = getelementptr inbounds ptr, ptr %220, i64 14
  %222 = load ptr, ptr %221, align 8
  %223 = call noundef zeroext i1 %222(ptr noundef nonnull align 8 dereferenceable(64) %218, ptr noundef %10, i32 noundef 1, i8 noundef zeroext %219)
  store i8 48, ptr %10, align 1, !tbaa !24
  %224 = load ptr, ptr %13, align 8, !tbaa !9
  %225 = getelementptr i8, ptr %224, i64 -24
  %226 = load i64, ptr %225, align 8
  %227 = getelementptr inbounds i8, ptr %13, i64 %226
  %228 = load ptr, ptr %227, align 8, !tbaa !9
  %229 = getelementptr inbounds ptr, ptr %228, i64 14
  %230 = load ptr, ptr %229, align 8
  %231 = call noundef zeroext i1 %230(ptr noundef nonnull align 8 dereferenceable(64) %227, ptr noundef %10, i32 noundef 1, i8 noundef zeroext 63)
  store i8 52, ptr %10, align 1, !tbaa !24
  %232 = load ptr, ptr %13, align 8, !tbaa !9
  %233 = getelementptr i8, ptr %232, i64 -24
  %234 = load i64, ptr %233, align 8
  %235 = getelementptr inbounds i8, ptr %13, i64 %234
  %236 = load ptr, ptr %235, align 8, !tbaa !9
  %237 = getelementptr inbounds ptr, ptr %236, i64 14
  %238 = load ptr, ptr %237, align 8
  %239 = call noundef zeroext i1 %238(ptr noundef nonnull align 8 dereferenceable(64) %235, ptr noundef %10, i32 noundef 1, i8 noundef zeroext 63)
  br label %240

240:                                              ; preds = %214, %163
  store i8 32, ptr %10, align 1, !tbaa !24
  %241 = load ptr, ptr %13, align 8, !tbaa !9
  %242 = getelementptr i8, ptr %241, i64 -24
  %243 = load i64, ptr %242, align 8
  %244 = getelementptr inbounds i8, ptr %13, i64 %243
  %245 = load ptr, ptr %244, align 8, !tbaa !9
  %246 = getelementptr inbounds ptr, ptr %245, i64 11
  %247 = load ptr, ptr %246, align 8
  %248 = call noundef zeroext i8 %247(ptr noundef nonnull align 8 dereferenceable(64) %244, ptr noundef %10, i32 noundef 1)
  %249 = zext i8 %248 to i32
  %250 = or i32 %249, 1
  %251 = or i32 %250, 2
  %252 = or i32 %251, 4
  %253 = trunc i32 %252 to i8
  store i8 %253, ptr %11, align 1, !tbaa !24
  %254 = load ptr, ptr %13, align 8, !tbaa !9
  %255 = getelementptr i8, ptr %254, i64 -24
  %256 = load i64, ptr %255, align 8
  %257 = getelementptr inbounds i8, ptr %13, i64 %256
  %258 = load i8, ptr %11, align 1, !tbaa !24
  %259 = load ptr, ptr %257, align 8, !tbaa !9
  %260 = getelementptr inbounds ptr, ptr %259, i64 14
  %261 = load ptr, ptr %260, align 8
  %262 = call noundef zeroext i1 %261(ptr noundef nonnull align 8 dereferenceable(64) %257, ptr noundef %10, i32 noundef 1, i8 noundef zeroext %258)
  store i1 true, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %263

263:                                              ; preds = %240, %119
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  br label %264

264:                                              ; preds = %263, %16
  %265 = load i1, ptr %5, align 1
  ret i1 %265
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Device9InterfaceEP11DeviceIntrf(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Device8DeviceIDEm(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Device5ValidEb(ptr noundef nonnull align 8 dereferenceable(64), i1 noundef zeroext) #2 align 2

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

attributes #0 = { mustprogress 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 = { mustprogress 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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS20__AccelSensor_Config", !13, i64 0, !14, i64 4, !13, i64 8, !15, i64 12, !13, i64 14, !7, i64 18, !16, i64 19, !6, i64 23}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS15__Sensor_OpMode", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!"_ZTS24__Dev_Interrupt_Polarity", !7, i64 0}
!17 = !{!18, !6, i64 24}
!18 = !{!"_ZTS6Device", !19, i64 8, !13, i64 12, !6, i64 16, !6, i64 24, !20, i64 32, !19, i64 40, !6, i64 48, !7, i64 56, !21, i64 60}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTS21__Dev_Data_Byte_Order", !7, i64 0}
!22 = !{!18, !6, i64 16}
!23 = !{!18, !13, i64 12}
!24 = !{!7, !7, i64 0}
!25 = !{!12, !14, i64 4}
!26 = !{!27, !14, i64 16}
!27 = !{!"_ZTS6Sensor", !13, i64 8, !28, i64 12, !14, i64 16, !13, i64 20, !20, i64 24, !19, i64 32, !20, i64 40, !20, i64 48, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !29, i64 72}
!28 = !{!"_ZTS14__Sensor_State", !7, i64 0}
!29 = !{!"_ZTSSt11atomic_flag", !30, i64 0}
!30 = !{!"_ZTSSt18__atomic_flag_base", !19, i64 0}
!31 = !{!12, !13, i64 8}
!32 = !{!12, !15, i64 12}
!33 = !{!12, !13, i64 14}
!34 = !{!12, !7, i64 18}
!35 = !{!12, !16, i64 19}


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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN15AccelH3lis331dl4InitERK20__AccelSensor_ConfigP11DeviceIntrfP5Timer(ptr noundef nonnull align 8 dereferenceable(156) %0, ptr nocapture noundef nonnull readonly align 1 dereferenceable(31) %1, ptr noundef %2, ptr noundef %3) unnamed_addr #0 align 2 {
  %5 = alloca i8, align 1
  %6 = icmp eq ptr %2, null
  br i1 %6, label %192, label %7

7:                                                ; preds = %4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  %8 = load ptr, ptr %0, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr %0, i64 %10
  tail call void @_ZN6Device9InterfaceEP11DeviceIntrf(ptr noundef nonnull align 8 dereferenceable(64) %11, ptr noundef nonnull %2)
  %12 = load ptr, ptr %0, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr %0, i64 %14
  %16 = load i32, ptr %1, align 1, !tbaa !8
  %17 = load ptr, ptr %15, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 48
  %19 = load ptr, ptr %18, align 8
  tail call void %19(ptr noundef nonnull align 8 dereferenceable(64) %15, i32 noundef %16)
  %.not = icmp eq ptr %3, null
  %.pre = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not, label %25, label %20

20:                                               ; preds = %7
  %21 = getelementptr i8, ptr %.pre, i64 -24
  %22 = load i64, ptr %21, align 8
  %23 = getelementptr inbounds i8, ptr %0, i64 %22
  %24 = getelementptr inbounds i8, ptr %23, i64 24
  store ptr %3, ptr %24, align 8, !tbaa !16
  br label %25

25:                                               ; preds = %20, %7
  %26 = getelementptr inbounds i8, ptr %.pre, i64 224
  %27 = load ptr, ptr %26, align 8
  tail call void %27(ptr noundef nonnull align 8 dereferenceable(156) %0)
  %28 = load ptr, ptr %0, align 8, !tbaa !5
  %29 = getelementptr i8, ptr %28, i64 -24
  %30 = load i64, ptr %29, align 8
  %31 = getelementptr inbounds i8, ptr %0, i64 %30
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  %33 = load ptr, ptr %32, align 8, !tbaa !21
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  %36 = load ptr, ptr %35, align 8
  %37 = tail call noundef i32 %36(ptr noundef nonnull align 8 dereferenceable(8) %33)
  %38 = icmp eq i32 %37, 6
  %.pre28 = load ptr, ptr %0, align 8, !tbaa !5
  %.phi.trans.insert = getelementptr i8, ptr %.pre28, i64 -24
  %.pre29 = load i64, ptr %.phi.trans.insert, align 8
  br i1 %38, label %._crit_edge, label %39

39:                                               ; preds = %25
  %40 = getelementptr inbounds i8, ptr %0, i64 %.pre29
  %41 = getelementptr inbounds i8, ptr %40, i64 12
  %42 = load i32, ptr %41, align 4, !tbaa !22
  %43 = and i32 %42, -2
  %switch = icmp eq i32 %43, 24
  br i1 %switch, label %69, label %._crit_edge

._crit_edge:                                      ; preds = %25, %39
  store i8 35, ptr %5, align 1, !tbaa !23
  %44 = getelementptr inbounds i8, ptr %0, i64 %.pre29
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %46 = load ptr, ptr %45, align 8, !tbaa !21
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i64 176
  %49 = load ptr, ptr %48, align 8
  %50 = tail call noundef i32 %49(ptr noundef nonnull align 8 dereferenceable(344) %46)
  %51 = icmp eq i32 %50, 1
  %.pre31 = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %51, label %52, label %69

52:                                               ; preds = %._crit_edge
  %53 = getelementptr i8, ptr %.pre31, i64 -24
  %54 = load i64, ptr %53, align 8
  %55 = getelementptr inbounds i8, ptr %0, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %56, i64 88
  %58 = load ptr, ptr %57, align 8
  %59 = call noundef zeroext i8 %58(ptr noundef nonnull align 8 dereferenceable(64) %55, ptr noundef nonnull %5, i32 noundef 1)
  %60 = or i8 %59, 1
  %61 = load ptr, ptr %0, align 8, !tbaa !5
  %62 = getelementptr i8, ptr %61, i64 -24
  %63 = load i64, ptr %62, align 8
  %64 = getelementptr inbounds i8, ptr %0, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %65, i64 112
  %67 = load ptr, ptr %66, align 8
  %68 = call noundef zeroext i1 %67(ptr noundef nonnull align 8 dereferenceable(64) %64, ptr noundef nonnull %5, i32 noundef 1, i8 noundef zeroext %60)
  %.pre30 = load ptr, ptr %0, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %39, %._crit_edge, %52
  %70 = phi ptr [ %.pre28, %39 ], [ %.pre31, %._crit_edge ], [ %.pre30, %52 ]
  store i8 15, ptr %5, align 1, !tbaa !23
  %71 = getelementptr i8, ptr %70, i64 -24
  %72 = load i64, ptr %71, align 8
  %73 = getelementptr inbounds i8, ptr %0, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %74, i64 88
  %76 = load ptr, ptr %75, align 8
  %77 = call noundef zeroext i8 %76(ptr noundef nonnull align 8 dereferenceable(64) %73, ptr noundef nonnull %5, i32 noundef 1)
  %.not26 = icmp eq i8 %77, 50
  br i1 %.not26, label %78, label %191

78:                                               ; preds = %69
  %79 = load ptr, ptr %0, align 8, !tbaa !5
  %80 = getelementptr i8, ptr %79, i64 -24
  %81 = load i64, ptr %80, align 8
  %82 = getelementptr inbounds i8, ptr %0, i64 %81
  call void @_ZN6Device8DeviceIDEm(ptr noundef nonnull align 8 dereferenceable(64) %82, i64 noundef 50)
  %83 = load ptr, ptr %0, align 8, !tbaa !5
  %84 = getelementptr i8, ptr %83, i64 -24
  %85 = load i64, ptr %84, align 8
  %86 = getelementptr inbounds i8, ptr %0, i64 %85
  call void @_ZN6Device5ValidEb(ptr noundef nonnull align 8 dereferenceable(64) %86, i1 noundef zeroext true)
  %87 = load ptr, ptr %0, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 112
  %89 = load ptr, ptr %88, align 8
  %90 = call noundef i32 %89(ptr noundef nonnull align 8 dereferenceable(156) %0, i32 noundef 32767)
  store i8 35, ptr %5, align 1, !tbaa !23
  %91 = load ptr, ptr %0, align 8, !tbaa !5
  %92 = getelementptr i8, ptr %91, i64 -24
  %93 = load i64, ptr %92, align 8
  %94 = getelementptr inbounds i8, ptr %0, i64 %93
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i64 88
  %97 = load ptr, ptr %96, align 8
  %98 = call noundef zeroext i8 %97(ptr noundef nonnull align 8 dereferenceable(64) %94, ptr noundef nonnull %5, i32 noundef 1)
  %99 = getelementptr inbounds i8, ptr %1, i64 4
  %100 = load i32, ptr %99, align 1, !tbaa !24
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %112

102:                                              ; preds = %78
  %103 = load ptr, ptr %0, align 8, !tbaa !5
  %104 = getelementptr i8, ptr %103, i64 -24
  %105 = load i64, ptr %104, align 8
  %106 = getelementptr inbounds i8, ptr %0, i64 %105
  %107 = or i8 %98, -128
  %108 = load ptr, ptr %106, align 8, !tbaa !5
  %109 = getelementptr inbounds i8, ptr %108, i64 112
  %110 = load ptr, ptr %109, align 8
  %111 = call noundef zeroext i1 %110(ptr noundef nonnull align 8 dereferenceable(64) %106, ptr noundef nonnull %5, i32 noundef 1, i8 noundef zeroext %107)
  %.pre32 = load i32, ptr %99, align 1, !tbaa !24
  br label %112

112:                                              ; preds = %102, %78
  %113 = phi i32 [ %.pre32, %102 ], [ %100, %78 ]
  %114 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %113, ptr %114, align 8, !tbaa !25
  %115 = getelementptr inbounds i8, ptr %1, i64 8
  %116 = load i32, ptr %115, align 1, !tbaa !30
  %117 = load ptr, ptr %0, align 8, !tbaa !5
  %118 = getelementptr inbounds i8, ptr %117, i64 56
  %119 = load ptr, ptr %118, align 8
  %120 = call noundef i32 %119(ptr noundef nonnull align 8 dereferenceable(156) %0, i32 noundef %116)
  %121 = getelementptr inbounds i8, ptr %1, i64 12
  %122 = load i16, ptr %121, align 1, !tbaa !31
  %123 = load ptr, ptr %0, align 8, !tbaa !5
  %124 = getelementptr inbounds i8, ptr %123, i64 168
  %125 = load ptr, ptr %124, align 8
  %126 = call noundef zeroext i16 %125(ptr noundef nonnull align 8 dereferenceable(156) %0, i16 noundef zeroext %122)
  %127 = getelementptr inbounds i8, ptr %1, i64 14
  %128 = load i32, ptr %127, align 1, !tbaa !32
  %129 = load ptr, ptr %0, align 8, !tbaa !5
  %130 = getelementptr inbounds i8, ptr %129, i64 96
  %131 = load ptr, ptr %130, align 8
  %132 = call noundef i32 %131(ptr noundef nonnull align 8 dereferenceable(156) %0, i32 noundef %128)
  %133 = getelementptr inbounds i8, ptr %1, i64 18
  %134 = load i8, ptr %133, align 1, !tbaa !33
  %.not27 = icmp eq i8 %134, 0
  br i1 %.not27, label %173, label %135

135:                                              ; preds = %112
  store i8 34, ptr %5, align 1, !tbaa !23
  %136 = load ptr, ptr %0, align 8, !tbaa !5
  %137 = getelementptr i8, ptr %136, i64 -24
  %138 = load i64, ptr %137, align 8
  %139 = getelementptr inbounds i8, ptr %0, i64 %138
  %140 = load ptr, ptr %139, align 8, !tbaa !5
  %141 = getelementptr inbounds i8, ptr %140, i64 88
  %142 = load ptr, ptr %141, align 8
  %143 = call noundef zeroext i8 %142(ptr noundef nonnull align 8 dereferenceable(64) %139, ptr noundef nonnull %5, i32 noundef 1)
  %144 = and i8 %143, 63
  %145 = getelementptr inbounds i8, ptr %1, i64 19
  %146 = load i32, ptr %145, align 1, !tbaa !34
  %147 = icmp eq i32 %146, 0
  %148 = or disjoint i8 %144, -128
  %spec.select = select i1 %147, i8 %148, i8 %144
  %149 = load ptr, ptr %0, align 8, !tbaa !5
  %150 = getelementptr i8, ptr %149, i64 -24
  %151 = load i64, ptr %150, align 8
  %152 = getelementptr inbounds i8, ptr %0, i64 %151
  %153 = load ptr, ptr %152, align 8, !tbaa !5
  %154 = getelementptr inbounds i8, ptr %153, i64 112
  %155 = load ptr, ptr %154, align 8
  %156 = call noundef zeroext i1 %155(ptr noundef nonnull align 8 dereferenceable(64) %152, ptr noundef nonnull %5, i32 noundef 1, i8 noundef zeroext %spec.select)
  store i8 48, ptr %5, align 1, !tbaa !23
  %157 = load ptr, ptr %0, align 8, !tbaa !5
  %158 = getelementptr i8, ptr %157, i64 -24
  %159 = load i64, ptr %158, align 8
  %160 = getelementptr inbounds i8, ptr %0, i64 %159
  %161 = load ptr, ptr %160, align 8, !tbaa !5
  %162 = getelementptr inbounds i8, ptr %161, i64 112
  %163 = load ptr, ptr %162, align 8
  %164 = call noundef zeroext i1 %163(ptr noundef nonnull align 8 dereferenceable(64) %160, ptr noundef nonnull %5, i32 noundef 1, i8 noundef zeroext 63)
  store i8 52, ptr %5, align 1, !tbaa !23
  %165 = load ptr, ptr %0, align 8, !tbaa !5
  %166 = getelementptr i8, ptr %165, i64 -24
  %167 = load i64, ptr %166, align 8
  %168 = getelementptr inbounds i8, ptr %0, i64 %167
  %169 = load ptr, ptr %168, align 8, !tbaa !5
  %170 = getelementptr inbounds i8, ptr %169, i64 112
  %171 = load ptr, ptr %170, align 8
  %172 = call noundef zeroext i1 %171(ptr noundef nonnull align 8 dereferenceable(64) %168, ptr noundef nonnull %5, i32 noundef 1, i8 noundef zeroext 63)
  br label %173

173:                                              ; preds = %135, %112
  store i8 32, ptr %5, align 1, !tbaa !23
  %174 = load ptr, ptr %0, align 8, !tbaa !5
  %175 = getelementptr i8, ptr %174, i64 -24
  %176 = load i64, ptr %175, align 8
  %177 = getelementptr inbounds i8, ptr %0, i64 %176
  %178 = load ptr, ptr %177, align 8, !tbaa !5
  %179 = getelementptr inbounds i8, ptr %178, i64 88
  %180 = load ptr, ptr %179, align 8
  %181 = call noundef zeroext i8 %180(ptr noundef nonnull align 8 dereferenceable(64) %177, ptr noundef nonnull %5, i32 noundef 1)
  %182 = or i8 %181, 7
  %183 = load ptr, ptr %0, align 8, !tbaa !5
  %184 = getelementptr i8, ptr %183, i64 -24
  %185 = load i64, ptr %184, align 8
  %186 = getelementptr inbounds i8, ptr %0, i64 %185
  %187 = load ptr, ptr %186, align 8, !tbaa !5
  %188 = getelementptr inbounds i8, ptr %187, i64 112
  %189 = load ptr, ptr %188, align 8
  %190 = call noundef zeroext i1 %189(ptr noundef nonnull align 8 dereferenceable(64) %186, ptr noundef nonnull %5, i32 noundef 1, i8 noundef zeroext %182)
  br label %191

191:                                              ; preds = %69, %173
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  br label %192

192:                                              ; preds = %4, %191
  %.1 = phi i1 [ %.not26, %191 ], [ false, %4 ]
  ret i1 %.1
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Device9InterfaceEP11DeviceIntrf(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Device8DeviceIDEm(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Device5ValidEb(ptr noundef nonnull align 8 dereferenceable(64), i1 noundef zeroext) local_unnamed_addr #2 align 2

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

attributes #0 = { mustprogress 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 = { mustprogress 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 #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, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 0}
!9 = !{!"_ZTS20__AccelSensor_Config", !10, i64 0, !12, i64 4, !10, i64 8, !13, i64 12, !10, i64 14, !11, i64 18, !14, i64 19, !15, i64 23}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"_ZTS15__Sensor_OpMode", !11, i64 0}
!13 = !{!"short", !11, i64 0}
!14 = !{!"_ZTS24__Dev_Interrupt_Polarity", !11, i64 0}
!15 = !{!"any pointer", !11, i64 0}
!16 = !{!17, !15, i64 24}
!17 = !{!"_ZTS6Device", !18, i64 8, !10, i64 12, !15, i64 16, !15, i64 24, !19, i64 32, !18, i64 40, !15, i64 48, !11, i64 56, !20, i64 60}
!18 = !{!"bool", !11, i64 0}
!19 = !{!"long", !11, i64 0}
!20 = !{!"_ZTS21__Dev_Data_Byte_Order", !11, i64 0}
!21 = !{!17, !15, i64 16}
!22 = !{!17, !10, i64 12}
!23 = !{!11, !11, i64 0}
!24 = !{!9, !12, i64 4}
!25 = !{!26, !12, i64 16}
!26 = !{!"_ZTS6Sensor", !10, i64 8, !27, i64 12, !12, i64 16, !10, i64 20, !19, i64 24, !18, i64 32, !19, i64 40, !19, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !28, i64 72}
!27 = !{!"_ZTS14__Sensor_State", !11, i64 0}
!28 = !{!"_ZTSSt11atomic_flag", !29, i64 0}
!29 = !{!"_ZTSSt18__atomic_flag_base", !18, i64 0}
!30 = !{!9, !10, i64 8}
!31 = !{!9, !13, i64 12}
!32 = !{!9, !10, i64 14}
!33 = !{!9, !11, i64 18}
!34 = !{!9, !14, i64 19}


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