Classes and identity
Two names can refer to the same Counter. Calling next through either name changes the one shared object. That identity is why class code needs allocation, reference counts, generation checks, and deterministic destruction.
Follow one shared Counter
The example constructs a counter and copies its reference into same. MIR makes object construction and storage explicit. LLVM IR lowers those operations to runtime calls and checked object lookup. ARM64 contains the calls and branches that enforce reference counting and stale-handle checks.
Luce source. Names and indentation describe the program for a reader.
open source file
class Counter:
value: i64
init(start: i64):
self.value = start
func next() -> i64:
self.value += 1
return self.value
func main(args: list[str]):
let counter = Counter(start = len(args))
let same = counter
print(str(same.next()))
Luce MIR. Types, registers, blocks, calls, and lifetime operations form the instruction plan sent to the LLVM backend.
open MIR fileMIR instruction guide hover, focus, or tap dotted terms
r7 is one typed intermediate value, %2 is a local storage slot, and b1 is a basic block. Read each block from top to bottom, then follow its final control-flow instruction.
Hover or focus a dotted term in the file for its explanation. On a touch screen, tap a term to keep the note open and tap elsewhere to close it. The list includes the operations that appear in this file.
class NAME- Declares a reference type with shared identity. Its fields live in an ARC-managed runtime object.
func …- Starts one MIR function and lists the source-level parameters with their resolved types.
local %N- Reserves a typed local slot. The slot gives later blocks a stable place to read or replace.
b0, b1, …- Names a basic block. Control enters at the label and runs until a branch, jump, trap, or return chooses what happens next.
r0, r1, …- Names one typed intermediate result. Each register is assigned once, which makes data flow explicit.
local_get- Reads a local slot into a fresh MIR register so this use has a precise value and type.
local_set- Writes a register into a local slot. Later blocks read that slot after control-flow paths join.
const- Creates a typed literal such as 2 or 10 inside the instruction stream.
add.i64- Adds two signed 64-bit integers. The type suffix selects the overflow and representation rules.
intrinsic NAME- Invokes a language operation with runtime rules recorded by the compiler. The name identifies the operation.
intrinsic len- Reads the logical length defined by the value's type, such as argument count or Unicode-scalar count.
intrinsic str_value- Converts a typed value into owned text through Luce's string conversion rules.
intrinsic print- Sends text through the installed host output capability.
intrinsic retain- Adds one strong owner before another place begins holding the same reference.
intrinsic release- Removes one strong owner and runs destruction when the count reaches zero.
intrinsic drop_storage- Releases any reference held by a temporary value and leaves that temporary in its empty state.
call NAME- Calls a resolved function directly. MIR already knows the target and argument order.
struct_make- Builds a value aggregate from fields in declared layout order.
struct_get- Extracts one field from a value aggregate.
struct_set- Replaces one field in a mutable class or value receiver using the field's ownership rule.
ret- Returns the current function's result to its caller and closes the current control-flow path.
class Counter:
value: i64
func main(args: list[str]) -> None
local %1 (temporary): Counter
local %2 counter: Counter
local %3 same: Counter
local %4 (temporary): str
b0:
r0 = local_get %0
r1 = intrinsic len, r0
r2 = call Counter.init, r1
local_set %2, r2
r4 = local_get %2
intrinsic retain, r4
local_set %3, r4
r7 = local_get %3
r8 = call Counter.next, r7
r9 = intrinsic str_value, r8
local_set %4, r9
intrinsic print, r9
r12 = local_get %4
r13 = intrinsic drop_storage, r12
local_set %4, r13
r15 = local_get %3
intrinsic release, r15
r17 = local_get %2
intrinsic release, r17
ret
func Counter.next(self: Counter) -> i64
b0:
r0 = const 1
r1 = local_get %0
r2 = struct_get r1, Counter.value
r3 = add.i64 r2, r0
struct_set r1, Counter.value, r3
r5 = local_get %0
r6 = struct_get r5, Counter.value
ret r6
func Counter.init(start: i64) -> Counter
local %1 $init.value: i64
b0:
r0 = const 0
local_set %1, r0
r2 = local_get %0
local_set %1, r2
r4 = local_get %1
r5 = struct_make Counter, r4
ret r5
LLVM IR. The backend expands MIR into typed memory operations, calls, checks, and control-flow blocks for LLVM.
open LLVM IR fileLLVM IR instruction guide hover, focus, or tap dotted terms
%7 is an SSA value, i64 is a 64-bit integer type, ptr is a pointer, and @name is a module symbol. Numbered labels divide the function into basic blocks.
Hover or focus a dotted term in the file for its explanation. On a touch screen, tap a term to keep the note open and tap elsewhere to close it. The list includes the operations that appear in this file.
@name = …- Defines module data such as text constants, source positions, function records, and the artifact identity tag.
define … @name- Begins a generated function. The parameter attributes tell LLVM which pointers are valid, writable, or read-only.
declare … @name- Declares a runtime or LLVM helper whose body is provided elsewhere.
numeric label- Starts an LLVM basic block. Every branch names one of these labels as its destination.
%0, %1, …- Names an SSA value. Each name is assigned once, allowing LLVM to trace definitions and uses directly.
alloca- Reserves a stack slot for a local value, return area, or temporary aggregate.
getelementptr- Calculates the address of a field or indexed element while preserving LLVM's type and bounds information.
load- Copies a typed value from memory into an SSA value.
store- Copies an SSA value into a stack slot, object field, return area, or runtime structure.
icmp- Compares integers or pointers and produces the one-bit condition consumed by a branch or select.
br- Transfers control to another block. With an
i1operand it chooses between two destinations. select- Chooses one of two SSA values from a condition, which can become a branch-free machine instruction.
call- Invokes a generated function, a runtime helper, a host callback, or an LLVM intrinsic.
extractvalue- Reads one field from an SSA aggregate, such as the result and overflow bit returned together.
insertvalue- Builds an SSA aggregate one field at a time.
ptrtoint- Encodes a pointer as an integer field inside Luce's uniform runtime value representation.
inttoptr- Recovers a pointer from the integer field of Luce's uniform runtime value representation.
zext- Widens an unsigned value by filling the new high bits with zero.
trunc- Keeps the low bits while converting to a narrower integer representation.
lshr- Shifts bits right and fills the high side with zero; this is useful for unpacking handle fields.
and- Combines or masks bits, often to inspect a flag in a packed handle or status value.
or- Sets or combines bits in a packed value.
sub- Subtracts integer values; the generated entry code also uses it to update the call-depth budget.
mul- Multiplies integers after the language-specific checks have been represented.
ret- Returns a status or value and ends the current basic block.
@llvm.sadd.with.overflow.i64- Returns a signed sum together with the overflow bit required by checked addition.
@llvm.memcpy.inline- Copies a small fixed-size value representation; LLVM can expand it directly for the target.
@luce_rt_open- Creates the per-run runtime state and installs the table used to turn function numbers into source-aware traces.
@luce_rt_close- Closes the per-run runtime state after the final status and reports have been collected.
@luce_rt_args_list- Builds the owned
list[str]passed tomainfrom the host's argument callbacks. @luce_rt_status- Combines the generated function result with runtime trap, error, exhaustion, and exit state.
@luce_rt_report_error- Sends an uncaught recoverable error through the host's error-report callback.
@luce_rt_report- Sends the completed trap report through the host callback selected by the entry wrapper.
@luce_rt_leaked- Reads the live-object count used to detect references that remain after program cleanup.
@luce_rt_exhaust- Records allocation exhaustion in the current run so the entry wrapper returns the corresponding status.
@luce_rt_raise- Records a source-aware trap in the runtime so every execution path reports the same code and location.
@luce_rt_unwound- Adds one generated function frame while a trap or uncaught error travels toward the entry point.
@luce_rt_retain- Adds a strong owner to a runtime object handle.
@luce_rt_release- Removes a strong owner and triggers destruction at zero.
@luce_rt_drop_storage- Releases reference-bearing fields in a temporary runtime value.
@luce_rt_str- Converts a uniform runtime value into owned UTF-8 text.
@luce_rt_class_make- Allocates and initializes storage for a class identity.
@luce_rt_class_get- Loads a field from class storage after validating the object handle.
@luce_rt_class_set- Replaces a class field while applying retain-before-release ownership order.
@luce_rt_files_install- Copies file-related callbacks from the host table into the current runtime context.
@luce_rt_sockets_install- Copies network callbacks from the host table into the current runtime context.
@luce_rt_graphics_install- Copies window and graphics callbacks from the host table into the current runtime context.
!prof- Attaches branch-probability metadata so LLVM can place common and failure paths efficiently.
; ModuleID = '/Users/sedov/Dev/luciaos/www/lucelang/examples/classes.luc'
source_filename = "/Users/sedov/Dev/luciaos/www/lucelang/examples/classes.luc"
target triple = "arm64-apple-darwin24.6.0"
@luce.text.0 = private unnamed_addr constant [0 x i8] zeroinitializer
@luce.text.1 = private unnamed_addr constant [21 x i8] c"null object reference"
@luce.text.2 = private unnamed_addr constant [22 x i8] c"object used after free"
@luce.text.3 = private unnamed_addr constant [19 x i8] c"call depth exceeded"
@luce.text.4 = private unnamed_addr constant [24 x i8] c"host service unavailable"
@luce.text.5 = private unnamed_addr constant [16 x i8] c"integer overflow"
@luce.text.6 = private unnamed_addr constant [4 x i8] c"main"
@luce.text.7 = private unnamed_addr constant [58 x i8] c"/Users/sedov/Dev/luciaos/www/lucelang/examples/classes.luc"
@luce.origins.0 = private constant [20 x { i32, i32 }] [{ i32, i32 } { i32 12, i32 5 }, { i32, i32 } { i32 12, i32 5 }, { i32, i32 } { i32 12, i32 5 }, { i32, i32 } { i32 12, i32 5 }, { i32, i32 } { i32 13, i32 5 }, { i32, i32 } { i32 13, i32 5 }, { i32, i32 } { i32 13, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }, { i32, i32 } { i32 14, i32 5 }]
@luce.text.8 = private unnamed_addr constant [12 x i8] c"Counter.next"
@luce.origins.1 = private constant [8 x { i32, i32 }] [{ i32, i32 } { i32 8, i32 9 }, { i32, i32 } { i32 8, i32 9 }, { i32, i32 } { i32 8, i32 9 }, { i32, i32 } { i32 8, i32 9 }, { i32, i32 } { i32 8, i32 9 }, { i32, i32 } { i32 9, i32 9 }, { i32, i32 } { i32 9, i32 9 }, { i32, i32 } { i32 9, i32 9 }]
@luce.text.9 = private unnamed_addr constant [12 x i8] c"Counter.init"
@luce.origins.2 = private constant [7 x { i32, i32 }] [{ i32, i32 } { i32 5, i32 1 }, { i32, i32 } { i32 5, i32 1 }, { i32, i32 } { i32 5, i32 9 }, { i32, i32 } { i32 5, i32 9 }, { i32, i32 } { i32 5, i32 1 }, { i32, i32 } { i32 5, i32 1 }, { i32, i32 } { i32 5, i32 1 }]
@luce.functions = private constant [3 x { ptr, i64, ptr, i64, ptr, i64 }] [{ ptr, i64, ptr, i64, ptr, i64 } { ptr @luce.text.6, i64 4, ptr @luce.text.7, i64 58, ptr @luce.origins.0, i64 20 }, { ptr, i64, ptr, i64, ptr, i64 } { ptr @luce.text.8, i64 12, ptr @luce.text.7, i64 58, ptr @luce.origins.1, i64 8 }, { ptr, i64, ptr, i64, ptr, i64 } { ptr @luce.text.9, i64 12, ptr @luce.text.7, i64 58, ptr @luce.origins.2, i64 7 }]
@luce_artifact = constant { i64, i64, i64, i32, i32, i32, i32, { i32, [52 x i8] } } { i64 23734338332087628, i64 0, i64 -7092229304759745108, i32 3, i32 29, i32 1, i32 0, { i32, [52 x i8] } { i32 18, [52 x i8] c"aarch64-macos-none\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" } }
define internal i32 @luce.0.main(ptr align 8 nocapture readonly nonnull dereferenceable(472) noundef %0, ptr align 8 nocapture nonnull noundef %1, i64 noundef %2, i64 %3) {
4:
%5 = alloca i64, align 8
%6 = alloca i64, align 8
%7 = alloca i64, align 8
%8 = alloca i64, align 8
%9 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
store i64 %3, ptr %5, align 8
store i64 4294967295, ptr %6, align 8
store i64 4294967295, ptr %7, align 8
store i64 4294967295, ptr %8, align 8
%10 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 0
store i8 4, ptr %10, align 1
%11 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 1
store i8 -1, ptr %11, align 1
%12 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 0
%13 = ptrtoint ptr %12 to i64
%14 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
store i64 %13, ptr %14, align 8
%15 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 1
%16 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 4
store i64 %15, ptr %16, align 8
%17 = sub nsw i64 %2, 1
%18 = alloca i64, align 8
%19 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%20 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %19, i32 0, i32 0
store i8 6, ptr %20, align 1
%21 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %19, i32 0, i32 4
store i64 0, ptr %21, align 8
%22 = alloca i64, align 8
%23 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%24 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %23, i32 0, i32 0
store i8 2, ptr %24, align 1
%25 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %23, i32 0, i32 4
store i64 0, ptr %25, align 8
%26 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%27 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%28 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%29 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %28, i32 0, i32 0
store i8 6, ptr %29, align 1
%30 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %28, i32 0, i32 4
store i64 0, ptr %30, align 8
%31 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%32 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %31, i32 0, i32 0
store i8 6, ptr %32, align 1
%33 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %31, i32 0, i32 4
store i64 0, ptr %33, align 8
br label %34
34:
%35 = load i64, ptr %5, align 8
%36 = trunc i64 %35 to i32
%37 = lshr i64 %35, 32
%38 = trunc i64 %37 to i32
%39 = icmp eq i32 %36, -1
br i1 %39, label %40, label %43, !prof !0
40:
%41 = extractvalue { ptr, i64 } { ptr @luce.text.1, i64 21 }, 0
%42 = extractvalue { ptr, i64 } { ptr @luce.text.1, i64 21 }, 1
call void @luce_rt_raise(ptr %1, i32 14, ptr %41, i64 %42)
call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
ret i32 1
43:
%44 = getelementptr inbounds i8, ptr %1, i64 96
%45 = load ptr, ptr %44, align 8!alias.scope !1, !noalias !2
%46 = zext i32 %36 to i64
%47 = mul nsw i64 %46, 112
%48 = getelementptr inbounds i8, ptr %45, i64 %47
%49 = getelementptr inbounds i8, ptr %48, i64 96
%50 = load i32, ptr %49, align 4, !alias.scope !1, !noalias !2
%51 = icmp ne i32 %50, %38
br i1 %51, label %52, label %55, !prof !0
52:
%53 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 0
%54 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 1
call void @luce_rt_raise(ptr %1, i32 13, ptr %53, i64 %54)
call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
ret i32 1
55:
%56 = and i32 %50, 1
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %61, !prof !0
58:
%59 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 0
%60 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 1
call void @luce_rt_raise(ptr %1, i32 13, ptr %59, i64 %60)
call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
ret i32 1
61:
%62 = getelementptr inbounds i8, ptr %48, i64 16
%63 = load i64, ptr %62, align 8!alias.scope !1, !noalias !2
%64 = load ptr, ptr %48, align 8, !alias.scope !1, !noalias !2
%65 = icmp slt i64 %17, 1
br i1 %65, label %66, label %69, !prof !0
66:
%67 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 19 }, 0
%68 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 19 }, 1
call void @luce_rt_raise(ptr %1, i32 6, ptr %67, i64 %68)
call void @luce_rt_unwound(ptr %1, i32 0, i32 2)
ret i32 1
69:
%70 = call i32 @luce.2.Counter.init(ptr %0, ptr %1, i64 %17, i64 %63, ptr %18)
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %73, !prof !0
72:
call void @luce_rt_unwound(ptr %1, i32 0, i32 2)
ret i32 1
73:
%74 = load i64, ptr %18, align 8
store i64 %74, ptr %7, align 8
%75 = load i64, ptr %7, align 8
%76 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %19, i32 0, i32 3
store i64 %75, ptr %76, align 8
%77 = call i32 @luce_rt_retain(ptr %1, ptr %19)
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %80, !prof !0
79:
call void @luce_rt_unwound(ptr %1, i32 0, i32 5)
ret i32 1
80:
store i64 %75, ptr %8, align 8
%81 = load i64, ptr %8, align 8
%82 = icmp slt i64 %17, 1
br i1 %82, label %83, label %86, !prof !0
83:
%84 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 19 }, 0
%85 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 19 }, 1
call void @luce_rt_raise(ptr %1, i32 6, ptr %84, i64 %85)
call void @luce_rt_unwound(ptr %1, i32 0, i32 8)
ret i32 1
86:
%87 = call i32 @luce.1.Counter.next(ptr %0, ptr %1, i64 %17, i64 %81, ptr %22)
%88 = icmp ne i32 %87, 0
br i1 %88, label %89, label %90, !prof !0
89:
call void @luce_rt_unwound(ptr %1, i32 0, i32 8)
ret i32 1
90:
%91 = load i64, ptr %22, align 8
%92 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %23, i32 0, i32 3
store i64 %91, ptr %92, align 8
%93 = call i32 @luce_rt_str(ptr %1, ptr %23, ptr %26)
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %96, !prof !0
95:
call void @luce_rt_unwound(ptr %1, i32 0, i32 9)
ret i32 1
96:
%97 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %26, i32 0, i32 3
%98 = load i64, ptr %97, align 8
%99 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %26, i32 0, i32 1
%100 = load i8, ptr %99, align 1
%101 = icmp eq i8 %100, -1
%102 = inttoptr i64 %98 to ptr
%103 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %26, i32 0, i32 2
%104 = select i1 %101, ptr %102, ptr %103
%105 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %26, i32 0, i32 4
%106 = load i64, ptr %105, align 8
%107 = zext i8 %100 to i64
%108 = select i1 %101, i64 %106, i64 %107
%109 = insertvalue { ptr, i64 } poison, ptr %104, 0
%110 = insertvalue { ptr, i64 } %109, i64 %108, 1
call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %9, ptr align 8 %26, i64 24, i1 false)
%111 = extractvalue { ptr, i64 } %110, 0
%112 = extractvalue { ptr, i64 } %110, 1
%113 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 1
%114 = load ptr, ptr %113, align 8
%115 = icmp eq ptr %114, null
br i1 %115, label %116, label %119, !prof !0
116:
%117 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 24 }, 0
%118 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 24 }, 1
call void @luce_rt_raise(ptr %1, i32 9, ptr %117, i64 %118)
call void @luce_rt_unwound(ptr %1, i32 0, i32 11)
ret i32 1
119:
%120 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 0
%121 = load ptr, ptr %120, align 8
%122 = call i32 %114(ptr %121, ptr %111, i64 %112)
%123 = icmp eq i32 %122, -1
br i1 %123, label %124, label %125, !prof !0
124:
call void @luce_rt_exhaust(ptr %1)
ret i32 1
125:
%126 = icmp ne i32 %122, 0
%127 = icmp ne i32 %122, 1
%128 = and i1 %126, %127
br i1 %128, label %129, label %132, !prof !0
129:
%130 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 24 }, 0
%131 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 24 }, 1
call void @luce_rt_raise(ptr %1, i32 9, ptr %130, i64 %131)
call void @luce_rt_unwound(ptr %1, i32 0, i32 11)
ret i32 1
132:
%133 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
%134 = load i64, ptr %133, align 8
%135 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 1
%136 = load i8, ptr %135, align 1
%137 = icmp eq i8 %136, -1
%138 = inttoptr i64 %134 to ptr
%139 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 2
%140 = select i1 %137, ptr %138, ptr %139
%141 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 4
%142 = load i64, ptr %141, align 8
%143 = zext i8 %136 to i64
%144 = select i1 %137, i64 %142, i64 %143
%145 = insertvalue { ptr, i64 } poison, ptr %140, 0
%146 = insertvalue { ptr, i64 } %145, i64 %144, 1
call void @luce_rt_drop_storage(ptr %1, ptr %9, ptr %27)
%147 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %27, i32 0, i32 3
%148 = load i64, ptr %147, align 8
%149 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %27, i32 0, i32 1
%150 = load i8, ptr %149, align 1
%151 = icmp eq i8 %150, -1
%152 = inttoptr i64 %148 to ptr
%153 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %27, i32 0, i32 2
%154 = select i1 %151, ptr %152, ptr %153
%155 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %27, i32 0, i32 4
%156 = load i64, ptr %155, align 8
%157 = zext i8 %150 to i64
%158 = select i1 %151, i64 %156, i64 %157
%159 = insertvalue { ptr, i64 } poison, ptr %154, 0
%160 = insertvalue { ptr, i64 } %159, i64 %158, 1
call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %9, ptr align 8 %27, i64 24, i1 false)
%161 = load i64, ptr %8, align 8
%162 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %28, i32 0, i32 3
store i64 %161, ptr %162, align 8
%163 = call i32 @luce_rt_release(ptr %1, ptr %28)
%164 = icmp ne i32 %163, 0
br i1 %164, label %165, label %166, !prof !0
165:
call void @luce_rt_unwound(ptr %1, i32 0, i32 16)
ret i32 1
166:
%167 = load i64, ptr %7, align 8
%168 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %31, i32 0, i32 3
store i64 %167, ptr %168, align 8
%169 = call i32 @luce_rt_release(ptr %1, ptr %31)
%170 = icmp ne i32 %169, 0
br i1 %170, label %171, label %172, !prof !0
171:
call void @luce_rt_unwound(ptr %1, i32 0, i32 18)
ret i32 1
172:
ret i32 0
}
define internal i32 @luce.1.Counter.next(ptr align 8 nocapture readonly nonnull dereferenceable(472) noundef %0, ptr align 8 nocapture nonnull noundef %1, i64 noundef %2, i64 %3, ptr align 8 nocapture nonnull dereferenceable(8) writeonly noundef %4) {
5:
%6 = alloca i64, align 8
store i64 %3, ptr %6, align 8
%7 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%8 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 0
store i8 6, ptr %8, align 1
%9 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 4
store i64 0, ptr %9, align 8
%10 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%11 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%12 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %11, i32 0, i32 0
store i8 6, ptr %12, align 1
%13 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %11, i32 0, i32 4
store i64 0, ptr %13, align 8
%14 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%15 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %14, i32 0, i32 0
store i8 2, ptr %15, align 1
%16 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %14, i32 0, i32 4
store i64 0, ptr %16, align 8
%17 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%18 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %17, i32 0, i32 0
store i8 6, ptr %18, align 1
%19 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %17, i32 0, i32 4
store i64 0, ptr %19, align 8
%20 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
br label %21
21:
%22 = load i64, ptr %6, align 8
%23 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 3
store i64 %22, ptr %23, align 8
%24 = call i32 @luce_rt_class_get(ptr %1, ptr %7, i64 0, i64 0, ptr %10)
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %27, !prof !0
26:
call void @luce_rt_unwound(ptr %1, i32 1, i32 2)
ret i32 1
27:
%28 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 3
%29 = load i64, ptr %28, align 8
%30 = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %29, i64 1)
%31 = extractvalue { i64, i1 } %30, 0
%32 = extractvalue { i64, i1 } %30, 1
br i1 %32, label %33, label %36, !prof !0
33:
%34 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 16 }, 0
%35 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 16 }, 1
call void @luce_rt_raise(ptr %1, i32 0, ptr %34, i64 %35)
call void @luce_rt_unwound(ptr %1, i32 1, i32 3)
ret i32 1
36:
%37 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %11, i32 0, i32 3
store i64 %22, ptr %37, align 8
%38 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %14, i32 0, i32 3
store i64 %31, ptr %38, align 8
%39 = call i32 @luce_rt_class_set(ptr %1, ptr %11, i64 0, i64 0, ptr %14)
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %42, !prof !0
41:
call void @luce_rt_unwound(ptr %1, i32 1, i32 4)
ret i32 1
42:
%43 = load i64, ptr %6, align 8
%44 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %17, i32 0, i32 3
store i64 %43, ptr %44, align 8
%45 = call i32 @luce_rt_class_get(ptr %1, ptr %17, i64 0, i64 0, ptr %20)
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %48, !prof !0
47:
call void @luce_rt_unwound(ptr %1, i32 1, i32 6)
ret i32 1
48:
%49 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %20, i32 0, i32 3
%50 = load i64, ptr %49, align 8
store i64 %50, ptr %4, align 8
ret i32 0
}
define internal i32 @luce.2.Counter.init(ptr align 8 nocapture readonly nonnull dereferenceable(472) noundef %0, ptr align 8 nocapture nonnull noundef %1, i64 noundef %2, i64 %3, ptr align 8 nocapture nonnull dereferenceable(8) writeonly noundef %4) {
5:
%6 = alloca i64, align 8
%7 = alloca i64, align 8
store i64 %3, ptr %6, align 8
store i64 0, ptr %7, align 8
%8 = alloca { i8, i8, [6 x i8], i64, i64 },i64 1, align 8
%9 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i64 0
%10 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 0
store i8 2, ptr %10, align 1
%11 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 4
store i64 0, ptr %11, align 8
%12 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
br label %13
13:
store i64 0, ptr %7, align 8
%14 = load i64, ptr %6, align 8
store i64 %14, ptr %7, align 8
%15 = load i64, ptr %7, align 8
%16 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
store i64 %15, ptr %16, align 8
%17 = call i32 @luce_rt_class_make(ptr %1, i64 0, i64 -1, ptr %8, i64 1, ptr %12)
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20, !prof !0
19:
call void @luce_rt_unwound(ptr %1, i32 2, i32 5)
ret i32 1
20:
%21 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %12, i32 0, i32 3
%22 = load i64, ptr %21, align 8
store i64 %22, ptr %4, align 8
ret i32 0
}
; Function Attrs: nounwind cold willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @luce_rt_raise(ptr nocapture nonnull noundef %0, i32 %1, ptr nocapture readonly %2, i64 %3) #0
; Function Attrs: nounwind cold willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @luce_rt_unwound(ptr nocapture nonnull noundef %0, i32 %1, i32 %2) #0
; Function Attrs: nounwind willreturn memory(readwrite)
declare i32 @luce_rt_retain(ptr nocapture nonnull noundef %0, ptr align 8 nocapture readonly nonnull dereferenceable(24) noundef %1) #1
; Function Attrs: nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: readwrite)
declare i32 @luce_rt_str(ptr nocapture nonnull noundef %0, ptr align 8 nocapture readonly nonnull dereferenceable(24) noundef %1, ptr align 8 nocapture nonnull dereferenceable(24) writeonly noundef %2) #2
; Function Attrs: nounwind willreturn nofree nocallback memory(argmem: readwrite)
declare void @llvm.memcpy.inline.p0.p0.i64(ptr noalias nocapture writeonly %0, ptr noalias nocapture readonly %1, i64 %2, i1 immarg %3) #3
; Function Attrs: nounwind cold willreturn memory(argmem: write)
declare void @luce_rt_exhaust(ptr nocapture nonnull noundef %0) #4
; Function Attrs: nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @luce_rt_drop_storage(ptr nocapture nonnull noundef %0, ptr align 8 nocapture readonly nonnull dereferenceable(24) noundef %1, ptr align 8 nocapture nonnull dereferenceable(24) writeonly noundef %2) #5
; Function Attrs: nounwind memory(readwrite)
declare i32 @luce_rt_release(ptr nocapture nonnull noundef %0, ptr align 8 nocapture readonly nonnull dereferenceable(24) noundef %1) #6
; Function Attrs: nounwind willreturn memory(read, argmem: readwrite)
declare i32 @luce_rt_class_get(ptr nocapture nonnull noundef %0, ptr align 8 nocapture readonly nonnull dereferenceable(24) noundef %1, i64 %2, i64 %3, ptr align 8 nocapture nonnull dereferenceable(24) writeonly noundef %4) #7
; Function Attrs: nounwind speculatable willreturn nofree nosync nocallback memory(none)
declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %0, i64 %1) #8
; Function Attrs: nounwind memory(readwrite)
declare i32 @luce_rt_class_set(ptr nocapture nonnull noundef %0, ptr align 8 nocapture readonly nonnull dereferenceable(24) noundef %1, i64 %2, i64 %3, ptr align 8 nocapture readonly nonnull dereferenceable(24) noundef %4) #6
; Function Attrs: nounwind memory(readwrite)
declare i32 @luce_rt_class_make(ptr nocapture nonnull noundef %0, i64 %1, i64 %2, ptr align 8 nocapture readonly nonnull noundef %3, i64 %4, ptr align 8 nocapture nonnull dereferenceable(24) writeonly noundef %5) #6
define i32 @luce_main(ptr align 8 nocapture readonly nonnull dereferenceable(472) noundef %0) {
1:
%2 = alloca i64, align 8
%3 = alloca i32, align 8
store i64 256, ptr %2, align 8
%4 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 0
%5 = load ptr, ptr %4, align 8
%6 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 14
%7 = load ptr, ptr %6, align 8
%8 = icmp eq ptr %7, null
br i1 %8, label %11, label %9
9:
%10 = call i64 %7(ptr %5)
store i64 %10, ptr %2, align 8
br label %11
11:
%12 = load i64, ptr %2, align 8
%13 = call ptr @luce_rt_open(ptr @luce.functions, i64 3)
%14 = icmp eq ptr %13, null
br i1 %14, label %15, label %16, !prof !0
15:
ret i32 2
16:
%17 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 28
%18 = load ptr, ptr %17, align 8
%19 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 54
%20 = load ptr, ptr %19, align 8
%21 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 55
%22 = load ptr, ptr %21, align 8
%23 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 56
%24 = load ptr, ptr %23, align 8
%25 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 57
%26 = load ptr, ptr %25, align 8
%27 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 58
%28 = load ptr, ptr %27, align 8
%29 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 29
%30 = load ptr, ptr %29, align 8
%31 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 30
%32 = load ptr, ptr %31, align 8
%33 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 31
%34 = load ptr, ptr %33, align 8
%35 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 32
%36 = load ptr, ptr %35, align 8
call void @luce_rt_files_install(ptr %13, ptr %5, ptr %18, ptr %20, ptr %22, ptr %24, ptr %26, ptr %28, ptr %30, ptr %32, ptr %34, ptr %36)
%37 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 48
%38 = load ptr, ptr %37, align 8
%39 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 49
%40 = load ptr, ptr %39, align 8
%41 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 50
%42 = load ptr, ptr %41, align 8
%43 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 51
%44 = load ptr, ptr %43, align 8
%45 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 52
%46 = load ptr, ptr %45, align 8
call void @luce_rt_sockets_install(ptr %13, ptr %5, ptr %38, ptr %40, ptr %42, ptr %44, ptr %46)
%47 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 40
%48 = load ptr, ptr %47, align 8
%49 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 41
%50 = load ptr, ptr %49, align 8
%51 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 42
%52 = load ptr, ptr %51, align 8
%53 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 43
%54 = load ptr, ptr %53, align 8
%55 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 44
%56 = load ptr, ptr %55, align 8
%57 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 45
%58 = load ptr, ptr %57, align 8
%59 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 46
%60 = load ptr, ptr %59, align 8
%61 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 47
%62 = load ptr, ptr %61, align 8
call void @luce_rt_graphics_install(ptr %13, ptr %5, ptr %48, ptr %50, ptr %52, ptr %54, ptr %56, ptr %58, ptr %60, ptr %62)
%63 = icmp slt i64 %12, 1
br i1 %63, label %64, label %65, !prof !0
64:
call void @luce_rt_raise(ptr %13, i32 6, ptr @luce.text.3, i64 19)
store i32 1, ptr %3, align 8
br label %73
65:
%66 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%67 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 4
%68 = load ptr, ptr %67, align 8
%69 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 5
%70 = load ptr, ptr %69, align 8
%71 = call i32 @luce_rt_args_list(ptr %13, ptr %5, ptr %68, ptr %70, ptr %66)
%72 = icmp ne i32 %71, 0
br i1 %72, label %77, label %78, !prof !0
73:
%74 = load i32, ptr %3, align 8
%75 = icmp eq i32 %74, 1
%76 = icmp eq i32 %74, 2
br i1 %75, label %83, label %86, !prof !0
77:
store i32 1, ptr %3, align 8
br label %73
78:
%79 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %66, i32 0, i32 3
%80 = load i64, ptr %79, align 8
%81 = call i32 @luce.0.main(ptr %0, ptr %13, i64 %12, i64 %80)
store i32 %81, ptr %3, align 8
%82 = call i32 @luce_rt_release(ptr %13, ptr %66)
br label %73
83:
%84 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 2
%85 = load ptr, ptr %84, align 8
call void @luce_rt_report(ptr %13, ptr %5, ptr %85)
br label %86
86:
br i1 %76, label %87, label %90, !prof !0
87:
%88 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 15
%89 = load ptr, ptr %88, align 8
call void @luce_rt_report_error(ptr %13, ptr %5, ptr %89)
br label %90
90:
%91 = call i32 @luce_rt_status(ptr %13, i32 %74)
%92 = icmp eq i32 %91, 2
%93 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 3
%94 = load ptr, ptr %93, align 8
%95 = icmp eq ptr %94, null
%96 = or i1 %95, %92
br i1 %96, label %97, label %98
97:
call void @luce_rt_close(ptr %13)
ret i32 %91
98:
%99 = call i64 @luce_rt_leaked(ptr %13)
call void %94(ptr %5, i64 %99)
br label %97
}
; Function Attrs: nounwind willreturn memory(argmem: read, inaccessiblemem: readwrite)
declare noalias ptr @luce_rt_open(ptr readonly %0, i64 %1) #9
; Function Attrs: nounwind willreturn memory(argmem: readwrite)
declare void @luce_rt_files_install(ptr nocapture nonnull noundef %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr %5, ptr %6, ptr %7, ptr %8, ptr %9, ptr %10, ptr %11) #10
; Function Attrs: nounwind willreturn memory(readwrite)
declare void @luce_rt_sockets_install(ptr nocapture nonnull noundef %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr %5, ptr %6) #1
; Function Attrs: nounwind willreturn memory(argmem: readwrite)
declare void @luce_rt_graphics_install(ptr nocapture nonnull noundef %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr %5, ptr %6, ptr %7, ptr %8, ptr %9) #10
; Function Attrs: nounwind memory(readwrite)
declare i32 @luce_rt_args_list(ptr nocapture nonnull noundef %0, ptr %1, ptr %2, ptr %3, ptr align 8 nocapture nonnull dereferenceable(24) writeonly noundef %4) #6
; Function Attrs: cold
declare void @luce_rt_report(ptr nocapture nonnull noundef %0, ptr %1, ptr %2) #11
; Function Attrs: cold
declare void @luce_rt_report_error(ptr nocapture nonnull noundef %0, ptr %1, ptr %2) #11
; Function Attrs: nounwind willreturn memory(argmem: read)
declare i32 @luce_rt_status(ptr nocapture nonnull noundef %0, i32 %1) #12
; Function Attrs: nounwind willreturn memory(argmem: read)
declare i64 @luce_rt_leaked(ptr nocapture nonnull noundef %0) #12
; Function Attrs: nounwind memory(readwrite)
declare void @luce_rt_close(ptr nocapture nonnull noundef %0) #6
attributes #0 = { nounwind cold willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #1 = { nounwind willreturn memory(readwrite) }
attributes #2 = { nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: readwrite) }
attributes #3 = { nounwind willreturn nofree nocallback memory(argmem: readwrite) }
attributes #4 = { nounwind cold willreturn memory(argmem: write) }
attributes #5 = { nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #6 = { nounwind memory(readwrite) }
attributes #7 = { nounwind willreturn memory(read, argmem: readwrite) }
attributes #8 = { nounwind speculatable willreturn nofree nosync nocallback memory(none) }
attributes #9 = { nounwind willreturn memory(argmem: read, inaccessiblemem: readwrite) }
attributes #10 = { nounwind willreturn memory(argmem: readwrite) }
attributes #11 = { cold }
attributes #12 = { nounwind willreturn memory(argmem: read) }
!0 = !{!"branch_weights", i32 1, i32 2000}
!1 = !{!3}
!2 = !{!4}
!3 = !{!"luce.rows", !5}
!4 = !{!"luce.elements", !5}
!5 = !{!"luce.alias"}
ARM64 object code. LLVM selected these instructions, registers, calls, and branch conditions for this target.
open assembly fileARM64 instruction guide hover, focus, or tap dotted terms
x8 is a 64-bit register; w8 is its low 32 bits. A leading # marks a constant, brackets describe a memory address, and conditional instructions read the processor flags set by the preceding arithmetic or comparison.
Hover or focus a dotted term in the file for its explanation. On a touch screen, tap a term to keep the note open and tap elsewhere to close it. The list includes the operations that appear in this file.
mov- Copies a register value or loads a small constant. Calls also use it to place arguments in the required registers.
add- Adds registers or a constant. Address setup and stack restoration frequently use this instruction.
sub- Subtracts registers or a constant. Function prologues use it to reserve stack space.
adds- Adds and updates the negative, zero, carry, and overflow flags for a following conditional instruction.
cmp- Performs a subtraction solely to set condition flags; a following branch or select consumes those flags.
cmn- Performs an addition solely to set condition flags. The checked multiply-by-two path uses it to recognize unsafe inputs.
csel- Selects one of two registers from the current condition flags. The clamp uses it to choose the doubled value or limit.
ldr- Loads a register from memory using a scaled address offset.
str- Stores one register into memory using a scaled address offset.
ldp- Loads two adjacent registers, often restoring saved registers or reading neighboring fields.
stp- Stores two adjacent registers, often saving the caller's registers in a function prologue.
ldur- Loads from an unscaled byte offset, which is useful for stack slots below the frame pointer.
stur- Stores to an unscaled byte offset, which is useful for stack slots below the frame pointer.
ldrb- Loads one byte and widens it into a register.
strb- Stores the low byte of a register.
sturb- Stores one byte using an unscaled byte offset.
strh- Stores the low 16 bits of a register.
adrp- Loads the page address of a symbol. The linker fills in the final page-relative relocation.
bl- Calls a direct target and records the return address in
x30. blr- Calls the function address held in a register, as required for host callbacks and function values.
b- Jumps to another instruction address.
b.eq- Branches when the previous comparison reported equality.
b.ne- Branches when the previous comparison reported different values.
b.le- Branches when the signed left operand was smaller or equal.
b.hs- Branches when an unsigned comparison found higher-or-same, represented by a set carry flag.
b.vs- Branches when the arithmetic overflow flag is set.
cbz- Compares a register with zero and branches when it is zero.
cbnz- Compares a register with zero and branches when it contains a nonzero value.
tbnz- Tests one selected bit and branches when that bit is set; packed runtime flags use this form.
lsr- Shifts bits right and fills with zero, often extracting the upper field of a packed handle.
umaddl- Widens two 32-bit unsigned operands, multiplies them, and adds a 64-bit base address.
orr- Combines bits, commonly setting tag or flag bits in a packed value.
ret- Returns to the address in
x30and ends the current machine function.
/Users/sedov/Dev/luciaos/www/lucelang/out/traces/classes.o: file format mach-o arm64
Disassembly of section __TEXT,__text:
0000000000000000 <ltmp0>:
; luce_main():
0: stp x26, x25, [sp, #-0x50]!
4: stp x24, x23, [sp, #0x10]
8: stp x22, x21, [sp, #0x20]
c: stp x20, x19, [sp, #0x30]
10: stp x29, x30, [sp, #0x40]
14: add x29, sp, #0x40
18: sub sp, sp, #0x140
1c: mov x19, sp
20: ldr x8, [x0, #0x70]
24: ldr x20, [x0]
28: mov x21, x0
2c: cbz x8, 0x338 <ltmp0+0x338>
30: mov x0, x20
34: blr x8
38: mov x24, x0
3c: adrp x0, 0x0 <ltmp0>
40: add x0, x0, #0x0
44: mov w1, #0x3 ; =3
48: bl 0x48 <ltmp0+0x48>
4c: cbz x0, 0x350 <ltmp0+0x350>
50: ldp x3, x4, [x21, #0x1b0]
54: mov x22, x0
58: ldp x5, x6, [x21, #0x1c0]
5c: ldr x2, [x21, #0xe0]
60: ldp x8, x9, [x21, #0xf8]
64: ldr x7, [x21, #0x1d0]
68: ldur q0, [x21, #0xe8]
6c: sub sp, sp, #0x20
70: mov x1, x20
74: stp x8, x9, [sp, #0x10]
78: str q0, [sp]
7c: bl 0x7c <ltmp0+0x7c>
80: add sp, sp, #0x20
84: ldp x2, x3, [x21, #0x180]
88: mov x0, x22
8c: ldp x4, x5, [x21, #0x190]
90: mov x1, x20
94: ldr x6, [x21, #0x1a0]
98: bl 0x98 <ltmp0+0x98>
9c: ldp x8, x9, [x21, #0x170]
a0: ldp x2, x3, [x21, #0x140]
a4: ldp x4, x5, [x21, #0x150]
a8: ldp x6, x7, [x21, #0x160]
ac: stp x8, x9, [sp, #-0x10]!
b0: mov x0, x22
b4: mov x1, x20
b8: bl 0xb8 <ltmp0+0xb8>
bc: add sp, sp, #0x10
c0: cmp x24, #0x0
c4: b.le 0x398 <ltmp0+0x398>
c8: sub x23, sp, #0x20
cc: mov sp, x23
d0: ldp x2, x3, [x21, #0x20]
d4: mov x0, x22
d8: mov x1, x20
dc: mov x4, x23
e0: bl 0xe0 <ltmp0+0xe0>
e4: cbnz w0, 0x480 <ltmp0+0x480>
e8: mov w8, #0xff04 ; =65284
ec: adrp x9, 0x0 <ltmp0>
f0: add x9, x9, #0x0
f4: strh w8, [x19, #0x90]
f8: mov w8, #0x2 ; =2
fc: strb w8, [x19, #0x60]
100: ldr x8, [x23, #0x8]
104: str x9, [x19, #0x98]
108: mov w9, #0x6 ; =6
10c: cmn w8, #0x1
110: strb w9, [x19, #0x78]
114: str xzr, [x19, #0x88]
118: str xzr, [x19, #0x70]
11c: strb w9, [x19, #0x18]
120: str xzr, [x19, #0x28]
124: strb w9, [x19]
128: str xzr, [x19, #0x10]
12c: b.eq 0x3b4 <ltmp0+0x3b4>
130: mov w9, #0x70 ; =112
134: ldr x10, [x22, #0x60]
138: umaddl x9, w8, w9, x10
13c: lsr x8, x8, #32
140: ldr w10, [x9, #0x60]
144: cmp w10, w8
148: b.ne 0x358 <ltmp0+0x358>
14c: tbnz w8, #0x0, 0x358 <ltmp0+0x358>
150: cmp x24, #0x1
154: b.eq 0x3dc <ltmp0+0x3dc>
158: ldr x9, [x9, #0x10]
15c: mov w8, #0x2 ; =2
160: sub x3, x29, #0x58
164: sub x5, x29, #0x70
168: mov x0, x22
16c: mov x1, xzr
170: mov x2, #-0x1 ; =-1
174: mov w4, #0x1 ; =1
178: sturb w8, [x29, #-0x58]
17c: stp x9, xzr, [x29, #-0x50]
180: bl 0x180 <ltmp0+0x180>
184: cbnz w0, 0x3f8 <ltmp0+0x3f8>
188: ldur x25, [x29, #-0x68]
18c: add x1, x19, #0x78
190: mov x0, x22
194: str x25, [x19, #0x80]
198: bl 0x198 <ltmp0+0x198>
19c: cbnz w0, 0x418 <ltmp0+0x418>
1a0: mov w8, #0x6 ; =6
1a4: mov w24, #0x2 ; =2
1a8: sub x1, x29, #0x58
1ac: sub x4, x29, #0x70
1b0: mov x0, x22
1b4: mov x2, xzr
1b8: mov x3, xzr
1bc: sturb w8, [x29, #-0x58]
1c0: sturb w8, [x29, #-0x88]
1c4: stur xzr, [x29, #-0x78]
1c8: sturb w24, [x29, #-0xa0]
1cc: stur xzr, [x29, #-0x90]
1d0: sturb w8, [x29, #-0xb8]
1d4: stur xzr, [x29, #-0xa8]
1d8: stp x25, xzr, [x29, #-0x50]
1dc: bl 0x1dc <ltmp0+0x1dc>
1e0: cbnz w0, 0x454 <ltmp0+0x454>
1e4: ldur x8, [x29, #-0x68]
1e8: adds x8, x8, #0x1
1ec: b.vs 0x428 <ltmp0+0x428>
1f0: sub x1, x29, #0x88
1f4: sub x4, x29, #0xa0
1f8: mov x0, x22
1fc: mov x2, xzr
200: mov x3, xzr
204: stur x25, [x29, #-0x80]
208: stur x8, [x29, #-0x98]
20c: bl 0x20c <ltmp0+0x20c>
210: cbnz w0, 0x448 <ltmp0+0x448>
214: sub x1, x29, #0xb8
218: add x4, x19, #0xb0
21c: mov x0, x22
220: mov x2, xzr
224: mov x3, xzr
228: stur x25, [x29, #-0xb0]
22c: bl 0x22c <ltmp0+0x22c>
230: cbnz w0, 0x450 <ltmp0+0x450>
234: ldr x8, [x19, #0xb8]
238: add x1, x19, #0x60
23c: add x2, x19, #0x48
240: mov x0, x22
244: str x8, [x19, #0x68]
248: bl 0x248 <ltmp0+0x248>
24c: cbnz w0, 0x4ac <ltmp0+0x4ac>
250: ldp x9, x10, [x19, #0x50]
254: ldur q0, [x19, #0x48]
258: ldr x8, [x21, #0x8]
25c: ldrb w11, [x19, #0x49]
260: str q0, [x19, #0x90]
264: str x10, [x19, #0xa0]
268: cbz x8, 0x370 <ltmp0+0x370>
26c: add x12, x19, #0x48
270: cmp w11, #0xff
274: ldr x0, [x21]
278: orr x12, x12, #0x2
27c: csel x2, x10, x11, eq
280: csel x1, x9, x12, eq
284: blr x8
288: cmn w0, #0x1
28c: b.eq 0x4bc <ltmp0+0x4bc>
290: cmp w0, #0x2
294: b.hs 0x370 <ltmp0+0x370>
298: add x1, x19, #0x90
29c: add x2, x19, #0x30
2a0: mov x0, x22
2a4: bl 0x2a4 <ltmp0+0x2a4>
2a8: add x1, x19, #0x18
2ac: mov x0, x22
2b0: str x25, [x19, #0x20]
2b4: bl 0x2b4 <ltmp0+0x2b4>
2b8: cbnz w0, 0x4c8 <ltmp0+0x4c8>
2bc: add x1, x19, #0x0
2c0: mov x0, x22
2c4: str x25, [x19, #0x8]
2c8: bl 0x2c8 <ltmp0+0x2c8>
2cc: cbnz w0, 0x4d8 <ltmp0+0x4d8>
2d0: mov x0, x22
2d4: mov x1, x23
2d8: bl 0x2d8 <ltmp0+0x2d8>
2dc: mov w1, wzr
2e0: mov x0, x22
2e4: bl 0x2e4 <ltmp0+0x2e4>
2e8: mov w23, w0
2ec: cmp w0, #0x2
2f0: b.eq 0x310 <ltmp0+0x310>
2f4: ldr x21, [x21, #0x18]
2f8: cbz x21, 0x310 <ltmp0+0x310>
2fc: mov x0, x22
300: bl 0x300 <ltmp0+0x300>
304: mov x1, x0
308: mov x0, x20
30c: blr x21
310: mov x0, x22
314: bl 0x314 <ltmp0+0x314>
318: mov w0, w23
31c: sub sp, x29, #0x40
320: ldp x29, x30, [sp, #0x40]
324: ldp x20, x19, [sp, #0x30]
328: ldp x22, x21, [sp, #0x20]
32c: ldp x24, x23, [sp, #0x10]
330: ldp x26, x25, [sp], #0x50
334: ret
338: mov w24, #0x100 ; =256
33c: adrp x0, 0x0 <ltmp0>
340: add x0, x0, #0x0
344: mov w1, #0x3 ; =3
348: bl 0x348 <ltmp0+0x348>
34c: cbnz x0, 0x50 <ltmp0+0x50>
350: mov w23, #0x2 ; =2
354: b 0x318 <ltmp0+0x318>
358: adrp x2, 0x0 <ltmp0>
35c: add x2, x2, #0x0
360: mov x0, x22
364: mov w1, #0xd ; =13
368: mov w3, #0x16 ; =22
36c: b 0x3c8 <ltmp0+0x3c8>
370: adrp x2, 0x0 <ltmp0>
374: add x2, x2, #0x0
378: mov x0, x22
37c: mov w1, #0x9 ; =9
380: mov w3, #0x18 ; =24
384: bl 0x384 <ltmp0+0x384>
388: mov x0, x22
38c: mov w1, wzr
390: mov w2, #0xb ; =11
394: b 0x470 <ltmp0+0x470>
398: adrp x2, 0x0 <ltmp0>
39c: add x2, x2, #0x0
3a0: mov x0, x22
3a4: mov w1, #0x6 ; =6
3a8: mov w3, #0x13 ; =19
3ac: bl 0x3ac <ltmp0+0x3ac>
3b0: b 0x480 <ltmp0+0x480>
3b4: adrp x2, 0x0 <ltmp0>
3b8: add x2, x2, #0x0
3bc: mov x0, x22
3c0: mov w1, #0xe ; =14
3c4: mov w3, #0x15 ; =21
3c8: bl 0x3c8 <ltmp0+0x3c8>
3cc: mov x0, x22
3d0: mov w1, wzr
3d4: mov w2, #0x1 ; =1
3d8: b 0x470 <ltmp0+0x470>
3dc: adrp x2, 0x0 <ltmp0>
3e0: add x2, x2, #0x0
3e4: mov x0, x22
3e8: mov w1, #0x6 ; =6
3ec: mov w3, #0x13 ; =19
3f0: bl 0x3f0 <ltmp0+0x3f0>
3f4: b 0x408 <ltmp0+0x408>
3f8: mov x0, x22
3fc: mov w1, #0x2 ; =2
400: mov w2, #0x5 ; =5
404: bl 0x404 <ltmp0+0x404>
408: mov x0, x22
40c: mov w1, wzr
410: mov w2, #0x2 ; =2
414: b 0x470 <ltmp0+0x470>
418: mov x0, x22
41c: mov w1, wzr
420: mov w2, #0x5 ; =5
424: b 0x470 <ltmp0+0x470>
428: adrp x2, 0x0 <ltmp0>
42c: add x2, x2, #0x0
430: mov x0, x22
434: mov w1, wzr
438: mov w3, #0x10 ; =16
43c: bl 0x43c <ltmp0+0x43c>
440: mov w24, #0x3 ; =3
444: b 0x454 <ltmp0+0x454>
448: mov w24, #0x4 ; =4
44c: b 0x454 <ltmp0+0x454>
450: mov w24, #0x6 ; =6
454: mov x0, x22
458: mov w1, #0x1 ; =1
45c: mov w2, w24
460: bl 0x460 <ltmp0+0x460>
464: mov x0, x22
468: mov w1, wzr
46c: mov w2, #0x8 ; =8
470: bl 0x470 <ltmp0+0x470>
474: mov x0, x22
478: mov x1, x23
47c: bl 0x47c <ltmp0+0x47c>
480: ldr x2, [x21, #0x10]
484: mov x0, x22
488: mov x1, x20
48c: bl 0x48c <ltmp0+0x48c>
490: mov w1, #0x1 ; =1
494: mov x0, x22
498: bl 0x498 <ltmp0+0x498>
49c: mov w23, w0
4a0: cmp w0, #0x2
4a4: b.ne 0x2f4 <ltmp0+0x2f4>
4a8: b 0x310 <ltmp0+0x310>
4ac: mov x0, x22
4b0: mov w1, wzr
4b4: mov w2, #0x9 ; =9
4b8: b 0x470 <ltmp0+0x470>
4bc: mov x0, x22
4c0: bl 0x4c0 <ltmp0+0x4c0>
4c4: b 0x474 <ltmp0+0x474>
4c8: mov x0, x22
4cc: mov w1, wzr
4d0: mov w2, #0x10 ; =16
4d4: b 0x470 <ltmp0+0x470>
4d8: mov x0, x22
4dc: mov w1, wzr
4e0: mov w2, #0x12 ; =18
4e4: b 0x470 <ltmp0+0x470>
Aliases share one object
firststable binding
strong ownersecondassignment retained
strong owneridentity + fields + class layout
strong 2Mutation through either alias is visible through the other. is compares class identity. A class may define an ordinary method when its domain needs field-based comparison.
Identity appears last
- Allocate construction stateField storage exists inside the initializer while the object is being built.
- Initialize fieldsMemberwise construction or one declared
initestablishes every field on every successful path. - Keep pre-identity
selflocalThe initializer may access stored fields while analysis prevents escape and instance-method calls. - Publish identityOnly a fully initialized object becomes the result of
new.
A fallible initializer can return through its error channel before identity is published. That path cleans initialized fields. When a class omits a custom initializer, memberwise construction supplies the public surface allowed by field visibility and defaults.
Stable names, mutable identity
A let class binding may call writing methods and replace fields because the name still denotes the same identity. Nested places and index operations follow ordinary assignment preparation and release order. A bound method retains its class receiver so it remains callable after the original binding leaves scope.
Weak back-edges break cycles
Class fields can hold weak optionals to supported ARC targets. The handle includes an object-table generation. Reusing a freed row changes that generation, so a stale weak read returns none. A successful read upgrades to an owned snapshot.
Last release and deinit
One bare deinit may perform deterministic cleanup. ARC calls it exactly once before releasing the object's stored fields. It runs on normal scope exit, error cleanup, trap teardown, and worker-local teardown. During deinit, semantic analysis prevents stores that would publish the dying self again.
The final-class model
Classes use composition for implementation reuse and interfaces for polymorphic calls. Their object layout, deinitialization, call targets, and ARC behavior are therefore determined from the declared class and its explicit conformances. Worker transfer accepts value graphs and collections, while class identities remain in their owning runtime.