; LLVM IR from ESPboy-edu/ESPboy_tinyphysicsengine :: programs (hello)

; 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.TPE_Joint = type { %struct.TPE_Vec3, [3 x i16], i8 }
%struct.TPE_Vec3 = type { i32, i32, i32 }

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

; 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
declare dso_local i32 @_TPE_hash(i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @TPE_jointHash(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.TPE_Joint, ptr %4, i32 0, i32 0
  %6 = getelementptr inbounds %struct.TPE_Vec3, ptr %5, i32 0, i32 0
  %7 = load i32, ptr %6, align 4, !tbaa !9
  %8 = call i32 @_TPE_hash(i32 noundef %7)
  store i32 %8, ptr %3, align 4, !tbaa !13
  %9 = load i32, ptr %3, align 4, !tbaa !13
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.TPE_Joint, ptr %10, i32 0, i32 0
  %12 = getelementptr inbounds %struct.TPE_Vec3, ptr %11, i32 0, i32 1
  %13 = load i32, ptr %12, align 4, !tbaa !14
  %14 = xor i32 %9, %13
  %15 = call i32 @_TPE_hash(i32 noundef %14)
  store i32 %15, ptr %3, align 4, !tbaa !13
  %16 = load i32, ptr %3, align 4, !tbaa !13
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.TPE_Joint, ptr %17, i32 0, i32 0
  %19 = getelementptr inbounds %struct.TPE_Vec3, ptr %18, i32 0, i32 2
  %20 = load i32, ptr %19, align 4, !tbaa !15
  %21 = xor i32 %16, %20
  %22 = call i32 @_TPE_hash(i32 noundef %21)
  store i32 %22, ptr %3, align 4, !tbaa !13
  %23 = load i32, ptr %3, align 4, !tbaa !13
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.TPE_Joint, ptr %24, i32 0, i32 1
  %26 = getelementptr inbounds [3 x i16], ptr %25, i64 0, i64 0
  %27 = load i16, ptr %26, align 4, !tbaa !16
  %28 = sext i16 %27 to i32
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.TPE_Joint, ptr %29, i32 0, i32 1
  %31 = getelementptr inbounds [3 x i16], ptr %30, i64 0, i64 1
  %32 = load i16, ptr %31, align 2, !tbaa !16
  %33 = sext i16 %32 to i32
  %34 = shl i32 %33, 16
  %35 = or i32 %28, %34
  %36 = xor i32 %23, %35
  %37 = call i32 @_TPE_hash(i32 noundef %36)
  store i32 %37, ptr %3, align 4, !tbaa !13
  %38 = load i32, ptr %3, align 4, !tbaa !13
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.TPE_Joint, ptr %39, i32 0, i32 1
  %41 = getelementptr inbounds [3 x i16], ptr %40, i64 0, i64 2
  %42 = load i16, ptr %41, align 4, !tbaa !16
  %43 = sext i16 %42 to i32
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.TPE_Joint, ptr %44, i32 0, i32 2
  %46 = load i8, ptr %45, align 2, !tbaa !18
  %47 = zext i8 %46 to i32
  %48 = or i32 %43, %47
  %49 = xor i32 %38, %48
  %50 = call i32 @_TPE_hash(i32 noundef %49)
  store i32 %50, ptr %3, align 4, !tbaa !13
  %51 = load i32, ptr %3, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret i32 %51
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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, !12, i64 0}
!10 = !{!"", !11, i64 0, !7, i64 12, !7, i64 18}
!11 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!10, !12, i64 4}
!15 = !{!10, !12, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{!10, !7, i64 18}


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

; Function Attrs: nounwind uwtable
declare dso_local i32 @_TPE_hash(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @TPE_jointHash(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = load i32, ptr %0, align 4, !tbaa !5
  %3 = tail call i32 @_TPE_hash(i32 noundef %2)
  %4 = getelementptr inbounds i8, ptr %0, i64 4
  %5 = load i32, ptr %4, align 4, !tbaa !11
  %6 = xor i32 %5, %3
  %7 = tail call i32 @_TPE_hash(i32 noundef %6)
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i32, ptr %8, align 4, !tbaa !12
  %10 = xor i32 %9, %7
  %11 = tail call i32 @_TPE_hash(i32 noundef %10)
  %12 = getelementptr inbounds i8, ptr %0, i64 12
  %13 = load i16, ptr %12, align 4, !tbaa !13
  %14 = sext i16 %13 to i32
  %15 = getelementptr inbounds i8, ptr %0, i64 14
  %16 = load i16, ptr %15, align 2, !tbaa !13
  %17 = sext i16 %16 to i32
  %18 = shl nsw i32 %17, 16
  %19 = or i32 %18, %14
  %20 = xor i32 %19, %11
  %21 = tail call i32 @_TPE_hash(i32 noundef %20)
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  %23 = load i16, ptr %22, align 4, !tbaa !13
  %24 = sext i16 %23 to i32
  %25 = getelementptr inbounds i8, ptr %0, i64 18
  %26 = load i8, ptr %25, align 2, !tbaa !15
  %27 = zext i8 %26 to i32
  %28 = or i32 %27, %24
  %29 = xor i32 %28, %21
  %30 = tail call i32 @_TPE_hash(i32 noundef %29)
  ret i32 %30
}

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

!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, !8, i64 0}
!6 = !{!"", !7, i64 0, !9, i64 12, !9, i64 18}
!7 = !{!"", !8, i64 0, !8, i64 4, !8, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!6, !8, i64 4}
!12 = !{!6, !8, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"short", !9, i64 0}
!15 = !{!6, !9, i64 18}


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