; LLVM IR from zisisvakras/crossw :: src (crossu)

; 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.Word = type { i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct.Map = type { ptr, i32, i32 }

@stderr = external global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [75 x i8], align 1
@stdin = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [18 x i8], align 1

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

declare void @perror(ptr noundef) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #3

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

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

; Function Attrs: nounwind uwtable
define dso_local void @check_crossword(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #6 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %17 = call noalias ptr @malloc(i64 noundef 81) #10
  store ptr %17, ptr %9, align 8, !tbaa !5
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %23

20:                                               ; preds = %4
  call void @perror(ptr noundef @.str.11)
  %21 = call ptr @__errno_location() #11
  %22 = load i32, ptr %21, align 4, !tbaa !9
  call void @exit(i32 noundef %22) #12
  unreachable

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

24:                                               ; preds = %225, %23
  %25 = load ptr, ptr @stdin, align 8, !tbaa !5
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %25, ptr noundef @.str.12, ptr noundef %26)
  %28 = icmp eq i32 %27, 1
  br i1 %28, label %29, label %235

29:                                               ; preds = %24
  %30 = load i32, ptr %10, align 4, !tbaa !9
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = icmp eq i32 %30, %31
  br i1 %32, label %33, label %36

33:                                               ; preds = %29
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str.13) #9
  call void @exit(i32 noundef 1) #12
  unreachable

36:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = call i64 @strlen(ptr noundef %37) #13
  %39 = trunc i64 %38 to i32
  store i32 %39, ptr %11, align 4, !tbaa !9
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds ptr, ptr %41, i64 %43
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.Word, ptr %45, i32 0, i32 5
  %47 = load i32, ptr %46, align 4, !tbaa !11
  %48 = icmp ne i32 %40, %47
  br i1 %48, label %49, label %53

49:                                               ; preds = %36
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef @.str.14, ptr noundef %51) #9
  call void @exit(i32 noundef 1) #12
  unreachable

53:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %54 = call noalias ptr @malloc(i64 noundef 16) #10
  store ptr %54, ptr %12, align 8, !tbaa !5
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = icmp eq ptr %55, null
  br i1 %56, label %57, label %60

57:                                               ; preds = %53
  call void @perror(ptr noundef @.str.15)
  %58 = call ptr @__errno_location() #11
  %59 = load i32, ptr %58, align 4, !tbaa !9
  call void @exit(i32 noundef %59) #12
  unreachable

60:                                               ; preds = %53
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load i32, ptr %11, align 4, !tbaa !9
  %63 = sub nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds ptr, ptr %61, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = load i32, ptr %11, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds ptr, ptr %66, i64 %68
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.Map, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !13
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.Map, ptr %73, i32 0, i32 1
  store i32 %72, ptr %74, align 8, !tbaa !13
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.Map, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 8, !tbaa !13
  %78 = sext i32 %77 to i64
  %79 = mul i64 %78, 8
  %80 = call noalias ptr @malloc(i64 noundef %79) #10
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.Map, ptr %81, i32 0, i32 0
  store ptr %80, ptr %82, align 8, !tbaa !15
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.Map, ptr %83, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !15
  %86 = icmp eq ptr %85, null
  br i1 %86, label %87, label %90

87:                                               ; preds = %60
  call void @perror(ptr noundef @.str.16)
  %88 = call ptr @__errno_location() #11
  %89 = load i32, ptr %88, align 4, !tbaa !9
  call void @exit(i32 noundef %89) #12
  unreachable

90:                                               ; preds = %60
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.Map, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !15
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = sub nsw i32 %95, 1
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds ptr, ptr %94, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  %100 = load i32, ptr %11, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds ptr, ptr %99, i64 %101
  %103 = load ptr, ptr %102, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.Map, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !15
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.Map, ptr %106, i32 0, i32 1
  %108 = load i32, ptr %107, align 8, !tbaa !13
  %109 = sext i32 %108 to i64
  %110 = mul i64 %109, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %93, ptr align 8 %105, i64 %110, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %136, %90
  %112 = load i32, ptr %13, align 4, !tbaa !9
  %113 = load i32, ptr %11, align 4, !tbaa !9
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %139

116:                                              ; preds = %111
  %117 = load ptr, ptr %12, align 8, !tbaa !5
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load i32, ptr %11, align 4, !tbaa !9
  %120 = sub nsw i32 %119, 1
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds ptr, ptr %118, i64 %121
  %123 = load ptr, ptr %122, align 8, !tbaa !5
  %124 = load i32, ptr %13, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds ptr, ptr %123, i64 %125
  %127 = load ptr, ptr %126, align 8, !tbaa !5
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = load i32, ptr %13, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i8, ptr %128, i64 %130
  %132 = load i8, ptr %131, align 1, !tbaa !16
  %133 = sext i8 %132 to i32
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds %struct.Map, ptr %127, i64 %134
  call void @join_map(ptr noundef %117, ptr noundef %135)
  br label %136

136:                                              ; preds = %116
  %137 = load i32, ptr %13, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %13, align 4, !tbaa !9
  br label %111, !llvm.loop !17

139:                                              ; preds = %115
  %140 = load ptr, ptr %12, align 8, !tbaa !5
  %141 = call i32 @sum_bit(ptr noundef %140)
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %147

143:                                              ; preds = %139
  %144 = load ptr, ptr @stderr, align 8, !tbaa !5
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef @.str.17, ptr noundef %145) #9
  call void @exit(i32 noundef 1) #12
  unreachable

147:                                              ; preds = %139
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = load i32, ptr %10, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds ptr, ptr %148, i64 %150
  %152 = load ptr, ptr %151, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.Word, ptr %152, i32 0, i32 1
  %154 = load i32, ptr %153, align 4, !tbaa !19
  %155 = icmp eq i32 %154, 1
  br i1 %155, label %156, label %225

156:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = load i32, ptr %10, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds ptr, ptr %157, i64 %159
  %161 = load ptr, ptr %160, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.Word, ptr %161, i32 0, i32 3
  %163 = load i32, ptr %162, align 4, !tbaa !20
  store i32 %163, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  %164 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %164, ptr %15, align 4, !tbaa !9
  br label %165

165:                                              ; preds = %221, %156
  %166 = load i32, ptr %15, align 4, !tbaa !9
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = load i32, ptr %10, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds ptr, ptr %167, i64 %169
  %171 = load ptr, ptr %170, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.Word, ptr %171, i32 0, i32 4
  %173 = load i32, ptr %172, align 8, !tbaa !21
  %174 = icmp sle i32 %166, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %224

176:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = load i32, ptr %15, align 4, !tbaa !9
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds ptr, ptr %177, i64 %179
  %181 = load ptr, ptr %180, align 8, !tbaa !5
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = load i32, ptr %10, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds ptr, ptr %182, i64 %184
  %186 = load ptr, ptr %185, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.Word, ptr %186, i32 0, i32 2
  %188 = load i32, ptr %187, align 8, !tbaa !22
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i8, ptr %181, i64 %189
  %191 = load i8, ptr %190, align 1, !tbaa !16
  %192 = sext i8 %191 to i32
  store i32 %192, ptr %16, align 4, !tbaa !9
  %193 = load i32, ptr %16, align 4, !tbaa !9
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %195, label %212

195:                                              ; preds = %176
  %196 = load ptr, ptr %12, align 8, !tbaa !5
  %197 = load ptr, ptr %7, align 8, !tbaa !5
  %198 = load i32, ptr %11, align 4, !tbaa !9
  %199 = sub nsw i32 %198, 1
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds ptr, ptr %197, i64 %200
  %202 = load ptr, ptr %201, align 8, !tbaa !5
  %203 = load i32, ptr %15, align 4, !tbaa !9
  %204 = load i32, ptr %14, align 4, !tbaa !9
  %205 = sub nsw i32 %203, %204
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds ptr, ptr %202, i64 %206
  %208 = load ptr, ptr %207, align 8, !tbaa !5
  %209 = load i32, ptr %16, align 4, !tbaa !9
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds %struct.Map, ptr %208, i64 %210
  call void @join_map(ptr noundef %196, ptr noundef %211)
  br label %212

212:                                              ; preds = %195, %176
  %213 = load ptr, ptr %12, align 8, !tbaa !5
  %214 = call i32 @sum_bit(ptr noundef %213)
  %215 = icmp eq i32 %214, 0
  br i1 %215, label %216, label %220

216:                                              ; preds = %212
  %217 = load ptr, ptr @stderr, align 8, !tbaa !5
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  %219 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %217, ptr noundef @.str.14, ptr noundef %218) #9
  call void @exit(i32 noundef 1) #12
  unreachable

220:                                              ; preds = %212
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %221

221:                                              ; preds = %220
  %222 = load i32, ptr %15, align 4, !tbaa !9
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %15, align 4, !tbaa !9
  br label %165, !llvm.loop !23

224:                                              ; preds = %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  br label %225

225:                                              ; preds = %224, %147
  %226 = load ptr, ptr %5, align 8, !tbaa !5
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = load i32, ptr %10, align 4, !tbaa !9
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds ptr, ptr %227, i64 %229
  %231 = load ptr, ptr %230, align 8, !tbaa !5
  %232 = load ptr, ptr %9, align 8, !tbaa !5
  call void @write_word(ptr noundef %226, ptr noundef %231, ptr noundef %232)
  %233 = load i32, ptr %10, align 4, !tbaa !9
  %234 = add nsw i32 %233, 1
  store i32 %234, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %24, !llvm.loop !24

235:                                              ; preds = %24
  %236 = load i32, ptr %10, align 4, !tbaa !9
  %237 = load i32, ptr %8, align 4, !tbaa !9
  %238 = icmp ne i32 %236, %237
  br i1 %238, label %239, label %242

239:                                              ; preds = %235
  %240 = load ptr, ptr @stderr, align 8, !tbaa !5
  %241 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %240, ptr noundef @.str.18) #9
  call void @exit(i32 noundef 1) #12
  unreachable

242:                                              ; preds = %235
  %243 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %243) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  ret void
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #7

; 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

declare void @join_map(ptr noundef, ptr noundef) #1

declare i32 @sum_bit(ptr noundef) #1

declare void @write_word(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

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 = { noreturn 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 = { nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 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 #6 = { 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 #7 = { nounwind willreturn memory(read) "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 = { nounwind allocsize(0) }
attributes #11 = { nounwind willreturn memory(none) }
attributes #12 = { noreturn nounwind }
attributes #13 = { nounwind willreturn memory(read) }

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

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


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [75 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #2

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #3

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local void @check_crossword(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) local_unnamed_addr #5 {
  %5 = tail call noalias dereferenceable_or_null(81) ptr @malloc(i64 noundef 81) #9
  %6 = icmp eq ptr %5, null
  br i1 %6, label %11, label %.preheader

.preheader:                                       ; preds = %4
  %7 = load ptr, ptr @stdin, align 8, !tbaa !5
  %8 = tail call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %7, ptr noundef nonnull @.str.12, ptr noundef nonnull %5) #10
  %9 = icmp eq i32 %8, 1
  br i1 %9, label %.lr.ph85.preheader, label %._crit_edge86

.lr.ph85.preheader:                               ; preds = %.preheader
  %10 = zext i32 %3 to i64
  br label %.lr.ph85

11:                                               ; preds = %4
  tail call void @perror(ptr noundef nonnull @.str.11) #11
  %12 = tail call ptr @__errno_location() #12
  %13 = load i32, ptr %12, align 4, !tbaa !9
  tail call void @exit(i32 noundef %13) #13
  unreachable

.lr.ph85:                                         ; preds = %.lr.ph85.preheader, %.loopexit
  %indvars.iv91 = phi i64 [ 0, %.lr.ph85.preheader ], [ %indvars.iv.next92, %.loopexit ]
  %14 = icmp eq i64 %indvars.iv91, %10
  br i1 %14, label %15, label %18

15:                                               ; preds = %.lr.ph85
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.13) #14
  tail call void @exit(i32 noundef 1) #13
  unreachable

18:                                               ; preds = %.lr.ph85
  %19 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %5) #15
  %20 = trunc i64 %19 to i32
  %21 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv91
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 20
  %24 = load i32, ptr %23, align 4, !tbaa !11
  %.not69 = icmp eq i32 %24, %20
  br i1 %.not69, label %28, label %25

25:                                               ; preds = %18
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef nonnull @.str.14, ptr noundef nonnull %5) #14
  tail call void @exit(i32 noundef 1) #13
  unreachable

28:                                               ; preds = %18
  %29 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #9
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  tail call void @perror(ptr noundef nonnull @.str.15) #11
  %32 = tail call ptr @__errno_location() #12
  %33 = load i32, ptr %32, align 4, !tbaa !9
  tail call void @exit(i32 noundef %33) #13
  unreachable

34:                                               ; preds = %28
  %35 = shl i64 %19, 32
  %sext = add i64 %35, -4294967296
  %36 = ashr exact i64 %sext, 29
  %37 = getelementptr inbounds i8, ptr %2, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = ashr exact i64 %35, 29
  %40 = getelementptr inbounds i8, ptr %38, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load i32, ptr %42, align 8, !tbaa !13
  %44 = getelementptr inbounds i8, ptr %29, i64 8
  store i32 %43, ptr %44, align 8, !tbaa !13
  %45 = sext i32 %43 to i64
  %46 = shl nsw i64 %45, 3
  %47 = tail call noalias ptr @malloc(i64 noundef %46) #9
  store ptr %47, ptr %29, align 8, !tbaa !15
  %48 = icmp eq ptr %47, null
  br i1 %48, label %49, label %52

49:                                               ; preds = %34
  tail call void @perror(ptr noundef nonnull @.str.16) #11
  %50 = tail call ptr @__errno_location() #12
  %51 = load i32, ptr %50, align 4, !tbaa !9
  tail call void @exit(i32 noundef %51) #13
  unreachable

52:                                               ; preds = %34
  %53 = load ptr, ptr %40, align 8, !tbaa !5
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %47, ptr align 8 %54, i64 %46, i1 false)
  %55 = icmp sgt i32 %20, 0
  br i1 %55, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %52
  %wide.trip.count = and i64 %19, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %52
  %56 = tail call i32 @sum_bit(ptr noundef nonnull %29) #10
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %65, label %68

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %58 = load ptr, ptr %37, align 8, !tbaa !5
  %59 = getelementptr inbounds ptr, ptr %58, i64 %indvars.iv
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %5, i64 %indvars.iv
  %62 = load i8, ptr %61, align 1, !tbaa !16
  %63 = sext i8 %62 to i64
  %64 = getelementptr inbounds %struct.Map, ptr %60, i64 %63
  tail call void @join_map(ptr noundef nonnull %29, ptr noundef %64) #10
  %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 %.lr.ph, !llvm.loop !17

65:                                               ; preds = %._crit_edge
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.17, ptr noundef nonnull %5) #14
  tail call void @exit(i32 noundef 1) #13
  unreachable

68:                                               ; preds = %._crit_edge
  %69 = load ptr, ptr %21, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 4
  %71 = load i32, ptr %70, align 4, !tbaa !19
  %72 = icmp eq i32 %71, 1
  br i1 %72, label %73, label %.loopexit

73:                                               ; preds = %68
  %74 = getelementptr inbounds i8, ptr %69, i64 12
  %75 = load i32, ptr %74, align 4, !tbaa !20
  %76 = getelementptr inbounds i8, ptr %69, i64 16
  %77 = load i32, ptr %76, align 8, !tbaa !21
  %.not7180 = icmp sgt i32 %75, %77
  br i1 %.not7180, label %.loopexit, label %.lr.ph83.preheader

.lr.ph83.preheader:                               ; preds = %73
  %78 = sext i32 %75 to i64
  br label %.lr.ph83

79:                                               ; preds = %99
  %indvars.iv.next89 = add nsw i64 %indvars.iv88, 1
  %80 = load ptr, ptr %21, align 8, !tbaa !5
  %81 = getelementptr inbounds i8, ptr %80, i64 16
  %82 = load i32, ptr %81, align 8, !tbaa !21
  %83 = sext i32 %82 to i64
  %.not71.not = icmp slt i64 %indvars.iv88, %83
  br i1 %.not71.not, label %.lr.ph83, label %.loopexit, !llvm.loop !22

.lr.ph83:                                         ; preds = %.lr.ph83.preheader, %79
  %indvars.iv88 = phi i64 [ %78, %.lr.ph83.preheader ], [ %indvars.iv.next89, %79 ]
  %84 = phi ptr [ %69, %.lr.ph83.preheader ], [ %80, %79 ]
  %85 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv88
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %84, i64 8
  %88 = load i32, ptr %87, align 8, !tbaa !23
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i8, ptr %86, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !16
  %.not72 = icmp eq i8 %91, 0
  br i1 %.not72, label %99, label %92

92:                                               ; preds = %.lr.ph83
  %93 = load ptr, ptr %37, align 8, !tbaa !5
  %94 = sub nsw i64 %indvars.iv88, %78
  %95 = getelementptr inbounds ptr, ptr %93, i64 %94
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = sext i8 %91 to i64
  %98 = getelementptr inbounds %struct.Map, ptr %96, i64 %97
  tail call void @join_map(ptr noundef nonnull %29, ptr noundef nonnull %98) #10
  br label %99

99:                                               ; preds = %92, %.lr.ph83
  %100 = tail call i32 @sum_bit(ptr noundef nonnull %29) #10
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %79

102:                                              ; preds = %99
  %103 = load ptr, ptr @stderr, align 8, !tbaa !5
  %104 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef nonnull @.str.14, ptr noundef nonnull %5) #14
  tail call void @exit(i32 noundef 1) #13
  unreachable

.loopexit:                                        ; preds = %79, %73, %68
  %105 = phi ptr [ %69, %73 ], [ %69, %68 ], [ %80, %79 ]
  tail call void @write_word(ptr noundef %0, ptr noundef nonnull %105, ptr noundef nonnull %5) #10
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %106 = load ptr, ptr @stdin, align 8, !tbaa !5
  %107 = tail call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %106, ptr noundef nonnull @.str.12, ptr noundef nonnull %5) #10
  %108 = icmp eq i32 %107, 1
  br i1 %108, label %.lr.ph85, label %._crit_edge86.loopexit, !llvm.loop !24

._crit_edge86.loopexit:                           ; preds = %.loopexit
  %109 = trunc nuw i64 %indvars.iv.next92 to i32
  br label %._crit_edge86

._crit_edge86:                                    ; preds = %._crit_edge86.loopexit, %.preheader
  %.0.lcssa = phi i32 [ 0, %.preheader ], [ %109, %._crit_edge86.loopexit ]
  %.not = icmp eq i32 %.0.lcssa, %3
  br i1 %.not, label %113, label %110

110:                                              ; preds = %._crit_edge86
  %111 = load ptr, ptr @stderr, align 8, !tbaa !5
  %112 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef nonnull @.str.18) #14
  tail call void @exit(i32 noundef 1) #13
  unreachable

113:                                              ; preds = %._crit_edge86
  tail call void @free(ptr noundef %5) #10
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: mustprogress 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) #7

declare void @join_map(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @sum_bit(ptr noundef) local_unnamed_addr #3

declare void @write_word(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8

attributes #0 = { 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 #1 = { noreturn 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 nofree nosync nounwind willreturn memory(none) "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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind }
attributes #11 = { cold }
attributes #12 = { nounwind willreturn memory(none) }
attributes #13 = { noreturn nounwind }
attributes #14 = { cold nounwind }
attributes #15 = { nounwind willreturn memory(read) }

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

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


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