; LLVM IR from devicehive/esp8266-firmware :: firmware-src/sources/devices (mpu6050)

; 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.MPU6050_XYZ = type { float, float, float }

@mpu6050_read.str = external hidden constant [31 x i8], align 4
@mAddress = external hidden global i32, align 4
@mpu6050_read.str.1 = external hidden constant [28 x i8], align 4
@mpu6050_read.str.2 = external hidden constant [43 x i8], align 4
@mpu6050_read.str.3 = external hidden constant [39 x i8], align 4
@mpu6050_read.str.4 = external hidden constant [37 x i8], align 4
@mpu6050_read.str.5 = external hidden constant [24 x i8], align 4
@mpu6050_read.str.6 = external hidden constant [28 x i8], align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @mpu6050_read(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca [16 x i8], align 16
  store i32 %0, ptr %7, align 4, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %15 = load i32, ptr %7, align 4, !tbaa !5
  %16 = icmp ne i32 %15, -1
  br i1 %16, label %17, label %31

17:                                               ; preds = %5
  %18 = load i32, ptr %8, align 4, !tbaa !5
  %19 = icmp ne i32 %18, -1
  br i1 %19, label %20, label %31

20:                                               ; preds = %17
  %21 = load i32, ptr %7, align 4, !tbaa !5
  %22 = load i32, ptr %8, align 4, !tbaa !5
  %23 = call i32 @dh_i2c_init(i32 noundef %21, i32 noundef %22)
  store i32 %23, ptr %12, align 4, !tbaa !5
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %30

25:                                               ; preds = %20
  br label %26

26:                                               ; preds = %25
  call void (ptr, ...) @dhdebug_ram(ptr noundef @mpu6050_read.str)
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  %29 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %29, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %165

30:                                               ; preds = %20
  br label %31

31:                                               ; preds = %30, %17, %5
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #4
  %32 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  store i8 107, ptr %32, align 16, !tbaa !11
  %33 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 1
  store i8 0, ptr %33, align 1, !tbaa !11
  %34 = load i32, ptr @mAddress, align 4, !tbaa !5
  %35 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %36 = call i32 @dh_i2c_write(i32 noundef %34, ptr noundef %35, i32 noundef 2, i32 noundef 1)
  store i32 %36, ptr %12, align 4, !tbaa !5
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %43

38:                                               ; preds = %31
  br label %39

39:                                               ; preds = %38
  call void (ptr, ...) @dhdebug_ram(ptr noundef @mpu6050_read.str.1)
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  %42 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %42, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %164

43:                                               ; preds = %31
  %44 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  store i8 28, ptr %44, align 16, !tbaa !11
  %45 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 1
  store i8 16, ptr %45, align 1, !tbaa !11
  %46 = load i32, ptr @mAddress, align 4, !tbaa !5
  %47 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %48 = call i32 @dh_i2c_write(i32 noundef %46, ptr noundef %47, i32 noundef 2, i32 noundef 1)
  store i32 %48, ptr %12, align 4, !tbaa !5
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %55

50:                                               ; preds = %43
  br label %51

51:                                               ; preds = %50
  call void (ptr, ...) @dhdebug_ram(ptr noundef @mpu6050_read.str.2)
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %54 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %54, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %164

55:                                               ; preds = %43
  %56 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  store i8 27, ptr %56, align 16, !tbaa !11
  %57 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 1
  store i8 16, ptr %57, align 1, !tbaa !11
  %58 = load i32, ptr @mAddress, align 4, !tbaa !5
  %59 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %60 = call i32 @dh_i2c_write(i32 noundef %58, ptr noundef %59, i32 noundef 2, i32 noundef 1)
  store i32 %60, ptr %12, align 4, !tbaa !5
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %67

62:                                               ; preds = %55
  br label %63

63:                                               ; preds = %62
  call void (ptr, ...) @dhdebug_ram(ptr noundef @mpu6050_read.str.3)
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %66, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %164

67:                                               ; preds = %55
  call void @delay_ms(i32 noundef 50)
  %68 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  store i8 59, ptr %68, align 16, !tbaa !11
  %69 = load i32, ptr @mAddress, align 4, !tbaa !5
  %70 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %71 = call i32 @dh_i2c_write(i32 noundef %69, ptr noundef %70, i32 noundef 1, i32 noundef 0)
  store i32 %71, ptr %12, align 4, !tbaa !5
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %78

73:                                               ; preds = %67
  br label %74

74:                                               ; preds = %73
  call void (ptr, ...) @dhdebug_ram(ptr noundef @mpu6050_read.str.4)
  br label %75

75:                                               ; preds = %74
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %77, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %164

78:                                               ; preds = %67
  %79 = load i32, ptr @mAddress, align 4, !tbaa !5
  %80 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %81 = call i32 @dh_i2c_read(i32 noundef %79, ptr noundef %80, i32 noundef 14)
  store i32 %81, ptr %12, align 4, !tbaa !5
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %88

83:                                               ; preds = %78
  br label %84

84:                                               ; preds = %83
  call void (ptr, ...) @dhdebug_ram(ptr noundef @mpu6050_read.str.5)
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %87, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %164

88:                                               ; preds = %78
  %89 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 14
  store i8 107, ptr %89, align 2, !tbaa !11
  %90 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 15
  store i8 64, ptr %90, align 1, !tbaa !11
  %91 = load i32, ptr @mAddress, align 4, !tbaa !5
  %92 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 14
  %93 = call i32 @dh_i2c_write(i32 noundef %91, ptr noundef %92, i32 noundef 2, i32 noundef 1)
  store i32 %93, ptr %12, align 4, !tbaa !5
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %100

95:                                               ; preds = %88
  br label %96

96:                                               ; preds = %95
  call void (ptr, ...) @dhdebug_ram(ptr noundef @mpu6050_read.str.6)
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %99, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %164

100:                                              ; preds = %88
  %101 = load ptr, ptr %9, align 8, !tbaa !9
  %102 = icmp ne ptr %101, null
  br i1 %102, label %103, label %128

103:                                              ; preds = %100
  %104 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %105 = call i32 @signedInt16be(ptr noundef %104, i32 noundef 0)
  %106 = sitofp i32 %105 to float
  %107 = fmul float %106, 8.000000e+00
  %108 = fmul float %107, 0x40239D0140000000
  %109 = fdiv float %108, 3.276800e+04
  %110 = load ptr, ptr %9, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.MPU6050_XYZ, ptr %110, i32 0, i32 0
  store float %109, ptr %111, align 4, !tbaa !12
  %112 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %113 = call i32 @signedInt16be(ptr noundef %112, i32 noundef 2)
  %114 = sitofp i32 %113 to float
  %115 = fmul float %114, 8.000000e+00
  %116 = fmul float %115, 0x40239D0140000000
  %117 = fdiv float %116, 3.276800e+04
  %118 = load ptr, ptr %9, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.MPU6050_XYZ, ptr %118, i32 0, i32 1
  store float %117, ptr %119, align 4, !tbaa !15
  %120 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %121 = call i32 @signedInt16be(ptr noundef %120, i32 noundef 4)
  %122 = sitofp i32 %121 to float
  %123 = fmul float %122, 8.000000e+00
  %124 = fmul float %123, 0x40239D0140000000
  %125 = fdiv float %124, 3.276800e+04
  %126 = load ptr, ptr %9, align 8, !tbaa !9
  %127 = getelementptr inbounds %struct.MPU6050_XYZ, ptr %126, i32 0, i32 2
  store float %125, ptr %127, align 4, !tbaa !16
  br label %128

128:                                              ; preds = %103, %100
  %129 = load ptr, ptr %10, align 8, !tbaa !9
  %130 = icmp ne ptr %129, null
  br i1 %130, label %131, label %153

131:                                              ; preds = %128
  %132 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %133 = call i32 @signedInt16be(ptr noundef %132, i32 noundef 8)
  %134 = sitofp i32 %133 to float
  %135 = fmul float %134, 1.000000e+03
  %136 = fdiv float %135, 3.276800e+04
  %137 = load ptr, ptr %10, align 8, !tbaa !9
  %138 = getelementptr inbounds %struct.MPU6050_XYZ, ptr %137, i32 0, i32 0
  store float %136, ptr %138, align 4, !tbaa !12
  %139 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %140 = call i32 @signedInt16be(ptr noundef %139, i32 noundef 10)
  %141 = sitofp i32 %140 to float
  %142 = fmul float %141, 1.000000e+03
  %143 = fdiv float %142, 3.276800e+04
  %144 = load ptr, ptr %10, align 8, !tbaa !9
  %145 = getelementptr inbounds %struct.MPU6050_XYZ, ptr %144, i32 0, i32 1
  store float %143, ptr %145, align 4, !tbaa !15
  %146 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %147 = call i32 @signedInt16be(ptr noundef %146, i32 noundef 12)
  %148 = sitofp i32 %147 to float
  %149 = fmul float %148, 1.000000e+03
  %150 = fdiv float %149, 3.276800e+04
  %151 = load ptr, ptr %10, align 8, !tbaa !9
  %152 = getelementptr inbounds %struct.MPU6050_XYZ, ptr %151, i32 0, i32 2
  store float %150, ptr %152, align 4, !tbaa !16
  br label %153

153:                                              ; preds = %131, %128
  %154 = load ptr, ptr %11, align 8, !tbaa !9
  %155 = icmp ne ptr %154, null
  br i1 %155, label %156, label %163

156:                                              ; preds = %153
  %157 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %158 = call i32 @signedInt16be(ptr noundef %157, i32 noundef 6)
  %159 = sitofp i32 %158 to float
  %160 = fdiv float %159, 3.400000e+02
  %161 = fadd float %160, 0x404243D700000000
  %162 = load ptr, ptr %11, align 8, !tbaa !9
  store float %161, ptr %162, align 4, !tbaa !17
  br label %163

163:                                              ; preds = %156, %153
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %164

164:                                              ; preds = %163, %98, %86, %76, %65, %53, %41
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #4
  br label %165

165:                                              ; preds = %164, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %166 = load i32, ptr %6, align 4
  ret i32 %166
}

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

declare i32 @dh_i2c_init(i32 noundef, i32 noundef) #2

declare void @dhdebug_ram(ptr noundef, ...) #2

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

declare void @delay_ms(i32 noundef) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @signedInt16be(ptr noundef, i32 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 = { "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 = { inlinehint 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8}
!14 = !{!"float", !7, i64 0}
!15 = !{!13, !14, i64 4}
!16 = !{!13, !14, i64 8}
!17 = !{!14, !14, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@mpu6050_read.str = external hidden constant [31 x i8], align 4
@mAddress = external hidden local_unnamed_addr global i32, align 4
@mpu6050_read.str.1 = external hidden constant [28 x i8], align 4
@mpu6050_read.str.2 = external hidden constant [43 x i8], align 4
@mpu6050_read.str.3 = external hidden constant [39 x i8], align 4
@mpu6050_read.str.4 = external hidden constant [37 x i8], align 4
@mpu6050_read.str.5 = external hidden constant [24 x i8], align 4
@mpu6050_read.str.6 = external hidden constant [28 x i8], align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @mpu6050_read(i32 noundef %0, i32 noundef %1, ptr noundef writeonly %2, ptr noundef writeonly %3, ptr noundef writeonly %4) local_unnamed_addr #0 {
  %6 = alloca [16 x i8], align 16
  %7 = icmp ne i32 %0, -1
  %8 = icmp ne i32 %1, -1
  %or.cond = and i1 %7, %8
  br i1 %or.cond, label %9, label %12

9:                                                ; preds = %5
  %10 = tail call i32 @dh_i2c_init(i32 noundef %0, i32 noundef %1) #4
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %12, label %11

11:                                               ; preds = %9
  tail call void (ptr, ...) @dhdebug_ram(ptr noundef nonnull @mpu6050_read.str) #4
  br label %81

12:                                               ; preds = %9, %5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  store i8 107, ptr %6, align 16, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %6, i64 1
  store i8 0, ptr %13, align 1, !tbaa !5
  %14 = load i32, ptr @mAddress, align 4, !tbaa !8
  %15 = call i32 @dh_i2c_write(i32 noundef %14, ptr noundef nonnull %6, i32 noundef 2, i32 noundef 1) #4
  %.not34 = icmp eq i32 %15, 0
  br i1 %.not34, label %17, label %16

16:                                               ; preds = %12
  call void (ptr, ...) @dhdebug_ram(ptr noundef nonnull @mpu6050_read.str.1) #4
  br label %80

17:                                               ; preds = %12
  store i8 28, ptr %6, align 16, !tbaa !5
  store i8 16, ptr %13, align 1, !tbaa !5
  %18 = load i32, ptr @mAddress, align 4, !tbaa !8
  %19 = call i32 @dh_i2c_write(i32 noundef %18, ptr noundef nonnull %6, i32 noundef 2, i32 noundef 1) #4
  %.not35 = icmp eq i32 %19, 0
  br i1 %.not35, label %21, label %20

20:                                               ; preds = %17
  call void (ptr, ...) @dhdebug_ram(ptr noundef nonnull @mpu6050_read.str.2) #4
  br label %80

21:                                               ; preds = %17
  store i8 27, ptr %6, align 16, !tbaa !5
  store i8 16, ptr %13, align 1, !tbaa !5
  %22 = load i32, ptr @mAddress, align 4, !tbaa !8
  %23 = call i32 @dh_i2c_write(i32 noundef %22, ptr noundef nonnull %6, i32 noundef 2, i32 noundef 1) #4
  %.not36 = icmp eq i32 %23, 0
  br i1 %.not36, label %25, label %24

24:                                               ; preds = %21
  call void (ptr, ...) @dhdebug_ram(ptr noundef nonnull @mpu6050_read.str.3) #4
  br label %80

25:                                               ; preds = %21
  call void @delay_ms(i32 noundef 50) #4
  store i8 59, ptr %6, align 16, !tbaa !5
  %26 = load i32, ptr @mAddress, align 4, !tbaa !8
  %27 = call i32 @dh_i2c_write(i32 noundef %26, ptr noundef nonnull %6, i32 noundef 1, i32 noundef 0) #4
  %.not37 = icmp eq i32 %27, 0
  br i1 %.not37, label %29, label %28

28:                                               ; preds = %25
  call void (ptr, ...) @dhdebug_ram(ptr noundef nonnull @mpu6050_read.str.4) #4
  br label %80

29:                                               ; preds = %25
  %30 = load i32, ptr @mAddress, align 4, !tbaa !8
  %31 = call i32 @dh_i2c_read(i32 noundef %30, ptr noundef nonnull %6, i32 noundef 14) #4
  %.not38 = icmp eq i32 %31, 0
  br i1 %.not38, label %33, label %32

32:                                               ; preds = %29
  call void (ptr, ...) @dhdebug_ram(ptr noundef nonnull @mpu6050_read.str.5) #4
  br label %80

33:                                               ; preds = %29
  %34 = getelementptr inbounds i8, ptr %6, i64 14
  store i8 107, ptr %34, align 2, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %6, i64 15
  store i8 64, ptr %35, align 1, !tbaa !5
  %36 = load i32, ptr @mAddress, align 4, !tbaa !8
  %37 = call i32 @dh_i2c_write(i32 noundef %36, ptr noundef nonnull %34, i32 noundef 2, i32 noundef 1) #4
  %.not39 = icmp eq i32 %37, 0
  br i1 %.not39, label %39, label %38

38:                                               ; preds = %33
  call void (ptr, ...) @dhdebug_ram(ptr noundef nonnull @mpu6050_read.str.6) #4
  br label %80

39:                                               ; preds = %33
  %.not40 = icmp eq ptr %2, null
  br i1 %.not40, label %58, label %40

40:                                               ; preds = %39
  %41 = call i32 @signedInt16be(ptr noundef nonnull %6, i32 noundef 0)
  %42 = sitofp i32 %41 to float
  %43 = fmul float %42, 8.000000e+00
  %44 = fmul float %43, 0x40239D0140000000
  %45 = fmul float %44, 0x3F00000000000000
  store float %45, ptr %2, align 4, !tbaa !10
  %46 = call i32 @signedInt16be(ptr noundef nonnull %6, i32 noundef 2)
  %47 = sitofp i32 %46 to float
  %48 = fmul float %47, 8.000000e+00
  %49 = fmul float %48, 0x40239D0140000000
  %50 = fmul float %49, 0x3F00000000000000
  %51 = getelementptr inbounds i8, ptr %2, i64 4
  store float %50, ptr %51, align 4, !tbaa !13
  %52 = call i32 @signedInt16be(ptr noundef nonnull %6, i32 noundef 4)
  %53 = sitofp i32 %52 to float
  %54 = fmul float %53, 8.000000e+00
  %55 = fmul float %54, 0x40239D0140000000
  %56 = fmul float %55, 0x3F00000000000000
  %57 = getelementptr inbounds i8, ptr %2, i64 8
  store float %56, ptr %57, align 4, !tbaa !14
  br label %58

58:                                               ; preds = %40, %39
  %.not41 = icmp eq ptr %3, null
  br i1 %.not41, label %74, label %59

59:                                               ; preds = %58
  %60 = call i32 @signedInt16be(ptr noundef nonnull %6, i32 noundef 8)
  %61 = sitofp i32 %60 to float
  %62 = fmul float %61, 1.000000e+03
  %63 = fmul float %62, 0x3F00000000000000
  store float %63, ptr %3, align 4, !tbaa !10
  %64 = call i32 @signedInt16be(ptr noundef nonnull %6, i32 noundef 10)
  %65 = sitofp i32 %64 to float
  %66 = fmul float %65, 1.000000e+03
  %67 = fmul float %66, 0x3F00000000000000
  %68 = getelementptr inbounds i8, ptr %3, i64 4
  store float %67, ptr %68, align 4, !tbaa !13
  %69 = call i32 @signedInt16be(ptr noundef nonnull %6, i32 noundef 12)
  %70 = sitofp i32 %69 to float
  %71 = fmul float %70, 1.000000e+03
  %72 = fmul float %71, 0x3F00000000000000
  %73 = getelementptr inbounds i8, ptr %3, i64 8
  store float %72, ptr %73, align 4, !tbaa !14
  br label %74

74:                                               ; preds = %59, %58
  %.not42 = icmp eq ptr %4, null
  br i1 %.not42, label %80, label %75

75:                                               ; preds = %74
  %76 = call i32 @signedInt16be(ptr noundef nonnull %6, i32 noundef 6)
  %77 = sitofp i32 %76 to float
  %78 = fdiv float %77, 3.400000e+02
  %79 = fadd float %78, 0x404243D700000000
  store float %79, ptr %4, align 4, !tbaa !15
  br label %80

80:                                               ; preds = %74, %75, %38, %32, %28, %24, %20, %16
  %.0 = phi i32 [ %15, %16 ], [ %19, %20 ], [ %23, %24 ], [ %27, %28 ], [ %31, %32 ], [ %37, %38 ], [ 0, %75 ], [ 0, %74 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  br label %81

81:                                               ; preds = %80, %11
  %.1 = phi i32 [ %10, %11 ], [ %.0, %80 ]
  ret i32 %.1
}

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

declare i32 @dh_i2c_init(i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @dhdebug_ram(ptr noundef, ...) local_unnamed_addr #2

declare i32 @dh_i2c_write(i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @delay_ms(i32 noundef) local_unnamed_addr #2

declare i32 @dh_i2c_read(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @signedInt16be(ptr noundef, i32 noundef) 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

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 = { "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 = { inlinehint 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !12, i64 0}
!11 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8}
!12 = !{!"float", !6, i64 0}
!13 = !{!11, !12, i64 4}
!14 = !{!11, !12, i64 8}
!15 = !{!12, !12, i64 0}


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