; LLVM IR from lfarcaro/ARINC653_ARMV7A_Z7000 :: ARINC653_ARMV7A_Z7000.sw/ARINC653_ARMV7A_Z7000_bsp/ps7_cortexa9_0/libsrc/sdps_v3_6 (MmcCardInitialize)

; 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.XSdPs = type { %struct.XSdPs_Config, i32, i32, i32, i32, i8, i8, i8, i8, i32, i8, [4 x i32], i32, [4 x i32], i32, i32, i32, ptr, [8 x i8], [32 x %struct.XSdPs_Adma2Descriptor], i64, [24 x i8] }
%struct.XSdPs_Config = type { i16, i32, i32, i32, i32, i32, i32, i32, i8 }
%struct.XSdPs_Adma2Descriptor = type <{ i16, i16, i64 }>

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @XSdPs_ReadReg16(i32 noundef, i8 noundef zeroext) #2

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

; 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 i32 @XSdPs_CmdTransfer(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

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

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

15:                                               ; preds = %1
  call void @Xil_Assert(ptr noundef @.str, i32 noundef 1742)
  store i32 1, ptr @Xil_AssertStatus, align 4, !tbaa !9
  store i32 0, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %228

16:                                               ; preds = %14
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.XSdPs, ptr %17, i32 0, i32 1
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = icmp eq i32 %19, 286331153
  br i1 %20, label %21, label %22

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

22:                                               ; preds = %16
  call void @Xil_Assert(ptr noundef @.str, i32 noundef 1743)
  store i32 1, ptr @Xil_AssertStatus, align 4, !tbaa !9
  store i32 0, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %228

23:                                               ; preds = %21
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.XSdPs, ptr %24, i32 0, i32 7
  %26 = load i8, ptr %25, align 2, !tbaa !16
  %27 = zext i8 %26 to i32
  %28 = icmp ne i32 %27, 2
  br i1 %28, label %35, label %29

29:                                               ; preds = %23
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.XSdPs, ptr %30, i32 0, i32 2
  %32 = load i32, ptr %31, align 8, !tbaa !17
  %33 = and i32 %32, -1073741824
  %34 = icmp ne i32 %33, 1073741824
  br i1 %34, label %35, label %55

35:                                               ; preds = %29, %23
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.XSdPs, ptr %36, i32 0, i32 0
  %38 = getelementptr inbounds %struct.XSdPs_Config, ptr %37, i32 0, i32 3
  %39 = load i32, ptr %38, align 4, !tbaa !18
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %54

41:                                               ; preds = %35
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.XSdPs, ptr %42, i32 0, i32 0
  %44 = getelementptr inbounds %struct.XSdPs_Config, ptr %43, i32 0, i32 1
  %45 = load i32, ptr %44, align 4, !tbaa !19
  %46 = add i32 %45, 36
  %47 = zext i32 %46 to i64
  %48 = call i32 @Xil_In32(i64 noundef %47)
  store i32 %48, ptr %4, align 4, !tbaa !9
  %49 = load i32, ptr %4, align 4, !tbaa !9
  %50 = and i32 %49, 65536
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %41
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %226

53:                                               ; preds = %41
  br label %54

54:                                               ; preds = %53, %35
  br label %55

55:                                               ; preds = %54, %29
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = call i32 @XSdPs_CmdTransfer(ptr noundef %56, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  store i32 %57, ptr %5, align 4, !tbaa !9
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = icmp ne i64 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %55
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %226

62:                                               ; preds = %55
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %74, %62
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %65 = and i32 %64, -2147483648
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %82

67:                                               ; preds = %63
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = call i32 @XSdPs_CmdTransfer(ptr noundef %68, i32 noundef 256, i32 noundef 1090486272, i32 noundef 0)
  store i32 %69, ptr %5, align 4, !tbaa !9
  %70 = load i32, ptr %5, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = icmp ne i64 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %67
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %226

74:                                               ; preds = %67
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.XSdPs, ptr %75, i32 0, i32 0
  %77 = getelementptr inbounds %struct.XSdPs_Config, ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !19
  %79 = add i32 %78, 16
  %80 = zext i32 %79 to i64
  %81 = call i32 @Xil_In32(i64 noundef %80)
  store i32 %81, ptr %6, align 4, !tbaa !9
  br label %63, !llvm.loop !20

82:                                               ; preds = %63
  %83 = load i32, ptr %6, align 4, !tbaa !9
  %84 = and i32 %83, 1073741824
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %89

86:                                               ; preds = %82
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.XSdPs, ptr %87, i32 0, i32 4
  store i32 1, ptr %88, align 16, !tbaa !22
  br label %89

89:                                               ; preds = %86, %82
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = call i32 @XSdPs_CmdTransfer(ptr noundef %90, i32 noundef 512, i32 noundef 0, i32 noundef 0)
  store i32 %91, ptr %5, align 4, !tbaa !9
  %92 = load i32, ptr %5, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = icmp ne i64 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %89
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %226

96:                                               ; preds = %89
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.XSdPs, ptr %97, i32 0, i32 0
  %99 = getelementptr inbounds %struct.XSdPs_Config, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !19
  %101 = call zeroext i16 @XSdPs_ReadReg16(i32 noundef %100, i8 noundef zeroext 16)
  %102 = zext i16 %101 to i32
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.XSdPs, ptr %103, i32 0, i32 11
  %105 = getelementptr inbounds [4 x i32], ptr %104, i64 0, i64 0
  store i32 %102, ptr %105, align 32, !tbaa !9
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.XSdPs, ptr %106, i32 0, i32 0
  %108 = getelementptr inbounds %struct.XSdPs_Config, ptr %107, i32 0, i32 1
  %109 = load i32, ptr %108, align 4, !tbaa !19
  %110 = call zeroext i16 @XSdPs_ReadReg16(i32 noundef %109, i8 noundef zeroext 20)
  %111 = zext i16 %110 to i32
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.XSdPs, ptr %112, i32 0, i32 11
  %114 = getelementptr inbounds [4 x i32], ptr %113, i64 0, i64 1
  store i32 %111, ptr %114, align 4, !tbaa !9
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.XSdPs, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds %struct.XSdPs_Config, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !19
  %119 = call zeroext i16 @XSdPs_ReadReg16(i32 noundef %118, i8 noundef zeroext 24)
  %120 = zext i16 %119 to i32
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.XSdPs, ptr %121, i32 0, i32 11
  %123 = getelementptr inbounds [4 x i32], ptr %122, i64 0, i64 2
  store i32 %120, ptr %123, align 8, !tbaa !9
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.XSdPs, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds %struct.XSdPs_Config, ptr %125, i32 0, i32 1
  %127 = load i32, ptr %126, align 4, !tbaa !19
  %128 = call zeroext i16 @XSdPs_ReadReg16(i32 noundef %127, i8 noundef zeroext 28)
  %129 = zext i16 %128 to i32
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.XSdPs, ptr %130, i32 0, i32 11
  %132 = getelementptr inbounds [4 x i32], ptr %131, i64 0, i64 3
  store i32 %129, ptr %132, align 4, !tbaa !9
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.XSdPs, ptr %133, i32 0, i32 12
  store i32 305397760, ptr %134, align 16, !tbaa !23
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.XSdPs, ptr %136, i32 0, i32 12
  %138 = load i32, ptr %137, align 16, !tbaa !23
  %139 = call i32 @XSdPs_CmdTransfer(ptr noundef %135, i32 noundef 768, i32 noundef %138, i32 noundef 0)
  store i32 %139, ptr %5, align 4, !tbaa !9
  %140 = load i32, ptr %5, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = icmp ne i64 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %96
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %226

144:                                              ; preds = %96
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.XSdPs, ptr %146, i32 0, i32 12
  %148 = load i32, ptr %147, align 16, !tbaa !23
  %149 = call i32 @XSdPs_CmdTransfer(ptr noundef %145, i32 noundef 2304, i32 noundef %148, i32 noundef 0)
  store i32 %149, ptr %5, align 4, !tbaa !9
  %150 = load i32, ptr %5, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = icmp ne i64 %151, 0
  br i1 %152, label %153, label %154

153:                                              ; preds = %144
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %226

154:                                              ; preds = %144
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.XSdPs, ptr %155, i32 0, i32 0
  %157 = getelementptr inbounds %struct.XSdPs_Config, ptr %156, i32 0, i32 1
  %158 = load i32, ptr %157, align 4, !tbaa !19
  %159 = add i32 %158, 16
  %160 = zext i32 %159 to i64
  %161 = call i32 @Xil_In32(i64 noundef %160)
  %162 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 0
  store i32 %161, ptr %162, align 16, !tbaa !9
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.XSdPs, ptr %163, i32 0, i32 0
  %165 = getelementptr inbounds %struct.XSdPs_Config, ptr %164, i32 0, i32 1
  %166 = load i32, ptr %165, align 4, !tbaa !19
  %167 = add i32 %166, 20
  %168 = zext i32 %167 to i64
  %169 = call i32 @Xil_In32(i64 noundef %168)
  %170 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 1
  store i32 %169, ptr %170, align 4, !tbaa !9
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.XSdPs, ptr %171, i32 0, i32 0
  %173 = getelementptr inbounds %struct.XSdPs_Config, ptr %172, i32 0, i32 1
  %174 = load i32, ptr %173, align 4, !tbaa !19
  %175 = add i32 %174, 24
  %176 = zext i32 %175 to i64
  %177 = call i32 @Xil_In32(i64 noundef %176)
  %178 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 2
  store i32 %177, ptr %178, align 8, !tbaa !9
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.XSdPs, ptr %179, i32 0, i32 0
  %181 = getelementptr inbounds %struct.XSdPs_Config, ptr %180, i32 0, i32 1
  %182 = load i32, ptr %181, align 4, !tbaa !19
  %183 = add i32 %182, 28
  %184 = zext i32 %183 to i64
  %185 = call i32 @Xil_In32(i64 noundef %184)
  %186 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 3
  store i32 %185, ptr %186, align 4, !tbaa !9
  %187 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 3
  %188 = load i32, ptr %187, align 4, !tbaa !9
  %189 = and i32 %188, 3932160
  %190 = lshr i32 %189, 18
  %191 = trunc i32 %190 to i8
  %192 = load ptr, ptr %3, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.XSdPs, ptr %192, i32 0, i32 6
  store i8 %191, ptr %193, align 1, !tbaa !24
  %194 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 2
  %195 = load i32, ptr %194, align 8, !tbaa !9
  %196 = and i32 %195, 3840
  %197 = lshr i32 %196, 8
  %198 = shl i32 1, %197
  store i32 %198, ptr %8, align 4, !tbaa !9
  %199 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 1
  %200 = load i32, ptr %199, align 4, !tbaa !9
  %201 = and i32 %200, 896
  %202 = lshr i32 %201, 7
  %203 = add i32 %202, 2
  %204 = shl i32 1, %203
  store i32 %204, ptr %10, align 4, !tbaa !9
  %205 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 1
  %206 = load i32, ptr %205, align 4, !tbaa !9
  %207 = and i32 %206, -4194304
  %208 = lshr i32 %207, 22
  store i32 %208, ptr %9, align 4, !tbaa !9
  %209 = getelementptr inbounds [4 x i32], ptr %7, i64 0, i64 2
  %210 = load i32, ptr %209, align 8, !tbaa !9
  %211 = and i32 %210, 3
  %212 = shl i32 %211, 10
  %213 = load i32, ptr %9, align 4, !tbaa !9
  %214 = or i32 %213, %212
  store i32 %214, ptr %9, align 4, !tbaa !9
  %215 = load i32, ptr %9, align 4, !tbaa !9
  %216 = add i32 %215, 1
  %217 = load i32, ptr %10, align 4, !tbaa !9
  %218 = mul i32 %216, %217
  store i32 %218, ptr %9, align 4, !tbaa !9
  %219 = load i32, ptr %9, align 4, !tbaa !9
  %220 = load i32, ptr %8, align 4, !tbaa !9
  %221 = mul i32 %219, %220
  store i32 %221, ptr %9, align 4, !tbaa !9
  %222 = load i32, ptr %9, align 4, !tbaa !9
  %223 = udiv i32 %222, 512
  %224 = load ptr, ptr %3, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.XSdPs, ptr %224, i32 0, i32 14
  store i32 %223, ptr %225, align 4, !tbaa !25
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %226

226:                                              ; preds = %154, %153, %143, %95, %73, %61, %52
  %227 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %227, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %228

228:                                              ; preds = %226, %22, %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %229 = load i32, ptr %2, align 4
  ret i32 %229
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { 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 = !{!"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 36}
!12 = !{!"", !13, i64 0, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !7, i64 52, !7, i64 53, !7, i64 54, !7, i64 55, !10, i64 56, !7, i64 60, !7, i64 64, !10, i64 80, !7, i64 84, !10, i64 100, !10, i64 104, !10, i64 108, !6, i64 112, !7, i64 128, !15, i64 512}
!13 = !{!"", !14, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !7, i64 32}
!14 = !{!"short", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!12, !7, i64 54}
!17 = !{!12, !10, i64 40}
!18 = !{!12, !10, i64 12}
!19 = !{!12, !10, i64 4}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!12, !10, i64 48}
!23 = !{!12, !10, i64 80}
!24 = !{!12, !7, i64 53}
!25 = !{!12, !10, i64 100}


; 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 [159 x i8], align 1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @XSdPs_ReadReg16(i32 noundef, i8 noundef zeroext) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @XSdPs_CmdTransfer(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @XSdPs_MmcCardInitialize(ptr noundef %0) local_unnamed_addr #2 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %6, label %2

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

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

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 54
  %9 = load i8, ptr %8, align 2, !tbaa !15
  %.not50 = icmp eq i8 %9, 2
  br i1 %.not50, label %11, label %15

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

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %0, i64 40
  %13 = load i32, ptr %12, align 8, !tbaa !16
  %14 = and i32 %13, -1073741824
  %.not51 = icmp eq i32 %14, 1073741824
  br i1 %.not51, label %26, label %15

15:                                               ; preds = %11, %7
  %16 = getelementptr inbounds i8, ptr %0, i64 12
  %17 = load i32, ptr %16, align 4, !tbaa !17
  %.not52 = icmp eq i32 %17, 0
  br i1 %.not52, label %26, label %18

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 4
  %20 = load i32, ptr %19, align 4, !tbaa !18
  %21 = add i32 %20, 36
  %22 = zext i32 %21 to i64
  %23 = tail call i32 @Xil_In32(i64 noundef %22)
  %24 = and i32 %23, 65536
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %.loopexit, label %26

26:                                               ; preds = %15, %18, %11
  %27 = tail call i32 @XSdPs_CmdTransfer(ptr noundef nonnull %0, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %.not53 = icmp eq i32 %27, 0
  br i1 %.not53, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %26
  %28 = getelementptr inbounds i8, ptr %0, i64 4
  br label %29

29:                                               ; preds = %.preheader, %31
  %30 = tail call i32 @XSdPs_CmdTransfer(ptr noundef nonnull %0, i32 noundef 256, i32 noundef 1090486272, i32 noundef 0)
  %.not58 = icmp eq i32 %30, 0
  br i1 %.not58, label %31, label %.loopexit

31:                                               ; preds = %29
  %32 = load i32, ptr %28, align 4, !tbaa !18
  %33 = add i32 %32, 16
  %34 = zext i32 %33 to i64
  %35 = tail call i32 @Xil_In32(i64 noundef %34)
  %36 = icmp sgt i32 %35, -1
  br i1 %36, label %29, label %37, !llvm.loop !19

37:                                               ; preds = %31
  %38 = and i32 %35, 1073741824
  %.not54 = icmp eq i32 %38, 0
  br i1 %.not54, label %41, label %39

39:                                               ; preds = %37
  %40 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 1, ptr %40, align 16, !tbaa !21
  br label %41

41:                                               ; preds = %39, %37
  %42 = tail call i32 @XSdPs_CmdTransfer(ptr noundef nonnull %0, i32 noundef 512, i32 noundef 0, i32 noundef 0)
  %.not55 = icmp eq i32 %42, 0
  br i1 %.not55, label %43, label %.loopexit

43:                                               ; preds = %41
  %44 = load i32, ptr %28, align 4, !tbaa !18
  %45 = tail call zeroext i16 @XSdPs_ReadReg16(i32 noundef %44, i8 noundef zeroext 16)
  %46 = zext i16 %45 to i32
  %47 = getelementptr inbounds i8, ptr %0, i64 64
  store i32 %46, ptr %47, align 32, !tbaa !5
  %48 = load i32, ptr %28, align 4, !tbaa !18
  %49 = tail call zeroext i16 @XSdPs_ReadReg16(i32 noundef %48, i8 noundef zeroext 20)
  %50 = zext i16 %49 to i32
  %51 = getelementptr inbounds i8, ptr %0, i64 68
  store i32 %50, ptr %51, align 4, !tbaa !5
  %52 = load i32, ptr %28, align 4, !tbaa !18
  %53 = tail call zeroext i16 @XSdPs_ReadReg16(i32 noundef %52, i8 noundef zeroext 24)
  %54 = zext i16 %53 to i32
  %55 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %54, ptr %55, align 8, !tbaa !5
  %56 = load i32, ptr %28, align 4, !tbaa !18
  %57 = tail call zeroext i16 @XSdPs_ReadReg16(i32 noundef %56, i8 noundef zeroext 28)
  %58 = zext i16 %57 to i32
  %59 = getelementptr inbounds i8, ptr %0, i64 76
  store i32 %58, ptr %59, align 4, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 305397760, ptr %60, align 16, !tbaa !22
  %61 = tail call i32 @XSdPs_CmdTransfer(ptr noundef nonnull %0, i32 noundef 768, i32 noundef 305397760, i32 noundef 0)
  %.not56 = icmp eq i32 %61, 0
  br i1 %.not56, label %62, label %.loopexit

62:                                               ; preds = %43
  %63 = load i32, ptr %60, align 16, !tbaa !22
  %64 = tail call i32 @XSdPs_CmdTransfer(ptr noundef nonnull %0, i32 noundef 2304, i32 noundef %63, i32 noundef 0)
  %.not57 = icmp eq i32 %64, 0
  br i1 %.not57, label %65, label %.loopexit

65:                                               ; preds = %62
  %66 = load i32, ptr %28, align 4, !tbaa !18
  %67 = add i32 %66, 16
  %68 = zext i32 %67 to i64
  %69 = tail call i32 @Xil_In32(i64 noundef %68)
  %70 = load i32, ptr %28, align 4, !tbaa !18
  %71 = add i32 %70, 20
  %72 = zext i32 %71 to i64
  %73 = tail call i32 @Xil_In32(i64 noundef %72)
  %74 = load i32, ptr %28, align 4, !tbaa !18
  %75 = add i32 %74, 24
  %76 = zext i32 %75 to i64
  %77 = tail call i32 @Xil_In32(i64 noundef %76)
  %78 = load i32, ptr %28, align 4, !tbaa !18
  %79 = add i32 %78, 28
  %80 = zext i32 %79 to i64
  %81 = tail call i32 @Xil_In32(i64 noundef %80)
  %82 = lshr i32 %81, 18
  %83 = trunc i32 %82 to i8
  %84 = and i8 %83, 15
  %85 = getelementptr inbounds i8, ptr %0, i64 53
  store i8 %84, ptr %85, align 1, !tbaa !23
  %86 = lshr i32 %77, 8
  %87 = and i32 %86, 15
  %88 = lshr i32 %73, 7
  %89 = and i32 %88, 7
  %90 = lshr i32 %73, 22
  %91 = shl i32 %77, 10
  %92 = and i32 %91, 3072
  %93 = add nuw nsw i32 %90, 1
  %94 = add nuw nsw i32 %93, %92
  %95 = add nuw nsw i32 %89, 2
  %96 = shl nuw nsw i32 %94, %95
  %97 = shl i32 %96, %87
  %98 = lshr i32 %97, 9
  %99 = getelementptr inbounds i8, ptr %0, i64 100
  store i32 %98, ptr %99, align 4, !tbaa !24
  br label %.loopexit

.loopexit:                                        ; preds = %29, %65, %18, %26, %41, %43, %62, %10, %6
  %.0 = phi i32 [ 0, %10 ], [ 0, %6 ], [ 0, %65 ], [ 1, %18 ], [ 1, %26 ], [ 1, %41 ], [ 1, %43 ], [ 1, %62 ], [ 1, %29 ]
  ret i32 %.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 = { 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 #2 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 36}
!10 = !{!"", !11, i64 0, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !7, i64 52, !7, i64 53, !7, i64 54, !7, i64 55, !6, i64 56, !7, i64 60, !7, i64 64, !6, i64 80, !7, i64 84, !6, i64 100, !6, i64 104, !6, i64 108, !13, i64 112, !7, i64 128, !14, i64 512}
!11 = !{!"", !12, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !7, i64 32}
!12 = !{!"short", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!10, !7, i64 54}
!16 = !{!10, !6, i64 40}
!17 = !{!10, !6, i64 12}
!18 = !{!10, !6, i64 4}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!10, !6, i64 48}
!22 = !{!10, !6, i64 80}
!23 = !{!10, !7, i64 53}
!24 = !{!10, !6, i64 100}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass