; LLVM IR from tangjz/acm-icpc :: self_training/2015-09-21 (G)

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

@t = external dso_local global i32, align 4
@id = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@cnt = external dso_local global [21 x i32], align 16
@pos = external dso_local global [21 x i32], align 16
@ans = external dso_local global [21 x %struct.Result], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i8, align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %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 %struct.Result, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %16

16:                                               ; preds = %243, %0
  %17 = load i32, ptr @t, align 4, !tbaa !5
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr @t, align 4, !tbaa !5
  %19 = icmp ne i32 %17, 0
  br i1 %19, label %20, label %244

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 1, ptr %2) #6
  store i8 1, ptr %2, align 1, !tbaa !9
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @id, ptr noundef @n)
  %22 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %22, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %38, %20
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %41

28:                                               ; preds = %23
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i32, ptr @cnt, i64 %30
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %31)
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %36
  store i32 %34, ptr %37, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %28
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %3, align 4, !tbaa !5
  br label %23, !llvm.loop !11

41:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %199, %41
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = sub nsw i32 %44, 2
  %46 = icmp slt i32 %43, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %42
  store i32 7, ptr %5, align 4
  br label %202

48:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %67, %48
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = load i32, ptr @tot, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %70

54:                                               ; preds = %49
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp slt i32 %58, %62
  br i1 %63, label %64, label %66

64:                                               ; preds = %54
  %65 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %65, ptr %6, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %64, %54
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %7, align 4, !tbaa !5
  br label %49, !llvm.loop !13

70:                                               ; preds = %53
  %71 = load i32, ptr @tot, align 4, !tbaa !5
  %72 = icmp slt i32 %71, 3
  br i1 %72, label %93, label %73

73:                                               ; preds = %70
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sub nsw i32 %74, 1
  %76 = load i32, ptr @tot, align 4, !tbaa !5
  %77 = add nsw i32 %75, %76
  %78 = load i32, ptr @tot, align 4, !tbaa !5
  %79 = srem i32 %77, %78
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %93

84:                                               ; preds = %73
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  %87 = load i32, ptr @tot, align 4, !tbaa !5
  %88 = srem i32 %86, %87
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %94, label %93

93:                                               ; preds = %84, %73, %70
  store i8 0, ptr %2, align 1, !tbaa !9
  store i32 7, ptr %5, align 4
  br label %196

94:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sub nsw i32 %95, 1
  %97 = load i32, ptr @tot, align 4, !tbaa !5
  %98 = add nsw i32 %96, %97
  %99 = load i32, ptr @tot, align 4, !tbaa !5
  %100 = srem i32 %98, %99
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  store i32 %103, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  store i32 %107, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  %110 = load i32, ptr @tot, align 4, !tbaa !5
  %111 = srem i32 %109, %110
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  store i32 %114, ptr %10, align 4, !tbaa !5
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = icmp sgt i32 %115, %116
  br i1 %117, label %118, label %119

118:                                              ; preds = %94
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9) #6
  br label %119

119:                                              ; preds = %118, %94
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = icmp sgt i32 %120, %121
  br i1 %122, label %123, label %124

123:                                              ; preds = %119
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %10) #6
  br label %124

124:                                              ; preds = %123, %119
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = icmp sgt i32 %125, %126
  br i1 %127, label %128, label %129

128:                                              ; preds = %124
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10) #6
  br label %129

129:                                              ; preds = %128, %124
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #6
  %130 = getelementptr inbounds %struct.Result, ptr %11, i32 0, i32 0
  %131 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %131, ptr %130, align 4, !tbaa !14
  %132 = getelementptr inbounds %struct.Result, ptr %11, i32 0, i32 1
  %133 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %133, ptr %132, align 4, !tbaa !16
  %134 = getelementptr inbounds %struct.Result, ptr %11, i32 0, i32 2
  %135 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %135, ptr %134, align 4, !tbaa !17
  %136 = load i32, ptr %4, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [21 x %struct.Result], ptr @ans, i64 0, i64 %137
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %138, ptr align 4 %11, i64 12, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #6
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = sub nsw i32 %139, 1
  %141 = load i32, ptr @tot, align 4, !tbaa !5
  %142 = add nsw i32 %140, %141
  %143 = load i32, ptr @tot, align 4, !tbaa !5
  %144 = srem i32 %142, %143
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = add nsw i32 %147, -1
  store i32 %148, ptr %146, align 4, !tbaa !5
  %149 = load i32, ptr %6, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = add nsw i32 %152, -1
  store i32 %153, ptr %151, align 4, !tbaa !5
  %154 = load i32, ptr %6, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  %156 = load i32, ptr @tot, align 4, !tbaa !5
  %157 = srem i32 %155, %156
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = add nsw i32 %160, -1
  store i32 %161, ptr %159, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %191, %129
  %163 = load i32, ptr %13, align 4, !tbaa !5
  %164 = load i32, ptr @tot, align 4, !tbaa !5
  %165 = icmp slt i32 %163, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %162
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %194

167:                                              ; preds = %162
  %168 = load i32, ptr %13, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %173, label %190

173:                                              ; preds = %167
  %174 = load i32, ptr %13, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = load i32, ptr %12, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %179
  store i32 %177, ptr %180, align 4, !tbaa !5
  %181 = load i32, ptr %13, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = load i32, ptr %12, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %186
  store i32 %184, ptr %187, align 4, !tbaa !5
  %188 = load i32, ptr %12, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %12, align 4, !tbaa !5
  br label %190

190:                                              ; preds = %173, %167
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %13, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %13, align 4, !tbaa !5
  br label %162, !llvm.loop !19

194:                                              ; preds = %166
  %195 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %195, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  store i32 0, ptr %5, align 4
  br label %196

196:                                              ; preds = %194, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %197 = load i32, ptr %5, align 4
  switch i32 %197, label %202 [
    i32 0, label %198
  ]

198:                                              ; preds = %196
  br label %199

199:                                              ; preds = %198
  %200 = load i32, ptr %4, align 4, !tbaa !5
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %4, align 4, !tbaa !5
  br label %42, !llvm.loop !20

202:                                              ; preds = %196, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %203

203:                                              ; preds = %202
  %204 = load i8, ptr %2, align 1, !tbaa !9, !range !21, !noundef !22
  %205 = trunc i8 %204 to i1
  br i1 %205, label %209, label %206

206:                                              ; preds = %203
  %207 = load i32, ptr @id, align 4, !tbaa !5
  %208 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %207)
  br label %243

209:                                              ; preds = %203
  %210 = load i32, ptr @id, align 4, !tbaa !5
  %211 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %210)
  %212 = load i32, ptr @n, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds %struct.Result, ptr @ans, i64 %213
  %215 = getelementptr inbounds %struct.Result, ptr %214, i64 -2
  call void @_ZSt4sortIP6ResultEvT_S2_(ptr noundef @ans, ptr noundef %215)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %216

216:                                              ; preds = %239, %209
  %217 = load i32, ptr %14, align 4, !tbaa !5
  %218 = load i32, ptr @n, align 4, !tbaa !5
  %219 = sub nsw i32 %218, 2
  %220 = icmp slt i32 %217, %219
  br i1 %220, label %222, label %221

221:                                              ; preds = %216
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %242

222:                                              ; preds = %216
  %223 = load i32, ptr %14, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [21 x %struct.Result], ptr @ans, i64 0, i64 %224
  %226 = getelementptr inbounds %struct.Result, ptr %225, i32 0, i32 0
  %227 = load i32, ptr %226, align 4, !tbaa !14
  %228 = load i32, ptr %14, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [21 x %struct.Result], ptr @ans, i64 0, i64 %229
  %231 = getelementptr inbounds %struct.Result, ptr %230, i32 0, i32 1
  %232 = load i32, ptr %231, align 4, !tbaa !16
  %233 = load i32, ptr %14, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [21 x %struct.Result], ptr @ans, i64 0, i64 %234
  %236 = getelementptr inbounds %struct.Result, ptr %235, i32 0, i32 2
  %237 = load i32, ptr %236, align 4, !tbaa !17
  %238 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %227, i32 noundef %232, i32 noundef %237)
  br label %239

239:                                              ; preds = %222
  %240 = load i32, ptr %14, align 4, !tbaa !5
  %241 = add nsw i32 %240, 1
  store i32 %241, ptr %14, align 4, !tbaa !5
  br label %216, !llvm.loop !23

242:                                              ; preds = %221
  br label %243

243:                                              ; preds = %242, %206
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #6
  br label %16, !llvm.loop !24

244:                                              ; preds = %16
  ret i32 0
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; 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) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP6ResultEvT_S2_(ptr noundef, ptr noundef) #5

attributes #0 = { mustprogress norecurse 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint 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 #6 = { 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 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTS6Result", !6, i64 0, !6, i64 4, !6, i64 8}
!16 = !{!15, !6, i64 4}
!17 = !{!15, !6, i64 8}
!18 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}


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

@t = external dso_local global i32, align 4
@id = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local global [21 x i32], align 16
@pos = external dso_local local_unnamed_addr global [21 x i32], align 16
@ans = external dso_local global [21 x %struct.Result], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %5 = load i32, ptr @t, align 4, !tbaa !5
  %6 = add nsw i32 %5, -1
  store i32 %6, ptr @t, align 4, !tbaa !5
  %.not73 = icmp eq i32 %5, 0
  br i1 %.not73, label %._crit_edge76, label %.lr.ph75

.lr.ph75:                                         ; preds = %0, %.loopexit
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @id, ptr noundef nonnull @n)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %8, ptr @tot, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge69

.preheader56:                                     ; preds = %.lr.ph
  %10 = icmp sgt i32 %15, 2
  br i1 %10, label %.preheader.preheader, label %._crit_edge69

.preheader.preheader:                             ; preds = %.preheader56
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br label %.preheader

.lr.ph:                                           ; preds = %.lr.ph75, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph75 ]
  %11 = getelementptr inbounds i32, ptr @cnt, i64 %indvars.iv
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %11)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %indvars.iv
  %14 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %14, ptr %13, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %indvars.iv.next, %16
  br i1 %17, label %.lr.ph, label %.preheader56, !llvm.loop !9

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge66
  %18 = phi i32 [ %.pre, %.preheader.preheader ], [ %.038.lcssa, %._crit_edge66 ]
  %indvars.iv86 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next87, %._crit_edge66 ]
  %19 = icmp sgt i32 %18, 1
  br i1 %19, label %.lr.ph60.preheader, label %.thread54

.lr.ph60.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %18 to i64
  %20 = add nsw i64 %wide.trip.count, -1
  %21 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %20, 3
  %22 = icmp ult i64 %21, 3
  br i1 %22, label %._crit_edge.unr-lcssa, label %.lr.ph60.preheader.new

.lr.ph60.preheader.new:                           ; preds = %.lr.ph60.preheader
  %unroll_iter = and i64 %20, -4
  br label %.lr.ph60

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph60, %.lr.ph60.preheader
  %spec.select.lcssa.ph = phi i32 [ poison, %.lr.ph60.preheader ], [ %spec.select.3, %.lr.ph60 ]
  %indvars.iv78.unr = phi i64 [ 1, %.lr.ph60.preheader ], [ %indvars.iv.next79.3, %.lr.ph60 ]
  %.04458.unr = phi i32 [ 0, %.lr.ph60.preheader ], [ %spec.select.3, %.lr.ph60 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph60.epil

.lr.ph60.epil:                                    ; preds = %._crit_edge.unr-lcssa, %.lr.ph60.epil
  %indvars.iv78.epil = phi i64 [ %indvars.iv.next79.epil, %.lr.ph60.epil ], [ %indvars.iv78.unr, %._crit_edge.unr-lcssa ]
  %.04458.epil = phi i32 [ %spec.select.epil, %.lr.ph60.epil ], [ %.04458.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph60.epil ], [ 0, %._crit_edge.unr-lcssa ]
  %23 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %indvars.iv78.epil
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = sext i32 %.04458.epil to i64
  %26 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp slt i32 %24, %27
  %29 = trunc nuw nsw i64 %indvars.iv78.epil to i32
  %spec.select.epil = select i1 %28, i32 %29, i32 %.04458.epil
  %indvars.iv.next79.epil = add nuw nsw i64 %indvars.iv78.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph60.epil, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph60.epil, %._crit_edge.unr-lcssa
  %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %._crit_edge.unr-lcssa ], [ %spec.select.epil, %.lr.ph60.epil ]
  %30 = icmp eq i32 %18, 2
  br i1 %30, label %.thread54, label %59

