; LLVM IR from GPUOpen-LibrariesAndSDKs/TAN :: tan/samples/src/GPUUtilities (GPUUtilities)

; 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._ADLAdapterInfo = type { i32, i8, i32, i32, i32, i64, i64, i32 }
%struct.cl_device_topology_amd = type { %"struct.listTanDevicesAndCaps(TanDeviceCapabilities **, int *)::cl_device_topology_amd::pcie_" }
%"struct.listTanDevicesAndCaps(TanDeviceCapabilities **, int *)::cl_device_topology_amd::pcie_" = type { i32, i32, i32 }
%struct._TanDeviceCapabilities = type { ptr, i64, ptr, ptr, ptr, i8, i8, i32, float, i32, i32, i32, i64, i64, i64, [1016 x i32] }

@stdout = external global ptr, align 8
@.str = external hidden unnamed_addr constant [37 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@__const.listTanDevicesAndCaps.clDeviceTypes = external hidden unnamed_addr constant [2 x i64], align 16
@.str.19 = external hidden unnamed_addr constant [21 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 i32 @clGetPlatformIDs(i32 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #5

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

declare i32 @printf(ptr noundef, ...) #1

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

declare i32 @clGetDeviceIDs(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) #1

declare i32 @clGetDeviceInfo(ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) #1

declare i32 @clReleaseDevice(ptr noundef) #1

declare ptr @clCreateContext(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @clCreateCommandQueue(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z27checkOpenCL2_XCompatibilityP13_cl_device_id(ptr noundef) #7

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z22getAMFdevicePropertiesP17_cl_command_queuePi(ptr noundef, ptr noundef) #7

; Function Attrs: mustprogress uwtable
define dso_local i32 @listTanDevicesAndCaps(ptr noundef %0, ptr noundef %1) #7 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [100 x %struct._ADLAdapterInfo], align 16
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca [100 x i8], align 16
  %15 = alloca [2048 x ptr], align 16
  %16 = alloca i32, align 4
  %17 = alloca [2 x i64], align 16
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca [3 x i64], align 16
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca %struct.cl_device_topology_amd, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4800, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %32 = getelementptr inbounds [100 x %struct._ADLAdapterInfo], ptr %7, i64 0, i64 0
  %33 = call noundef i32 @_Z19ADLQueryAdapterInfoP15_ADLAdapterInfoi(ptr noundef %32, i32 noundef 100)
  store i32 %33, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %34 = call noalias noundef nonnull ptr @_Znam(i64 noundef 415200) #10
  store ptr %34, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  store ptr null, ptr %12, align 8, !tbaa !5
  %35 = call i32 @clGetPlatformIDs(i32 noundef 0, ptr noundef null, ptr noundef %10)
  store i32 %35, ptr %6, align 4, !tbaa !9
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %42

38:                                               ; preds = %2
  %39 = load ptr, ptr @stdout, align 8, !tbaa !5
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str, i32 noundef %40) #9
  store i32 0, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %511

42:                                               ; preds = %2
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = icmp ult i32 0, %43
  br i1 %44, label %45, label %67

45:                                               ; preds = %42
  %46 = load i32, ptr %10, align 4, !tbaa !9
  %47 = zext i32 %46 to i64
  %48 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %47, i64 8)
  %49 = extractvalue { i64, i1 } %48, 1
  %50 = extractvalue { i64, i1 } %48, 0
  %51 = select i1 %49, i64 -1, i64 %50
  %52 = call noalias noundef nonnull ptr @_Znam(i64 noundef %51) #10
  store ptr %52, ptr %12, align 8, !tbaa !5
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = call i32 @clGetPlatformIDs(i32 noundef %53, ptr noundef %54, ptr noundef null)
  store i32 %55, ptr %6, align 4, !tbaa !9
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %66

58:                                               ; preds = %45
  %59 = load ptr, ptr @stdout, align 8, !tbaa !5
  %60 = load i32, ptr %6, align 4, !tbaa !9
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef @.str, i32 noundef %60) #9
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = icmp eq ptr %62, null
  br i1 %63, label %65, label %64

64:                                               ; preds = %58
  call void @_ZdaPv(ptr noundef %62) #11
  br label %65

65:                                               ; preds = %64, %58
  store i32 0, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %511

66:                                               ; preds = %45
  br label %67

67:                                               ; preds = %66, %42
  call void @llvm.lifetime.start.p0(i64 100, ptr %14) #9
  call void @llvm.memset.p0.i64(ptr align 16 %14, i8 0, i64 100, i1 false)
  call void @llvm.lifetime.start.p0(i64 16384, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %17, ptr align 16 @__const.listTanDevicesAndCaps.clDeviceTypes, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %495, %67
  %69 = load i32, ptr %18, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = icmp ult i64 %70, 2
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %498

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %491, %73
  %75 = load i32, ptr %19, align 4, !tbaa !9
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = icmp ult i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %494

79:                                               ; preds = %74
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = load i32, ptr %19, align 4, !tbaa !9
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds ptr, ptr %80, i64 %82
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  store ptr %84, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  store i32 0, ptr %20, align 4, !tbaa !9
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = load i32, ptr %18, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [2 x i64], ptr %17, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !11
  %90 = call i32 @clGetDeviceIDs(ptr noundef %85, i64 noundef %89, i32 noundef 0, ptr noundef null, ptr noundef %20)
  %91 = load i32, ptr %20, align 4, !tbaa !9
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %79
  store i32 7, ptr %13, align 4
  br label %488

94:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %95 = load i32, ptr %20, align 4, !tbaa !9
  %96 = zext i32 %95 to i64
  %97 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %96, i64 8)
  %98 = extractvalue { i64, i1 } %97, 1
  %99 = extractvalue { i64, i1 } %97, 0
  %100 = select i1 %98, i64 -1, i64 %99
  %101 = call noalias noundef nonnull ptr @_Znam(i64 noundef %100) #10
  store ptr %101, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %112, %94
  %103 = load i32, ptr %22, align 4, !tbaa !9
  %104 = load i32, ptr %20, align 4, !tbaa !9
  %105 = icmp ult i32 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %115

107:                                              ; preds = %102
  %108 = load ptr, ptr %21, align 8, !tbaa !5
  %109 = load i32, ptr %22, align 4, !tbaa !9
  %110 = zext i32 %109 to i64
  %111 = getelementptr inbounds ptr, ptr %108, i64 %110
  store ptr null, ptr %111, align 8, !tbaa !5
  br label %112

112:                                              ; preds = %107
  %113 = load i32, ptr %22, align 4, !tbaa !9
  %114 = add i32 %113, 1
  store i32 %114, ptr %22, align 4, !tbaa !9
  br label %102, !llvm.loop !13

115:                                              ; preds = %106
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = load i32, ptr %18, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [2 x i64], ptr %17, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !11
  %121 = load i32, ptr %20, align 4, !tbaa !9
  %122 = load ptr, ptr %21, align 8, !tbaa !5
  %123 = call i32 @clGetDeviceIDs(ptr noundef %116, i64 noundef %120, i32 noundef %121, ptr noundef %122, ptr noundef %20)
  store i32 %123, ptr %6, align 4, !tbaa !9
  %124 = load i32, ptr %6, align 4, !tbaa !9
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %130

126:                                              ; preds = %115
  %127 = load ptr, ptr @stdout, align 8, !tbaa !5
  %128 = load i32, ptr %6, align 4, !tbaa !9
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.3, i32 noundef %128) #9
  br label %130

130:                                              ; preds = %126, %115
  %131 = load ptr, ptr %21, align 8, !tbaa !5
  %132 = getelementptr inbounds ptr, ptr %131, i64 0
  %133 = load ptr, ptr %132, align 8, !tbaa !5
  %134 = getelementptr inbounds [100 x i8], ptr %14, i64 0, i64 0
  %135 = call i32 @clGetDeviceInfo(ptr noundef %133, i32 noundef 4141, i64 noundef 100, ptr noundef %134, ptr noundef null)
  store i32 %135, ptr %6, align 4, !tbaa !9
  %136 = load i32, ptr %6, align 4, !tbaa !9
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %142

138:                                              ; preds = %130
  %139 = load ptr, ptr @stdout, align 8, !tbaa !5
  %140 = load i32, ptr %6, align 4, !tbaa !9
  %141 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str.4, i32 noundef %140) #9
  br label %464

142:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %460, %142
  %144 = load i32, ptr %23, align 4, !tbaa !9
  %145 = load i32, ptr %20, align 4, !tbaa !9
  %146 = icmp ult i32 %144, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %143
  store i32 11, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %463

148:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  %149 = load i32, ptr %16, align 4, !tbaa !9
  %150 = load i32, ptr %23, align 4, !tbaa !9
  %151 = add i32 %149, %150
  store i32 %151, ptr %24, align 4, !tbaa !9
  %152 = load ptr, ptr %21, align 8, !tbaa !5
  %153 = load i32, ptr %23, align 4, !tbaa !9
  %154 = zext i32 %153 to i64
  %155 = getelementptr inbounds ptr, ptr %152, i64 %154
  %156 = load ptr, ptr %155, align 8, !tbaa !5
  %157 = load ptr, ptr %9, align 8, !tbaa !5
  %158 = load i32, ptr %24, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %157, i64 %159
  %161 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %160, i32 0, i32 0
  store ptr %156, ptr %161, align 8, !tbaa !15
  %162 = load ptr, ptr %21, align 8, !tbaa !5
  %163 = load i32, ptr %23, align 4, !tbaa !9
  %164 = zext i32 %163 to i64
  %165 = getelementptr inbounds ptr, ptr %162, i64 %164
  %166 = load ptr, ptr %165, align 8, !tbaa !5
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = load i32, ptr %24, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %167, i64 %169
  %171 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %170, i32 0, i32 1
  %172 = call i32 @clGetDeviceInfo(ptr noundef %166, i32 noundef 4096, i64 noundef 100, ptr noundef %171, ptr noundef null)
  %173 = call noalias noundef nonnull ptr @_Znam(i64 noundef 100) #10
  %174 = load ptr, ptr %9, align 8, !tbaa !5
  %175 = load i32, ptr %24, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %174, i64 %176
  %178 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %177, i32 0, i32 2
  store ptr %173, ptr %178, align 8, !tbaa !19
  %179 = load ptr, ptr %9, align 8, !tbaa !5
  %180 = load i32, ptr %24, align 4, !tbaa !9
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %179, i64 %181
  %183 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %182, i32 0, i32 2
  %184 = load ptr, ptr %183, align 8, !tbaa !19
  %185 = getelementptr inbounds i8, ptr %184, i64 0
  store i8 0, ptr %185, align 1, !tbaa !20
  %186 = load ptr, ptr %21, align 8, !tbaa !5
  %187 = load i32, ptr %23, align 4, !tbaa !9
  %188 = zext i32 %187 to i64
  %189 = getelementptr inbounds ptr, ptr %186, i64 %188
  %190 = load ptr, ptr %189, align 8, !tbaa !5
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = load i32, ptr %24, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %191, i64 %193
  %195 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %194, i32 0, i32 2
  %196 = load ptr, ptr %195, align 8, !tbaa !19
  %197 = call i32 @clGetDeviceInfo(ptr noundef %190, i32 noundef 4139, i64 noundef 100, ptr noundef %196, ptr noundef null)
  %198 = call noalias noundef nonnull ptr @_Znam(i64 noundef 100) #10
  %199 = load ptr, ptr %9, align 8, !tbaa !5
  %200 = load i32, ptr %24, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %199, i64 %201
  %203 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %202, i32 0, i32 3
  store ptr %198, ptr %203, align 8, !tbaa !21
  %204 = load ptr, ptr %9, align 8, !tbaa !5
  %205 = load i32, ptr %24, align 4, !tbaa !9
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %204, i64 %206
  %208 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %207, i32 0, i32 3
  %209 = load ptr, ptr %208, align 8, !tbaa !21
  %210 = getelementptr inbounds i8, ptr %209, i64 0
  store i8 0, ptr %210, align 1, !tbaa !20
  %211 = load ptr, ptr %21, align 8, !tbaa !5
  %212 = load i32, ptr %23, align 4, !tbaa !9
  %213 = zext i32 %212 to i64
  %214 = getelementptr inbounds ptr, ptr %211, i64 %213
  %215 = load ptr, ptr %214, align 8, !tbaa !5
  %216 = load ptr, ptr %9, align 8, !tbaa !5
  %217 = load i32, ptr %24, align 4, !tbaa !9
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %216, i64 %218
  %220 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %219, i32 0, i32 3
  %221 = load ptr, ptr %220, align 8, !tbaa !21
  %222 = call i32 @clGetDeviceInfo(ptr noundef %215, i32 noundef 4140, i64 noundef 100, ptr noundef %221, ptr noundef null)
  %223 = call noalias noundef nonnull ptr @_Znam(i64 noundef 100) #10
  %224 = load ptr, ptr %9, align 8, !tbaa !5
  %225 = load i32, ptr %24, align 4, !tbaa !9
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %224, i64 %226
  %228 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %227, i32 0, i32 4
  store ptr %223, ptr %228, align 8, !tbaa !22
  %229 = load ptr, ptr %9, align 8, !tbaa !5
  %230 = load i32, ptr %24, align 4, !tbaa !9
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %229, i64 %231
  %233 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %232, i32 0, i32 4
  %234 = load ptr, ptr %233, align 8, !tbaa !22
  %235 = getelementptr inbounds i8, ptr %234, i64 0
  store i8 0, ptr %235, align 1, !tbaa !20
  %236 = load ptr, ptr %21, align 8, !tbaa !5
  %237 = load i32, ptr %23, align 4, !tbaa !9
  %238 = zext i32 %237 to i64
  %239 = getelementptr inbounds ptr, ptr %236, i64 %238
  %240 = load ptr, ptr %239, align 8, !tbaa !5
  %241 = load ptr, ptr %9, align 8, !tbaa !5
  %242 = load i32, ptr %24, align 4, !tbaa !9
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %241, i64 %243
  %245 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %244, i32 0, i32 4
  %246 = load ptr, ptr %245, align 8, !tbaa !22
  %247 = call i32 @clGetDeviceInfo(ptr noundef %240, i32 noundef 4141, i64 noundef 100, ptr noundef %246, ptr noundef null)
  %248 = load ptr, ptr %21, align 8, !tbaa !5
  %249 = load i32, ptr %23, align 4, !tbaa !9
  %250 = zext i32 %249 to i64
  %251 = getelementptr inbounds ptr, ptr %248, i64 %250
  %252 = load ptr, ptr %251, align 8, !tbaa !5
  %253 = call noundef zeroext i1 @_Z27checkOpenCL2_XCompatibilityP13_cl_device_id(ptr noundef %252)
  %254 = load ptr, ptr %9, align 8, !tbaa !5
  %255 = load i32, ptr %24, align 4, !tbaa !9
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %254, i64 %256
  %258 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %257, i32 0, i32 5
  %259 = zext i1 %253 to i8
  store i8 %259, ptr %258, align 8, !tbaa !23
  %260 = load ptr, ptr %21, align 8, !tbaa !5
  %261 = load i32, ptr %23, align 4, !tbaa !9
  %262 = zext i32 %261 to i64
  %263 = getelementptr inbounds ptr, ptr %260, i64 %262
  %264 = load ptr, ptr %263, align 8, !tbaa !5
  %265 = load ptr, ptr %9, align 8, !tbaa !5
  %266 = load i32, ptr %24, align 4, !tbaa !9
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %265, i64 %267
  %269 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %268, i32 0, i32 7
  %270 = call i32 @clGetDeviceInfo(ptr noundef %264, i32 noundef 4108, i64 noundef 100, ptr noundef %269, ptr noundef null)
  %271 = load ptr, ptr %9, align 8, !tbaa !5
  %272 = load i32, ptr %24, align 4, !tbaa !9
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %271, i64 %273
  %275 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %274, i32 0, i32 8
  store float 1.000000e+00, ptr %275, align 8, !tbaa !24
  %276 = load ptr, ptr %21, align 8, !tbaa !5
  %277 = load i32, ptr %23, align 4, !tbaa !9
  %278 = zext i32 %277 to i64
  %279 = getelementptr inbounds ptr, ptr %276, i64 %278
  %280 = load ptr, ptr %279, align 8, !tbaa !5
  %281 = load ptr, ptr %9, align 8, !tbaa !5
  %282 = load i32, ptr %24, align 4, !tbaa !9
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %281, i64 %283
  %285 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %284, i32 0, i32 9
  %286 = call i32 @clGetDeviceInfo(ptr noundef %280, i32 noundef 4098, i64 noundef 100, ptr noundef %285, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #9
  store i64 4228, ptr %25, align 8, !tbaa !11
  %287 = getelementptr inbounds i64, ptr %25, i64 1
  %288 = load ptr, ptr %11, align 8, !tbaa !5
  %289 = ptrtoint ptr %288 to i64
  store i64 %289, ptr %287, align 8, !tbaa !11
  %290 = getelementptr inbounds i64, ptr %25, i64 2
  store i64 0, ptr %290, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  store i32 0, ptr %26, align 4, !tbaa !9
  %291 = load ptr, ptr %9, align 8, !tbaa !5
  %292 = load i32, ptr %24, align 4, !tbaa !9
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %291, i64 %293
  %295 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %294, i32 0, i32 10
  store i32 0, ptr %295, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %296 = getelementptr inbounds [3 x i64], ptr %25, i64 0, i64 0
  %297 = load ptr, ptr %9, align 8, !tbaa !5
  %298 = load i32, ptr %24, align 4, !tbaa !9
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %297, i64 %299
  %301 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %300, i32 0, i32 0
  %302 = call ptr @clCreateContext(ptr noundef %296, i32 noundef 1, ptr noundef %301, ptr noundef null, ptr noundef null, ptr noundef %26)
  store ptr %302, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %303 = load ptr, ptr %27, align 8, !tbaa !5
  %304 = load ptr, ptr %9, align 8, !tbaa !5
  %305 = load i32, ptr %24, align 4, !tbaa !9
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %304, i64 %306
  %308 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %307, i32 0, i32 0
  %309 = load ptr, ptr %308, align 8, !tbaa !15
  %310 = call ptr @clCreateCommandQueue(ptr noundef %303, ptr noundef %309, i64 noundef 0, ptr noundef %26)
  store ptr %310, ptr %28, align 8, !tbaa !5
  %311 = load ptr, ptr %28, align 8, !tbaa !5
  %312 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, ptr noundef %311)
  %313 = load ptr, ptr %28, align 8, !tbaa !5
  %314 = load ptr, ptr %9, align 8, !tbaa !5
  %315 = load i32, ptr %24, align 4, !tbaa !9
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %314, i64 %316
  %318 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %317, i32 0, i32 10
  %319 = call noundef zeroext i1 @_Z22getAMFdevicePropertiesP17_cl_command_queuePi(ptr noundef %313, ptr noundef %318)
  %320 = load ptr, ptr %9, align 8, !tbaa !5
  %321 = load i32, ptr %24, align 4, !tbaa !9
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %320, i64 %322
  %324 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %323, i32 0, i32 11
  store i32 4, ptr %324, align 4, !tbaa !26
  %325 = load ptr, ptr %9, align 8, !tbaa !5
  %326 = load i32, ptr %24, align 4, !tbaa !9
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %325, i64 %327
  %329 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %328, i32 0, i32 11
  %330 = load i32, ptr %329, align 4, !tbaa !26
  %331 = load ptr, ptr %9, align 8, !tbaa !5
  %332 = load i32, ptr %24, align 4, !tbaa !9
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %331, i64 %333
  %335 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %334, i32 0, i32 10
  %336 = load i32, ptr %335, align 8, !tbaa !25
  %337 = icmp sgt i32 %330, %336
  br i1 %337, label %338, label %350

338:                                              ; preds = %148
  %339 = load ptr, ptr %9, align 8, !tbaa !5
  %340 = load i32, ptr %24, align 4, !tbaa !9
  %341 = sext i32 %340 to i64
  %342 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %339, i64 %341
  %343 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %342, i32 0, i32 10
  %344 = load i32, ptr %343, align 8, !tbaa !25
  %345 = load ptr, ptr %9, align 8, !tbaa !5
  %346 = load i32, ptr %24, align 4, !tbaa !9
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %345, i64 %347
  %349 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %348, i32 0, i32 11
  store i32 %344, ptr %349, align 4, !tbaa !26
  br label %350

350:                                              ; preds = %338, %148
  %351 = load ptr, ptr %21, align 8, !tbaa !5
  %352 = load i32, ptr %23, align 4, !tbaa !9
  %353 = zext i32 %352 to i64
  %354 = getelementptr inbounds ptr, ptr %351, i64 %353
  %355 = load ptr, ptr %354, align 8, !tbaa !5
  %356 = load ptr, ptr %9, align 8, !tbaa !5
  %357 = load i32, ptr %24, align 4, !tbaa !9
  %358 = sext i32 %357 to i64
  %359 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %356, i64 %358
  %360 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %359, i32 0, i32 12
  %361 = call i32 @clGetDeviceInfo(ptr noundef %355, i32 noundef 4127, i64 noundef 100, ptr noundef %360, ptr noundef null)
  %362 = load ptr, ptr %9, align 8, !tbaa !5
  %363 = load i32, ptr %24, align 4, !tbaa !9
  %364 = sext i32 %363 to i64
  %365 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %362, i64 %364
  %366 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %365, i32 0, i32 14
  store i64 0, ptr %366, align 8, !tbaa !27
  %367 = load ptr, ptr %21, align 8, !tbaa !5
  %368 = load i32, ptr %23, align 4, !tbaa !9
  %369 = zext i32 %368 to i64
  %370 = getelementptr inbounds ptr, ptr %367, i64 %369
  %371 = load ptr, ptr %370, align 8, !tbaa !5
  %372 = load ptr, ptr %9, align 8, !tbaa !5
  %373 = load i32, ptr %24, align 4, !tbaa !9
  %374 = sext i32 %373 to i64
  %375 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %372, i64 %374
  %376 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %375, i32 0, i32 14
  %377 = call i32 @clGetDeviceInfo(ptr noundef %371, i32 noundef 4131, i64 noundef 100, ptr noundef %376, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #9
  call void @llvm.memset.p0.i64(ptr align 4 %29, i8 0, i64 12, i1 false)
  %378 = load ptr, ptr %21, align 8, !tbaa !5
  %379 = load i32, ptr %23, align 4, !tbaa !9
  %380 = zext i32 %379 to i64
  %381 = getelementptr inbounds ptr, ptr %378, i64 %380
  %382 = load ptr, ptr %381, align 8, !tbaa !5
  %383 = call i32 @clGetDeviceInfo(ptr noundef %382, i32 noundef 16439, i64 noundef 12, ptr noundef %29, ptr noundef null)
  store i32 %383, ptr %6, align 4, !tbaa !9
  %384 = load ptr, ptr %21, align 8, !tbaa !5
  %385 = load i32, ptr %23, align 4, !tbaa !9
  %386 = zext i32 %385 to i64
  %387 = getelementptr inbounds ptr, ptr %384, i64 %386
  %388 = load ptr, ptr %387, align 8, !tbaa !5
  %389 = getelementptr inbounds [2048 x ptr], ptr %15, i64 0, i64 0
  %390 = call i32 @clGetDeviceInfo(ptr noundef %388, i32 noundef 4144, i64 noundef 2047, ptr noundef %389, ptr noundef null)
  store i32 %390, ptr %6, align 4, !tbaa !9
  %391 = load ptr, ptr %9, align 8, !tbaa !5
  %392 = load i32, ptr %24, align 4, !tbaa !9
  %393 = sext i32 %392 to i64
  %394 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %391, i64 %393
  %395 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %394, i32 0, i32 6
  store i8 0, ptr %395, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #9
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %396

396:                                              ; preds = %456, %350
  %397 = load i32, ptr %30, align 4, !tbaa !9
  %398 = load i32, ptr %8, align 4, !tbaa !9
  %399 = icmp slt i32 %397, %398
  br i1 %399, label %401, label %400

400:                                              ; preds = %396
  store i32 14, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #9
  br label %459

401:                                              ; preds = %396
  %402 = load i32, ptr %30, align 4, !tbaa !9
  %403 = sext i32 %402 to i64
  %404 = getelementptr inbounds [100 x %struct._ADLAdapterInfo], ptr %7, i64 0, i64 %403
  %405 = getelementptr inbounds %struct._ADLAdapterInfo, ptr %404, i32 0, i32 2
  %406 = load i32, ptr %405, align 8, !tbaa !29
  %407 = getelementptr inbounds %struct.cl_device_topology_amd, ptr %29, i32 0, i32 0
  %408 = getelementptr inbounds %"struct.listTanDevicesAndCaps(TanDeviceCapabilities **, int *)::cl_device_topology_amd::pcie_", ptr %407, i32 0, i32 0
  %409 = load i32, ptr %408, align 4, !tbaa !32
  %410 = icmp eq i32 %406, %409
  br i1 %410, label %411, label %455

411:                                              ; preds = %401
  %412 = load i32, ptr %30, align 4, !tbaa !9
  %413 = sext i32 %412 to i64
  %414 = getelementptr inbounds [100 x %struct._ADLAdapterInfo], ptr %7, i64 0, i64 %413
  %415 = getelementptr inbounds %struct._ADLAdapterInfo, ptr %414, i32 0, i32 3
  %416 = load i32, ptr %415, align 4, !tbaa !35
  %417 = getelementptr inbounds %struct.cl_device_topology_amd, ptr %29, i32 0, i32 0
  %418 = getelementptr inbounds %"struct.listTanDevicesAndCaps(TanDeviceCapabilities **, int *)::cl_device_topology_amd::pcie_", ptr %417, i32 0, i32 1
  %419 = load i32, ptr %418, align 4, !tbaa !36
  %420 = icmp eq i32 %416, %419
  br i1 %420, label %421, label %455

421:                                              ; preds = %411
  %422 = load i32, ptr %30, align 4, !tbaa !9
  %423 = sext i32 %422 to i64
  %424 = getelementptr inbounds [100 x %struct._ADLAdapterInfo], ptr %7, i64 0, i64 %423
  %425 = getelementptr inbounds %struct._ADLAdapterInfo, ptr %424, i32 0, i32 4
  %426 = load i32, ptr %425, align 16, !tbaa !37
  %427 = getelementptr inbounds %struct.cl_device_topology_amd, ptr %29, i32 0, i32 0
  %428 = getelementptr inbounds %"struct.listTanDevicesAndCaps(TanDeviceCapabilities **, int *)::cl_device_topology_amd::pcie_", ptr %427, i32 0, i32 2
  %429 = load i32, ptr %428, align 4, !tbaa !38
  %430 = icmp eq i32 %426, %429
  br i1 %430, label %431, label %455

431:                                              ; preds = %421
  %432 = load i32, ptr %30, align 4, !tbaa !9
  %433 = sext i32 %432 to i64
  %434 = getelementptr inbounds [100 x %struct._ADLAdapterInfo], ptr %7, i64 0, i64 %433
  %435 = getelementptr inbounds %struct._ADLAdapterInfo, ptr %434, i32 0, i32 1
  %436 = load i8, ptr %435, align 4, !tbaa !39, !range !40, !noundef !41
  %437 = trunc i8 %436 to i1
  br i1 %437, label %438, label %444

438:                                              ; preds = %431
  %439 = load ptr, ptr %9, align 8, !tbaa !5
  %440 = load i32, ptr %24, align 4, !tbaa !9
  %441 = sext i32 %440 to i64
  %442 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %439, i64 %441
  %443 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %442, i32 0, i32 6
  store i8 1, ptr %443, align 1, !tbaa !28
  br label %444

444:                                              ; preds = %438, %431
  %445 = load i32, ptr %30, align 4, !tbaa !9
  %446 = sext i32 %445 to i64
  %447 = getelementptr inbounds [100 x %struct._ADLAdapterInfo], ptr %7, i64 0, i64 %446
  %448 = getelementptr inbounds %struct._ADLAdapterInfo, ptr %447, i32 0, i32 6
  %449 = load i64, ptr %448, align 16, !tbaa !42
  %450 = load ptr, ptr %9, align 8, !tbaa !5
  %451 = load i32, ptr %24, align 4, !tbaa !9
  %452 = sext i32 %451 to i64
  %453 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %450, i64 %452
  %454 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %453, i32 0, i32 13
  store i64 %449, ptr %454, align 8, !tbaa !43
  br label %455

455:                                              ; preds = %444, %421, %411, %401
  br label %456

456:                                              ; preds = %455
  %457 = load i32, ptr %30, align 4, !tbaa !9
  %458 = add nsw i32 %457, 1
  store i32 %458, ptr %30, align 4, !tbaa !9
  br label %396, !llvm.loop !44

459:                                              ; preds = %400
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %460

460:                                              ; preds = %459
  %461 = load i32, ptr %23, align 4, !tbaa !9
  %462 = add i32 %461, 1
  store i32 %462, ptr %23, align 4, !tbaa !9
  br label %143, !llvm.loop !45

463:                                              ; preds = %147
  br label %464

464:                                              ; preds = %463, %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #9
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %465

465:                                              ; preds = %477, %464
  %466 = load i32, ptr %31, align 4, !tbaa !9
  %467 = load i32, ptr %20, align 4, !tbaa !9
  %468 = icmp ult i32 %466, %467
  br i1 %468, label %470, label %469

469:                                              ; preds = %465
  store i32 17, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  br label %480

470:                                              ; preds = %465
  %471 = load ptr, ptr %21, align 8, !tbaa !5
  %472 = load i32, ptr %31, align 4, !tbaa !9
  %473 = zext i32 %472 to i64
  %474 = getelementptr inbounds ptr, ptr %471, i64 %473
  %475 = load ptr, ptr %474, align 8, !tbaa !5
  %476 = call i32 @clReleaseDevice(ptr noundef %475)
  br label %477

477:                                              ; preds = %470
  %478 = load i32, ptr %31, align 4, !tbaa !9
  %479 = add i32 %478, 1
  store i32 %479, ptr %31, align 4, !tbaa !9
  br label %465, !llvm.loop !46

480:                                              ; preds = %469
  %481 = load i32, ptr %20, align 4, !tbaa !9
  %482 = load i32, ptr %16, align 4, !tbaa !9
  %483 = add i32 %482, %481
  store i32 %483, ptr %16, align 4, !tbaa !9
  %484 = load ptr, ptr %21, align 8, !tbaa !5
  %485 = icmp eq ptr %484, null
  br i1 %485, label %487, label %486

486:                                              ; preds = %480
  call void @_ZdaPv(ptr noundef %484) #11
  br label %487

487:                                              ; preds = %486, %480
  store ptr null, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  store i32 0, ptr %13, align 4
  br label %488

488:                                              ; preds = %487, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  %489 = load i32, ptr %13, align 4
  switch i32 %489, label %513 [
    i32 0, label %490
    i32 7, label %491
  ]

490:                                              ; preds = %488
  br label %491

491:                                              ; preds = %490, %488
  %492 = load i32, ptr %19, align 4, !tbaa !9
  %493 = add i32 %492, 1
  store i32 %493, ptr %19, align 4, !tbaa !9
  br label %74, !llvm.loop !47

494:                                              ; preds = %78
  br label %495

495:                                              ; preds = %494
  %496 = load i32, ptr %18, align 4, !tbaa !9
  %497 = add nsw i32 %496, 1
  store i32 %497, ptr %18, align 4, !tbaa !9
  br label %68, !llvm.loop !48

498:                                              ; preds = %72
  %499 = load ptr, ptr %12, align 8, !tbaa !5
  %500 = icmp ne ptr %499, null
  br i1 %500, label %501, label %506

501:                                              ; preds = %498
  %502 = load ptr, ptr %12, align 8, !tbaa !5
  %503 = icmp eq ptr %502, null
  br i1 %503, label %505, label %504

504:                                              ; preds = %501
  call void @_ZdaPv(ptr noundef %502) #11
  br label %505

505:                                              ; preds = %504, %501
  br label %506

506:                                              ; preds = %505, %498
  %507 = load i32, ptr %16, align 4, !tbaa !9
  %508 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 %507, ptr %508, align 4, !tbaa !9
  %509 = load ptr, ptr %9, align 8, !tbaa !5
  %510 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %509, ptr %510, align 8, !tbaa !5
  store i32 0, ptr %3, align 4
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 16384, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 100, ptr %14) #9
  br label %511

