; LLVM IR from wumo/vkg :: src/par/test (test_msquares)

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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @par_easycurl_to_memory(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca [256 x i8], align 16
  %9 = alloca %struct.par_easycurl_buffer, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = 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
  call void @llvm.lifetime.start.p0(i64 256, ptr %8) #5
  call void @llvm.memset.p0.i64(ptr align 16 %8, i8 0, i64 256, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  %15 = getelementptr inbounds %struct.par_easycurl_buffer, ptr %9, i32 0, i32 0
  %16 = call noalias ptr @malloc(i64 noundef 1) #6
  store ptr %16, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct.par_easycurl_buffer, ptr %9, i32 0, i32 1
  store i32 0, ptr %17, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %18 = call ptr @curl_easy_init()
  store ptr %18, ptr %12, align 8, !tbaa !5
  %19 = load ptr, ptr %12, align 8, !tbaa !5
  %20 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %19, i32 noundef 99, i32 noundef 1)
  %21 = load ptr, ptr %12, align 8, !tbaa !5
  %22 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %21, i32 noundef 10102, ptr noundef @.str)
  %23 = load ptr, ptr %12, align 8, !tbaa !5
  %24 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %23, i32 noundef 52, i32 noundef 1)
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  %26 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %25, i32 noundef 68, i32 noundef 8)
  %27 = load ptr, ptr %12, align 8, !tbaa !5
  %28 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %27, i32 noundef 45, i32 noundef 1)
  %29 = load ptr, ptr %12, align 8, !tbaa !5
  %30 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %29, i32 noundef 20011, ptr noundef @onwrite)
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %31, i32 noundef 10001, ptr noundef %9)
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  %34 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %33, i32 noundef 20079, ptr noundef @onheader)
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %35, i32 noundef 10002, ptr noundef %36)
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %38, i32 noundef 33, i32 noundef 1)
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %40, i32 noundef 34, i32 noundef 0)
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %42, i32 noundef 10023, i32 noundef 0)
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %44, i32 noundef 13, i32 noundef 60)
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %48 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %46, i32 noundef 10010, ptr noundef %47)
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %49, i32 noundef 81, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = call i32 @curl_easy_perform(ptr noundef %51)
  store i32 %52, ptr %13, align 4, !tbaa !15
  %53 = load i32, ptr %13, align 4, !tbaa !15
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %58

55:                                               ; preds = %3
  %56 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %56)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %14, align 4
  br label %77

58:                                               ; preds = %3
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = call i32 (ptr, i32, ...) @curl_easy_getinfo(ptr noundef %59, i32 noundef 2097187, ptr noundef %10)
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = call i32 (ptr, i32, ...) @curl_easy_getinfo(ptr noundef %61, i32 noundef 2097154, ptr noundef %11)
  %63 = load i64, ptr %11, align 8, !tbaa !13
  %64 = icmp eq i64 %63, 304
  br i1 %64, label %68, label %65

65:                                               ; preds = %58
  %66 = load i64, ptr %11, align 8, !tbaa !13
  %67 = icmp sge i64 %66, 400
  br i1 %67, label %68, label %69

68:                                               ; preds = %65, %58
  store i32 0, ptr %4, align 4
  store i32 1, ptr %14, align 4
  br label %77

69:                                               ; preds = %65
  %70 = getelementptr inbounds %struct.par_easycurl_buffer, ptr %9, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !9
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %71, ptr %72, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.par_easycurl_buffer, ptr %9, i32 0, i32 1
  %74 = load i32, ptr %73, align 8, !tbaa !12
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %74, ptr %75, align 4, !tbaa !15
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  call void @curl_easy_cleanup(ptr noundef %76)
  store i32 1, ptr %4, align 4
  store i32 1, ptr %14, align 4
  br label %77

77:                                               ; preds = %69, %68, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %8) #5
  %78 = load i32, ptr %4, align 4
  ret i32 %78
}

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

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

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

declare ptr @curl_easy_init() #4

declare i32 @curl_easy_setopt(ptr noundef, i32 noundef, ...) #4

; Function Attrs: nounwind uwtable
declare hidden i64 @onwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i64 @onheader(ptr noundef, i64 noundef, i64 noundef) #0

declare i32 @curl_easy_perform(ptr noundef) #4

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

declare i32 @curl_easy_getinfo(ptr noundef, i32 noundef, ...) #4

declare void @curl_easy_cleanup(ptr noundef) #4

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

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

%struct.par_easycurl_buffer = type { ptr, i32 }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @par_easycurl_to_memory(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2) local_unnamed_addr #0 {
  %4 = alloca [256 x i8], align 16
  %5 = alloca %struct.par_easycurl_buffer, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %4, i8 0, i64 256, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  %8 = tail call noalias dereferenceable_or_null(1) ptr @malloc(i64 noundef 1) #7
  store ptr %8, ptr %5, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %5, i64 8
  store i32 0, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store i64 0, ptr %6, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store i64 0, ptr %7, align 8, !tbaa !12
  %10 = tail call ptr @curl_easy_init() #6
  %11 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 99, i32 noundef 1) #6
  %12 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 10102, ptr noundef nonnull @.str) #6
  %13 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 52, i32 noundef 1) #6
  %14 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 68, i32 noundef 8) #6
  %15 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 45, i32 noundef 1) #6
  %16 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 20011, ptr noundef nonnull @onwrite) #6
  %17 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 10001, ptr noundef nonnull %5) #6
  %18 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 20079, ptr noundef nonnull @onheader) #6
  %19 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 10002, ptr noundef %0) #6
  %20 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 33, i32 noundef 1) #6
  %21 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 34, i32 noundef 0) #6
  %22 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 10023, i32 noundef 0) #6
  %23 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 13, i32 noundef 60) #6
  %24 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 10010, ptr noundef nonnull %4) #6
  %25 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %10, i32 noundef 81, i32 noundef 0) #6
  %26 = call i32 @curl_easy_perform(ptr noundef %10) #6
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %29, label %27

27:                                               ; preds = %3
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %4)
  br label %38

29:                                               ; preds = %3
  %30 = call i32 (ptr, i32, ...) @curl_easy_getinfo(ptr noundef %10, i32 noundef 2097187, ptr noundef nonnull %6) #6
  %31 = call i32 (ptr, i32, ...) @curl_easy_getinfo(ptr noundef %10, i32 noundef 2097154, ptr noundef nonnull %7) #6
  %32 = load i64, ptr %7, align 8
  %33 = icmp eq i64 %32, 304
  %34 = icmp sgt i64 %32, 399
  %or.cond = or i1 %33, %34
  br i1 %or.cond, label %38, label %35

35:                                               ; preds = %29
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %36, ptr %1, align 8, !tbaa !14
  %37 = load i32, ptr %9, align 8, !tbaa !11
  store i32 %37, ptr %2, align 4, !tbaa !15
  call void @curl_easy_cleanup(ptr noundef %10) #6
  br label %38

38:                                               ; preds = %29, %35, %27
  %.0 = phi i32 [ 0, %27 ], [ 1, %35 ], [ 0, %29 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #6
  ret i32 %.0
}

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

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

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

declare ptr @curl_easy_init() local_unnamed_addr #4

declare i32 @curl_easy_setopt(ptr noundef, i32 noundef, ...) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden i64 @onwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i64 @onheader(ptr noundef, i64 noundef, i64 noundef) #0

declare i32 @curl_easy_perform(ptr noundef) local_unnamed_addr #4

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

declare i32 @curl_easy_getinfo(ptr noundef, i32 noundef, ...) local_unnamed_addr #4

declare void @curl_easy_cleanup(ptr noundef) local_unnamed_addr #4

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #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 = { 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 #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, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !8, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!10, !10, i64 0}


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