; LLVM IR from shellphish/how2heap :: glibc_2.31 (poison_null_byte)

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

@stdin = external global ptr, align 8
@stdout = external global ptr, align 8
@.str = external hidden unnamed_addr constant [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [132 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [130 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [333 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [83 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [148 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [117 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [218 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [132 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = load ptr, ptr @stdin, align 8, !tbaa !5
  call void @setbuf(ptr noundef %15, ptr noundef null) #8
  %16 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @setbuf(ptr noundef %16, ptr noundef null) #8
  %17 = call i32 @puts(ptr noundef @.str)
  %18 = call i32 @puts(ptr noundef @.str.1)
  %19 = call i32 @puts(ptr noundef @.str.2)
  %20 = call i32 @puts(ptr noundef @.str.3)
  %21 = call i32 @puts(ptr noundef @.str.4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #8
  %22 = call noalias ptr @malloc(i64 noundef 1) #9
  store ptr %22, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  %23 = load ptr, ptr %1, align 8, !tbaa !5
  %24 = ptrtoint ptr %23 to i64
  %25 = and i64 %24, -4096
  %26 = inttoptr i64 %25 to ptr
  store ptr %26, ptr %2, align 8, !tbaa !5
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef %27)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  %29 = load ptr, ptr %1, align 8, !tbaa !5
  %30 = ptrtoint ptr %29 to i64
  %31 = and i64 %30, 65535
  %32 = sub nsw i64 65536, %31
  %33 = sub nsw i64 %32, 32
  store i64 %33, ptr %3, align 8, !tbaa !9
  %34 = load i64, ptr %3, align 8, !tbaa !9
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i64 noundef %34)
  %36 = call i32 @puts(ptr noundef @.str.7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %37 = load i64, ptr %3, align 8, !tbaa !9
  %38 = call noalias ptr @malloc(i64 noundef %37) #9
  store ptr %38, ptr %4, align 8, !tbaa !5
  %39 = call i32 @puts(ptr noundef @.str.8)
  %40 = call i32 @puts(ptr noundef @.str.9)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %41 = call noalias ptr @malloc(i64 noundef 1280) #9
  store ptr %41, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %42 = call noalias ptr @malloc(i64 noundef 1264) #9
  store ptr %42, ptr %6, align 8, !tbaa !5
  %43 = call i32 @puts(ptr noundef @.str.10)
  %44 = call noalias ptr @malloc(i64 noundef 16) #9
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, ptr noundef %45)
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, ptr noundef %47)
  %49 = call i32 @puts(ptr noundef @.str.13)
  %50 = call i32 @puts(ptr noundef @.str.14)
  %51 = call i32 @puts(ptr noundef @.str.15)
  %52 = call i32 @puts(ptr noundef @.str.16)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %53 = call noalias ptr @malloc(i64 noundef 1264) #9
  store ptr %53, ptr %7, align 8, !tbaa !5
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, ptr noundef %54)
  %56 = call i32 @puts(ptr noundef @.str.10)
  %57 = call noalias ptr @malloc(i64 noundef 16) #9
  %58 = call i32 @puts(ptr noundef @.str.18)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %59 = call noalias ptr @malloc(i64 noundef 1296) #9
  store ptr %59, ptr %8, align 8, !tbaa !5
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, ptr noundef %60)
  %62 = call i32 @puts(ptr noundef @.str.10)
  %63 = call noalias ptr @malloc(i64 noundef 16) #9
  %64 = call i32 @puts(ptr noundef @.str.20)
  %65 = call i32 @puts(ptr noundef @.str.21)
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %66) #8
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %67) #8
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %68) #8
  %69 = call i32 @puts(ptr noundef @.str.22)
  %70 = call i32 @puts(ptr noundef @.str.23)
  %71 = call noalias ptr @malloc(i64 noundef 4096) #9
  %72 = call i32 @puts(ptr noundef @.str.24)
  %73 = call i32 @puts(ptr noundef @.str.25)
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds ptr, ptr %74, i64 2
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.26, ptr noundef %77)
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds ptr, ptr %79, i64 3
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 16
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.27, ptr noundef %82)
  %84 = call i32 @puts(ptr noundef @.str.28)
  %85 = call i32 @puts(ptr noundef @.str.29)
  %86 = call i32 @puts(ptr noundef @.str.30)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %87 = call noalias ptr @malloc(i64 noundef 1280) #9
  store ptr %87, ptr %9, align 8, !tbaa !5
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.31, ptr noundef %88)
  %90 = call i32 @puts(ptr noundef @.str.32)
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = icmp eq ptr %91, %92
  br i1 %93, label %94, label %95

94:                                               ; preds = %0
  br label %96

95:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str.33, ptr noundef @.str.34, i32 noundef 84, ptr noundef @__PRETTY_FUNCTION__.main) #10
  unreachable

96:                                               ; preds = %94
  %97 = call i32 @puts(ptr noundef @.str.35)
  %98 = call i32 @puts(ptr noundef @.str.36)
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds i64, ptr %99, i64 1
  store i64 1281, ptr %100, align 8, !tbaa !9
  %101 = call i32 @puts(ptr noundef @.str.37)
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds i8, ptr %102, i64 1280
  store i64 1280, ptr %103, align 8, !tbaa !9
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i64 16
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.38, ptr noundef %105)
  %107 = call i32 @puts(ptr noundef @.str.39)
  %108 = call i32 @puts(ptr noundef @.str.40)
  %109 = call i32 @puts(ptr noundef @.str.41)
  %110 = call i32 @puts(ptr noundef @.str.42)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %111 = call noalias ptr @malloc(i64 noundef 1296) #9
  store ptr %111, ptr %10, align 8, !tbaa !5
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = getelementptr inbounds ptr, ptr %112, i64 0
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  %115 = getelementptr inbounds i8, ptr %114, i64 16
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.43, ptr noundef %115)
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str.44)
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %118, i64 0
  store i8 16, ptr %119, align 1, !tbaa !11
  %120 = load ptr, ptr %10, align 8, !tbaa !5
  %121 = getelementptr inbounds i8, ptr %120, i64 1
  store i8 0, ptr %121, align 1, !tbaa !11
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = getelementptr inbounds ptr, ptr %122, i64 0
  %124 = load ptr, ptr %123, align 8, !tbaa !5
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.45, ptr noundef %124)
  %126 = call i32 @puts(ptr noundef @.str.46)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %127 = call noalias ptr @malloc(i64 noundef 1264) #9
  store ptr %127, ptr %11, align 8, !tbaa !5
  %128 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %128) #8
  %129 = call i32 @puts(ptr noundef @.str.47)
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  call void @free(ptr noundef %130) #8
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds ptr, ptr %131, i64 1
  %133 = load ptr, ptr %132, align 8, !tbaa !5
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = call i32 (ptr, ...) @printf(ptr noundef @.str.48, ptr noundef %133, ptr noundef %134)
  %136 = call i32 @puts(ptr noundef @.str.49)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %137 = call noalias ptr @malloc(i64 noundef 1264) #9
  store ptr %137, ptr %12, align 8, !tbaa !5
  %138 = load ptr, ptr %12, align 8, !tbaa !5
  %139 = getelementptr inbounds i8, ptr %138, i64 8
  store i8 16, ptr %139, align 1, !tbaa !11
  %140 = load ptr, ptr %12, align 8, !tbaa !5
  %141 = getelementptr inbounds i8, ptr %140, i64 9
  store i8 0, ptr %141, align 1, !tbaa !11
  %142 = load ptr, ptr %12, align 8, !tbaa !5
  %143 = getelementptr inbounds ptr, ptr %142, i64 1
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  %145 = call i32 (ptr, ...) @printf(ptr noundef @.str.50, ptr noundef %144)
  %146 = call i32 @puts(ptr noundef @.str.51)
  %147 = call i32 @puts(ptr noundef @.str.52)
  %148 = call i32 @puts(ptr noundef @.str.53)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %149 = call noalias ptr @malloc(i64 noundef 1264) #9
  store ptr %149, ptr %13, align 8, !tbaa !5
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = call i32 (ptr, ...) @printf(ptr noundef @.str.54, ptr noundef %150)
  %152 = call i32 @puts(ptr noundef @.str.55)
  %153 = load ptr, ptr %13, align 8, !tbaa !5
  %154 = getelementptr inbounds i8, ptr %153, i64 -8
  store i8 0, ptr %154, align 1, !tbaa !11
  %155 = call i32 @puts(ptr noundef @.str.56)
  %156 = load ptr, ptr %12, align 8, !tbaa !5
  %157 = getelementptr inbounds ptr, ptr %156, i64 1
  %158 = load ptr, ptr %157, align 8, !tbaa !5
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  %161 = getelementptr inbounds ptr, ptr %160, i64 0
  %162 = load ptr, ptr %161, align 8, !tbaa !5
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = call i32 (ptr, ...) @printf(ptr noundef @.str.57, ptr noundef %158, ptr noundef %159, ptr noundef %162, ptr noundef %163)
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  call void @free(ptr noundef %165) #8
  %166 = call i32 @puts(ptr noundef @.str.58)
  %167 = call i32 @puts(ptr noundef @.str.59)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %168 = call noalias ptr @malloc(i64 noundef 256) #9
  store ptr %168, ptr %14, align 8, !tbaa !5
  %169 = load ptr, ptr %14, align 8, !tbaa !5
  %170 = call i32 (ptr, ...) @printf(ptr noundef @.str.60, ptr noundef %169)
  %171 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 1 %171, i8 65, i64 128, i1 false)
  %172 = load ptr, ptr %14, align 8, !tbaa !5
  %173 = call i32 (ptr, ...) @printf(ptr noundef @.str.61, ptr noundef %172)
  %174 = call i32 @puts(ptr noundef @.str.62)
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 1 %175, i8 67, i64 128, i1 false)
  %176 = load ptr, ptr %14, align 8, !tbaa !5
  %177 = call i32 (ptr, ...) @printf(ptr noundef @.str.63, ptr noundef %176)
  %178 = load ptr, ptr %14, align 8, !tbaa !5
  %179 = call ptr @strstr(ptr noundef %178, ptr noundef @.str.64) #11
  %180 = icmp ne ptr %179, null
  br i1 %180, label %181, label %182

181:                                              ; preds = %96
  br label %183

182:                                              ; preds = %96
  call void @__assert_fail(ptr noundef @.str.65, ptr noundef @.str.34, i32 noundef 160, ptr noundef @__PRETTY_FUNCTION__.main) #10
  unreachable

183:                                              ; preds = %181
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #8
  ret i32 0
}

; Function Attrs: nounwind
declare void @setbuf(ptr noundef, ptr noundef) #1

declare i32 @puts(ptr noundef) #2

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

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

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

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

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


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

@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [132 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [130 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [333 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [83 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [148 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [117 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [218 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [132 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = load ptr, ptr @stdin, align 8, !tbaa !5
  tail call void @setbuf(ptr noundef %1, ptr noundef null) #7
  %2 = load ptr, ptr @stdout, align 8, !tbaa !5
  tail call void @setbuf(ptr noundef %2, ptr noundef null) #7
  %3 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
  %4 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  %5 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  %6 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  %7 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  %8 = tail call noalias dereferenceable_or_null(1) ptr @malloc(i64 noundef 1) #8
  %9 = ptrtoint ptr %8 to i64
  %10 = and i64 %9, -4096
  %11 = inttoptr i64 %10 to ptr
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef %11)
  %13 = and i64 %9, 65535
  %14 = sub nsw i64 65504, %13
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %14)
  %16 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.7)
  %17 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.8)
  %18 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.9)
  %19 = tail call noalias dereferenceable_or_null(1280) ptr @malloc(i64 noundef 1280) #8
  %20 = tail call noalias dereferenceable_or_null(1264) ptr @malloc(i64 noundef 1264) #8
  %21 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.10)
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef %19)
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %20)
  %24 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.13)
  %25 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.14)
  %26 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.15)
  %27 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.16)
  %28 = tail call noalias dereferenceable_or_null(1264) ptr @malloc(i64 noundef 1264) #8
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef %28)
  %30 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.10)
  %31 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.18)
  %32 = tail call noalias dereferenceable_or_null(1296) ptr @malloc(i64 noundef 1296) #8
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, ptr noundef %32)
  %34 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.10)
  %35 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.20)
  %36 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.21)
  tail call void @free(ptr noundef %28) #7
  tail call void @free(ptr noundef %32) #7
  tail call void @free(ptr noundef %19) #7
  %37 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.22)
  %38 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.23)
  %39 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.24)
  %40 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.25)
  %41 = getelementptr inbounds i8, ptr %19, i64 16
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26, ptr noundef nonnull %43)
  %45 = getelementptr inbounds i8, ptr %19, i64 24
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27, ptr noundef nonnull %47)
  %49 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.28)
  %50 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.29)
  %51 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.30)
  %52 = tail call noalias dereferenceable_or_null(1280) ptr @malloc(i64 noundef 1280) #8
  %53 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.31, ptr noundef %52)
  %54 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.32)
  %55 = icmp eq ptr %19, %52
  br i1 %55, label %57, label %56

56:                                               ; preds = %0
  tail call void @__assert_fail(ptr noundef nonnull @.str.33, ptr noundef nonnull @.str.34, i32 noundef 84, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

57:                                               ; preds = %0
  %58 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.35)
  %59 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.36)
  %60 = getelementptr inbounds i8, ptr %19, i64 8
  store i64 1281, ptr %60, align 8, !tbaa !9
  %61 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.37)
  %62 = getelementptr inbounds i8, ptr %19, i64 1280
  store i64 1280, ptr %62, align 8, !tbaa !9
  %63 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.38, ptr noundef nonnull %41)
  %64 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.39)
  %65 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.40)
  %66 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.41)
  %67 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.42)
  %68 = tail call noalias dereferenceable_or_null(1296) ptr @malloc(i64 noundef 1296) #8
  %69 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.43, ptr noundef nonnull undef)
  %70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.44)
  store i8 16, ptr %68, align 1, !tbaa !11
  %71 = getelementptr inbounds i8, ptr %68, i64 1
  store i8 0, ptr %71, align 1, !tbaa !11
  %72 = load ptr, ptr %68, align 8, !tbaa !5
  %73 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.45, ptr noundef %72)
  %74 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.46)
  %75 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.47)
  tail call void @free(ptr noundef %20) #7
  %76 = getelementptr inbounds i8, ptr %28, i64 8
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.48, ptr noundef %77, ptr noundef %20)
  %79 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.49)
  %80 = tail call noalias dereferenceable_or_null(1264) ptr @malloc(i64 noundef 1264) #8
  %81 = getelementptr inbounds i8, ptr %80, i64 8
  store i8 16, ptr %81, align 1, !tbaa !11
  %82 = getelementptr inbounds i8, ptr %80, i64 9
  store i8 0, ptr %82, align 1, !tbaa !11
  %83 = load ptr, ptr %81, align 8, !tbaa !5
  %84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.50, ptr noundef %83)
  %85 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.51)
  %86 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.52)
  %87 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.53)
  %88 = tail call noalias dereferenceable_or_null(1264) ptr @malloc(i64 noundef 1264) #8
  %89 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.54, ptr noundef %88)
  %90 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.55)
  %91 = getelementptr inbounds i8, ptr %88, i64 -8
  store i8 0, ptr %91, align 1, !tbaa !11
  %92 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.56)
  %93 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.57, ptr noundef %83, ptr noundef nonnull %19, ptr noundef %72, ptr noundef nonnull %19)
  tail call void @free(ptr noundef %20) #7
  %94 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.58)
  %95 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.59)
  %96 = tail call noalias dereferenceable_or_null(256) ptr @malloc(i64 noundef 256) #8
  %97 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.60, ptr noundef %96)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(128) %96, i8 65, i64 128, i1 false)
  %98 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.61, ptr noundef %96)
  %99 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.62)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(128) %52, i8 67, i64 128, i1 false)
  %100 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.63, ptr noundef %96)
  %101 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %96, ptr noundef nonnull dereferenceable(1) @.str.64) #10
  %.not = icmp eq ptr %101, null
  br i1 %.not, label %102, label %103

102:                                              ; preds = %57
  tail call void @__assert_fail(ptr noundef nonnull @.str.65, ptr noundef nonnull @.str.34, i32 noundef 160, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

103:                                              ; preds = %57
  ret i32 0
}

; Function Attrs: nofree nounwind
declare void @setbuf(ptr nocapture noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

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

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


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