.lr.ph60:                                         ; preds = %.lr.ph60, %.lr.ph60.preheader.new
  %indvars.iv78 = phi i64 [ 1, %.lr.ph60.preheader.new ], [ %indvars.iv.next79.3, %.lr.ph60 ]
  %.04458 = phi i32 [ 0, %.lr.ph60.preheader.new ], [ %spec.select.3, %.lr.ph60 ]
  %niter = phi i64 [ 0, %.lr.ph60.preheader.new ], [ %niter.next.3, %.lr.ph60 ]
  %31 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %indvars.iv78
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sext i32 %.04458 to i64
  %34 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = icmp slt i32 %32, %35
  %37 = trunc nuw nsw i64 %indvars.iv78 to i32
  %spec.select = select i1 %36, i32 %37, i32 %.04458
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %38 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %indvars.iv.next79
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %spec.select to i64
  %41 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = icmp slt i32 %39, %42
  %44 = trunc nuw nsw i64 %indvars.iv.next79 to i32
  %spec.select.1 = select i1 %43, i32 %44, i32 %spec.select
  %indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78, 2
  %45 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %indvars.iv.next79.1
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %spec.select.1 to i64
  %48 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp slt i32 %46, %49
  %51 = trunc nuw nsw i64 %indvars.iv.next79.1 to i32
  %spec.select.2 = select i1 %50, i32 %51, i32 %spec.select.1
  %indvars.iv.next79.2 = add nuw nsw i64 %indvars.iv78, 3
  %52 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %indvars.iv.next79.2
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sext i32 %spec.select.2 to i64
  %55 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp slt i32 %53, %56
  %58 = trunc nuw nsw i64 %indvars.iv.next79.2 to i32
  %spec.select.3 = select i1 %57, i32 %58, i32 %spec.select.2
  %indvars.iv.next79.3 = add nuw nsw i64 %indvars.iv78, 4
  %niter.next.3 = add nuw i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.unr-lcssa, label %.lr.ph60, !llvm.loop !13

59:                                               ; preds = %._crit_edge
  %60 = add nsw i32 %spec.select.lcssa, -1
  %61 = add nsw i32 %18, %60
  %62 = srem i32 %61, %18
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %.not49 = icmp eq i32 %65, 0
  br i1 %.not49, label %.thread54, label %66

66:                                               ; preds = %59
  %67 = add nsw i32 %spec.select.lcssa, 1
  %68 = srem i32 %67, %18
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %.not50 = icmp eq i32 %71, 0
  br i1 %.not50, label %.thread54, label %72

72:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %73 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %63
  %74 = load i32, ptr %73, align 4, !tbaa !5
  store i32 %74, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %75 = sext i32 %spec.select.lcssa to i64
  %76 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  store i32 %77, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %78 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %69
  %79 = load i32, ptr %78, align 4, !tbaa !5
  store i32 %79, ptr %3, align 4, !tbaa !5
  %80 = icmp sgt i32 %74, %77
  br i1 %80, label %81, label %82

81:                                               ; preds = %72
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) #5
  %.pre92 = load i32, ptr %1, align 4, !tbaa !5
  %.pre93 = load i32, ptr %3, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %81, %72
  %83 = phi i32 [ %.pre93, %81 ], [ %79, %72 ]
  %84 = phi i32 [ %.pre92, %81 ], [ %74, %72 ]
  %85 = icmp sgt i32 %84, %83
  br i1 %85, label %86, label %87

86:                                               ; preds = %82
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %3) #5
  %.pre94 = load i32, ptr %3, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %86, %82
  %88 = phi i32 [ %.pre94, %86 ], [ %83, %82 ]
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = icmp sgt i32 %89, %88
  br i1 %90, label %91, label %92

91:                                               ; preds = %87
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3) #5
  %.pre95 = load i32, ptr %2, align 4, !tbaa !5
  %.pre96 = load i32, ptr %3, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %91, %87
  %93 = phi i32 [ %.pre96, %91 ], [ %88, %87 ]
  %94 = phi i32 [ %.pre95, %91 ], [ %89, %87 ]
  %95 = load i32, ptr %1, align 4, !tbaa !5
  %96 = getelementptr inbounds [21 x %struct.Result], ptr @ans, i64 0, i64 %indvars.iv86
  store i32 %95, ptr %96, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %96, i64 4
  store i32 %94, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %96, i64 8
  store i32 %93, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  %97 = load i32, ptr @tot, align 4, !tbaa !5
  %98 = add nsw i32 %97, %60
  %99 = srem i32 %98, %97
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %102, -1
  store i32 %103, ptr %101, align 4, !tbaa !5
  %104 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %75
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = add nsw i32 %105, -1
  store i32 %106, ptr %104, align 4, !tbaa !5
  %107 = srem i32 %67, %97
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = add nsw i32 %110, -1
  store i32 %111, ptr %109, align 4, !tbaa !5
  %112 = icmp sgt i32 %97, 0
  br i1 %112, label %.lr.ph65.preheader, label %._crit_edge66

.lr.ph65.preheader:                               ; preds = %92
  %wide.trip.count84 = zext nneg i32 %97 to i64
  %xtraiter99 = and i64 %wide.trip.count84, 1
  %113 = icmp eq i32 %97, 1
  br i1 %113, label %._crit_edge66.loopexit.unr-lcssa, label %.lr.ph65.preheader.new

.lr.ph65.preheader.new:                           ; preds = %.lr.ph65.preheader
  %unroll_iter103 = and i64 %wide.trip.count84, 2147483646
  br label %.lr.ph65

.lr.ph65:                                         ; preds = %132, %.lr.ph65.preheader.new
  %indvars.iv81 = phi i64 [ 0, %.lr.ph65.preheader.new ], [ %indvars.iv.next82.1, %132 ]
  %.03862 = phi i32 [ 0, %.lr.ph65.preheader.new ], [ %.1.1, %132 ]
  %niter104 = phi i64 [ 0, %.lr.ph65.preheader.new ], [ %niter104.next.1, %132 ]
  %114 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %indvars.iv81
  %115 = load i32, ptr %114, align 8, !tbaa !5
  %.not51 = icmp eq i32 %115, 0
  br i1 %.not51, label %.lr.ph65.1, label %116

116:                                              ; preds = %.lr.ph65
  %117 = sext i32 %.03862 to i64
  %118 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %117
  store i32 %115, ptr %118, align 4, !tbaa !5
  %119 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %indvars.iv81
  %120 = load i32, ptr %119, align 8, !tbaa !5
  %121 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %117
  store i32 %120, ptr %121, align 4, !tbaa !5
  %122 = add nsw i32 %.03862, 1
  br label %.lr.ph65.1

.lr.ph65.1:                                       ; preds = %.lr.ph65, %116
  %.1 = phi i32 [ %122, %116 ], [ %.03862, %.lr.ph65 ]
  %indvars.iv.next82 = or disjoint i64 %indvars.iv81, 1
  %123 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %indvars.iv.next82
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %.not51.1 = icmp eq i32 %124, 0
  br i1 %.not51.1, label %132, label %125

125:                                              ; preds = %.lr.ph65.1
  %126 = sext i32 %.1 to i64
  %127 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %126
  store i32 %124, ptr %127, align 4, !tbaa !5
  %128 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %indvars.iv.next82
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %126
  store i32 %129, ptr %130, align 4, !tbaa !5
  %131 = add nsw i32 %.1, 1
  br label %132

132:                                              ; preds = %125, %.lr.ph65.1
  %.1.1 = phi i32 [ %131, %125 ], [ %.1, %.lr.ph65.1 ]
  %indvars.iv.next82.1 = add nuw nsw i64 %indvars.iv81, 2
  %niter104.next.1 = add i64 %niter104, 2
  %niter104.ncmp.1 = icmp eq i64 %niter104.next.1, %unroll_iter103
  br i1 %niter104.ncmp.1, label %._crit_edge66.loopexit.unr-lcssa, label %.lr.ph65, !llvm.loop !14

._crit_edge66.loopexit.unr-lcssa:                 ; preds = %132, %.lr.ph65.preheader
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph65.preheader ], [ %.1.1, %132 ]
  %indvars.iv81.unr = phi i64 [ 0, %.lr.ph65.preheader ], [ %indvars.iv.next82.1, %132 ]
  %.03862.unr = phi i32 [ 0, %.lr.ph65.preheader ], [ %.1.1, %132 ]
  %lcmp.mod101.not = icmp eq i64 %xtraiter99, 0
  br i1 %lcmp.mod101.not, label %._crit_edge66, label %.lr.ph65.epil

.lr.ph65.epil:                                    ; preds = %._crit_edge66.loopexit.unr-lcssa
  %133 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %indvars.iv81.unr
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %.not51.epil = icmp eq i32 %134, 0
  br i1 %.not51.epil, label %._crit_edge66, label %135

135:                                              ; preds = %.lr.ph65.epil
  %136 = sext i32 %.03862.unr to i64
  %137 = getelementptr inbounds [21 x i32], ptr @cnt, i64 0, i64 %136
  store i32 %134, ptr %137, align 4, !tbaa !5
  %138 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %indvars.iv81.unr
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = getelementptr inbounds [21 x i32], ptr @pos, i64 0, i64 %136
  store i32 %139, ptr %140, align 4, !tbaa !5
  %141 = add nsw i32 %.03862.unr, 1
  br label %._crit_edge66

._crit_edge66:                                    ; preds = %._crit_edge66.loopexit.unr-lcssa, %135, %.lr.ph65.epil, %92
  %.038.lcssa = phi i32 [ 0, %92 ], [ %.1.lcssa.ph, %._crit_edge66.loopexit.unr-lcssa ], [ %141, %135 ], [ %.03862.unr, %.lr.ph65.epil ]
  store i32 %.038.lcssa, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %142 = load i32, ptr @n, align 4, !tbaa !5
  %143 = add nsw i32 %142, -2
  %144 = sext i32 %143 to i64
  %145 = icmp slt i64 %indvars.iv.next87, %144
  br i1 %145, label %.preheader, label %._crit_edge69, !llvm.loop !15

.thread54:                                        ; preds = %.preheader, %66, %59, %._crit_edge
  %146 = load i32, ptr @id, align 4, !tbaa !5
  %147 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %146)
  br label %.loopexit

._crit_edge69:                                    ; preds = %._crit_edge66, %.lr.ph75, %.preheader56
  %148 = load i32, ptr @id, align 4, !tbaa !5
  %149 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %148)
  %150 = load i32, ptr @n, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %gep = getelementptr %struct.Result, ptr getelementptr (i8, ptr @ans, i64 -24), i64 %151
  call void @_ZSt4sortIP6ResultEvT_S2_(ptr noundef nonnull @ans, ptr noundef nonnull %gep)
  %152 = load i32, ptr @n, align 4, !tbaa !5
  %153 = icmp sgt i32 %152, 2
  br i1 %153, label %.lr.ph72, label %.loopexit

.lr.ph72:                                         ; preds = %._crit_edge69, %.lr.ph72
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %.lr.ph72 ], [ 0, %._crit_edge69 ]
  %154 = getelementptr inbounds [21 x %struct.Result], ptr @ans, i64 0, i64 %indvars.iv89
  %155 = load i32, ptr %154, align 4, !tbaa !16
  %156 = getelementptr inbounds i8, ptr %154, i64 4
  %157 = load i32, ptr %156, align 4, !tbaa !18
  %158 = getelementptr inbounds i8, ptr %154, i64 8
  %159 = load i32, ptr %158, align 4, !tbaa !19
  %160 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %155, i32 noundef %157, i32 noundef %159)
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %161 = load i32, ptr @n, align 4, !tbaa !5
  %162 = add nsw i32 %161, -2
  %163 = sext i32 %162 to i64
  %164 = icmp slt i64 %indvars.iv.next90, %163
  br i1 %164, label %.lr.ph72, label %.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %.lr.ph72, %._crit_edge69, %.thread54
  %165 = load i32, ptr @t, align 4, !tbaa !5
  %166 = add nsw i32 %165, -1
  store i32 %166, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %165, 0
  br i1 %.not, label %._crit_edge76, label %.lr.ph75, !llvm.loop !21

._crit_edge76:                                    ; preds = %.loopexit, %0
  ret i32 0
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP6ResultEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTS6Result", !6, i64 0, !6, i64 4, !6, i64 8}
!18 = !{!17, !6, i64 4}
!19 = !{!17, !6, i64 8}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}


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