llvm-ir 0.11.3

LLVM IR in natural Rust data structures
Documentation
; ModuleID = 'variables.c'
source_filename = "variables.c"
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx12.0.0"

@global = global i32 5, align 4, !dbg !0

; Function Attrs: nofree nounwind ssp uwtable
define void @variables(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 !dbg !16 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store volatile i32 %0, ptr %3, align 4, !tbaa !24
    #dbg_declare(ptr %3, !20, !DIExpression(), !28)
    #dbg_value(ptr %1, !21, !DIExpression(), !29)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4), !dbg !30
    #dbg_declare(ptr %4, !22, !DIExpression(), !31)
  store volatile i32 72, ptr %4, align 4, !dbg !31, !tbaa !24
  %5 = tail call dereferenceable_or_null(4) ptr @malloc(i64 noundef 4) #3, !dbg !32
    #dbg_value(ptr %5, !23, !DIExpression(), !29)
  %6 = load volatile i32, ptr %4, align 4, !dbg !33, !tbaa !24
  %7 = add nsw i32 %6, 5, !dbg !34
  store volatile i32 %7, ptr %4, align 4, !dbg !35, !tbaa !24
  %8 = load volatile i32, ptr %5, align 4, !dbg !36, !tbaa !24
  %9 = add nsw i32 %8, 5, !dbg !37
  store volatile i32 %9, ptr %5, align 4, !dbg !38, !tbaa !24
  %10 = load volatile i32, ptr @global, align 4, !dbg !39, !tbaa !24
  %11 = add nsw i32 %10, 5, !dbg !40
  store volatile i32 %11, ptr @global, align 4, !dbg !41, !tbaa !24
  %12 = load volatile i32, ptr %3, align 4, !dbg !42, !tbaa !24
  %13 = add nsw i32 %12, 5, !dbg !43
  store volatile i32 %13, ptr %3, align 4, !dbg !44, !tbaa !24
  %14 = load volatile i32, ptr %1, align 4, !dbg !45, !tbaa !24
  %15 = add nsw i32 %14, 5, !dbg !46
  store volatile i32 %15, ptr %1, align 4, !dbg !47, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4), !dbg !48
  ret void, !dbg !48
}

; 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare !dbg !49 noalias noundef ptr @malloc(i64 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 = { nofree nounwind ssp uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cmov,+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cmov,+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" }
attributes #3 = { allocsize(0) }

!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!9, !10, !11, !12, !13, !14}
!llvm.ident = !{!15}

!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "global", scope: !2, file: !3, line: 4, type: !6, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C11, file: !3, producer: "clang version 19.1.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: !4, globals: !8, splitDebugInlining: false, nameTableKind: Apple, sysroot: "/")
!3 = !DIFile(filename: "variables.c", directory: "/home/benji/Dev/OSSDev/Rust/llvm-ir/tests/basic_bc")
!4 = !{!5}
!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64)
!6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!8 = !{!0}
!9 = !{i32 7, !"Dwarf Version", i32 4}
!10 = !{i32 2, !"Debug Info Version", i32 3}
!11 = !{i32 1, !"wchar_size", i32 4}
!12 = !{i32 8, !"PIC Level", i32 2}
!13 = !{i32 7, !"uwtable", i32 2}
!14 = !{i32 7, !"frame-pointer", i32 2}
!15 = !{!"clang version 19.1.0"}
!16 = distinct !DISubprogram(name: "variables", scope: !3, file: !3, line: 6, type: !17, scopeLine: 6, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !19)
!17 = !DISubroutineType(types: !18)
!18 = !{null, !6, !5}
!19 = !{!20, !21, !22, !23}
!20 = !DILocalVariable(name: "byvalue", arg: 1, scope: !16, file: !3, line: 6, type: !6)
!21 = !DILocalVariable(name: "ptr", arg: 2, scope: !16, file: !3, line: 6, type: !5)
!22 = !DILocalVariable(name: "stack_alloc", scope: !16, file: !3, line: 7, type: !6)
!23 = !DILocalVariable(name: "heap_alloc", scope: !16, file: !3, line: 8, type: !5)
!24 = !{!25, !25, i64 0}
!25 = !{!"int", !26, i64 0}
!26 = !{!"omnipotent char", !27, i64 0}
!27 = !{!"Simple C/C++ TBAA"}
!28 = !DILocation(line: 6, column: 29, scope: !16)
!29 = !DILocation(line: 0, scope: !16)
!30 = !DILocation(line: 7, column: 3, scope: !16)
!31 = !DILocation(line: 7, column: 16, scope: !16)
!32 = !DILocation(line: 8, column: 46, scope: !16)
!33 = !DILocation(line: 11, column: 17, scope: !16)
!34 = !DILocation(line: 11, column: 29, scope: !16)
!35 = !DILocation(line: 11, column: 15, scope: !16)
!36 = !DILocation(line: 14, column: 17, scope: !16)
!37 = !DILocation(line: 14, column: 29, scope: !16)
!38 = !DILocation(line: 14, column: 15, scope: !16)
!39 = !DILocation(line: 17, column: 12, scope: !16)
!40 = !DILocation(line: 17, column: 19, scope: !16)
!41 = !DILocation(line: 17, column: 10, scope: !16)
!42 = !DILocation(line: 20, column: 13, scope: !16)
!43 = !DILocation(line: 20, column: 21, scope: !16)
!44 = !DILocation(line: 20, column: 11, scope: !16)
!45 = !DILocation(line: 23, column: 10, scope: !16)
!46 = !DILocation(line: 23, column: 15, scope: !16)
!47 = !DILocation(line: 23, column: 8, scope: !16)
!48 = !DILocation(line: 24, column: 1, scope: !16)
!49 = !DISubprogram(name: "malloc", scope: !3, file: !3, line: 3, type: !50, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
!50 = !DISubroutineType(types: !51)
!51 = !{!52, !53}
!52 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
!53 = !DIBasicType(name: "unsigned long", size: 64, encoding: DW_ATE_unsigned)