; LLVM IR from FrancesoM/Bisc8FX :: sdk_projects/bisc8_platform/ps7_cortexa9_0/standalone_domain/bsp/ps7_cortexa9_0_ (Reset)

; 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.XEmacPs_Instance = type { %struct.XEmacPs_Config, i32, i32, i32, %struct.XEmacPs_BdRing, %struct.XEmacPs_BdRing, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32 }
%struct.XEmacPs_Config = type { i16, i64, i8, i8, i8, i8, i8, i8, i8 }
%struct.XEmacPs_BdRing = type { i64, i64, i64, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32 }

@Xil_AssertStatus = external global i32, align 4
@.str = external hidden unnamed_addr constant [165 x i8], align 1

declare void @Xil_Assert(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @XEmacPs_Reset(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca [6 x i8], align 1
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 6, ptr %5) #5
  call void @llvm.memset.p0.i64(ptr align 1 %5, i8 0, i64 6, i1 false)
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = icmp ne ptr %7, null
  br i1 %8, label %9, label %10

9:                                                ; preds = %1
  store i32 0, ptr @Xil_AssertStatus, align 4, !tbaa !9
  br label %11

10:                                               ; preds = %1
  call void @Xil_Assert(ptr noundef @.str, i32 noundef 304)
  store i32 1, ptr @Xil_AssertStatus, align 4, !tbaa !9
  store i32 1, ptr %6, align 4
  br label %212

11:                                               ; preds = %9
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %12, i32 0, i32 2
  %14 = load i32, ptr %13, align 4, !tbaa !11
  %15 = icmp eq i32 %14, 286331153
  br i1 %15, label %16, label %17

16:                                               ; preds = %11
  store i32 0, ptr @Xil_AssertStatus, align 4, !tbaa !9
  br label %18

17:                                               ; preds = %11
  call void @Xil_Assert(ptr noundef @.str, i32 noundef 305)
  store i32 1, ptr @Xil_AssertStatus, align 4, !tbaa !9
  store i32 1, ptr %6, align 4
  br label %212

18:                                               ; preds = %16
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  call void @XEmacPs_Stop(ptr noundef %19)
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %20, i32 0, i32 3
  store i32 14320, ptr %21, align 8, !tbaa !17
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %22, i32 0, i32 0
  %24 = getelementptr inbounds %struct.XEmacPs_Config, ptr %23, i32 0, i32 1
  %25 = load i64, ptr %24, align 8, !tbaa !18
  %26 = add i64 %25, 252
  %27 = call i32 @Xil_In32(i64 noundef %26)
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %28, i32 0, i32 12
  store i32 %27, ptr %29, align 8, !tbaa !19
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %30, i32 0, i32 12
  %32 = load i32, ptr %31, align 8, !tbaa !19
  %33 = lshr i32 %32, 16
  %34 = and i32 %33, 4095
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %35, i32 0, i32 12
  store i32 %34, ptr %36, align 8, !tbaa !19
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %37, i32 0, i32 14
  store i32 1500, ptr %38, align 8, !tbaa !20
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %39, i32 0, i32 15
  store i32 1518, ptr %40, align 4, !tbaa !21
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %41, i32 0, i32 15
  %43 = load i32, ptr %42, align 4, !tbaa !21
  %44 = add i32 %43, 18
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %45, i32 0, i32 16
  store i32 %44, ptr %46, align 8, !tbaa !22
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %47, i32 0, i32 13
  store i32 8191, ptr %48, align 4, !tbaa !23
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds %struct.XEmacPs_Config, ptr %50, i32 0, i32 1
  %52 = load i64, ptr %51, align 8, !tbaa !18
  %53 = add i64 %52, 0
  call void @Xil_Out32(i64 noundef %53, i32 noundef 48)
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %54, i32 0, i32 0
  %56 = getelementptr inbounds %struct.XEmacPs_Config, ptr %55, i32 0, i32 1
  %57 = load i64, ptr %56, align 8, !tbaa !18
  %58 = add i64 %57, 4
  %59 = call i32 @Xil_In32(i64 noundef %58)
  store i32 %59, ptr %3, align 4, !tbaa !9
  %60 = load i32, ptr %3, align 4, !tbaa !9
  %61 = and i32 %60, 1835008
  store i32 %61, ptr %3, align 4, !tbaa !9
  %62 = load i32, ptr %3, align 4, !tbaa !9
  %63 = or i32 %62, 1
  %64 = or i32 %63, 2
  %65 = or i32 %64, 128
  store i32 %65, ptr %3, align 4, !tbaa !9
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %66, i32 0, i32 0
  %68 = getelementptr inbounds %struct.XEmacPs_Config, ptr %67, i32 0, i32 1
  %69 = load i64, ptr %68, align 8, !tbaa !18
  %70 = add i64 %69, 4
  %71 = load i32, ptr %3, align 4, !tbaa !9
  call void @Xil_Out32(i64 noundef %70, i32 noundef %71)
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %72, i32 0, i32 12
  %74 = load i32, ptr %73, align 8, !tbaa !19
  %75 = icmp ugt i32 %74, 2
  br i1 %75, label %76, label %89

76:                                               ; preds = %18
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %77, i32 0, i32 0
  %79 = getelementptr inbounds %struct.XEmacPs_Config, ptr %78, i32 0, i32 1
  %80 = load i64, ptr %79, align 8, !tbaa !18
  %81 = add i64 %80, 4
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds %struct.XEmacPs_Config, ptr %83, i32 0, i32 1
  %85 = load i64, ptr %84, align 8, !tbaa !18
  %86 = add i64 %85, 4
  %87 = call i32 @Xil_In32(i64 noundef %86)
  %88 = or i32 %87, 2097152
  call void @Xil_Out32(i64 noundef %81, i32 noundef %88)
  br label %89

89:                                               ; preds = %76, %18
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %90, i32 0, i32 0
  %92 = getelementptr inbounds %struct.XEmacPs_Config, ptr %91, i32 0, i32 1
  %93 = load i64, ptr %92, align 8, !tbaa !18
  %94 = add i64 %93, 16
  call void @Xil_Out32(i64 noundef %94, i32 noundef 1574656)
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %95, i32 0, i32 12
  %97 = load i32, ptr %96, align 8, !tbaa !19
  %98 = icmp ugt i32 %97, 2
  br i1 %98, label %99, label %112

99:                                               ; preds = %89
  %100 = load ptr, ptr %2, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds %struct.XEmacPs_Config, ptr %101, i32 0, i32 1
  %103 = load i64, ptr %102, align 8, !tbaa !18
  %104 = add i64 %103, 16
  %105 = load ptr, ptr %2, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %105, i32 0, i32 0
  %107 = getelementptr inbounds %struct.XEmacPs_Config, ptr %106, i32 0, i32 1
  %108 = load i64, ptr %107, align 8, !tbaa !18
  %109 = add i64 %108, 16
  %110 = call i32 @Xil_In32(i64 noundef %109)
  %111 = or i32 %110, 16
  call void @Xil_Out32(i64 noundef %104, i32 noundef %111)
  br label %112

112:                                              ; preds = %99, %89
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %struct.XEmacPs_Config, ptr %114, i32 0, i32 1
  %116 = load i64, ptr %115, align 8, !tbaa !18
  %117 = add i64 %116, 20
  call void @Xil_Out32(i64 noundef %117, i32 noundef -1)
  %118 = load ptr, ptr %2, align 8, !tbaa !5
  call void @XEmacPs_SetQueuePtr(ptr noundef %118, i64 noundef 0, i8 noundef zeroext 0, i16 noundef zeroext 1)
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %119, i32 0, i32 12
  %121 = load i32, ptr %120, align 8, !tbaa !19
  %122 = icmp ugt i32 %121, 2
  br i1 %122, label %123, label %125

123:                                              ; preds = %112
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  call void @XEmacPs_SetQueuePtr(ptr noundef %124, i64 noundef 0, i8 noundef zeroext 1, i16 noundef zeroext 1)
  br label %125

125:                                              ; preds = %123, %112
  %126 = load ptr, ptr %2, align 8, !tbaa !5
  call void @XEmacPs_SetQueuePtr(ptr noundef %126, i64 noundef 0, i8 noundef zeroext 0, i16 noundef zeroext 2)
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %127, i32 0, i32 0
  %129 = getelementptr inbounds %struct.XEmacPs_Config, ptr %128, i32 0, i32 1
  %130 = load i64, ptr %129, align 8, !tbaa !18
  %131 = add i64 %130, 32
  call void @Xil_Out32(i64 noundef %131, i32 noundef -1)
  %132 = load ptr, ptr %2, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds %struct.XEmacPs_Config, ptr %133, i32 0, i32 1
  %135 = load i64, ptr %134, align 8, !tbaa !18
  %136 = add i64 %135, 44
  call void @Xil_Out32(i64 noundef %136, i32 noundef 32767)
  %137 = load ptr, ptr %2, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %137, i32 0, i32 0
  %139 = getelementptr inbounds %struct.XEmacPs_Config, ptr %138, i32 0, i32 1
  %140 = load i64, ptr %139, align 8, !tbaa !18
  %141 = add i64 %140, 36
  %142 = call i32 @Xil_In32(i64 noundef %141)
  store i32 %142, ptr %3, align 4, !tbaa !9
  %143 = load ptr, ptr %2, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %143, i32 0, i32 0
  %145 = getelementptr inbounds %struct.XEmacPs_Config, ptr %144, i32 0, i32 1
  %146 = load i64, ptr %145, align 8, !tbaa !18
  %147 = add i64 %146, 36
  %148 = load i32, ptr %3, align 4, !tbaa !9
  call void @Xil_Out32(i64 noundef %147, i32 noundef %148)
  %149 = load ptr, ptr %2, align 8, !tbaa !5
  call void @XEmacPs_ClearHash(ptr noundef %149)
  store i8 1, ptr %4, align 1, !tbaa !24
  br label %150

150:                                              ; preds = %162, %125
  %151 = load i8, ptr %4, align 1, !tbaa !24
  %152 = zext i8 %151 to i32
  %153 = icmp ult i32 %152, 5
  br i1 %153, label %154, label %165

154:                                              ; preds = %150
  %155 = load ptr, ptr %2, align 8, !tbaa !5
  %156 = getelementptr inbounds [6 x i8], ptr %5, i64 0, i64 0
  %157 = load i8, ptr %4, align 1, !tbaa !24
  %158 = call i64 @XEmacPs_SetMacAddress(ptr noundef %155, ptr noundef %156, i8 noundef zeroext %157)
  %159 = load ptr, ptr %2, align 8, !tbaa !5
  %160 = load i8, ptr %4, align 1, !tbaa !24
  %161 = call i64 @XEmacPs_SetTypeIdCheck(ptr noundef %159, i32 noundef 0, i8 noundef zeroext %160)
  br label %162

162:                                              ; preds = %154
  %163 = load i8, ptr %4, align 1, !tbaa !24
  %164 = add i8 %163, 1
  store i8 %164, ptr %4, align 1, !tbaa !24
  br label %150, !llvm.loop !25

165:                                              ; preds = %150
  store i8 0, ptr %4, align 1, !tbaa !24
  br label %166

166:                                              ; preds = %182, %165
  %167 = load i8, ptr %4, align 1, !tbaa !24
  %168 = zext i8 %167 to i32
  %169 = icmp slt i32 %168, 45
  br i1 %169, label %170, label %185

170:                                              ; preds = %166
  %171 = load ptr, ptr %2, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %171, i32 0, i32 0
  %173 = getelementptr inbounds %struct.XEmacPs_Config, ptr %172, i32 0, i32 1
  %174 = load i64, ptr %173, align 8, !tbaa !18
  %175 = load i8, ptr %4, align 1, !tbaa !24
  %176 = zext i8 %175 to i32
  %177 = mul i32 %176, 4
  %178 = add i32 256, %177
  %179 = zext i32 %178 to i64
  %180 = add i64 %174, %179
  %181 = call i32 @Xil_In32(i64 noundef %180)
  br label %182

182:                                              ; preds = %170
  %183 = load i8, ptr %4, align 1, !tbaa !24
  %184 = add i8 %183, 1
  store i8 %184, ptr %4, align 1, !tbaa !24
  br label %166, !llvm.loop !27

185:                                              ; preds = %166
  %186 = load ptr, ptr %2, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %186, i32 0, i32 0
  %188 = getelementptr inbounds %struct.XEmacPs_Config, ptr %187, i32 0, i32 1
  %189 = load i64, ptr %188, align 8, !tbaa !18
  %190 = add i64 %189, 0
  %191 = call i32 @Xil_In32(i64 noundef %190)
  store i32 %191, ptr %3, align 4, !tbaa !9
  %192 = load i32, ptr %3, align 4, !tbaa !9
  %193 = and i32 %192, -5
  store i32 %193, ptr %3, align 4, !tbaa !9
  %194 = load ptr, ptr %2, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %194, i32 0, i32 0
  %196 = getelementptr inbounds %struct.XEmacPs_Config, ptr %195, i32 0, i32 1
  %197 = load i64, ptr %196, align 8, !tbaa !18
  %198 = add i64 %197, 0
  %199 = load i32, ptr %3, align 4, !tbaa !9
  call void @Xil_Out32(i64 noundef %198, i32 noundef %199)
  %200 = load ptr, ptr %2, align 8, !tbaa !5
  %201 = load ptr, ptr %2, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %201, i32 0, i32 3
  %203 = load i32, ptr %202, align 8, !tbaa !17
  %204 = and i32 %203, -769
  %205 = call i64 @XEmacPs_SetOptions(ptr noundef %200, i32 noundef %204)
  %206 = load ptr, ptr %2, align 8, !tbaa !5
  %207 = load ptr, ptr %2, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.XEmacPs_Instance, ptr %207, i32 0, i32 3
  %209 = load i32, ptr %208, align 8, !tbaa !17
  %210 = xor i32 %209, -1
  %211 = call i64 @XEmacPs_ClearOptions(ptr noundef %206, i32 noundef %210)
  store i32 0, ptr %6, align 4
  br label %212

212:                                              ; preds = %185, %17, %10
  call void @llvm.lifetime.end.p0(i64 6, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  %213 = load i32, ptr %6, align 4
  switch i32 %213, label %215 [
    i32 0, label %214
    i32 1, label %214
  ]

214:                                              ; preds = %212, %212
  ret void

215:                                              ; preds = %212
  unreachable
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Xil_Out32(i64 noundef, i32 noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @Xil_In32(i64 noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @XEmacPs_Stop(ptr noundef) #1

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

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

declare void @XEmacPs_ClearHash(ptr noundef) #0

declare i64 @XEmacPs_SetMacAddress(ptr noundef, ptr noundef, i8 noundef zeroext) #0

declare i64 @XEmacPs_SetTypeIdCheck(ptr noundef, i32 noundef, i8 noundef zeroext) #0

declare i64 @XEmacPs_SetOptions(ptr noundef, i32 noundef) #0

declare i64 @XEmacPs_ClearOptions(ptr noundef, i32 noundef) #0

attributes #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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 28}
!12 = !{!"XEmacPs_Instance", !13, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !16, i64 40, !16, i64 152, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !10, i64 312, !10, i64 316, !10, i64 320, !10, i64 324, !10, i64 328}
!13 = !{!"", !14, i64 0, !15, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19, !7, i64 20, !7, i64 21, !7, i64 22}
!14 = !{!"short", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"", !15, i64 0, !15, i64 8, !15, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104}
!17 = !{!12, !10, i64 32}
!18 = !{!12, !15, i64 8}
!19 = !{!12, !10, i64 312}
!20 = !{!12, !10, i64 320}
!21 = !{!12, !10, i64 324}
!22 = !{!12, !10, i64 328}
!23 = !{!12, !10, i64 316}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


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

@Xil_AssertStatus = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [165 x i8], align 1

declare void @Xil_Assert(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @XEmacPs_Reset(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca [6 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %2) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(6) %2, i8 0, i64 6, i1 false)
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %7, label %3

3:                                                ; preds = %1
  store i32 0, ptr @Xil_AssertStatus, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 28
  %5 = load i32, ptr %4, align 4, !tbaa !9
  %6 = icmp eq i32 %5, 286331153
  br i1 %6, label %8, label %28

7:                                                ; preds = %1
  tail call void @Xil_Assert(ptr noundef nonnull @.str, i32 noundef 304) #5
  store i32 1, ptr @Xil_AssertStatus, align 4, !tbaa !5
  br label %83

8:                                                ; preds = %3
  tail call void @XEmacPs_Stop(ptr noundef nonnull %0)
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 14320, ptr %9, align 8, !tbaa !16
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load i64, ptr %10, align 8, !tbaa !17
  %12 = add i64 %11, 252
  %13 = tail call i32 @Xil_In32(i64 noundef %12)
  %14 = getelementptr inbounds i8, ptr %0, i64 312
  %15 = lshr i32 %13, 16
  %16 = and i32 %15, 4095
  store i32 %16, ptr %14, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %0, i64 316
  store <4 x i32> <i32 8191, i32 1500, i32 1518, i32 1536>, ptr %17, align 4, !tbaa !5
  %18 = load i64, ptr %10, align 8, !tbaa !17
  tail call void @Xil_Out32(i64 noundef %18, i32 noundef 48)
  %19 = load i64, ptr %10, align 8, !tbaa !17
  %20 = add i64 %19, 4
  %21 = tail call i32 @Xil_In32(i64 noundef %20)
  %22 = and i32 %21, 1835008
  %23 = or disjoint i32 %22, 131
  %24 = load i64, ptr %10, align 8, !tbaa !17
  %25 = add i64 %24, 4
  tail call void @Xil_Out32(i64 noundef %25, i32 noundef %23)
  %26 = load i32, ptr %14, align 8, !tbaa !18
  %27 = icmp ugt i32 %26, 2
  br i1 %27, label %29, label %34

28:                                               ; preds = %3
  tail call void @Xil_Assert(ptr noundef nonnull @.str, i32 noundef 305) #5
  store i32 1, ptr @Xil_AssertStatus, align 4, !tbaa !5
  br label %83

29:                                               ; preds = %8
  %30 = load i64, ptr %10, align 8, !tbaa !17
  %31 = add i64 %30, 4
  %32 = tail call i32 @Xil_In32(i64 noundef %31)
  %33 = or i32 %32, 2097152
  tail call void @Xil_Out32(i64 noundef %31, i32 noundef %33)
  br label %34

34:                                               ; preds = %29, %8
  %35 = load i64, ptr %10, align 8, !tbaa !17
  %36 = add i64 %35, 16
  tail call void @Xil_Out32(i64 noundef %36, i32 noundef 1574656)
  %37 = load i32, ptr %14, align 8, !tbaa !18
  %38 = icmp ugt i32 %37, 2
  br i1 %38, label %39, label %44

39:                                               ; preds = %34
  %40 = load i64, ptr %10, align 8, !tbaa !17
  %41 = add i64 %40, 16
  %42 = tail call i32 @Xil_In32(i64 noundef %41)
  %43 = or i32 %42, 16
  tail call void @Xil_Out32(i64 noundef %41, i32 noundef %43)
  br label %44

44:                                               ; preds = %39, %34
  %45 = load i64, ptr %10, align 8, !tbaa !17
  %46 = add i64 %45, 20
  tail call void @Xil_Out32(i64 noundef %46, i32 noundef -1)
  tail call void @XEmacPs_SetQueuePtr(ptr noundef nonnull %0, i64 noundef 0, i8 noundef zeroext 0, i16 noundef zeroext 1)
  %47 = load i32, ptr %14, align 8, !tbaa !18
  %48 = icmp ugt i32 %47, 2
  br i1 %48, label %49, label %.preheader.preheader

49:                                               ; preds = %44
  tail call void @XEmacPs_SetQueuePtr(ptr noundef nonnull %0, i64 noundef 0, i8 noundef zeroext 1, i16 noundef zeroext 1)
  br label %.preheader.preheader

.preheader.preheader:                             ; preds = %49, %44
  tail call void @XEmacPs_SetQueuePtr(ptr noundef nonnull %0, i64 noundef 0, i8 noundef zeroext 0, i16 noundef zeroext 2)
  %50 = load i64, ptr %10, align 8, !tbaa !17
  %51 = add i64 %50, 32
  tail call void @Xil_Out32(i64 noundef %51, i32 noundef -1)
  %52 = load i64, ptr %10, align 8, !tbaa !17
  %53 = add i64 %52, 44
  tail call void @Xil_Out32(i64 noundef %53, i32 noundef 32767)
  %54 = load i64, ptr %10, align 8, !tbaa !17
  %55 = add i64 %54, 36
  %56 = tail call i32 @Xil_In32(i64 noundef %55)
  %57 = load i64, ptr %10, align 8, !tbaa !17
  %58 = add i64 %57, 36
  tail call void @Xil_Out32(i64 noundef %58, i32 noundef %56)
  tail call void @XEmacPs_ClearHash(ptr noundef nonnull %0) #5
  %59 = call i64 @XEmacPs_SetMacAddress(ptr noundef nonnull %0, ptr noundef nonnull %2, i8 noundef zeroext 1) #5
  %60 = call i64 @XEmacPs_SetTypeIdCheck(ptr noundef nonnull %0, i32 noundef 0, i8 noundef zeroext 1) #5
  %61 = call i64 @XEmacPs_SetMacAddress(ptr noundef nonnull %0, ptr noundef nonnull %2, i8 noundef zeroext 2) #5
  %62 = call i64 @XEmacPs_SetTypeIdCheck(ptr noundef nonnull %0, i32 noundef 0, i8 noundef zeroext 2) #5
  %63 = call i64 @XEmacPs_SetMacAddress(ptr noundef nonnull %0, ptr noundef nonnull %2, i8 noundef zeroext 3) #5
  %64 = call i64 @XEmacPs_SetTypeIdCheck(ptr noundef nonnull %0, i32 noundef 0, i8 noundef zeroext 3) #5
  %65 = call i64 @XEmacPs_SetMacAddress(ptr noundef nonnull %0, ptr noundef nonnull %2, i8 noundef zeroext 4) #5
  %66 = call i64 @XEmacPs_SetTypeIdCheck(ptr noundef nonnull %0, i32 noundef 0, i8 noundef zeroext 4) #5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %indvars.iv = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next, %.preheader ]
  %67 = load i64, ptr %10, align 8, !tbaa !17
  %68 = shl nuw i64 %indvars.iv, 2
  %69 = or disjoint i64 %68, 256
  %70 = add i64 %69, %67
  %71 = call i32 @Xil_In32(i64 noundef %70)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 45
  br i1 %exitcond.not, label %72, label %.preheader, !llvm.loop !19

72:                                               ; preds = %.preheader
  %73 = load i64, ptr %10, align 8, !tbaa !17
  %74 = call i32 @Xil_In32(i64 noundef %73)
  %75 = and i32 %74, -5
  %76 = load i64, ptr %10, align 8, !tbaa !17
  call void @Xil_Out32(i64 noundef %76, i32 noundef %75)
  %77 = load i32, ptr %9, align 8, !tbaa !16
  %78 = and i32 %77, -769
  %79 = call i64 @XEmacPs_SetOptions(ptr noundef nonnull %0, i32 noundef %78) #5
  %80 = load i32, ptr %9, align 8, !tbaa !16
  %81 = xor i32 %80, -1
  %82 = call i64 @XEmacPs_ClearOptions(ptr noundef nonnull %0, i32 noundef %81) #5
  br label %83

83:                                               ; preds = %72, %28, %7
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %2) #5
  ret void
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Xil_Out32(i64 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @Xil_In32(i64 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) #2

; Function Attrs: nounwind uwtable
declare dso_local void @XEmacPs_Stop(ptr noundef) local_unnamed_addr #1

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

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

declare void @XEmacPs_ClearHash(ptr noundef) local_unnamed_addr #0

declare i64 @XEmacPs_SetMacAddress(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #0

declare i64 @XEmacPs_SetTypeIdCheck(ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #0

declare i64 @XEmacPs_SetOptions(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i64 @XEmacPs_ClearOptions(ptr noundef, i32 noundef) local_unnamed_addr #0

attributes #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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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, !6, i64 28}
!10 = !{!"XEmacPs_Instance", !11, i64 0, !6, i64 24, !6, i64 28, !6, i64 32, !14, i64 40, !14, i64 152, !15, i64 264, !15, i64 272, !15, i64 280, !15, i64 288, !15, i64 296, !15, i64 304, !6, i64 312, !6, i64 316, !6, i64 320, !6, i64 324, !6, i64 328}
!11 = !{!"", !12, i64 0, !13, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19, !7, i64 20, !7, i64 21, !7, i64 22}
!12 = !{!"short", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!10, !6, i64 32}
!17 = !{!10, !13, i64 8}
!18 = !{!10, !6, i64 312}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


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