; ModuleID = 'variables.c'
source_filename = "variables.c"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-macosx13.0.0"
@global = global i32 5, align 4, !dbg !0
; Function Attrs: nofree nounwind ssp uwtable(sync)
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
call void @llvm.dbg.declare(metadata ptr %3, metadata !20, metadata !DIExpression()), !dbg !28
call void @llvm.dbg.value(metadata ptr %1, metadata !21, metadata !DIExpression()), !dbg !29
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4), !dbg !30
call void @llvm.dbg.declare(metadata ptr %4, metadata !22, metadata !DIExpression()), !dbg !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) #5, !dbg !32
call void @llvm.dbg.value(metadata ptr %5, metadata !23, metadata !DIExpression()), !dbg !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 speculatable willreturn memory(none)
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; 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 #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare void @llvm.dbg.value(metadata, metadata, metadata) #4
attributes #0 = { nofree nounwind ssp uwtable(sync) "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+crc,+crypto,+dotprod,+fp-armv8,+fp16fml,+fullfp16,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8a,+zcm,+zcz" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+crc,+crypto,+dotprod,+fp-armv8,+fp16fml,+fullfp16,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8a,+zcm,+zcz" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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: 5, type: !6, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C11, file: !3, producer: "Homebrew clang version 16.0.6", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, retainedTypes: !4, globals: !8, splitDebugInlining: false, nameTableKind: None, sysroot: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk", sdk: "MacOSX13.sdk")
!3 = !DIFile(filename: "variables.c", directory: "/Users/william/devel/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 1}
!14 = !{i32 7, !"frame-pointer", i32 1}
!15 = !{!"Homebrew clang version 16.0.6"}
!16 = distinct !DISubprogram(name: "variables", scope: !3, file: !3, line: 7, type: !17, scopeLine: 7, 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: 7, type: !6)
!21 = !DILocalVariable(name: "ptr", arg: 2, scope: !16, file: !3, line: 7, type: !5)
!22 = !DILocalVariable(name: "stack_alloc", scope: !16, file: !3, line: 8, type: !6)
!23 = !DILocalVariable(name: "heap_alloc", scope: !16, file: !3, line: 9, 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: 7, column: 29, scope: !16)
!29 = !DILocation(line: 0, scope: !16)
!30 = !DILocation(line: 8, column: 3, scope: !16)
!31 = !DILocation(line: 8, column: 16, scope: !16)
!32 = !DILocation(line: 9, column: 46, scope: !16)
!33 = !DILocation(line: 12, column: 17, scope: !16)
!34 = !DILocation(line: 12, column: 29, scope: !16)
!35 = !DILocation(line: 12, column: 15, scope: !16)
!36 = !DILocation(line: 15, column: 17, scope: !16)
!37 = !DILocation(line: 15, column: 29, scope: !16)
!38 = !DILocation(line: 15, column: 15, scope: !16)
!39 = !DILocation(line: 18, column: 12, scope: !16)
!40 = !DILocation(line: 18, column: 19, scope: !16)
!41 = !DILocation(line: 18, column: 10, scope: !16)
!42 = !DILocation(line: 21, column: 13, scope: !16)
!43 = !DILocation(line: 21, column: 21, scope: !16)
!44 = !DILocation(line: 21, column: 11, scope: !16)
!45 = !DILocation(line: 24, column: 10, scope: !16)
!46 = !DILocation(line: 24, column: 15, scope: !16)
!47 = !DILocation(line: 24, column: 8, scope: !16)
!48 = !DILocation(line: 25, column: 1, scope: !16)
!49 = !DISubprogram(name: "malloc", scope: !50, file: !50, line: 40, type: !51, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !59)
!50 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/malloc/_malloc.h", directory: "")
!51 = !DISubroutineType(types: !52)
!52 = !{!53, !54}
!53 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
!54 = !DIDerivedType(tag: DW_TAG_typedef, name: "size_t", file: !55, line: 31, baseType: !56)
!55 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_types/_size_t.h", directory: "")
!56 = !DIDerivedType(tag: DW_TAG_typedef, name: "__darwin_size_t", file: !57, line: 70, baseType: !58)
!57 = !DIFile(filename: "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/arm/_types.h", directory: "")
!58 = !DIBasicType(name: "unsigned long", size: 64, encoding: DW_ATE_unsigned)
!59 = !{}