511:                                              ; preds = %506, %65, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 4800, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  %512 = load i32, ptr %3, align 4
  ret i32 %512

513:                                              ; preds = %488
  unreachable
}

declare noundef i32 @_Z19ADLQueryAdapterInfoP15_ADLAdapterInfoi(ptr noundef, i32 noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8

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 = { nounwind "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nobuiltin allocsize(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 #5 = { nobuiltin nounwind "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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTS22_TanDeviceCapabilities", !6, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !17, i64 40, !17, i64 41, !10, i64 44, !18, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !12, i64 64, !12, i64 72, !12, i64 80, !7, i64 88}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!16, !6, i64 16}
!20 = !{!7, !7, i64 0}
!21 = !{!16, !6, i64 24}
!22 = !{!16, !6, i64 32}
!23 = !{!16, !17, i64 40}
!24 = !{!16, !18, i64 48}
!25 = !{!16, !10, i64 56}
!26 = !{!16, !10, i64 60}
!27 = !{!16, !12, i64 80}
!28 = !{!16, !17, i64 41}
!29 = !{!30, !10, i64 8}
!30 = !{!"_ZTS15_ADLAdapterInfo", !10, i64 0, !17, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !31, i64 24, !31, i64 32, !10, i64 40}
!31 = !{!"long long", !7, i64 0}
!32 = !{!33, !10, i64 0}
!33 = !{!"_ZTSZ21listTanDevicesAndCapsE22cl_device_topology_amd", !34, i64 0}
!34 = !{!"_ZTSZ21listTanDevicesAndCapsEN22cl_device_topology_amd5pcie_E", !10, i64 0, !10, i64 4, !10, i64 8}
!35 = !{!30, !10, i64 12}
!36 = !{!33, !10, i64 4}
!37 = !{!30, !10, i64 16}
!38 = !{!33, !10, i64 8}
!39 = !{!30, !17, i64 4}
!40 = !{i8 0, i8 2}
!41 = !{}
!42 = !{!30, !31, i64 32}
!43 = !{!16, !12, i64 72}
!44 = distinct !{!44, !14}
!45 = distinct !{!45, !14}
!46 = distinct !{!46, !14}
!47 = distinct !{!47, !14}
!48 = distinct !{!48, !14}


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

%struct._ADLAdapterInfo = type { i32, i8, i32, i32, i32, i64, i64, i32 }
%struct.cl_device_topology_amd = type { %"struct.listTanDevicesAndCaps(TanDeviceCapabilities **, int *)::cl_device_topology_amd::pcie_" }
%"struct.listTanDevicesAndCaps(TanDeviceCapabilities **, int *)::cl_device_topology_amd::pcie_" = type { i32, i32, i32 }
%struct._TanDeviceCapabilities = type { ptr, i64, ptr, ptr, ptr, i8, i8, i32, float, i32, i32, i32, i64, i64, i64, [1016 x i32] }

@stdout = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [37 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@__const.listTanDevicesAndCaps.clDeviceTypes = external hidden unnamed_addr constant [2 x i64], align 16
@.str.19 = external hidden unnamed_addr constant [21 x i8], align 1

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

declare i32 @clGetPlatformIDs(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

declare i32 @clGetDeviceIDs(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @clGetDeviceInfo(ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @clReleaseDevice(ptr noundef) local_unnamed_addr #1

declare ptr @clCreateContext(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @clCreateCommandQueue(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z27checkOpenCL2_XCompatibilityP13_cl_device_id(ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z22getAMFdevicePropertiesP17_cl_command_queuePi(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @listTanDevicesAndCaps(ptr nocapture noundef writeonly %0, ptr nocapture noundef writeonly %1) local_unnamed_addr #6 {
  %3 = alloca [100 x %struct._ADLAdapterInfo], align 16
  %4 = alloca i32, align 4
  %5 = alloca [100 x i8], align 16
  %6 = alloca [2048 x ptr], align 16
  %7 = alloca i32, align 4
  %8 = alloca [3 x i64], align 16
  %9 = alloca i32, align 4
  %10 = alloca %struct.cl_device_topology_amd, align 4
  call void @llvm.lifetime.start.p0(i64 4800, ptr nonnull %3) #8
  %11 = call noundef i32 @_Z19ADLQueryAdapterInfoP15_ADLAdapterInfoi(ptr noundef nonnull %3, i32 noundef 100)
  %12 = call noalias noundef nonnull dereferenceable(415200) ptr @_Znam(i64 noundef 415200) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  %13 = call i32 @clGetPlatformIDs(i32 noundef 0, ptr noundef null, ptr noundef nonnull %4)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %17, label %14

14:                                               ; preds = %2
  %15 = load ptr, ptr @stdout, align 8, !tbaa !9
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str, i32 noundef %13) #8
  br label %154

17:                                               ; preds = %2
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %.not156 = icmp eq i32 %18, 0
  br i1 %.not156, label %.split179.us, label %19

19:                                               ; preds = %17
  %20 = zext i32 %18 to i64
  %21 = shl nuw nsw i64 %20, 3
  %22 = call noalias noundef nonnull ptr @_Znam(i64 noundef %21) #9
  %23 = call i32 @clGetPlatformIDs(i32 noundef %18, ptr noundef nonnull %22, ptr noundef null)
  %.not157 = icmp eq i32 %23, 0
  br i1 %.not157, label %27, label %24

24:                                               ; preds = %19
  %25 = load ptr, ptr @stdout, align 8, !tbaa !9
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str, i32 noundef %23) #8
  call void @_ZdaPv(ptr noundef nonnull %22) #10
  br label %154

27:                                               ; preds = %19
  %.pre = load i32, ptr %4, align 4, !tbaa !5
  %28 = icmp eq i32 %.pre, 0
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %5) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100) %5, i8 0, i64 100, i1 false)
  call void @llvm.lifetime.start.p0(i64 16384, ptr nonnull %6) #8
  %29 = getelementptr inbounds i8, ptr %8, i64 8
  %30 = getelementptr inbounds i8, ptr %8, i64 16
  %31 = icmp sgt i32 %11, 0
  %32 = getelementptr inbounds i8, ptr %10, i64 4
  %33 = getelementptr inbounds i8, ptr %10, i64 8
  br i1 %28, label %.loopexit210, label %.preheader161.preheader

.preheader161.preheader:                          ; preds = %27
  %wide.trip.count = zext nneg i32 %11 to i64
  br label %.preheader161

.preheader161:                                    ; preds = %.preheader161.preheader, %._crit_edge174
  %34 = phi i32 [ 1, %.preheader161.preheader ], [ %38, %._crit_edge174 ]
  %35 = phi i1 [ true, %.preheader161.preheader ], [ false, %._crit_edge174 ]
  %indvars.iv194 = phi i64 [ 0, %.preheader161.preheader ], [ 1, %._crit_edge174 ]
  %.0144176 = phi i32 [ 0, %.preheader161.preheader ], [ %.1.lcssa, %._crit_edge174 ]
  %.not181 = icmp eq i32 %34, 0
  br i1 %.not181, label %._crit_edge174, label %.lr.ph173

.lr.ph173:                                        ; preds = %.preheader161
  %36 = getelementptr inbounds [2 x i64], ptr @__const.listTanDevicesAndCaps.clDeviceTypes, i64 0, i64 %indvars.iv194
  %37 = load i64, ptr %36, align 8, !tbaa !11
  br label %39

.split179.us:                                     ; preds = %17
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 16384, ptr nonnull %6) #8
  br label %153

._crit_edge174:                                   ; preds = %149, %.preheader161
  %38 = phi i32 [ 0, %.preheader161 ], [ %150, %149 ]
  %.1.lcssa = phi i32 [ %.0144176, %.preheader161 ], [ %.2, %149 ]
  br i1 %35, label %.preheader161, label %.loopexit210, !llvm.loop !13

39:                                               ; preds = %.lr.ph173, %149
  %indvars.iv191 = phi i64 [ 0, %.lr.ph173 ], [ %indvars.iv.next192, %149 ]
  %.1170 = phi i32 [ %.0144176, %.lr.ph173 ], [ %.2, %149 ]
  %40 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv191
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  %42 = call i32 @clGetDeviceIDs(ptr noundef %41, i64 noundef %37, i32 noundef 0, ptr noundef null, ptr noundef nonnull %7)
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %149, label %45

45:                                               ; preds = %39
  %46 = zext i32 %43 to i64
  %47 = shl nuw nsw i64 %46, 3
  %48 = call noalias noundef nonnull ptr @_Znam(i64 noundef %47) #9
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %48, i8 0, i64 %47, i1 false), !tbaa !9
  %49 = call i32 @clGetDeviceIDs(ptr noundef %41, i64 noundef %37, i32 noundef %43, ptr noundef nonnull %48, ptr noundef nonnull %7)
  %.not159 = icmp eq i32 %49, 0
  br i1 %.not159, label %53, label %50

50:                                               ; preds = %45
  %51 = load ptr, ptr @stdout, align 8, !tbaa !9
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.3, i32 noundef %49) #8
  br label %53

53:                                               ; preds = %50, %45
  %54 = load ptr, ptr %48, align 8, !tbaa !9
  %55 = call i32 @clGetDeviceInfo(ptr noundef %54, i32 noundef 4141, i64 noundef 100, ptr noundef nonnull %5, ptr noundef null)
  %.not160 = icmp eq i32 %55, 0
  br i1 %.not160, label %.preheader, label %58

.preheader:                                       ; preds = %53
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %.not182 = icmp eq i32 %56, 0
  br i1 %.not182, label %._crit_edge169, label %.lr.ph165

.lr.ph165:                                        ; preds = %.preheader
  %57 = ptrtoint ptr %41 to i64
  br label %61

58:                                               ; preds = %53
  %59 = load ptr, ptr @stdout, align 8, !tbaa !9
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef nonnull @.str.4, i32 noundef %55) #8
  %.pre198 = load i32, ptr %7, align 4, !tbaa !5
  br label %.loopexit

61:                                               ; preds = %.lr.ph165, %._crit_edge
  %.0140164 = phi i32 [ 0, %.lr.ph165 ], [ %116, %._crit_edge ]
  %62 = add i32 %.0140164, %.1170
  %63 = zext i32 %.0140164 to i64
  %64 = getelementptr inbounds ptr, ptr %48, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = sext i32 %62 to i64
  %67 = getelementptr inbounds %struct._TanDeviceCapabilities, ptr %12, i64 %66
  store ptr %65, ptr %67, align 8, !tbaa !16
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  %69 = call i32 @clGetDeviceInfo(ptr noundef %65, i32 noundef 4096, i64 noundef 100, ptr noundef nonnull %68, ptr noundef null)
  %70 = call noalias noundef nonnull dereferenceable(100) ptr @_Znam(i64 noundef 100) #9
  %71 = getelementptr inbounds i8, ptr %67, i64 16
  store ptr %70, ptr %71, align 8, !tbaa !20
  store i8 0, ptr %70, align 1, !tbaa !21
  %72 = load ptr, ptr %64, align 8, !tbaa !9
  %73 = call i32 @clGetDeviceInfo(ptr noundef %72, i32 noundef 4139, i64 noundef 100, ptr noundef nonnull %70, ptr noundef null)
  %74 = call noalias noundef nonnull dereferenceable(100) ptr @_Znam(i64 noundef 100) #9
  %75 = getelementptr inbounds i8, ptr %67, i64 24
  store ptr %74, ptr %75, align 8, !tbaa !22
  store i8 0, ptr %74, align 1, !tbaa !21
  %76 = load ptr, ptr %64, align 8, !tbaa !9
  %77 = call i32 @clGetDeviceInfo(ptr noundef %76, i32 noundef 4140, i64 noundef 100, ptr noundef nonnull %74, ptr noundef null)
  %78 = call noalias noundef nonnull dereferenceable(100) ptr @_Znam(i64 noundef 100) #9
  %79 = getelementptr inbounds i8, ptr %67, i64 32
  store ptr %78, ptr %79, align 8, !tbaa !23
  store i8 0, ptr %78, align 1, !tbaa !21
  %80 = load ptr, ptr %64, align 8, !tbaa !9
  %81 = call i32 @clGetDeviceInfo(ptr noundef %80, i32 noundef 4141, i64 noundef 100, ptr noundef nonnull %78, ptr noundef null)
  %82 = load ptr, ptr %64, align 8, !tbaa !9
  %83 = call noundef zeroext i1 @_Z27checkOpenCL2_XCompatibilityP13_cl_device_id(ptr noundef %82)
  %84 = getelementptr inbounds i8, ptr %67, i64 40
  %85 = zext i1 %83 to i8
  store i8 %85, ptr %84, align 8, !tbaa !24
  %86 = load ptr, ptr %64, align 8, !tbaa !9
  %87 = getelementptr inbounds i8, ptr %67, i64 44
  %88 = call i32 @clGetDeviceInfo(ptr noundef %86, i32 noundef 4108, i64 noundef 100, ptr noundef nonnull %87, ptr noundef null)
  %89 = getelementptr inbounds i8, ptr %67, i64 48
  store float 1.000000e+00, ptr %89, align 8, !tbaa !25
  %90 = load ptr, ptr %64, align 8, !tbaa !9
  %91 = getelementptr inbounds i8, ptr %67, i64 52
  %92 = call i32 @clGetDeviceInfo(ptr noundef %90, i32 noundef 4098, i64 noundef 100, ptr noundef nonnull %91, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #8
  store i64 4228, ptr %8, align 16, !tbaa !11
  store i64 %57, ptr %29, align 8, !tbaa !11
  store i64 0, ptr %30, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %67, i64 56
  store i32 0, ptr %93, align 8, !tbaa !26
  %94 = call ptr @clCreateContext(ptr noundef nonnull %8, i32 noundef 1, ptr noundef nonnull %67, ptr noundef null, ptr noundef null, ptr noundef nonnull %9)
  %95 = load ptr, ptr %67, align 8, !tbaa !16
  %96 = call ptr @clCreateCommandQueue(ptr noundef %94, ptr noundef %95, i64 noundef 0, ptr noundef nonnull %9)
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, ptr noundef %96)
  %98 = call noundef zeroext i1 @_Z22getAMFdevicePropertiesP17_cl_command_queuePi(ptr noundef %96, ptr noundef nonnull %93)
  %99 = getelementptr inbounds i8, ptr %67, i64 60
  %100 = load i32, ptr %93, align 8, !tbaa !26
  %spec.store.select = call i32 @llvm.smin.i32(i32 %100, i32 4)
  store i32 %spec.store.select, ptr %99, align 4
  %101 = load ptr, ptr %64, align 8, !tbaa !9
  %102 = getelementptr inbounds i8, ptr %67, i64 64
  %103 = call i32 @clGetDeviceInfo(ptr noundef %101, i32 noundef 4127, i64 noundef 100, ptr noundef nonnull %102, ptr noundef null)
  %104 = getelementptr inbounds i8, ptr %67, i64 80
  store i64 0, ptr %104, align 8, !tbaa !27
  %105 = load ptr, ptr %64, align 8, !tbaa !9
  %106 = call i32 @clGetDeviceInfo(ptr noundef %105, i32 noundef 4131, i64 noundef 100, ptr noundef nonnull %104, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %10, i8 0, i64 12, i1 false)
  %107 = load ptr, ptr %64, align 8, !tbaa !9
  %108 = call i32 @clGetDeviceInfo(ptr noundef %107, i32 noundef 16439, i64 noundef 12, ptr noundef nonnull %10, ptr noundef null)
  %109 = load ptr, ptr %64, align 8, !tbaa !9
  %110 = call i32 @clGetDeviceInfo(ptr noundef %109, i32 noundef 4144, i64 noundef 2047, ptr noundef nonnull %6, ptr noundef null)
  %111 = getelementptr inbounds i8, ptr %67, i64 41
  store i8 0, ptr %111, align 1, !tbaa !28
  br i1 %31, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %61
  %112 = load i32, ptr %10, align 4, !tbaa !29
  %113 = load i32, ptr %32, align 4
  %114 = load i32, ptr %33, align 4
  %115 = getelementptr inbounds i8, ptr %67, i64 72
  br label %119

._crit_edge:                                      ; preds = %140, %61
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #8
  %116 = add nuw i32 %.0140164, 1
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = icmp ult i32 %116, %117
  br i1 %118, label %61, label %.loopexit, !llvm.loop !32

119:                                              ; preds = %.lr.ph, %140
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %140 ]
  %120 = getelementptr inbounds [100 x %struct._ADLAdapterInfo], ptr %3, i64 0, i64 %indvars.iv
  %121 = getelementptr inbounds i8, ptr %120, i64 8
  %122 = load i32, ptr %121, align 8, !tbaa !33
  %123 = icmp eq i32 %122, %112
  br i1 %123, label %124, label %140

124:                                              ; preds = %119
  %125 = getelementptr inbounds i8, ptr %120, i64 12
  %126 = load i32, ptr %125, align 4, !tbaa !36
  %127 = icmp eq i32 %126, %113
  br i1 %127, label %128, label %140

128:                                              ; preds = %124
  %129 = getelementptr inbounds i8, ptr %120, i64 16
  %130 = load i32, ptr %129, align 16, !tbaa !37
  %131 = icmp eq i32 %130, %114
  br i1 %131, label %132, label %140

132:                                              ; preds = %128
  %133 = getelementptr inbounds i8, ptr %120, i64 4
  %134 = load i8, ptr %133, align 4, !tbaa !38, !range !39, !noundef !40
  %135 = trunc nuw i8 %134 to i1
  br i1 %135, label %136, label %137

136:                                              ; preds = %132
  store i8 1, ptr %111, align 1, !tbaa !28
  br label %137

137:                                              ; preds = %136, %132
  %138 = getelementptr inbounds i8, ptr %120, i64 32
  %139 = load i64, ptr %138, align 16, !tbaa !41
  store i64 %139, ptr %115, align 8, !tbaa !42
  br label %140

140:                                              ; preds = %119, %124, %128, %137
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %119, !llvm.loop !43

.loopexit:                                        ; preds = %._crit_edge, %58
  %141 = phi i32 [ %.pre198, %58 ], [ %117, %._crit_edge ]
  %.not183 = icmp eq i32 %141, 0
  br i1 %.not183, label %._crit_edge169, label %.lr.ph168

