; LLVM IR from erincatto/box2d-lite :: extern/glfw/src/input.ll (glfwAllocJoystick)

; 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._GLFWlibrary = type { i32, %struct.anon.0, ptr, ptr, ptr, ptr, i32, [16 x %struct._GLFWjoystick], ptr, i32, %struct._GLFWtls, %struct._GLFWtls, %struct._GLFWmutex, %struct.anon.5, %struct.anon.6, %struct.anon.7, %struct._GLFWlibraryX11, %struct._GLFWlibraryGLX, %struct._GLFWlibraryLinux, %struct._GLFWlibraryEGL, %struct._GLFWlibraryOSMesa }
%struct.anon.0 = type { %struct._GLFWinitconfig, %struct._GLFWfbconfig, %struct._GLFWwndconfig, %struct._GLFWctxconfig, i32 }
%struct._GLFWinitconfig = type { i32, %struct.anon.1 }
%struct.anon.1 = type { i32, i32 }
%struct._GLFWfbconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
%struct._GLFWwndconfig = type { i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.anon.2, %struct.anon.3 }
%struct.anon.2 = type { i32, [256 x i8] }
%struct.anon.3 = type { [256 x i8], [256 x i8] }
%struct._GLFWctxconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, %struct.anon.4 }
%struct.anon.4 = type { i32 }
%struct._GLFWjoystick = type { i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, [33 x i8], ptr, %struct._GLFWjoystickLinux }
%struct._GLFWjoystickLinux = type { i32, [4096 x i8], [512 x i32], [64 x i32], [64 x %struct.input_absinfo], [4 x [2 x i32]] }
%struct.input_absinfo = type { i32, i32, i32, i32, i32, i32 }
%struct._GLFWtls = type { %struct._GLFWtlsPOSIX }
%struct._GLFWtlsPOSIX = type { i32, i32 }
%struct._GLFWmutex = type { %struct._GLFWmutexPOSIX }
%struct._GLFWmutexPOSIX = type { i32, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.anon.5 = type { i64, %struct._GLFWtimerPOSIX }
%struct._GLFWtimerPOSIX = type { i32, i64 }
%struct.anon.6 = type { i32, ptr, [2 x ptr], ptr, ptr, i32, i32, i32 }
%struct.anon.7 = type { ptr, ptr }
%struct._GLFWlibraryX11 = type { ptr, i32, i64, float, float, i64, i64, i32, ptr, i32, ptr, ptr, [5 x i8], [256 x i16], [349 x i16], double, double, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.anon.8, %struct.anon.9, %struct.anon.10, %struct.anon.11, %struct.anon.12, %struct.anon.13, %struct.anon.14, %struct.anon.15, %struct.anon.16, %struct.anon.17 }
%struct.anon.8 = type { i32, ptr, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon.9 = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.anon.10 = type { i32, i32, i32, i32, i32 }
%struct.anon.11 = type { i32, i64, i64 }
%struct.anon.12 = type { ptr, ptr, ptr, ptr }
%struct.anon.13 = type { i32, ptr, i32, i32, ptr, ptr, ptr }
%struct.anon.14 = type { ptr, ptr }
%struct.anon.15 = type { i32, ptr, i32, i32, ptr, ptr, ptr, ptr }
%struct.anon.16 = type { i32, ptr, i32, i32, i32, i32, i32, ptr, ptr }
%struct.anon.17 = type { i32, ptr, i32, i32, i32, i32, ptr, ptr, ptr }
%struct._GLFWlibraryGLX = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct._GLFWlibraryLinux = type { i32, i32, %struct.re_pattern_buffer, i32 }
%struct.re_pattern_buffer = type { ptr, i64, i64, i64, ptr, ptr, i64, i8 }
%struct._GLFWlibraryEGL = type { ptr, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._GLFWlibraryOSMesa = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@_glfw = external global %struct._GLFWlibrary, align 8

; 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
define dso_local ptr @_glfwAllocJoystick(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %27, %5
  %16 = load i32, ptr %12, align 4, !tbaa !9
  %17 = icmp sle i32 %16, 15
  br i1 %17, label %18, label %30

18:                                               ; preds = %15
  %19 = load i32, ptr %12, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [16 x %struct._GLFWjoystick], ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 7), i64 0, i64 %20
  %22 = getelementptr inbounds %struct._GLFWjoystick, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %18
  br label %30

26:                                               ; preds = %18
  br label %27

27:                                               ; preds = %26
  %28 = load i32, ptr %12, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %12, align 4, !tbaa !9
  br label %15, !llvm.loop !14

30:                                               ; preds = %25, %15
  %31 = load i32, ptr %12, align 4, !tbaa !9
  %32 = icmp sgt i32 %31, 15
  br i1 %32, label %33, label %34

33:                                               ; preds = %30
  store ptr null, ptr %6, align 8
  store i32 1, ptr %14, align 4
  br label %81

34:                                               ; preds = %30
  %35 = load i32, ptr %12, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds %struct._GLFWjoystick, ptr getelementptr inbounds (%struct._GLFWlibrary, ptr @_glfw, i32 0, i32 7), i64 %36
  store ptr %37, ptr %13, align 8, !tbaa !5
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._GLFWjoystick, ptr %38, i32 0, i32 0
  store i32 1, ptr %39, align 8, !tbaa !11
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = call ptr @_glfw_strdup(ptr noundef %40)
  %42 = load ptr, ptr %13, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._GLFWjoystick, ptr %42, i32 0, i32 7
  store ptr %41, ptr %43, align 8, !tbaa !16
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = call noalias ptr @calloc(i64 noundef %45, i64 noundef 4) #6
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._GLFWjoystick, ptr %47, i32 0, i32 1
  store ptr %46, ptr %48, align 8, !tbaa !17
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = load i32, ptr %11, align 4, !tbaa !9
  %51 = mul nsw i32 %50, 4
  %52 = add nsw i32 %49, %51
  %53 = sext i32 %52 to i64
  %54 = call noalias ptr @calloc(i64 noundef %53, i64 noundef 1) #6
  %55 = load ptr, ptr %13, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._GLFWjoystick, ptr %55, i32 0, i32 3
  store ptr %54, ptr %56, align 8, !tbaa !18
  %57 = load i32, ptr %11, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = call noalias ptr @calloc(i64 noundef %58, i64 noundef 1) #6
  %60 = load ptr, ptr %13, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._GLFWjoystick, ptr %60, i32 0, i32 5
  store ptr %59, ptr %61, align 8, !tbaa !19
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._GLFWjoystick, ptr %63, i32 0, i32 2
  store i32 %62, ptr %64, align 8, !tbaa !20
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._GLFWjoystick, ptr %66, i32 0, i32 4
  store i32 %65, ptr %67, align 8, !tbaa !21
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._GLFWjoystick, ptr %69, i32 0, i32 6
  store i32 %68, ptr %70, align 8, !tbaa !22
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._GLFWjoystick, ptr %71, i32 0, i32 9
  %73 = getelementptr inbounds [33 x i8], ptr %72, i64 0, i64 0
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = call ptr @strcpy(ptr noundef %73, ptr noundef %74) #5
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = call ptr @findValidMapping(ptr noundef %76)
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._GLFWjoystick, ptr %78, i32 0, i32 10
  store ptr %77, ptr %79, align 8, !tbaa !23
  %80 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %80, ptr %6, align 8
  store i32 1, ptr %14, align 4
  br label %81

81:                                               ; preds = %34, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %82 = load ptr, ptr %6, align 8
  ret ptr %82
}

declare ptr @_glfw_strdup(ptr noundef) #2

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

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden ptr @findValidMapping(ptr noundef) #1

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 = { "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 allocsize(0,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 #4 = { 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 = { nounwind }
attributes #6 = { nounwind allocsize(0,1) }

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_GLFWjoystick", !10, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !10, i64 32, !6, i64 40, !10, i64 48, !6, i64 56, !6, i64 64, !7, i64 72, !6, i64 112, !13, i64 120}
!13 = !{!"_GLFWjoystickLinux", !10, i64 0, !7, i64 4, !7, i64 4100, !7, i64 6148, !7, i64 6404, !7, i64 7940}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!12, !6, i64 56}
!17 = !{!12, !6, i64 8}
!18 = !{!12, !6, i64 24}
!19 = !{!12, !6, i64 40}
!20 = !{!12, !10, i64 16}
!21 = !{!12, !10, i64 32}
!22 = !{!12, !10, i64 48}
!23 = !{!12, !6, i64 112}


; 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._GLFWlibrary = type { i32, %struct.anon.0, ptr, ptr, ptr, ptr, i32, [16 x %struct._GLFWjoystick], ptr, i32, %struct._GLFWtls, %struct._GLFWtls, %struct._GLFWmutex, %struct.anon.5, %struct.anon.6, %struct.anon.7, %struct._GLFWlibraryX11, %struct._GLFWlibraryGLX, %struct._GLFWlibraryLinux, %struct._GLFWlibraryEGL, %struct._GLFWlibraryOSMesa }
%struct.anon.0 = type { %struct._GLFWinitconfig, %struct._GLFWfbconfig, %struct._GLFWwndconfig, %struct._GLFWctxconfig, i32 }
%struct._GLFWinitconfig = type { i32, %struct.anon.1 }
%struct.anon.1 = type { i32, i32 }
%struct._GLFWfbconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
%struct._GLFWwndconfig = type { i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.anon.2, %struct.anon.3 }
%struct.anon.2 = type { i32, [256 x i8] }
%struct.anon.3 = type { [256 x i8], [256 x i8] }
%struct._GLFWctxconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, %struct.anon.4 }
%struct.anon.4 = type { i32 }
%struct._GLFWjoystick = type { i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, [33 x i8], ptr, %struct._GLFWjoystickLinux }
%struct._GLFWjoystickLinux = type { i32, [4096 x i8], [512 x i32], [64 x i32], [64 x %struct.input_absinfo], [4 x [2 x i32]] }
%struct.input_absinfo = type { i32, i32, i32, i32, i32, i32 }
%struct._GLFWtls = type { %struct._GLFWtlsPOSIX }
%struct._GLFWtlsPOSIX = type { i32, i32 }
%struct._GLFWmutex = type { %struct._GLFWmutexPOSIX }
%struct._GLFWmutexPOSIX = type { i32, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.anon.5 = type { i64, %struct._GLFWtimerPOSIX }
%struct._GLFWtimerPOSIX = type { i32, i64 }
%struct.anon.6 = type { i32, ptr, [2 x ptr], ptr, ptr, i32, i32, i32 }
%struct.anon.7 = type { ptr, ptr }
%struct._GLFWlibraryX11 = type { ptr, i32, i64, float, float, i64, i64, i32, ptr, i32, ptr, ptr, [5 x i8], [256 x i16], [349 x i16], double, double, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.anon.8, %struct.anon.9, %struct.anon.10, %struct.anon.11, %struct.anon.12, %struct.anon.13, %struct.anon.14, %struct.anon.15, %struct.anon.16, %struct.anon.17 }
%struct.anon.8 = type { i32, ptr, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon.9 = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.anon.10 = type { i32, i32, i32, i32, i32 }
%struct.anon.11 = type { i32, i64, i64 }
%struct.anon.12 = type { ptr, ptr, ptr, ptr }
%struct.anon.13 = type { i32, ptr, i32, i32, ptr, ptr, ptr }
%struct.anon.14 = type { ptr, ptr }
%struct.anon.15 = type { i32, ptr, i32, i32, ptr, ptr, ptr, ptr }
%struct.anon.16 = type { i32, ptr, i32, i32, i32, i32, i32, ptr, ptr }
%struct.anon.17 = type { i32, ptr, i32, i32, i32, i32, ptr, ptr, ptr }
%struct._GLFWlibraryGLX = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct._GLFWlibraryLinux = type { i32, i32, %struct.re_pattern_buffer, i32 }
%struct.re_pattern_buffer = type { ptr, i64, i64, i64, ptr, ptr, i64, i8 }
%struct._GLFWlibraryEGL = type { ptr, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._GLFWlibraryOSMesa = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@_glfw = external global %struct._GLFWlibrary, align 8

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @_glfwAllocJoystick(ptr noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 1032), align 8, !tbaa !5
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %37, label %7

7:                                                ; preds = %5
  %8 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 9128), align 8, !tbaa !5
  %.not.1 = icmp eq i32 %8, 0
  br i1 %.not.1, label %37, label %9

9:                                                ; preds = %7
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 17224), align 8, !tbaa !5
  %.not.2 = icmp eq i32 %10, 0
  br i1 %.not.2, label %37, label %11

11:                                               ; preds = %9
  %12 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 25320), align 8, !tbaa !5
  %.not.3 = icmp eq i32 %12, 0
  br i1 %.not.3, label %37, label %13

13:                                               ; preds = %11
  %14 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 33416), align 8, !tbaa !5
  %.not.4 = icmp eq i32 %14, 0
  br i1 %.not.4, label %37, label %15

15:                                               ; preds = %13
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 41512), align 8, !tbaa !5
  %.not.5 = icmp eq i32 %16, 0
  br i1 %.not.5, label %37, label %17

17:                                               ; preds = %15
  %18 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 49608), align 8, !tbaa !5
  %.not.6 = icmp eq i32 %18, 0
  br i1 %.not.6, label %37, label %19

19:                                               ; preds = %17
  %20 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 57704), align 8, !tbaa !5
  %.not.7 = icmp eq i32 %20, 0
  br i1 %.not.7, label %37, label %21

21:                                               ; preds = %19
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 65800), align 8, !tbaa !5
  %.not.8 = icmp eq i32 %22, 0
  br i1 %.not.8, label %37, label %23

23:                                               ; preds = %21
  %24 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 73896), align 8, !tbaa !5
  %.not.9 = icmp eq i32 %24, 0
  br i1 %.not.9, label %37, label %25

25:                                               ; preds = %23
  %26 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 81992), align 8, !tbaa !5
  %.not.10 = icmp eq i32 %26, 0
  br i1 %.not.10, label %37, label %27

27:                                               ; preds = %25
  %28 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 90088), align 8, !tbaa !5
  %.not.11 = icmp eq i32 %28, 0
  br i1 %.not.11, label %37, label %29

29:                                               ; preds = %27
  %30 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 98184), align 8, !tbaa !5
  %.not.12 = icmp eq i32 %30, 0
  br i1 %.not.12, label %37, label %31

31:                                               ; preds = %29
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 106280), align 8, !tbaa !5
  %.not.13 = icmp eq i32 %32, 0
  br i1 %.not.13, label %37, label %33

33:                                               ; preds = %31
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 114376), align 8, !tbaa !5
  %.not.14 = icmp eq i32 %34, 0
  br i1 %.not.14, label %37, label %35

35:                                               ; preds = %33
  %36 = load i32, ptr getelementptr inbounds (i8, ptr @_glfw, i64 122472), align 8, !tbaa !5
  %.not.15 = icmp eq i32 %36, 0
  br i1 %.not.15, label %37, label %.thread

37:                                               ; preds = %35, %33, %31, %29, %27, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5
  %.02628.lcssa.wide = phi i64 [ 0, %5 ], [ 1, %7 ], [ 2, %9 ], [ 3, %11 ], [ 4, %13 ], [ 5, %15 ], [ 6, %17 ], [ 7, %19 ], [ 8, %21 ], [ 9, %23 ], [ 10, %25 ], [ 11, %27 ], [ 12, %29 ], [ 13, %31 ], [ 14, %33 ], [ 15, %35 ]
  %38 = getelementptr inbounds %struct._GLFWjoystick, ptr getelementptr inbounds (i8, ptr @_glfw, i64 1032), i64 %.02628.lcssa.wide
  store i32 1, ptr %38, align 8, !tbaa !5
  %39 = tail call ptr @_glfw_strdup(ptr noundef %0) #4
  %40 = getelementptr inbounds i8, ptr %38, i64 56
  store ptr %39, ptr %40, align 8, !tbaa !12
  %41 = sext i32 %2 to i64
  %42 = tail call noalias ptr @calloc(i64 noundef %41, i64 noundef 4) #5
  %43 = getelementptr inbounds i8, ptr %38, i64 8
  store ptr %42, ptr %43, align 8, !tbaa !13
  %44 = shl nsw i32 %4, 2
  %45 = add nsw i32 %44, %3
  %46 = sext i32 %45 to i64
  %47 = tail call noalias ptr @calloc(i64 noundef %46, i64 noundef 1) #5
  %48 = getelementptr inbounds i8, ptr %38, i64 24
  store ptr %47, ptr %48, align 8, !tbaa !14
  %49 = sext i32 %4 to i64
  %50 = tail call noalias ptr @calloc(i64 noundef %49, i64 noundef 1) #5
  %51 = getelementptr inbounds i8, ptr %38, i64 40
  store ptr %50, ptr %51, align 8, !tbaa !15
  %52 = getelementptr inbounds i8, ptr %38, i64 16
  store i32 %2, ptr %52, align 8, !tbaa !16
  %53 = getelementptr inbounds i8, ptr %38, i64 32
  store i32 %3, ptr %53, align 8, !tbaa !17
  %54 = getelementptr inbounds i8, ptr %38, i64 48
  store i32 %4, ptr %54, align 8, !tbaa !18
  %55 = getelementptr inbounds i8, ptr %38, i64 72
  %56 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %55, ptr noundef nonnull dereferenceable(1) %1) #4
  %57 = tail call ptr @findValidMapping(ptr noundef nonnull %38)
  %58 = getelementptr inbounds i8, ptr %38, i64 112
  store ptr %57, ptr %58, align 8, !tbaa !19
  br label %.thread

.thread:                                          ; preds = %35, %37
  %.0 = phi ptr [ %38, %37 ], [ null, %35 ]
  ret ptr %.0
}

declare ptr @_glfw_strdup(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden ptr @findValidMapping(ptr noundef) local_unnamed_addr #0

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 = { "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,zeroed") allocsize(0,1) 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 nofree nounwind willreturn memory(argmem: readwrite) "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 }
attributes #5 = { nounwind allocsize(0,1) }

!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 = !{!"_GLFWjoystick", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !7, i64 32, !10, i64 40, !7, i64 48, !10, i64 56, !10, i64 64, !8, i64 72, !10, i64 112, !11, i64 120}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_GLFWjoystickLinux", !7, i64 0, !8, i64 4, !8, i64 4100, !8, i64 6148, !8, i64 6404, !8, i64 7940}
!12 = !{!6, !10, i64 56}
!13 = !{!6, !10, i64 8}
!14 = !{!6, !10, i64 24}
!15 = !{!6, !10, i64 40}
!16 = !{!6, !7, i64 16}
!17 = !{!6, !7, i64 32}
!18 = !{!6, !7, i64 48}
!19 = !{!6, !10, i64 112}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass