; LLVM IR from devantler/software-engineering-f22-shared :: IOT/BudgetManagementExcercise-03-28/ESP-Project/components/components/nghttp (LLVMFuzzerTestOneInput)

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

@__const.LLVMFuzzerTestOneInput.iv = external hidden unnamed_addr constant %struct.nghttp2_settings_entry, align 4

; Function Attrs: mustprogress uwtable
define dso_local i32 @LLVMFuzzerTestOneInput(ptr noundef %0, i64 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.nghttp2_settings_entry, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %8 = call i32 @nghttp2_session_callbacks_new(ptr noundef %6)
  %9 = load ptr, ptr %6, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_set_on_frame_recv_callback(ptr noundef %9, ptr noundef @_ZN12_GLOBAL__N_122on_frame_recv_callbackEP15nghttp2_sessionPK13nghttp2_framePv)
  %10 = load ptr, ptr %6, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_set_on_begin_headers_callback(ptr noundef %10, ptr noundef @_ZN12_GLOBAL__N_125on_begin_headers_callbackEP15nghttp2_sessionPK13nghttp2_framePv)
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_set_on_header_callback2(ptr noundef %11, ptr noundef @_ZN12_GLOBAL__N_119on_header_callback2EP15nghttp2_sessionPK13nghttp2_frameP13nghttp2_rcbufS6_hPv)
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_set_before_frame_send_callback(ptr noundef %12, ptr noundef @_ZN12_GLOBAL__N_126before_frame_send_callbackEP15nghttp2_sessionPK13nghttp2_framePv)
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_set_on_frame_send_callback(ptr noundef %13, ptr noundef @_ZN12_GLOBAL__N_122on_frame_send_callbackEP15nghttp2_sessionPK13nghttp2_framePv)
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = call i32 @nghttp2_session_server_new(ptr noundef %5, ptr noundef %14, ptr noundef null)
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_del(ptr noundef %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 @__const.LLVMFuzzerTestOneInput.iv, i64 8, i1 false)
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call i32 @nghttp2_submit_settings(ptr noundef %17, i8 noundef zeroext 0, ptr noundef %7, i64 noundef 1)
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN12_GLOBAL__N_112send_pendingEP15nghttp2_session(ptr noundef %19)
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = load i64, ptr %4, align 8, !tbaa !9
  %23 = call i64 @nghttp2_session_mem_recv(ptr noundef %20, ptr noundef %21, i64 noundef %22)
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN12_GLOBAL__N_112send_pendingEP15nghttp2_session(ptr noundef %24)
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  call void @nghttp2_session_del(ptr noundef %25)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret i32 0
}

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

declare i32 @nghttp2_session_callbacks_new(ptr noundef) #2

declare void @nghttp2_session_callbacks_set_on_frame_recv_callback(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_122on_frame_recv_callbackEP15nghttp2_sessionPK13nghttp2_framePv(ptr noundef, ptr noundef, ptr noundef) #3

declare void @nghttp2_session_callbacks_set_on_begin_headers_callback(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_125on_begin_headers_callbackEP15nghttp2_sessionPK13nghttp2_framePv(ptr noundef, ptr noundef, ptr noundef) #3

declare void @nghttp2_session_callbacks_set_on_header_callback2(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_119on_header_callback2EP15nghttp2_sessionPK13nghttp2_frameP13nghttp2_rcbufS6_hPv(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef) #3

declare void @nghttp2_session_callbacks_set_before_frame_send_callback(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_126before_frame_send_callbackEP15nghttp2_sessionPK13nghttp2_framePv(ptr noundef, ptr noundef, ptr noundef) #3

declare void @nghttp2_session_callbacks_set_on_frame_send_callback(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_122on_frame_send_callbackEP15nghttp2_sessionPK13nghttp2_framePv(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @nghttp2_session_server_new(ptr noundef, ptr noundef, ptr noundef) #2

declare void @nghttp2_session_callbacks_del(ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare i32 @nghttp2_submit_settings(ptr noundef, i8 noundef zeroext, ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_112send_pendingEP15nghttp2_session(ptr noundef) #0

declare i64 @nghttp2_session_mem_recv(ptr noundef, ptr noundef, i64 noundef) #2

declare void @nghttp2_session_del(ptr noundef) #2

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

attributes #0 = { mustprogress 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 = { "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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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++ 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"

%struct.nghttp2_settings_entry = type { i32, i32 }

@__const.LLVMFuzzerTestOneInput.iv = external hidden unnamed_addr constant %struct.nghttp2_settings_entry, align 4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @LLVMFuzzerTestOneInput(ptr noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.nghttp2_settings_entry, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %6 = call i32 @nghttp2_session_callbacks_new(ptr noundef nonnull %4)
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_set_on_frame_recv_callback(ptr noundef %7, ptr noundef nonnull @_ZN12_GLOBAL__N_122on_frame_recv_callbackEP15nghttp2_sessionPK13nghttp2_framePv)
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_set_on_begin_headers_callback(ptr noundef %8, ptr noundef nonnull @_ZN12_GLOBAL__N_125on_begin_headers_callbackEP15nghttp2_sessionPK13nghttp2_framePv)
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_set_on_header_callback2(ptr noundef %9, ptr noundef nonnull @_ZN12_GLOBAL__N_119on_header_callback2EP15nghttp2_sessionPK13nghttp2_frameP13nghttp2_rcbufS6_hPv)
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_set_before_frame_send_callback(ptr noundef %10, ptr noundef nonnull @_ZN12_GLOBAL__N_126before_frame_send_callbackEP15nghttp2_sessionPK13nghttp2_framePv)
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_set_on_frame_send_callback(ptr noundef %11, ptr noundef nonnull @_ZN12_GLOBAL__N_122on_frame_send_callbackEP15nghttp2_sessionPK13nghttp2_framePv)
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = call i32 @nghttp2_session_server_new(ptr noundef nonnull %3, ptr noundef %12, ptr noundef null)
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  call void @nghttp2_session_callbacks_del(ptr noundef %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %15 = load i64, ptr @__const.LLVMFuzzerTestOneInput.iv, align 4
  store i64 %15, ptr %5, align 8
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = call i32 @nghttp2_submit_settings(ptr noundef %16, i8 noundef zeroext 0, ptr noundef nonnull %5, i64 noundef 1)
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN12_GLOBAL__N_112send_pendingEP15nghttp2_session(ptr noundef %18)
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = call i64 @nghttp2_session_mem_recv(ptr noundef %19, ptr noundef %0, i64 noundef %1)
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN12_GLOBAL__N_112send_pendingEP15nghttp2_session(ptr noundef %21)
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  call void @nghttp2_session_del(ptr noundef %22)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  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 0
}

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

declare i32 @nghttp2_session_callbacks_new(ptr noundef) local_unnamed_addr #2

declare void @nghttp2_session_callbacks_set_on_frame_recv_callback(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_122on_frame_recv_callbackEP15nghttp2_sessionPK13nghttp2_framePv(ptr noundef, ptr noundef, ptr noundef) #3

declare void @nghttp2_session_callbacks_set_on_begin_headers_callback(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_125on_begin_headers_callbackEP15nghttp2_sessionPK13nghttp2_framePv(ptr noundef, ptr noundef, ptr noundef) #3

declare void @nghttp2_session_callbacks_set_on_header_callback2(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_119on_header_callback2EP15nghttp2_sessionPK13nghttp2_frameP13nghttp2_rcbufS6_hPv(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef) #3

declare void @nghttp2_session_callbacks_set_before_frame_send_callback(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_126before_frame_send_callbackEP15nghttp2_sessionPK13nghttp2_framePv(ptr noundef, ptr noundef, ptr noundef) #3

declare void @nghttp2_session_callbacks_set_on_frame_send_callback(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_122on_frame_send_callbackEP15nghttp2_sessionPK13nghttp2_framePv(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @nghttp2_session_server_new(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @nghttp2_session_callbacks_del(ptr noundef) local_unnamed_addr #2

declare i32 @nghttp2_submit_settings(ptr noundef, i8 noundef zeroext, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_112send_pendingEP15nghttp2_session(ptr noundef) local_unnamed_addr #0

declare i64 @nghttp2_session_mem_recv(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @nghttp2_session_del(ptr noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress 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 = { "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 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 = { 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++ TBAA"}


; Effective O3 passes: GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass