; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/OptionRomPkg (PhyDetect)

; 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.s_data_instance = type { i16, i16, i8, i8, i16, i16, i16, i16, i16, [32 x i8], [32 x i8], [32 x i8], [64 x i32], [128 x i32], i32, i32, i16, i16, i8, i8, i8, i8, i16, i16, i16, i16, i32, i32, i16, i16, [2 x i16], i8, i8, i16, i32, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, [64 x i64], i16, i16, i16, i16, i8, i8, i8, i8, i8, [3 x i8], %struct.mc, i64, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.mc = type { [3 x i16], i16, [8 x [32 x i8]] }

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @DelayIt(ptr noundef, i16 noundef zeroext) #1

; Function Attrs: nounwind uwtable
declare dso_local void @MdiWrite(ptr noundef, i8 noundef zeroext, i8 noundef zeroext, i16 noundef zeroext) #1

; Function Attrs: nounwind uwtable
declare dso_local void @MdiRead(ptr noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @PhyDetect(ptr noundef %0) #1 {
  %2 = alloca i8, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i16, align 2
  %6 = alloca i16, align 2
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 2, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 2, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #2
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.s_data_instance, ptr %10, i32 0, i32 13
  %12 = getelementptr inbounds [128 x i32], ptr %11, i64 0, i64 0
  store ptr %12, ptr %4, align 8, !tbaa !5
  store i8 0, ptr %7, align 1, !tbaa !9
  store i8 35, ptr %8, align 1, !tbaa !9
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds i16, ptr %13, i64 6
  %15 = load i16, ptr %14, align 2, !tbaa !10
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.s_data_instance, ptr %16, i32 0, i32 30
  %18 = getelementptr inbounds [2 x i16], ptr %17, i64 0, i64 0
  store i16 %15, ptr %18, align 4, !tbaa !10
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds i16, ptr %19, i64 7
  %21 = load i16, ptr %20, align 2, !tbaa !10
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.s_data_instance, ptr %22, i32 0, i32 30
  %24 = getelementptr inbounds [2 x i16], ptr %23, i64 0, i64 1
  store i16 %21, ptr %24, align 2, !tbaa !10
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.s_data_instance, ptr %25, i32 0, i32 30
  %27 = getelementptr inbounds [2 x i16], ptr %26, i64 0, i64 0
  %28 = load i16, ptr %27, align 4, !tbaa !10
  %29 = zext i16 %28 to i32
  %30 = and i32 %29, 7
  %31 = trunc i32 %30 to i8
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.s_data_instance, ptr %32, i32 0, i32 31
  store i8 %31, ptr %33, align 8, !tbaa !12
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.s_data_instance, ptr %34, i32 0, i32 31
  %36 = load i8, ptr %35, align 8, !tbaa !12
  %37 = zext i8 %36 to i32
  %38 = icmp eq i32 %37, 32
  br i1 %38, label %39, label %42

39:                                               ; preds = %1
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.s_data_instance, ptr %40, i32 0, i32 16
  store i16 10, ptr %41, align 8, !tbaa !17
  store i8 1, ptr %2, align 1
  store i32 1, ptr %9, align 4
  br label %191

42:                                               ; preds = %1
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.s_data_instance, ptr %43, i32 0, i32 31
  %45 = load i8, ptr %44, align 8, !tbaa !12
  %46 = zext i8 %45 to i32
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %48, label %88

48:                                               ; preds = %42
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.s_data_instance, ptr %49, i32 0, i32 31
  %51 = load i8, ptr %50, align 8, !tbaa !12
  %52 = zext i8 %51 to i32
  %53 = icmp slt i32 %52, 32
  br i1 %53, label %54, label %88

54:                                               ; preds = %48
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.s_data_instance, ptr %56, i32 0, i32 31
  %58 = load i8, ptr %57, align 8, !tbaa !12
  call void @MdiRead(ptr noundef %55, i8 noundef zeroext 0, i8 noundef zeroext %58, ptr noundef %5)
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.s_data_instance, ptr %60, i32 0, i32 31
  %62 = load i8, ptr %61, align 8, !tbaa !12
  call void @MdiRead(ptr noundef %59, i8 noundef zeroext 1, i8 noundef zeroext %62, ptr noundef %6)
  %63 = load i16, ptr %5, align 2, !tbaa !10
  %64 = zext i16 %63 to i32
  %65 = icmp eq i32 %64, 65535
  br i1 %65, label %87, label %66

66:                                               ; preds = %54
  %67 = load i16, ptr %6, align 2, !tbaa !10
  %68 = zext i16 %67 to i32
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %74

70:                                               ; preds = %66
  %71 = load i16, ptr %5, align 2, !tbaa !10
  %72 = zext i16 %71 to i32
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %87, label %74

74:                                               ; preds = %70, %66
  store i8 1, ptr %7, align 1, !tbaa !9
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.s_data_instance, ptr %76, i32 0, i32 31
  %78 = load i8, ptr %77, align 8, !tbaa !12
  call void @MdiRead(ptr noundef %75, i8 noundef zeroext 1, i8 noundef zeroext %78, ptr noundef %6)
  %79 = load i16, ptr %6, align 2, !tbaa !10
  %80 = zext i16 %79 to i32
  %81 = and i32 %80, 4
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %86

83:                                               ; preds = %74
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = call zeroext i8 @SetupPhy(ptr noundef %84)
  store i8 %85, ptr %2, align 1
  store i32 1, ptr %9, align 4
  br label %191

86:                                               ; preds = %74
  br label %87

87:                                               ; preds = %86, %70, %54
  br label %88

88:                                               ; preds = %87, %48, %42
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  call void @MdiRead(ptr noundef %89, i8 noundef zeroext 0, i8 noundef zeroext 0, ptr noundef %5)
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  call void @MdiRead(ptr noundef %90, i8 noundef zeroext 1, i8 noundef zeroext 0, ptr noundef %6)
  %91 = load i16, ptr %5, align 2, !tbaa !10
  %92 = zext i16 %91 to i32
  %93 = icmp eq i32 %92, 65535
  br i1 %93, label %102, label %94

94:                                               ; preds = %88
  %95 = load i16, ptr %6, align 2, !tbaa !10
  %96 = zext i16 %95 to i32
  %97 = icmp eq i32 %96, 0
  br i1 %97, label %98, label %127

98:                                               ; preds = %94
  %99 = load i16, ptr %5, align 2, !tbaa !10
  %100 = zext i16 %99 to i32
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %127

102:                                              ; preds = %98, %88
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.s_data_instance, ptr %103, i32 0, i32 31
  %105 = load i8, ptr %104, align 8, !tbaa !12
  %106 = zext i8 %105 to i32
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %108, label %109

108:                                              ; preds = %102
  store i8 0, ptr %2, align 1
  store i32 1, ptr %9, align 4
  br label %191

109:                                              ; preds = %102
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.s_data_instance, ptr %110, i32 0, i32 20
  %112 = load i8, ptr %111, align 2, !tbaa !18
  %113 = zext i8 %112 to i32
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %116

115:                                              ; preds = %109
  store i8 0, ptr %2, align 1
  store i32 1, ptr %9, align 4
  br label %191

116:                                              ; preds = %109
  %117 = load i8, ptr %7, align 1, !tbaa !9
  %118 = icmp ne i8 %117, 0
  br i1 %118, label %119, label %122

119:                                              ; preds = %116
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = call zeroext i8 @SetupPhy(ptr noundef %120)
  store i8 %121, ptr %2, align 1
  store i32 1, ptr %9, align 4
  br label %191

122:                                              ; preds = %116
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.s_data_instance, ptr %123, i32 0, i32 31
  store i8 32, ptr %124, align 8, !tbaa !12
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.s_data_instance, ptr %125, i32 0, i32 16
  store i16 10, ptr %126, align 8, !tbaa !17
  store i8 1, ptr %2, align 1
  store i32 1, ptr %9, align 4
  br label %191

127:                                              ; preds = %98, %94
  %128 = load i8, ptr %7, align 1, !tbaa !9
  %129 = icmp ne i8 %128, 0
  br i1 %129, label %130, label %136

130:                                              ; preds = %127
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.s_data_instance, ptr %132, i32 0, i32 31
  %134 = load i8, ptr %133, align 8, !tbaa !12
  call void @MdiWrite(ptr noundef %131, i8 noundef zeroext 0, i8 noundef zeroext %134, i16 noundef zeroext 1024)
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  call void @DelayIt(ptr noundef %135, i16 noundef zeroext 100)
  br label %136

136:                                              ; preds = %130, %127
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  call void @MdiWrite(ptr noundef %137, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 4096)
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  call void @DelayIt(ptr noundef %138, i16 noundef zeroext 100)
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  call void @MdiWrite(ptr noundef %139, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 4608)
  br label %140

140:                                              ; preds = %151, %136
  %141 = load i8, ptr %8, align 1, !tbaa !9
  %142 = icmp ne i8 %141, 0
  br i1 %142, label %143, label %155

143:                                              ; preds = %140
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  call void @MdiRead(ptr noundef %144, i8 noundef zeroext 1, i8 noundef zeroext 0, ptr noundef %6)
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  call void @MdiRead(ptr noundef %145, i8 noundef zeroext 1, i8 noundef zeroext 0, ptr noundef %6)
  %146 = load i16, ptr %6, align 2, !tbaa !10
  %147 = zext i16 %146 to i32
  %148 = and i32 %147, 32
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %150, label %151

150:                                              ; preds = %143
  br label %155

151:                                              ; preds = %143
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  call void @DelayIt(ptr noundef %152, i16 noundef zeroext 100)
  %153 = load i8, ptr %8, align 1, !tbaa !9
  %154 = add i8 %153, -1
  store i8 %154, ptr %8, align 1, !tbaa !9
  br label %140, !llvm.loop !19

155:                                              ; preds = %150, %140
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  call void @MdiRead(ptr noundef %156, i8 noundef zeroext 1, i8 noundef zeroext 0, ptr noundef %6)
  %157 = load i16, ptr %6, align 2, !tbaa !10
  %158 = zext i16 %157 to i32
  %159 = and i32 %158, 4
  %160 = icmp eq i32 %159, 0
  br i1 %160, label %161, label %186

161:                                              ; preds = %155
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.s_data_instance, ptr %162, i32 0, i32 20
  %164 = load i8, ptr %163, align 2, !tbaa !18
  %165 = zext i8 %164 to i32
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %168

167:                                              ; preds = %161
  store i8 0, ptr %2, align 1
  store i32 1, ptr %9, align 4
  br label %191

168:                                              ; preds = %161
  %169 = load i8, ptr %7, align 1, !tbaa !9
  %170 = icmp ne i8 %169, 0
  br i1 %170, label %171, label %185

171:                                              ; preds = %168
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  call void @MdiWrite(ptr noundef %172, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 1024)
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  call void @DelayIt(ptr noundef %173, i16 noundef zeroext 100)
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = load ptr, ptr %3, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.s_data_instance, ptr %175, i32 0, i32 31
  %177 = load i8, ptr %176, align 8, !tbaa !12
  call void @MdiWrite(ptr noundef %174, i8 noundef zeroext 0, i8 noundef zeroext %177, i16 noundef zeroext 4096)
  %178 = load ptr, ptr %3, align 8, !tbaa !5
  call void @DelayIt(ptr noundef %178, i16 noundef zeroext 100)
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = load ptr, ptr %3, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.s_data_instance, ptr %180, i32 0, i32 31
  %182 = load i8, ptr %181, align 8, !tbaa !12
  call void @MdiWrite(ptr noundef %179, i8 noundef zeroext 0, i8 noundef zeroext %182, i16 noundef zeroext 4608)
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = call zeroext i8 @SetupPhy(ptr noundef %183)
  store i8 %184, ptr %2, align 1
  store i32 1, ptr %9, align 4
  br label %191

185:                                              ; preds = %168
  br label %186

186:                                              ; preds = %185, %155
  %187 = load ptr, ptr %3, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.s_data_instance, ptr %187, i32 0, i32 31
  store i8 0, ptr %188, align 8, !tbaa !12
  %189 = load ptr, ptr %3, align 8, !tbaa !5
  %190 = call zeroext i8 @SetupPhy(ptr noundef %189)
  store i8 %190, ptr %2, align 1
  store i32 1, ptr %9, align 4
  br label %191

191:                                              ; preds = %186, %171, %167, %122, %119, %115, %108, %83, %39
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  %192 = load i8, ptr %2, align 1
  ret i8 %192
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @SetupPhy(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !7, i64 0}
!12 = !{!13, !7, i64 920}
!13 = !{!"s_data_instance", !11, i64 0, !11, i64 2, !7, i64 4, !7, i64 5, !11, i64 6, !11, i64 8, !11, i64 10, !11, i64 12, !11, i64 14, !7, i64 16, !7, i64 48, !7, i64 80, !7, i64 112, !7, i64 368, !14, i64 880, !14, i64 884, !11, i64 888, !11, i64 890, !7, i64 892, !7, i64 893, !7, i64 894, !7, i64 895, !11, i64 896, !11, i64 898, !11, i64 900, !11, i64 902, !14, i64 904, !14, i64 908, !11, i64 912, !11, i64 914, !7, i64 916, !7, i64 920, !7, i64 921, !11, i64 922, !14, i64 924, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !15, i64 976, !15, i64 984, !15, i64 992, !15, i64 1000, !15, i64 1008, !7, i64 1016, !11, i64 1528, !11, i64 1530, !11, i64 1532, !11, i64 1534, !7, i64 1536, !7, i64 1537, !7, i64 1538, !7, i64 1539, !7, i64 1540, !7, i64 1541, !16, i64 1544, !15, i64 1808, !6, i64 1816, !15, i64 1824, !6, i64 1832, !6, i64 1840, !6, i64 1848, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888, !6, i64 1896, !6, i64 1904, !6, i64 1912}
!14 = !{!"int", !7, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"mc", !7, i64 0, !11, i64 6, !7, i64 8}
!17 = !{!13, !11, i64 888}
!18 = !{!13, !7, i64 894}
!19 = distinct !{!19, !20}
!20 = !{!"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"

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @DelayIt(ptr noundef, i16 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @MdiWrite(ptr noundef, i8 noundef zeroext, i8 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @MdiRead(ptr noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @PhyDetect(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca i16, align 2
  %3 = alloca i16, align 2
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %2) #2
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %3) #2
  %4 = getelementptr inbounds i8, ptr %0, i64 380
  %5 = getelementptr inbounds i8, ptr %0, i64 916
  %6 = load <2 x i16>, ptr %4, align 2, !tbaa !5
  store <2 x i16> %6, ptr %5, align 4, !tbaa !5
  %7 = bitcast <2 x i16> %6 to <4 x i8>
  %8 = extractelement <4 x i8> %7, i64 0
  %9 = and i8 %8, 7
  %10 = getelementptr inbounds i8, ptr %0, i64 920
  store i8 %9, ptr %10, align 8, !tbaa !9
  %.not = icmp eq i8 %9, 0
  br i1 %.not, label %24, label %11

11:                                               ; preds = %1
  call void @MdiRead(ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext %9, ptr noundef nonnull %2)
  %12 = load i8, ptr %10, align 8, !tbaa !9
  call void @MdiRead(ptr noundef nonnull %0, i8 noundef zeroext 1, i8 noundef zeroext %12, ptr noundef nonnull %3)
  %13 = load i16, ptr %2, align 2
  %14 = icmp eq i16 %13, -1
  br i1 %14, label %24, label %15

15:                                               ; preds = %11
  %16 = load i16, ptr %3, align 2, !tbaa !5
  %17 = or i16 %16, %13
  %or.cond = icmp eq i16 %17, 0
  br i1 %or.cond, label %24, label %18

18:                                               ; preds = %15
  %19 = load i8, ptr %10, align 8, !tbaa !9
  call void @MdiRead(ptr noundef nonnull %0, i8 noundef zeroext 1, i8 noundef zeroext %19, ptr noundef nonnull %3)
  %20 = load i16, ptr %3, align 2, !tbaa !5
  %21 = and i16 %20, 4
  %.not61 = icmp eq i16 %21, 0
  br i1 %.not61, label %24, label %22

22:                                               ; preds = %18
  %23 = call zeroext i8 @SetupPhy(ptr noundef nonnull %0)
  br label %64

24:                                               ; preds = %11, %15, %18, %1
  %.not62 = phi i1 [ true, %11 ], [ true, %15 ], [ false, %18 ], [ true, %1 ]
  call void @MdiRead(ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext 0, ptr noundef nonnull %2)
  call void @MdiRead(ptr noundef nonnull %0, i8 noundef zeroext 1, i8 noundef zeroext 0, ptr noundef nonnull %3)
  %25 = load i16, ptr %2, align 2
  %26 = icmp eq i16 %25, -1
  br i1 %26, label %30, label %27

27:                                               ; preds = %24
  %28 = load i16, ptr %3, align 2, !tbaa !5
  %29 = or i16 %28, %25
  %or.cond5 = icmp eq i16 %29, 0
  br i1 %or.cond5, label %30, label %41

30:                                               ; preds = %27, %24
  %31 = load i8, ptr %10, align 8, !tbaa !9
  %32 = icmp eq i8 %31, 0
  br i1 %32, label %64, label %33

33:                                               ; preds = %30
  %34 = getelementptr inbounds i8, ptr %0, i64 894
  %35 = load i8, ptr %34, align 2, !tbaa !15
  %.not66 = icmp eq i8 %35, 0
  br i1 %.not66, label %36, label %64

36:                                               ; preds = %33
  br i1 %.not62, label %39, label %37

37:                                               ; preds = %36
  %38 = call zeroext i8 @SetupPhy(ptr noundef nonnull %0)
  br label %64

39:                                               ; preds = %36
  store i8 32, ptr %10, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %0, i64 888
  store i16 10, ptr %40, align 8, !tbaa !16
  br label %64

41:                                               ; preds = %27
  br i1 %.not62, label %44, label %42

42:                                               ; preds = %41
  %43 = load i8, ptr %10, align 8, !tbaa !9
  call void @MdiWrite(ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext %43, i16 noundef zeroext 1024)
  call void @DelayIt(ptr noundef nonnull %0, i16 noundef zeroext 100)
  br label %44

44:                                               ; preds = %42, %41
  call void @MdiWrite(ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 4096)
  call void @DelayIt(ptr noundef nonnull %0, i16 noundef zeroext 100)
  call void @MdiWrite(ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 4608)
  br label %45

45:                                               ; preds = %44, %48
  %.068 = phi i8 [ 35, %44 ], [ %49, %48 ]
  call void @MdiRead(ptr noundef %0, i8 noundef zeroext 1, i8 noundef zeroext 0, ptr noundef nonnull %3)
  call void @MdiRead(ptr noundef %0, i8 noundef zeroext 1, i8 noundef zeroext 0, ptr noundef nonnull %3)
  %46 = load i16, ptr %3, align 2, !tbaa !5
  %47 = and i16 %46, 32
  %.not64 = icmp eq i16 %47, 0
  br i1 %.not64, label %48, label %50

48:                                               ; preds = %45
  call void @DelayIt(ptr noundef %0, i16 noundef zeroext 100)
  %49 = add nsw i8 %.068, -1
  %.not63 = icmp eq i8 %49, 0
  br i1 %.not63, label %50, label %45, !llvm.loop !17

50:                                               ; preds = %45, %48
  call void @MdiRead(ptr noundef %0, i8 noundef zeroext 1, i8 noundef zeroext 0, ptr noundef nonnull %3)
  %51 = load i16, ptr %3, align 2, !tbaa !5
  %52 = and i16 %51, 4
  %53 = icmp eq i16 %52, 0
  br i1 %53, label %54, label %62

54:                                               ; preds = %50
  %55 = getelementptr inbounds i8, ptr %0, i64 894
  %56 = load i8, ptr %55, align 2, !tbaa !15
  %.not65 = icmp eq i8 %56, 0
  br i1 %.not65, label %57, label %64

57:                                               ; preds = %54
  br i1 %.not62, label %62, label %58

58:                                               ; preds = %57
  call void @MdiWrite(ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext 0, i16 noundef zeroext 1024)
  call void @DelayIt(ptr noundef nonnull %0, i16 noundef zeroext 100)
  %59 = load i8, ptr %10, align 8, !tbaa !9
  call void @MdiWrite(ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext %59, i16 noundef zeroext 4096)
  call void @DelayIt(ptr noundef nonnull %0, i16 noundef zeroext 100)
  %60 = load i8, ptr %10, align 8, !tbaa !9
  call void @MdiWrite(ptr noundef nonnull %0, i8 noundef zeroext 0, i8 noundef zeroext %60, i16 noundef zeroext 4608)
  %61 = call zeroext i8 @SetupPhy(ptr noundef nonnull %0)
  br label %64

62:                                               ; preds = %57, %50
  store i8 0, ptr %10, align 8, !tbaa !9
  %63 = call zeroext i8 @SetupPhy(ptr noundef %0)
  br label %64

64:                                               ; preds = %54, %33, %30, %62, %58, %39, %37, %22
  %.057 = phi i8 [ %38, %37 ], [ 1, %39 ], [ %61, %58 ], [ %63, %62 ], [ %23, %22 ], [ 0, %30 ], [ 0, %33 ], [ 0, %54 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %3) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %2) #2
  ret i8 %.057
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @SetupPhy(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !7, i64 920}
!10 = !{!"s_data_instance", !6, i64 0, !6, i64 2, !7, i64 4, !7, i64 5, !6, i64 6, !6, i64 8, !6, i64 10, !6, i64 12, !6, i64 14, !7, i64 16, !7, i64 48, !7, i64 80, !7, i64 112, !7, i64 368, !11, i64 880, !11, i64 884, !6, i64 888, !6, i64 890, !7, i64 892, !7, i64 893, !7, i64 894, !7, i64 895, !6, i64 896, !6, i64 898, !6, i64 900, !6, i64 902, !11, i64 904, !11, i64 908, !6, i64 912, !6, i64 914, !7, i64 916, !7, i64 920, !7, i64 921, !6, i64 922, !11, i64 924, !12, i64 928, !12, i64 936, !12, i64 944, !12, i64 952, !12, i64 960, !12, i64 968, !13, i64 976, !13, i64 984, !13, i64 992, !13, i64 1000, !13, i64 1008, !7, i64 1016, !6, i64 1528, !6, i64 1530, !6, i64 1532, !6, i64 1534, !7, i64 1536, !7, i64 1537, !7, i64 1538, !7, i64 1539, !7, i64 1540, !7, i64 1541, !14, i64 1544, !13, i64 1808, !12, i64 1816, !13, i64 1824, !12, i64 1832, !12, i64 1840, !12, i64 1848, !12, i64 1856, !12, i64 1864, !12, i64 1872, !12, i64 1880, !12, i64 1888, !12, i64 1896, !12, i64 1904, !12, i64 1912}
!11 = !{!"int", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"mc", !7, i64 0, !6, i64 6, !7, i64 8}
!15 = !{!10, !7, i64 894}
!16 = !{!10, !6, i64 888}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass