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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [32 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 ptr @curl_easy_init() #1

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

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

declare i32 @curl_easy_perform(ptr noundef) #1

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

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

declare void @curl_easy_cleanup(ptr noundef) #1

; 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 i32 @par_easycurl_to_file(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 0, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = call noalias ptr @fopen(ptr noundef %11, ptr noundef @.str.2)
  store ptr %12, ptr %8, align 8, !tbaa !5
  %13 = load ptr, ptr %8, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %18, label %15

15:                                               ; preds = %2
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %16)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %65

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %19 = call ptr @curl_easy_init()
  store ptr %19, ptr %10, align 8, !tbaa !5
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  %21 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %20, i32 noundef 99, i32 noundef 1)
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  %23 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %22, i32 noundef 10102, ptr noundef @.str)
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  %25 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %24, i32 noundef 52, i32 noundef 1)
  %26 = load ptr, ptr %10, align 8, !tbaa !5
  %27 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %26, i32 noundef 68, i32 noundef 8)
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %28, i32 noundef 45, i32 noundef 1)
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %30, i32 noundef 10001, ptr noundef %31)
  %33 = load ptr, ptr %10, 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 %10, align 8, !tbaa !5
  %36 = load ptr, ptr %4, 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 %10, 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 %10, 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 %10, 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 %10, 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 %10, align 8, !tbaa !5
  %47 = call i32 @curl_easy_perform(ptr noundef %46)
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = call i32 (ptr, i32, ...) @curl_easy_getinfo(ptr noundef %48, i32 noundef 2097187, ptr noundef %6)
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = call i32 (ptr, i32, ...) @curl_easy_getinfo(ptr noundef %50, i32 noundef 2097154, ptr noundef %7)
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = call i32 @fclose(ptr noundef %52)
  %54 = load i64, ptr %7, align 8, !tbaa !9
  %55 = icmp eq i64 %54, 304
  br i1 %55, label %59, label %56

56:                                               ; preds = %18
  %57 = load i64, ptr %7, align 8, !tbaa !9
  %58 = icmp sge i64 %57, 400
  br i1 %58, label %59, label %62

59:                                               ; preds = %56, %18
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = call i32 @remove(ptr noundef %60) #4
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %64

62:                                               ; preds = %56
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  call void @curl_easy_cleanup(ptr noundef %63)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %64

64:                                               ; preds = %62, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %65

65:                                               ; preds = %64, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %66 = load i32, ptr %3, align 4
  ret i32 %66
}

declare noalias ptr @fopen(ptr noundef, ptr noundef) #1

declare i32 @fclose(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @remove(ptr noundef) #3

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 = { 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 = { 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}


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

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

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

declare ptr @curl_easy_init() local_unnamed_addr #1

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

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

declare i32 @curl_easy_perform(ptr noundef) local_unnamed_addr #1

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

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

declare void @curl_easy_cleanup(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress 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 range(i32 0, 2) i32 @par_easycurl_to_file(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store i64 0, ptr %4, align 8, !tbaa !5
  %5 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.2)
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %6, label %8

6:                                                ; preds = %2
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %1)
  br label %32

8:                                                ; preds = %2
  %9 = tail call ptr @curl_easy_init() #4
  %10 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 99, i32 noundef 1) #4
  %11 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 10102, ptr noundef nonnull @.str) #4
  %12 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 52, i32 noundef 1) #4
  %13 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 68, i32 noundef 8) #4
  %14 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 45, i32 noundef 1) #4
  %15 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 10001, ptr noundef nonnull %5) #4
  %16 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 20079, ptr noundef nonnull @onheader) #4
  %17 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 10002, ptr noundef %0) #4
  %18 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 33, i32 noundef 1) #4
  %19 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 34, i32 noundef 0) #4
  %20 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 10023, i32 noundef 0) #4
  %21 = tail call i32 (ptr, i32, ...) @curl_easy_setopt(ptr noundef %9, i32 noundef 13, i32 noundef 60) #4
  %22 = tail call i32 @curl_easy_perform(ptr noundef %9) #4
  %23 = call i32 (ptr, i32, ...) @curl_easy_getinfo(ptr noundef %9, i32 noundef 2097187, ptr noundef nonnull %3) #4
  %24 = call i32 (ptr, i32, ...) @curl_easy_getinfo(ptr noundef %9, i32 noundef 2097154, ptr noundef nonnull %4) #4
  %25 = call i32 @fclose(ptr noundef nonnull %5)
  %26 = load i64, ptr %4, align 8
  %27 = icmp eq i64 %26, 304
  %28 = icmp sgt i64 %26, 399
  %or.cond = or i1 %27, %28
  br i1 %or.cond, label %29, label %31

29:                                               ; preds = %8
  %30 = call i32 @remove(ptr noundef %1) #4
  br label %32

31:                                               ; preds = %8
  call void @curl_easy_cleanup(ptr noundef %9) #4
  br label %32

32:                                               ; preds = %29, %31, %6
  %.1 = phi i32 [ 0, %6 ], [ 0, %29 ], [ 1, %31 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret i32 %.1
}

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress 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 = { 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 = { 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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