; ModuleID = 'variables.c'
source_filename = "variables.c"
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.16.0"
@global = global i32 5, align 4, !dbg !0
; Function Attrs: nounwind ssp uwtable
define void @variables(i32 %0, i32* %1) local_unnamed_addr #0 !dbg !16 {
%3 = alloca i32, align 4
%4 = alloca i32, align 4
store volatile i32 %0, i32* %3, align 4, !tbaa !24
call void @llvm.dbg.declare(metadata i32* %3, metadata !20, metadata !DIExpression()), !dbg !28
call void @llvm.dbg.value(metadata i32* %1, metadata !21, metadata !DIExpression()), !dbg !29
%5 = bitcast i32* %4 to i8*, !dbg !30
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %5), !dbg !30
call void @llvm.dbg.declare(metadata i32* %4, metadata !22, metadata !DIExpression()), !dbg !31
store volatile i32 72, i32* %4, align 4, !dbg !31, !tbaa !24
%6 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4) #4, !dbg !32
%7 = bitcast i8* %6 to i32*, !dbg !33
call void @llvm.dbg.value(metadata i32* %7, metadata !23, metadata !DIExpression()), !dbg !29
%8 = load volatile i32, i32* %4, align 4, !dbg !34, !tbaa !24
%9 = add nsw i32 %8, 5, !dbg !35
store volatile i32 %9, i32* %4, align 4, !dbg !36, !tbaa !24
%10 = load volatile i32, i32* %7, align 4, !dbg !37, !tbaa !24
%11 = add nsw i32 %10, 5, !dbg !38
store volatile i32 %11, i32* %7, align 4, !dbg !39, !tbaa !24
%12 = load volatile i32, i32* @global, align 4, !dbg !40, !tbaa !24
%13 = add nsw i32 %12, 5, !dbg !41
store volatile i32 %13, i32* @global, align 4, !dbg !42, !tbaa !24
%14 = load volatile i32, i32* %3, align 4, !dbg !43, !tbaa !24
%15 = add nsw i32 %14, 5, !dbg !44
store volatile i32 %15, i32* %3, align 4, !dbg !45, !tbaa !24
%16 = load volatile i32, i32* %1, align 4, !dbg !46, !tbaa !24
%17 = add nsw i32 %16, 5, !dbg !47
store volatile i32 %17, i32* %1, align 4, !dbg !48, !tbaa !24
call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %5), !dbg !49
ret void, !dbg !49
}
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #2
; Function Attrs: nofree nounwind allocsize(0)
declare noalias i8* @malloc(i64) local_unnamed_addr #3
; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
attributes #0 = { nounwind ssp uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone speculatable willreturn }
attributes #2 = { argmemonly nounwind willreturn }
attributes #3 = { nofree nounwind allocsize(0) "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #4 = { allocsize(0) }
!llvm.module.flags = !{!10, !11, !12, !13, !14}
!llvm.dbg.cu = !{!2}
!llvm.ident = !{!15}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "global", scope: !2, file: !3, line: 5, type: !7, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 10.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !5, globals: !9, nameTableKind: None)
!3 = !DIFile(filename: "variables.c", directory: "/Users/craig/llvm-ir/tests/basic_bc")
!4 = !{}
!5 = !{!6}
!6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64)
!7 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !8)
!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!9 = !{!0}
!10 = !{i32 2, !"SDK Version", [2 x i32] [i32 11, i32 3]}
!11 = !{i32 7, !"Dwarf Version", i32 4}
!12 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !{i32 1, !"wchar_size", i32 4}
!14 = !{i32 7, !"PIC Level", i32 2}
!15 = !{!"clang version 10.0.0 "}
!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, !7, !6}
!19 = !{!20, !21, !22, !23}
!20 = !DILocalVariable(name: "byvalue", arg: 1, scope: !16, file: !3, line: 7, type: !7)
!21 = !DILocalVariable(name: "ptr", arg: 2, scope: !16, file: !3, line: 7, type: !6)
!22 = !DILocalVariable(name: "stack_alloc", scope: !16, file: !3, line: 8, type: !7)
!23 = !DILocalVariable(name: "heap_alloc", scope: !16, file: !3, line: 9, type: !6)
!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: 9, column: 30, scope: !16)
!34 = !DILocation(line: 12, column: 17, scope: !16)
!35 = !DILocation(line: 12, column: 29, scope: !16)
!36 = !DILocation(line: 12, column: 15, scope: !16)
!37 = !DILocation(line: 15, column: 17, scope: !16)
!38 = !DILocation(line: 15, column: 29, scope: !16)
!39 = !DILocation(line: 15, column: 15, scope: !16)
!40 = !DILocation(line: 18, column: 12, scope: !16)
!41 = !DILocation(line: 18, column: 19, scope: !16)
!42 = !DILocation(line: 18, column: 10, scope: !16)
!43 = !DILocation(line: 21, column: 13, scope: !16)
!44 = !DILocation(line: 21, column: 21, scope: !16)
!45 = !DILocation(line: 21, column: 11, scope: !16)
!46 = !DILocation(line: 24, column: 10, scope: !16)
!47 = !DILocation(line: 24, column: 15, scope: !16)
!48 = !DILocation(line: 24, column: 8, scope: !16)
!49 = !DILocation(line: 25, column: 1, scope: !16)