._crit_edge169:                                   ; preds = %.lr.ph168, %.preheader, %.loopexit
  %.lcssa = phi i32 [ 0, %.loopexit ], [ 0, %.preheader ], [ %146, %.lr.ph168 ]
  %142 = add i32 %.lcssa, %.1170
  call void @_ZdaPv(ptr noundef nonnull %48) #10
  br label %149

.lr.ph168:                                        ; preds = %.loopexit, %.lr.ph168
  %indvars.iv188 = phi i64 [ %indvars.iv.next189, %.lr.ph168 ], [ 0, %.loopexit ]
  %143 = getelementptr inbounds ptr, ptr %48, i64 %indvars.iv188
  %144 = load ptr, ptr %143, align 8, !tbaa !9
  %145 = call i32 @clReleaseDevice(ptr noundef %144)
  %indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1
  %146 = load i32, ptr %7, align 4, !tbaa !5
  %147 = zext i32 %146 to i64
  %148 = icmp ult i64 %indvars.iv.next189, %147
  br i1 %148, label %.lr.ph168, label %._crit_edge169, !llvm.loop !44

149:                                              ; preds = %39, %._crit_edge169
  %.2 = phi i32 [ %142, %._crit_edge169 ], [ %.1170, %39 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
  %150 = load i32, ptr %4, align 4, !tbaa !5
  %151 = zext i32 %150 to i64
  %152 = icmp ult i64 %indvars.iv.next192, %151
  br i1 %152, label %39, label %._crit_edge174, !llvm.loop !45

.loopexit210:                                     ; preds = %._crit_edge174, %27
  %.us-phi.ph = phi i32 [ 0, %27 ], [ %.1.lcssa, %._crit_edge174 ]
  call void @_ZdaPv(ptr noundef nonnull %22) #10
  br label %153

153:                                              ; preds = %.split179.us, %.loopexit210
  %.us-phi208 = phi i32 [ %.us-phi.ph, %.loopexit210 ], [ 0, %.split179.us ]
  store i32 %.us-phi208, ptr %1, align 4, !tbaa !5
  store ptr %12, ptr %0, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 16384, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %5) #8
  br label %154

154:                                              ; preds = %153, %24, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4800, ptr nonnull %3) #8
  ret i32 0
}

declare noundef i32 @_Z19ADLQueryAdapterInfoP15_ADLAdapterInfoi(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7

attributes #0 = { mustprogress 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 = { nofree nounwind "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 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14, !15}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = !{!17, !10, i64 0}
!17 = !{!"_ZTS22_TanDeviceCapabilities", !10, i64 0, !12, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !18, i64 40, !18, i64 41, !6, i64 44, !19, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !12, i64 64, !12, i64 72, !12, i64 80, !7, i64 88}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"float", !7, i64 0}
!20 = !{!17, !10, i64 16}
!21 = !{!7, !7, i64 0}
!22 = !{!17, !10, i64 24}
!23 = !{!17, !10, i64 32}
!24 = !{!17, !18, i64 40}
!25 = !{!17, !19, i64 48}
!26 = !{!17, !6, i64 56}
!27 = !{!17, !12, i64 80}
!28 = !{!17, !18, i64 41}
!29 = !{!30, !6, i64 0}
!30 = !{!"_ZTSZ21listTanDevicesAndCapsE22cl_device_topology_amd", !31, i64 0}
!31 = !{!"_ZTSZ21listTanDevicesAndCapsEN22cl_device_topology_amd5pcie_E", !6, i64 0, !6, i64 4, !6, i64 8}
!32 = distinct !{!32, !14}
!33 = !{!34, !6, i64 8}
!34 = !{!"_ZTS15_ADLAdapterInfo", !6, i64 0, !18, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !35, i64 24, !35, i64 32, !6, i64 40}
!35 = !{!"long long", !7, i64 0}
!36 = !{!34, !6, i64 12}
!37 = !{!34, !6, i64 16}
!38 = !{!34, !18, i64 4}
!39 = !{i8 0, i8 2}
!40 = !{}
!41 = !{!34, !35, i64 32}
!42 = !{!17, !12, i64 72}
!43 = distinct !{!43, !14}
!44 = distinct !{!44, !14}
!45 = distinct !{!45, !14}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass