; LLVM IR from jrl-umi3218/mc_rtc :: 3rd-party/qhull/src/libqhull (mem)

; 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.qhmemT = type { i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@qhmem = external dso_local global %struct.qhmemT, align 8
@.str = external hidden unnamed_addr constant [89 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [54 x i8], align 1

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

15:                                               ; preds = %1
  %16 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 13), align 8, !tbaa !9
  %17 = load i32, ptr %3, align 4, !tbaa !5
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %16, i32 noundef 6235, ptr noundef @.str, i32 noundef %17)
  call void @qh_errexit(i32 noundef 4, ptr noundef null, ptr noundef null)
  br label %18

18:                                               ; preds = %15, %1
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = icmp sge i32 %19, 0
  br i1 %20, label %21, label %172

21:                                               ; preds = %18
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 4), align 8, !tbaa !12
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %25, label %172

25:                                               ; preds = %21
  %26 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 8), align 8, !tbaa !13
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr %26, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  store i32 %30, ptr %6, align 4, !tbaa !5
  %31 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 7), align 8, !tbaa !14
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i32, ptr %31, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  store i32 %35, ptr %9, align 4, !tbaa !5
  %36 = load i32, ptr %9, align 4, !tbaa !5
  %37 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 25), align 4, !tbaa !15
  %38 = add nsw i32 %37, %36
  store i32 %38, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 25), align 4, !tbaa !15
  %39 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 6), align 8, !tbaa !16
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds ptr, ptr %39, i64 %41
  store ptr %42, ptr %4, align 8, !tbaa !17
  %43 = load ptr, ptr %4, align 8, !tbaa !17
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  store ptr %44, ptr %11, align 8, !tbaa !17
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %76

46:                                               ; preds = %25
  %47 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 15), align 4, !tbaa !18
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 15), align 4, !tbaa !18
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 22), align 8, !tbaa !19
  %51 = sub nsw i32 %50, %49
  store i32 %51, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 22), align 8, !tbaa !19
  %52 = load ptr, ptr %4, align 8, !tbaa !17
  %53 = load ptr, ptr %52, align 8, !tbaa !17
  %54 = load ptr, ptr %53, align 8, !tbaa !17
  %55 = load ptr, ptr %4, align 8, !tbaa !17
  store ptr %54, ptr %55, align 8, !tbaa !17
  %56 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 16), align 8, !tbaa !20
  %57 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 15), align 4, !tbaa !18
  %58 = add nsw i32 %56, %57
  %59 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 18), align 8, !tbaa !21
  %60 = add nsw i32 %58, %59
  store i32 %60, ptr %8, align 4, !tbaa !5
  %61 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 14), align 8, !tbaa !22
  %62 = icmp sge i32 %61, 5
  br i1 %62, label %63, label %74

63:                                               ; preds = %46
  %64 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 13), align 8, !tbaa !9
  %65 = load ptr, ptr %11, align 8, !tbaa !17
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 25), align 4, !tbaa !15
  %69 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 16), align 8, !tbaa !20
  %70 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 15), align 4, !tbaa !18
  %71 = add nsw i32 %69, %70
  %72 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 18), align 8, !tbaa !21
  %73 = sub nsw i32 %71, %72
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %64, i32 noundef 8141, ptr noundef @.str.1, ptr noundef %65, i32 noundef %66, i32 noundef %67, i32 noundef %68, i32 noundef %73)
  br label %74

74:                                               ; preds = %63, %46
  %75 = load ptr, ptr %11, align 8, !tbaa !17
  store ptr %75, ptr %2, align 8
  store i32 1, ptr %12, align 4
  br label %214

76:                                               ; preds = %25
  %77 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 16), align 8, !tbaa !20
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 16), align 8, !tbaa !20
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 11), align 8, !tbaa !23
  %81 = icmp sgt i32 %79, %80
  br i1 %81, label %82, label %138

82:                                               ; preds = %76
  %83 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 11), align 8, !tbaa !23
  %84 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 21), align 4, !tbaa !24
  %85 = add nsw i32 %84, %83
  store i32 %85, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 21), align 4, !tbaa !24
  %86 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 9), align 8, !tbaa !25
  %87 = icmp ne ptr %86, null
  br i1 %87, label %90, label %88

88:                                               ; preds = %82
  %89 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 1), align 4, !tbaa !26
  store i32 %89, ptr %10, align 4, !tbaa !5
  br label %92

90:                                               ; preds = %82
  %91 = load i32, ptr @qhmem, align 8, !tbaa !27
  store i32 %91, ptr %10, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %90, %88
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = call ptr @qh_malloc(i64 noundef %94)
  store ptr %95, ptr %5, align 8, !tbaa !17
  %96 = icmp ne ptr %95, null
  br i1 %96, label %100, label %97

97:                                               ; preds = %92
  %98 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 13), align 8, !tbaa !9
  %99 = load i32, ptr %10, align 4, !tbaa !5
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %98, i32 noundef 6080, ptr noundef @.str.2, i32 noundef %99)
  call void @qh_errexit(i32 noundef 4, ptr noundef null, ptr noundef null)
  br label %100

100:                                              ; preds = %97, %92
  %101 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 9), align 8, !tbaa !25
  %102 = load ptr, ptr %5, align 8, !tbaa !17
  store ptr %101, ptr %102, align 8, !tbaa !17
  %103 = load ptr, ptr %5, align 8, !tbaa !17
  store ptr %103, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 9), align 8, !tbaa !25
  %104 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 5), align 4, !tbaa !28
  %105 = add nsw i32 8, %104
  %106 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 5), align 4, !tbaa !28
  %107 = xor i32 %106, -1
  %108 = and i32 %105, %107
  store i32 %108, ptr %7, align 4, !tbaa !5
  %109 = load ptr, ptr %5, align 8, !tbaa !17
  %110 = load i32, ptr %7, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i8, ptr %109, i64 %111
  store ptr %112, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 10), align 8, !tbaa !29
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = sub nsw i32 %113, %114
  store i32 %115, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 11), align 8, !tbaa !23
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = sub nsw i32 %116, %117
  %119 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 20), align 8, !tbaa !30
  %120 = add nsw i32 %119, %118
  store i32 %120, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 20), align 8, !tbaa !30
  %121 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 25), align 4, !tbaa !15
  %122 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 22), align 8, !tbaa !19
  %123 = add nsw i32 %121, %122
  %124 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 21), align 4, !tbaa !24
  %125 = add nsw i32 %123, %124
  %126 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 11), align 8, !tbaa !23
  %127 = add nsw i32 %125, %126
  %128 = load i32, ptr %9, align 4, !tbaa !5
  %129 = sub nsw i32 %127, %128
  store i32 %129, ptr %8, align 4, !tbaa !5
  %130 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 20), align 8, !tbaa !30
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = icmp ne i32 %130, %131
  br i1 %132, label %133, label %137

133:                                              ; preds = %100
  %134 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 13), align 8, !tbaa !9
  %135 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 20), align 8, !tbaa !30
  %136 = load i32, ptr %8, align 4, !tbaa !5
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %134, i32 noundef 6212, ptr noundef @.str.3, i32 noundef %135, i32 noundef %136)
  call void @qh_errexit(i32 noundef 4, ptr noundef null, ptr noundef null)
  br label %137

137:                                              ; preds = %133, %100
  br label %138

138:                                              ; preds = %137, %76
  %139 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 10), align 8, !tbaa !29
  store ptr %139, ptr %11, align 8, !tbaa !17
  %140 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 10), align 8, !tbaa !29
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i8, ptr %140, i64 %142
  store ptr %143, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 10), align 8, !tbaa !29
  %144 = load i32, ptr %9, align 4, !tbaa !5
  %145 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 11), align 8, !tbaa !23
  %146 = sub nsw i32 %145, %144
  store i32 %146, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 11), align 8, !tbaa !23
  %147 = load i32, ptr %9, align 4, !tbaa !5
  %148 = load i32, ptr %3, align 4, !tbaa !5
  %149 = sub nsw i32 %147, %148
  %150 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 26), align 8, !tbaa !31
  %151 = add nsw i32 %150, %149
  store i32 %151, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 26), align 8, !tbaa !31
  %152 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 16), align 8, !tbaa !20
  %153 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 15), align 4, !tbaa !18
  %154 = add nsw i32 %152, %153
  %155 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 18), align 8, !tbaa !21
  %156 = add nsw i32 %154, %155
  store i32 %156, ptr %8, align 4, !tbaa !5
  %157 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 14), align 8, !tbaa !22
  %158 = icmp sge i32 %157, 5
  br i1 %158, label %159, label %170

159:                                              ; preds = %138
  %160 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 13), align 8, !tbaa !9
  %161 = load ptr, ptr %11, align 8, !tbaa !17
  %162 = load i32, ptr %8, align 4, !tbaa !5
  %163 = load i32, ptr %9, align 4, !tbaa !5
  %164 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 25), align 4, !tbaa !15
  %165 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 16), align 8, !tbaa !20
  %166 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 15), align 4, !tbaa !18
  %167 = add nsw i32 %165, %166
  %168 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 18), align 8, !tbaa !21
  %169 = sub nsw i32 %167, %168
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %160, i32 noundef 8140, ptr noundef @.str.4, ptr noundef %161, i32 noundef %162, i32 noundef %163, i32 noundef %164, i32 noundef %169)
  br label %170

170:                                              ; preds = %159, %138
  %171 = load ptr, ptr %11, align 8, !tbaa !17
  store ptr %171, ptr %2, align 8
  store i32 1, ptr %12, align 4
  br label %214

172:                                              ; preds = %21, %18
  %173 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 8), align 8, !tbaa !13
  %174 = icmp ne ptr %173, null
  br i1 %174, label %177, label %175

175:                                              ; preds = %172
  %176 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 13), align 8, !tbaa !9
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %176, i32 noundef 6081, ptr noundef @.str.5)
  call void @qh_errexit(i32 noundef 5, ptr noundef null, ptr noundef null)
  br label %177

177:                                              ; preds = %175, %172
  %178 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %178, ptr %9, align 4, !tbaa !5
  %179 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 17), align 4, !tbaa !32
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 17), align 4, !tbaa !32
  %181 = load i32, ptr %9, align 4, !tbaa !5
  %182 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 23), align 4, !tbaa !33
  %183 = add nsw i32 %182, %181
  store i32 %183, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 23), align 4, !tbaa !33
  %184 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 24), align 8, !tbaa !34
  %185 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 23), align 4, !tbaa !33
  %186 = icmp slt i32 %184, %185
  br i1 %186, label %187, label %189

187:                                              ; preds = %177
  %188 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 23), align 4, !tbaa !33
  store i32 %188, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 24), align 8, !tbaa !34
  br label %189

189:                                              ; preds = %187, %177
  %190 = load i32, ptr %9, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = call ptr @qh_malloc(i64 noundef %191)
  store ptr %192, ptr %11, align 8, !tbaa !17
  %193 = icmp ne ptr %192, null
  br i1 %193, label %197, label %194

194:                                              ; preds = %189
  %195 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 13), align 8, !tbaa !9
  %196 = load i32, ptr %9, align 4, !tbaa !5
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %195, i32 noundef 6082, ptr noundef @.str.6, i32 noundef %196)
  call void @qh_errexit(i32 noundef 4, ptr noundef null, ptr noundef null)
  br label %197

197:                                              ; preds = %194, %189
  %198 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 14), align 8, !tbaa !22
  %199 = icmp sge i32 %198, 5
  br i1 %199, label %200, label %211

200:                                              ; preds = %197
  %201 = load ptr, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 13), align 8, !tbaa !9
  %202 = load ptr, ptr %11, align 8, !tbaa !17
  %203 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 17), align 4, !tbaa !32
  %204 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 19), align 4, !tbaa !35
  %205 = add nsw i32 %203, %204
  %206 = load i32, ptr %9, align 4, !tbaa !5
  %207 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 23), align 4, !tbaa !33
  %208 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 17), align 4, !tbaa !32
  %209 = load i32, ptr getelementptr inbounds (%struct.qhmemT, ptr @qhmem, i32 0, i32 19), align 4, !tbaa !35
  %210 = sub nsw i32 %208, %209
  call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %201, i32 noundef 8057, ptr noundef @.str.7, ptr noundef %202, i32 noundef %205, i32 noundef %206, i32 noundef %207, i32 noundef %210)
  br label %211

211:                                              ; preds = %200, %197
  br label %212

212:                                              ; preds = %211
  %213 = load ptr, ptr %11, align 8, !tbaa !17
  store ptr %213, ptr %2, align 8
  store i32 1, ptr %12, align 4
  br label %214

214:                                              ; preds = %212, %170, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %215 = load ptr, ptr %2, align 8
  ret ptr %215
}

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

declare void @qh_fprintf(ptr noundef, i32 noundef, ptr noundef, ...) #2

declare void @qh_errexit(i32 noundef, ptr noundef, ptr noundef) #2

declare ptr @qh_malloc(i64 noundef) #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !11, i64 80}
!10 = !{!"qhmemT", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !6, i64 64, !11, i64 72, !11, i64 80, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !6, i64 120, !6, i64 124, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !6, i64 16}
!13 = !{!10, !11, i64 40}
!14 = !{!10, !11, i64 32}
!15 = !{!10, !6, i64 132}
!16 = !{!10, !11, i64 24}
!17 = !{!11, !11, i64 0}
!18 = !{!10, !6, i64 92}
!19 = !{!10, !6, i64 120}
!20 = !{!10, !6, i64 96}
!21 = !{!10, !6, i64 104}
!22 = !{!10, !6, i64 88}
!23 = !{!10, !6, i64 64}
!24 = !{!10, !6, i64 116}
!25 = !{!10, !11, i64 48}
!26 = !{!10, !6, i64 4}
!27 = !{!10, !6, i64 0}
!28 = !{!10, !6, i64 20}
!29 = !{!10, !11, i64 56}
!30 = !{!10, !6, i64 112}
!31 = !{!10, !6, i64 136}
!32 = !{!10, !6, i64 100}
!33 = !{!10, !6, i64 124}
!34 = !{!10, !6, i64 128}
!35 = !{!10, !6, i64 108}


; 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.qhmemT = type { i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@qhmem = external dso_local local_unnamed_addr global %struct.qhmemT, align 8
@.str = external hidden unnamed_addr constant [89 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [54 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @qh_memalloc(i32 noundef %0) local_unnamed_addr #0 {
  %2 = icmp slt i32 %0, 0
  br i1 %2, label %.thread, label %4

.thread:                                          ; preds = %1
  %3 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 80), align 8, !tbaa !5
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %3, i32 noundef 6235, ptr noundef nonnull @.str, i32 noundef %0) #2
  tail call void @qh_errexit(i32 noundef 4, ptr noundef null, ptr noundef null) #2
  br label %88

4:                                                ; preds = %1
  %5 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 16), align 8
  %.not = icmp slt i32 %5, %0
  br i1 %.not, label %88, label %6

6:                                                ; preds = %4
  %7 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 40), align 8, !tbaa !11
  %8 = zext nneg i32 %0 to i64
  %9 = getelementptr inbounds i32, ptr %7, i64 %8
  %10 = load i32, ptr %9, align 4, !tbaa !12
  %11 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 32), align 8, !tbaa !13
  %12 = sext i32 %10 to i64
  %13 = getelementptr inbounds i32, ptr %11, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !12
  %15 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 132), align 4, !tbaa !14
  %16 = add nsw i32 %15, %14
  store i32 %16, ptr getelementptr inbounds (i8, ptr @qhmem, i64 132), align 4, !tbaa !14
  %17 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 24), align 8, !tbaa !15
  %18 = getelementptr inbounds ptr, ptr %17, i64 %12
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %.not55 = icmp eq ptr %19, null
  br i1 %.not55, label %35, label %20

20:                                               ; preds = %6
  %21 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 92), align 4, !tbaa !17
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr getelementptr inbounds (i8, ptr @qhmem, i64 92), align 4, !tbaa !17
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 120), align 8, !tbaa !18
  %24 = sub nsw i32 %23, %14
  store i32 %24, ptr getelementptr inbounds (i8, ptr @qhmem, i64 120), align 8, !tbaa !18
  %25 = load ptr, ptr %19, align 8, !tbaa !16
  store ptr %25, ptr %18, align 8, !tbaa !16
  %26 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 88), align 8, !tbaa !19
  %27 = icmp sgt i32 %26, 4
  br i1 %27, label %28, label %115

28:                                               ; preds = %20
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 96), align 8, !tbaa !20
  %30 = add nsw i32 %29, %22
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 104), align 8, !tbaa !21
  %32 = add nsw i32 %30, %31
  %33 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 80), align 8, !tbaa !5
  %34 = sub nsw i32 %30, %31
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %33, i32 noundef 8141, ptr noundef nonnull @.str.1, ptr noundef nonnull %19, i32 noundef %32, i32 noundef %14, i32 noundef %16, i32 noundef %34) #2
  br label %115

35:                                               ; preds = %6
  %36 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 96), align 8, !tbaa !20
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr getelementptr inbounds (i8, ptr @qhmem, i64 96), align 8, !tbaa !20
  %38 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 64), align 8, !tbaa !22
  %39 = icmp sgt i32 %14, %38
  br i1 %39, label %40, label %68

40:                                               ; preds = %35
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 116), align 4, !tbaa !23
  %42 = add nsw i32 %41, %38
  store i32 %42, ptr getelementptr inbounds (i8, ptr @qhmem, i64 116), align 4, !tbaa !23
  %43 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 48), align 8, !tbaa !24
  %.not56 = icmp eq ptr %43, null
  %.val = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 4), align 4
  %qhmem.val = load i32, ptr @qhmem, align 8
  %.0 = select i1 %.not56, i32 %.val, i32 %qhmem.val
  %44 = sext i32 %.0 to i64
  %45 = tail call ptr @qh_malloc(i64 noundef %44) #2
  %.not57 = icmp eq ptr %45, null
  br i1 %.not57, label %46, label %48

46:                                               ; preds = %40
  %47 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 80), align 8, !tbaa !5
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %47, i32 noundef 6080, ptr noundef nonnull @.str.2, i32 noundef %.0) #2
  tail call void @qh_errexit(i32 noundef 4, ptr noundef null, ptr noundef null) #2
  br label %48

48:                                               ; preds = %46, %40
  %49 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 48), align 8, !tbaa !24
  store ptr %49, ptr %45, align 8, !tbaa !16
  store ptr %45, ptr getelementptr inbounds (i8, ptr @qhmem, i64 48), align 8, !tbaa !24
  %50 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 20), align 4, !tbaa !25
  %51 = add nsw i32 %50, 8
  %52 = xor i32 %50, -1
  %53 = and i32 %51, %52
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %45, i64 %54
  store ptr %55, ptr getelementptr inbounds (i8, ptr @qhmem, i64 56), align 8, !tbaa !26
  %56 = sub nsw i32 %.0, %53
  store i32 %56, ptr getelementptr inbounds (i8, ptr @qhmem, i64 64), align 8, !tbaa !22
  %57 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 112), align 8, !tbaa !27
  %58 = add nsw i32 %57, %56
  store i32 %58, ptr getelementptr inbounds (i8, ptr @qhmem, i64 112), align 8, !tbaa !27
  %59 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 132), align 4, !tbaa !14
  %60 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 120), align 8, !tbaa !18
  %61 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 116), align 4, !tbaa !23
  %62 = sub i32 %56, %14
  %63 = add i32 %62, %59
  %64 = add i32 %63, %60
  %65 = add i32 %64, %61
  %.not58 = icmp eq i32 %58, %65
  br i1 %.not58, label %68, label %66

66:                                               ; preds = %48
  %67 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 80), align 8, !tbaa !5
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %67, i32 noundef 6212, ptr noundef nonnull @.str.3, i32 noundef %58, i32 noundef %65) #2
  tail call void @qh_errexit(i32 noundef 4, ptr noundef null, ptr noundef null) #2
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 64), align 8, !tbaa !22
  br label %68

68:                                               ; preds = %48, %66, %35
  %69 = phi i32 [ %56, %48 ], [ %.pre, %66 ], [ %38, %35 ]
  %70 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 56), align 8, !tbaa !26
  %71 = sext i32 %14 to i64
  %72 = getelementptr inbounds i8, ptr %70, i64 %71
  store ptr %72, ptr getelementptr inbounds (i8, ptr @qhmem, i64 56), align 8, !tbaa !26
  %73 = sub nsw i32 %69, %14
  store i32 %73, ptr getelementptr inbounds (i8, ptr @qhmem, i64 64), align 8, !tbaa !22
  %74 = sub i32 %14, %0
  %75 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 136), align 8, !tbaa !28
  %76 = add nsw i32 %74, %75
  store i32 %76, ptr getelementptr inbounds (i8, ptr @qhmem, i64 136), align 8, !tbaa !28
  %77 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 88), align 8, !tbaa !19
  %78 = icmp sgt i32 %77, 4
  br i1 %78, label %79, label %115

79:                                               ; preds = %68
  %80 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 96), align 8, !tbaa !20
  %81 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 92), align 4, !tbaa !17
  %82 = add nsw i32 %81, %80
  %83 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 104), align 8, !tbaa !21
  %84 = add nsw i32 %82, %83
  %85 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 80), align 8, !tbaa !5
  %86 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 132), align 4, !tbaa !14
  %87 = sub nsw i32 %82, %83
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %85, i32 noundef 8140, ptr noundef nonnull @.str.4, ptr noundef %70, i32 noundef %84, i32 noundef %14, i32 noundef %86, i32 noundef %87) #2
  br label %115

88:                                               ; preds = %.thread, %4
  %89 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 40), align 8, !tbaa !11
  %.not53 = icmp eq ptr %89, null
  br i1 %.not53, label %90, label %92

90:                                               ; preds = %88
  %91 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 80), align 8, !tbaa !5
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %91, i32 noundef 6081, ptr noundef nonnull @.str.5) #2
  tail call void @qh_errexit(i32 noundef 5, ptr noundef null, ptr noundef null) #2
  br label %92

92:                                               ; preds = %90, %88
  %93 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 100), align 4, !tbaa !29
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr getelementptr inbounds (i8, ptr @qhmem, i64 100), align 4, !tbaa !29
  %95 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 124), align 4, !tbaa !30
  %96 = add nsw i32 %95, %0
  store i32 %96, ptr getelementptr inbounds (i8, ptr @qhmem, i64 124), align 4, !tbaa !30
  %97 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 128), align 8, !tbaa !31
  %98 = icmp slt i32 %97, %96
  br i1 %98, label %99, label %100

99:                                               ; preds = %92
  store i32 %96, ptr getelementptr inbounds (i8, ptr @qhmem, i64 128), align 8, !tbaa !31
  br label %100

100:                                              ; preds = %99, %92
  %101 = sext i32 %0 to i64
  %102 = tail call ptr @qh_malloc(i64 noundef %101) #2
  %.not54 = icmp eq ptr %102, null
  br i1 %.not54, label %103, label %105

103:                                              ; preds = %100
  %104 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 80), align 8, !tbaa !5
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %104, i32 noundef 6082, ptr noundef nonnull @.str.6, i32 noundef %0) #2
  tail call void @qh_errexit(i32 noundef 4, ptr noundef null, ptr noundef null) #2
  br label %105

105:                                              ; preds = %103, %100
  %106 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 88), align 8, !tbaa !19
  %107 = icmp sgt i32 %106, 4
  br i1 %107, label %108, label %115

108:                                              ; preds = %105
  %109 = load ptr, ptr getelementptr inbounds (i8, ptr @qhmem, i64 80), align 8, !tbaa !5
  %110 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 100), align 4, !tbaa !29
  %111 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 108), align 4, !tbaa !32
  %112 = add nsw i32 %111, %110
  %113 = load i32, ptr getelementptr inbounds (i8, ptr @qhmem, i64 124), align 4, !tbaa !30
  %114 = sub nsw i32 %110, %111
  tail call void (ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %109, i32 noundef 8057, ptr noundef nonnull @.str.7, ptr noundef %102, i32 noundef %112, i32 noundef %0, i32 noundef %113, i32 noundef %114) #2
  br label %115

115:                                              ; preds = %108, %105, %68, %79, %20, %28
  %.045 = phi ptr [ %19, %28 ], [ %19, %20 ], [ %70, %79 ], [ %70, %68 ], [ %102, %105 ], [ %102, %108 ]
  ret ptr %.045
}

declare void @qh_fprintf(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

declare void @qh_errexit(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @qh_malloc(i64 noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 80}
!6 = !{!"qhmemT", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !10, i64 72, !10, i64 80, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !7, i64 136, !7, i64 140, !7, i64 144}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 40}
!12 = !{!7, !7, i64 0}
!13 = !{!6, !10, i64 32}
!14 = !{!6, !7, i64 132}
!15 = !{!6, !10, i64 24}
!16 = !{!10, !10, i64 0}
!17 = !{!6, !7, i64 92}
!18 = !{!6, !7, i64 120}
!19 = !{!6, !7, i64 88}
!20 = !{!6, !7, i64 96}
!21 = !{!6, !7, i64 104}
!22 = !{!6, !7, i64 64}
!23 = !{!6, !7, i64 116}
!24 = !{!6, !10, i64 48}
!25 = !{!6, !7, i64 20}
!26 = !{!6, !10, i64 56}
!27 = !{!6, !7, i64 112}
!28 = !{!6, !7, i64 136}
!29 = !{!6, !7, i64 100}
!30 = !{!6, !7, i64 124}
!31 = !{!6, !7, i64 128}
!32 = !{!6, !7, i64 108}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass