; LLVM IR from Aeternum-Veritas/Merry :: merry (merry_nreader)

; 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.MerryReader = type { i8, i8, i8, i8, %struct.MerryInstSection, %struct.MerryEAT, %struct.MerrySsT, %struct.MerryST, ptr, [2 x i64], i64, i64, ptr, i64, ptr, i64, ptr, ptr, ptr, ptr, i64, i64 }
%struct.MerryInstSection = type { i64, ptr, i64, i64 }
%struct.MerryEAT = type { ptr, i64, i64 }
%struct.MerrySsT = type { i64, i64, ptr, i8 }
%struct.MerryST = type { ptr, i64 }

@stdout = external global ptr, align 8
@stderr = external global ptr, align 8
@.str.20 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [54 x i8], align 1

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @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

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @merry_reader_read_eat(ptr noundef %0) #3 {
  %2 = alloca i8, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr @stdout, align 8, !tbaa !5
  %11 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef @.str.20, ptr noundef null) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.MerryReader, ptr %12, i32 0, i32 5
  %14 = getelementptr inbounds %struct.MerryEAT, ptr %13, i32 0, i32 2
  %15 = load i64, ptr %14, align 8, !tbaa !9
  %16 = udiv i64 %15, 8
  store i64 %16, ptr %4, align 8, !tbaa !16
  %17 = load i64, ptr %4, align 8, !tbaa !16
  %18 = icmp eq i64 %17, 0
  br i1 %18, label %19, label %43

19:                                               ; preds = %1
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef @.str.21) #6
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.MerryReader, ptr %22, i32 0, i32 5
  %24 = getelementptr inbounds %struct.MerryEAT, ptr %23, i32 0, i32 1
  store i64 1, ptr %24, align 8, !tbaa !17
  %25 = call noalias ptr @malloc(i64 noundef 8) #7
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.MerryReader, ptr %26, i32 0, i32 5
  %28 = getelementptr inbounds %struct.MerryEAT, ptr %27, i32 0, i32 0
  store ptr %25, ptr %28, align 8, !tbaa !18
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.MerryReader, ptr %29, i32 0, i32 5
  %31 = getelementptr inbounds %struct.MerryEAT, ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !18
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %37

34:                                               ; preds = %19
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.22) #6
  store i8 1, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %247

37:                                               ; preds = %19
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.MerryReader, ptr %38, i32 0, i32 5
  %40 = getelementptr inbounds %struct.MerryEAT, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  %42 = getelementptr inbounds i64, ptr %41, i64 0
  store i64 0, ptr %42, align 8, !tbaa !16
  store i8 0, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %247

43:                                               ; preds = %1
  %44 = load i64, ptr %4, align 8, !tbaa !16
  %45 = mul i64 8, %44
  %46 = call noalias ptr @malloc(i64 noundef %45) #7
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.MerryReader, ptr %47, i32 0, i32 5
  %49 = getelementptr inbounds %struct.MerryEAT, ptr %48, i32 0, i32 0
  store ptr %46, ptr %49, align 8, !tbaa !18
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.MerryReader, ptr %50, i32 0, i32 5
  %52 = getelementptr inbounds %struct.MerryEAT, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !18
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %58

55:                                               ; preds = %43
  %56 = load ptr, ptr @stderr, align 8, !tbaa !5
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.22) #6
  store i8 1, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %247

58:                                               ; preds = %43
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.MerryReader, ptr %59, i32 0, i32 5
  %61 = getelementptr inbounds %struct.MerryEAT, ptr %60, i32 0, i32 2
  %62 = load i64, ptr %61, align 8, !tbaa !9
  %63 = call ptr @llvm.stacksave.p0()
  store ptr %63, ptr %6, align 8
  %64 = alloca i8, i64 %62, align 16
  store i64 %62, ptr %7, align 8
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.MerryReader, ptr %65, i32 0, i32 5
  %67 = getelementptr inbounds %struct.MerryEAT, ptr %66, i32 0, i32 2
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.MerryReader, ptr %69, i32 0, i32 12
  %71 = load ptr, ptr %70, align 8, !tbaa !19
  %72 = call i64 @fread(ptr noundef %64, i64 noundef 1, i64 noundef %68, ptr noundef %71)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !16
  br label %73

73:                                               ; preds = %238, %58
  %74 = load i64, ptr %8, align 8, !tbaa !16
  %75 = load i64, ptr %4, align 8, !tbaa !16
  %76 = icmp ult i64 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %241

78:                                               ; preds = %73
  %79 = load i64, ptr %9, align 8, !tbaa !16
  %80 = getelementptr inbounds i8, ptr %64, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !20
  %82 = zext i8 %81 to i64
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.MerryReader, ptr %83, i32 0, i32 5
  %85 = getelementptr inbounds %struct.MerryEAT, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !18
  %87 = load i64, ptr %8, align 8, !tbaa !16
  %88 = getelementptr inbounds i64, ptr %86, i64 %87
  store i64 %82, ptr %88, align 8, !tbaa !16
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.MerryReader, ptr %89, i32 0, i32 5
  %91 = getelementptr inbounds %struct.MerryEAT, ptr %90, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !18
  %93 = load i64, ptr %8, align 8, !tbaa !16
  %94 = getelementptr inbounds i64, ptr %92, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !16
  %96 = shl i64 %95, 8
  store i64 %96, ptr %94, align 8, !tbaa !16
  %97 = load i64, ptr %9, align 8, !tbaa !16
  %98 = add i64 %97, 1
  %99 = getelementptr inbounds i8, ptr %64, i64 %98
  %100 = load i8, ptr %99, align 1, !tbaa !20
  %101 = zext i8 %100 to i64
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.MerryReader, ptr %102, i32 0, i32 5
  %104 = getelementptr inbounds %struct.MerryEAT, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !18
  %106 = load i64, ptr %8, align 8, !tbaa !16
  %107 = getelementptr inbounds i64, ptr %105, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !16
  %109 = or i64 %108, %101
  store i64 %109, ptr %107, align 8, !tbaa !16
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.MerryReader, ptr %110, i32 0, i32 5
  %112 = getelementptr inbounds %struct.MerryEAT, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !18
  %114 = load i64, ptr %8, align 8, !tbaa !16
  %115 = getelementptr inbounds i64, ptr %113, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !16
  %117 = shl i64 %116, 8
  store i64 %117, ptr %115, align 8, !tbaa !16
  %118 = load i64, ptr %9, align 8, !tbaa !16
  %119 = add i64 %118, 2
  %120 = getelementptr inbounds i8, ptr %64, i64 %119
  %121 = load i8, ptr %120, align 1, !tbaa !20
  %122 = zext i8 %121 to i64
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.MerryReader, ptr %123, i32 0, i32 5
  %125 = getelementptr inbounds %struct.MerryEAT, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !18
  %127 = load i64, ptr %8, align 8, !tbaa !16
  %128 = getelementptr inbounds i64, ptr %126, i64 %127
  %129 = load i64, ptr %128, align 8, !tbaa !16
  %130 = or i64 %129, %122
  store i64 %130, ptr %128, align 8, !tbaa !16
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.MerryReader, ptr %131, i32 0, i32 5
  %133 = getelementptr inbounds %struct.MerryEAT, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !18
  %135 = load i64, ptr %8, align 8, !tbaa !16
  %136 = getelementptr inbounds i64, ptr %134, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !16
  %138 = shl i64 %137, 8
  store i64 %138, ptr %136, align 8, !tbaa !16
  %139 = load i64, ptr %9, align 8, !tbaa !16
  %140 = add i64 %139, 3
  %141 = getelementptr inbounds i8, ptr %64, i64 %140
  %142 = load i8, ptr %141, align 1, !tbaa !20
  %143 = zext i8 %142 to i64
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.MerryReader, ptr %144, i32 0, i32 5
  %146 = getelementptr inbounds %struct.MerryEAT, ptr %145, i32 0, i32 0
  %147 = load ptr, ptr %146, align 8, !tbaa !18
  %148 = load i64, ptr %8, align 8, !tbaa !16
  %149 = getelementptr inbounds i64, ptr %147, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !16
  %151 = or i64 %150, %143
  store i64 %151, ptr %149, align 8, !tbaa !16
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.MerryReader, ptr %152, i32 0, i32 5
  %154 = getelementptr inbounds %struct.MerryEAT, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !18
  %156 = load i64, ptr %8, align 8, !tbaa !16
  %157 = getelementptr inbounds i64, ptr %155, i64 %156
  %158 = load i64, ptr %157, align 8, !tbaa !16
  %159 = shl i64 %158, 8
  store i64 %159, ptr %157, align 8, !tbaa !16
  %160 = load i64, ptr %9, align 8, !tbaa !16
  %161 = add i64 %160, 4
  %162 = getelementptr inbounds i8, ptr %64, i64 %161
  %163 = load i8, ptr %162, align 1, !tbaa !20
  %164 = zext i8 %163 to i64
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.MerryReader, ptr %165, i32 0, i32 5
  %167 = getelementptr inbounds %struct.MerryEAT, ptr %166, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !18
  %169 = load i64, ptr %8, align 8, !tbaa !16
  %170 = getelementptr inbounds i64, ptr %168, i64 %169
  %171 = load i64, ptr %170, align 8, !tbaa !16
  %172 = or i64 %171, %164
  store i64 %172, ptr %170, align 8, !tbaa !16
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.MerryReader, ptr %173, i32 0, i32 5
  %175 = getelementptr inbounds %struct.MerryEAT, ptr %174, i32 0, i32 0
  %176 = load ptr, ptr %175, align 8, !tbaa !18
  %177 = load i64, ptr %8, align 8, !tbaa !16
  %178 = getelementptr inbounds i64, ptr %176, i64 %177
  %179 = load i64, ptr %178, align 8, !tbaa !16
  %180 = shl i64 %179, 8
  store i64 %180, ptr %178, align 8, !tbaa !16
  %181 = load i64, ptr %9, align 8, !tbaa !16
  %182 = add i64 %181, 5
  %183 = getelementptr inbounds i8, ptr %64, i64 %182
  %184 = load i8, ptr %183, align 1, !tbaa !20
  %185 = zext i8 %184 to i64
  %186 = load ptr, ptr %3, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.MerryReader, ptr %186, i32 0, i32 5
  %188 = getelementptr inbounds %struct.MerryEAT, ptr %187, i32 0, i32 0
  %189 = load ptr, ptr %188, align 8, !tbaa !18
  %190 = load i64, ptr %8, align 8, !tbaa !16
  %191 = getelementptr inbounds i64, ptr %189, i64 %190
  %192 = load i64, ptr %191, align 8, !tbaa !16
  %193 = or i64 %192, %185
  store i64 %193, ptr %191, align 8, !tbaa !16
  %194 = load ptr, ptr %3, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.MerryReader, ptr %194, i32 0, i32 5
  %196 = getelementptr inbounds %struct.MerryEAT, ptr %195, i32 0, i32 0
  %197 = load ptr, ptr %196, align 8, !tbaa !18
  %198 = load i64, ptr %8, align 8, !tbaa !16
  %199 = getelementptr inbounds i64, ptr %197, i64 %198
  %200 = load i64, ptr %199, align 8, !tbaa !16
  %201 = shl i64 %200, 8
  store i64 %201, ptr %199, align 8, !tbaa !16
  %202 = load i64, ptr %9, align 8, !tbaa !16
  %203 = add i64 %202, 6
  %204 = getelementptr inbounds i8, ptr %64, i64 %203
  %205 = load i8, ptr %204, align 1, !tbaa !20
  %206 = zext i8 %205 to i64
  %207 = load ptr, ptr %3, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.MerryReader, ptr %207, i32 0, i32 5
  %209 = getelementptr inbounds %struct.MerryEAT, ptr %208, i32 0, i32 0
  %210 = load ptr, ptr %209, align 8, !tbaa !18
  %211 = load i64, ptr %8, align 8, !tbaa !16
  %212 = getelementptr inbounds i64, ptr %210, i64 %211
  %213 = load i64, ptr %212, align 8, !tbaa !16
  %214 = or i64 %213, %206
  store i64 %214, ptr %212, align 8, !tbaa !16
  %215 = load ptr, ptr %3, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.MerryReader, ptr %215, i32 0, i32 5
  %217 = getelementptr inbounds %struct.MerryEAT, ptr %216, i32 0, i32 0
  %218 = load ptr, ptr %217, align 8, !tbaa !18
  %219 = load i64, ptr %8, align 8, !tbaa !16
  %220 = getelementptr inbounds i64, ptr %218, i64 %219
  %221 = load i64, ptr %220, align 8, !tbaa !16
  %222 = shl i64 %221, 8
  store i64 %222, ptr %220, align 8, !tbaa !16
  %223 = load i64, ptr %9, align 8, !tbaa !16
  %224 = add i64 %223, 7
  %225 = getelementptr inbounds i8, ptr %64, i64 %224
  %226 = load i8, ptr %225, align 1, !tbaa !20
  %227 = zext i8 %226 to i64
  %228 = load ptr, ptr %3, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.MerryReader, ptr %228, i32 0, i32 5
  %230 = getelementptr inbounds %struct.MerryEAT, ptr %229, i32 0, i32 0
  %231 = load ptr, ptr %230, align 8, !tbaa !18
  %232 = load i64, ptr %8, align 8, !tbaa !16
  %233 = getelementptr inbounds i64, ptr %231, i64 %232
  %234 = load i64, ptr %233, align 8, !tbaa !16
  %235 = or i64 %234, %227
  store i64 %235, ptr %233, align 8, !tbaa !16
  %236 = load i64, ptr %9, align 8, !tbaa !16
  %237 = add i64 %236, 8
  store i64 %237, ptr %9, align 8, !tbaa !16
  br label %238

238:                                              ; preds = %78
  %239 = load i64, ptr %8, align 8, !tbaa !16
  %240 = add i64 %239, 1
  store i64 %240, ptr %8, align 8, !tbaa !16
  br label %73, !llvm.loop !21

241:                                              ; preds = %77
  %242 = load i64, ptr %4, align 8, !tbaa !16
  %243 = load ptr, ptr %3, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.MerryReader, ptr %243, i32 0, i32 5
  %245 = getelementptr inbounds %struct.MerryEAT, ptr %244, i32 0, i32 1
  store i64 %242, ptr %245, align 8, !tbaa !17
  store i8 0, ptr %2, align 1
  store i32 1, ptr %5, align 4
  %246 = load ptr, ptr %6, align 8
  call void @llvm.stackrestore.p0(ptr %246)
  br label %247

247:                                              ; preds = %241, %55, %37, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %248 = load i8, ptr %2, align 1
  ret i8 %248
}

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

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

!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, !12, i64 56}
!10 = !{!"MerryReader", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 8, !13, i64 40, !14, i64 64, !15, i64 96, !6, i64 112, !7, i64 120, !12, i64 136, !12, i64 144, !6, i64 152, !12, i64 160, !6, i64 168, !12, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !12, i64 216, !12, i64 224}
!11 = !{!"MerryInstSection", !12, i64 0, !6, i64 8, !12, i64 16, !12, i64 24}
!12 = !{!"long", !7, i64 0}
!13 = !{!"MerryEAT", !6, i64 0, !12, i64 8, !12, i64 16}
!14 = !{!"MerrySsT", !12, i64 0, !12, i64 8, !6, i64 16, !7, i64 24}
!15 = !{!"MerryST", !6, i64 0, !12, i64 8}
!16 = !{!12, !12, i64 0}
!17 = !{!10, !12, i64 48}
!18 = !{!10, !6, i64 40}
!19 = !{!10, !6, i64 152}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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

@stdout = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.20 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [54 x i8], align 1

; 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 #1

; Function Attrs: nofree nounwind uwtable
define dso_local zeroext range(i8 0, 2) i8 @merry_reader_read_eat(ptr nocapture noundef %0) local_unnamed_addr #2 {
  %2 = load ptr, ptr @stdout, align 8, !tbaa !5
  %3 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.20, ptr noundef null) #4
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  %6 = load i64, ptr %5, align 8, !tbaa !9
  %7 = lshr i64 %6, 3
  %8 = icmp ult i64 %6, 8
  br i1 %8, label %9, label %19

9:                                                ; preds = %1
  %10 = load ptr, ptr @stderr, align 8, !tbaa !5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.21) #5
  %12 = getelementptr inbounds i8, ptr %0, i64 48
  store i64 1, ptr %12, align 8, !tbaa !16
  %13 = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #6
  store ptr %13, ptr %4, align 8, !tbaa !17
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %18

15:                                               ; preds = %9
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.22) #5
  br label %83

18:                                               ; preds = %9
  store i64 0, ptr %13, align 8, !tbaa !18
  br label %83

19:                                               ; preds = %1
  %20 = and i64 %6, -8
  %21 = tail call noalias ptr @malloc(i64 noundef %20) #6
  store ptr %21, ptr %4, align 8, !tbaa !17
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %.lr.ph

23:                                               ; preds = %19
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.22) #5
  br label %83

.lr.ph:                                           ; preds = %19
  %26 = tail call ptr @llvm.stacksave.p0()
  %27 = alloca i8, i64 %6, align 16
  %28 = load i64, ptr %5, align 8, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %0, i64 152
  %30 = load ptr, ptr %29, align 8, !tbaa !19
  %31 = call i64 @fread(ptr noundef nonnull %27, i64 noundef 1, i64 noundef %28, ptr noundef %30)
  %32 = load ptr, ptr %4, align 8, !tbaa !17
  br label %34

._crit_edge:                                      ; preds = %34
  %33 = getelementptr inbounds i8, ptr %0, i64 48
  store i64 %7, ptr %33, align 8, !tbaa !16
  tail call void @llvm.stackrestore.p0(ptr %26)
  br label %83

34:                                               ; preds = %.lr.ph, %34
  %.062 = phi i64 [ 0, %.lr.ph ], [ %81, %34 ]
  %.05761 = phi i64 [ 0, %.lr.ph ], [ %82, %34 ]
  %35 = getelementptr inbounds i8, ptr %27, i64 %.062
  %36 = load i8, ptr %35, align 8, !tbaa !20
  %37 = zext i8 %36 to i64
  %38 = getelementptr inbounds i64, ptr %32, i64 %.05761
  %39 = or disjoint i64 %.062, 1
  %40 = getelementptr inbounds i8, ptr %27, i64 %39
  %41 = load i8, ptr %40, align 1, !tbaa !20
  %42 = zext i8 %41 to i64
  %43 = shl nuw nsw i64 %37, 16
  %44 = shl nuw nsw i64 %42, 8
  %45 = or disjoint i64 %43, %44
  %46 = or disjoint i64 %.062, 2
  %47 = getelementptr inbounds i8, ptr %27, i64 %46
  %48 = load i8, ptr %47, align 2, !tbaa !20
  %49 = zext i8 %48 to i64
  %50 = or disjoint i64 %45, %49
  %51 = or disjoint i64 %.062, 3
  %52 = getelementptr inbounds i8, ptr %27, i64 %51
  %53 = load i8, ptr %52, align 1, !tbaa !20
  %54 = zext i8 %53 to i64
  %55 = shl nuw nsw i64 %50, 16
  %56 = shl nuw nsw i64 %54, 8
  %57 = or disjoint i64 %55, %56
  %58 = or disjoint i64 %.062, 4
  %59 = getelementptr inbounds i8, ptr %27, i64 %58
  %60 = load i8, ptr %59, align 4, !tbaa !20
  %61 = zext i8 %60 to i64
  %62 = or disjoint i64 %57, %61
  %63 = or disjoint i64 %.062, 5
  %64 = getelementptr inbounds i8, ptr %27, i64 %63
  %65 = load i8, ptr %64, align 1, !tbaa !20
  %66 = zext i8 %65 to i64
  %67 = shl i64 %62, 16
  %68 = shl nuw nsw i64 %66, 8
  %69 = or disjoint i64 %67, %68
  %70 = or disjoint i64 %.062, 6
  %71 = getelementptr inbounds i8, ptr %27, i64 %70
  %72 = load i8, ptr %71, align 2, !tbaa !20
  %73 = zext i8 %72 to i64
  %74 = or disjoint i64 %69, %73
  %75 = shl nuw i64 %74, 8
  %76 = or disjoint i64 %.062, 7
  %77 = getelementptr inbounds i8, ptr %27, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !20
  %79 = zext i8 %78 to i64
  %80 = or disjoint i64 %75, %79
  store i64 %80, ptr %38, align 8, !tbaa !18
  %81 = add nuw i64 %.062, 8
  %82 = add nuw nsw i64 %.05761, 1
  %exitcond.not = icmp eq i64 %82, %7
  br i1 %exitcond.not, label %._crit_edge, label %34, !llvm.loop !21

83:                                               ; preds = %._crit_edge, %23, %18, %15
  %.058 = phi i8 [ 1, %15 ], [ 0, %18 ], [ 1, %23 ], [ 0, %._crit_edge ]
  ret i8 %.058
}

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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

!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, !12, i64 56}
!10 = !{!"MerryReader", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 8, !13, i64 40, !14, i64 64, !15, i64 96, !6, i64 112, !7, i64 120, !12, i64 136, !12, i64 144, !6, i64 152, !12, i64 160, !6, i64 168, !12, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !12, i64 216, !12, i64 224}
!11 = !{!"MerryInstSection", !12, i64 0, !6, i64 8, !12, i64 16, !12, i64 24}
!12 = !{!"long", !7, i64 0}
!13 = !{!"MerryEAT", !6, i64 0, !12, i64 8, !12, i64 16}
!14 = !{!"MerrySsT", !12, i64 0, !12, i64 8, !6, i64 16, !7, i64 24}
!15 = !{!"MerryST", !6, i64 0, !12, i64 8}
!16 = !{!10, !12, i64 48}
!17 = !{!10, !6, i64 40}
!18 = !{!12, !12, i64 0}
!19 = !{!10, !6, i64 152}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass