Structures and value layout
A Point is two integers carried as one value. Copying the point copies its fields, and a method can compile down to arithmetic on those fields.
Follow one Point
The example constructs a point, calls moved, and adds the result fields. MIR names the structure layout and field operations. LLVM IR chooses concrete aggregate storage. Optimization can then flatten the whole value into registers before ARM64 sees it.
Luce source. Names and indentation describe the program for a reader.
open source file
struct Point:
x: i64
y: i64
func moved(dx: i64, dy: i64) -> Point:
return Point(x = self.x + dx, y = self.y + dy)
func main(args: list[str]):
let start = Point(x = len(args), y = 2)
let end = start.moved(3, 4)
print(str(end.x + end.y))
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.
struct NAME- Declares a value type whose fields are copied or retained as one aggregate.
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 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.
ret- Returns the current function's result to its caller and closes the current control-flow path.
struct Point:
x: i64
y: i64
func main(args: list[str]) -> None
local %1 (temporary): Point
local %2 start: Point
local %3 (temporary): Point
local %4 end: Point
local %5 (temporary): str
b0:
r0 = local_get %0
r1 = intrinsic len, r0
r2 = const 2
r3 = struct_make Point, r1, r2
local_set %2, r3
r5 = local_get %2
r6 = const 3
r7 = const 4
r8 = call Point.moved, r5, r6, r7
local_set %4, r8
r10 = local_get %4
r11 = struct_get r10, Point.x
r12 = local_get %4
r13 = struct_get r12, Point.y
r14 = add.i64 r11, r13
r15 = intrinsic str_value, r14
local_set %5, r15
intrinsic print, r15
r18 = local_get %5
r19 = intrinsic drop_storage, r18
local_set %5, r19
r21 = local_get %4
r22 = intrinsic drop_storage, r21
local_set %4, r22
r24 = local_get %2
r25 = intrinsic drop_storage, r24
local_set %2, r25
ret
func Point.moved(self: Point, dx: i64, dy: i64) -> Point
local %3 (temporary): Point
b0:
r0 = local_get %0
r1 = struct_get r0, Point.x
r2 = local_get %1
r3 = add.i64 r1, r2
r4 = local_get %0
r5 = struct_get r4, Point.y
r6 = local_get %2
r7 = add.i64 r5, r6
r8 = struct_make Point, r3, r7
ret r8
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_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_struct_make- Builds a value aggregate from typed fields while retaining any reference-bearing fields.
@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/structures.luc'
source_filename = "/Users/sedov/Dev/luciaos/www/lucelang/examples/structures.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 [16 x i8] c"integer overflow"
@luce.text.5 = private unnamed_addr constant [24 x i8] c"host service unavailable"
@luce.text.6 = private unnamed_addr constant [4 x i8] c"main"
@luce.text.7 = private unnamed_addr constant [61 x i8] c"/Users/sedov/Dev/luciaos/www/lucelang/examples/structures.luc"
@luce.origins.0 = private constant [28 x { i32, i32 }] [{ i32, i32 } { i32 9, i32 5 }, { i32, i32 } { i32 9, i32 5 }, { i32, i32 } { i32 9, i32 5 }, { i32, i32 } { i32 9, i32 5 }, { i32, i32 } { i32 9, i32 5 }, { i32, i32 } { i32 10, i32 5 }, { i32, i32 } { i32 10, i32 5 }, { i32, i32 } { i32 10, i32 5 }, { i32, i32 } { i32 10, i32 5 }, { i32, i32 } { i32 10, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }, { i32, i32 } { i32 11, i32 5 }]
@luce.text.8 = private unnamed_addr constant [11 x i8] c"Point.moved"
@luce.origins.1 = private constant [10 x { i32, i32 }] [{ i32, i32 } { i32 6, i32 9 }, { i32, i32 } { i32 6, i32 9 }, { i32, i32 } { i32 6, i32 9 }, { i32, i32 } { i32 6, i32 9 }, { i32, i32 } { i32 6, i32 9 }, { i32, i32 } { i32 6, i32 9 }, { i32, i32 } { i32 6, i32 9 }, { i32, i32 } { i32 6, i32 9 }, { i32, i32 } { i32 6, i32 9 }, { i32, i32 } { i32 6, i32 9 }]
@luce.functions = private constant [2 x { ptr, i64, ptr, i64, ptr, i64 }] [{ ptr, i64, ptr, i64, ptr, i64 } { ptr @luce.text.6, i64 4, ptr @luce.text.7, i64 61, ptr @luce.origins.0, i64 28 }, { ptr, i64, ptr, i64, ptr, i64 } { ptr @luce.text.8, i64 11, ptr @luce.text.7, i64 61, ptr @luce.origins.1, i64 10 }]
@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 { i8, i8, [6 x i8], i64, i64 }, align 8
%7 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%8 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%9 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%10 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
store i64 %3, ptr %5, align 8
%11 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %6, i32 0, i32 0
store i8 5, ptr %11, align 1
%12 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %6, i32 0, i32 4
store i64 2, ptr %12, align 8
%13 = ptrtoint ptr null to i64
%14 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %6, i32 0, i32 3
store i64 %13, ptr %14, align 8
%15 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 0
store i8 5, ptr %15, align 1
%16 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 4
store i64 2, ptr %16, align 8
%17 = ptrtoint ptr null to i64
%18 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 3
store i64 %17, ptr %18, align 8
%19 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 0
store i8 5, ptr %19, align 1
%20 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 4
store i64 2, ptr %20, align 8
%21 = ptrtoint ptr null to i64
%22 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 3
store i64 %21, ptr %22, align 8
%23 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 0
store i8 5, ptr %23, align 1
%24 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 4
store i64 2, ptr %24, align 8
%25 = ptrtoint ptr null to i64
%26 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
store i64 %25, ptr %26, align 8
%27 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 0
store i8 4, ptr %27, align 1
%28 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 1
store i8 -1, ptr %28, align 1
%29 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 0
%30 = ptrtoint ptr %29 to i64
%31 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 3
store i64 %30, ptr %31, align 8
%32 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 1
%33 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 4
store i64 %32, ptr %33, align 8
%34 = alloca { i8, i8, [6 x i8], i64, i64 },i64 2, align 8
%35 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %34, i64 0
%36 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %35, i32 0, i32 0
store i8 2, ptr %36, align 1
%37 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %35, i32 0, i32 4
store i64 0, ptr %37, align 8
%38 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %34, i64 1
%39 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %38, i32 0, i32 0
store i8 2, ptr %39, align 1
%40 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %38, i32 0, i32 4
store i64 0, ptr %40, align 8
%41 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%42 = sub nsw i64 %2, 1
%43 = alloca ptr, align 8
%44 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%45 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %44, i32 0, i32 0
store i8 2, ptr %45, align 1
%46 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %44, i32 0, i32 4
store i64 0, ptr %46, align 8
%47 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%48 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%49 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%50 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
br label %51
51:
%52 = load i64, ptr %5, align 8
%53 = trunc i64 %52 to i32
%54 = lshr i64 %52, 32
%55 = trunc i64 %54 to i32
%56 = icmp eq i32 %53, -1
br i1 %56, label %57, label %60, !prof !0
57:
%58 = extractvalue { ptr, i64 } { ptr @luce.text.1, i64 21 }, 0
%59 = extractvalue { ptr, i64 } { ptr @luce.text.1, i64 21 }, 1
call void @luce_rt_raise(ptr %1, i32 14, ptr %58, i64 %59)
call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
ret i32 1
60:
%61 = getelementptr inbounds i8, ptr %1, i64 96
%62 = load ptr, ptr %61, align 8!alias.scope !1, !noalias !2
%63 = zext i32 %53 to i64
%64 = mul nsw i64 %63, 112
%65 = getelementptr inbounds i8, ptr %62, i64 %64
%66 = getelementptr inbounds i8, ptr %65, i64 96
%67 = load i32, ptr %66, align 4, !alias.scope !1, !noalias !2
%68 = icmp ne i32 %67, %55
br i1 %68, label %69, label %72, !prof !0
69:
%70 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 0
%71 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 1
call void @luce_rt_raise(ptr %1, i32 13, ptr %70, i64 %71)
call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
ret i32 1
72:
%73 = and i32 %67, 1
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %78, !prof !0
75:
%76 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 0
%77 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 1
call void @luce_rt_raise(ptr %1, i32 13, ptr %76, i64 %77)
call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
ret i32 1
78:
%79 = getelementptr inbounds i8, ptr %65, i64 16
%80 = load i64, ptr %79, align 8!alias.scope !1, !noalias !2
%81 = load ptr, ptr %65, align 8, !alias.scope !1, !noalias !2
%82 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %35, i32 0, i32 3
store i64 %80, ptr %82, align 8
%83 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %38, i32 0, i32 3
store i64 2, ptr %83, align 8
%84 = call i32 @luce_rt_struct_make(ptr %1, ptr %34, i64 2, ptr %41)
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %87, !prof !0
86:
call void @luce_rt_unwound(ptr %1, i32 0, i32 3)
ret i32 1
87:
%88 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %41, i32 0, i32 3
%89 = load i64, ptr %88, align 8
%90 = inttoptr i64 %89 to ptr
call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %7, ptr align 8 %41, i64 24, i1 false)
%91 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 3
%92 = load i64, ptr %91, align 8
%93 = inttoptr i64 %92 to ptr
%94 = icmp slt i64 %42, 1
br i1 %94, label %95, label %98, !prof !0
95:
%96 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 19 }, 0
%97 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 19 }, 1
call void @luce_rt_raise(ptr %1, i32 6, ptr %96, i64 %97)
call void @luce_rt_unwound(ptr %1, i32 0, i32 8)
ret i32 1
98:
%99 = call i32 @luce.1.Point.moved(ptr %0, ptr %1, i64 %42, ptr %93, i64 3, i64 4, ptr %43)
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %102, !prof !0
101:
call void @luce_rt_unwound(ptr %1, i32 0, i32 8)
ret i32 1
102:
%103 = load ptr, ptr %43, align 8
%104 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 0
store i8 5, ptr %104, align 1
%105 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 4
store i64 2, ptr %105, align 8
%106 = ptrtoint ptr %103 to i64
%107 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
store i64 %106, ptr %107, align 8
%108 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
%109 = load i64, ptr %108, align 8
%110 = inttoptr i64 %109 to ptr
%111 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %110, i64 0
%112 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %111, i32 0, i32 3
%113 = load i64, ptr %112, align 8
%114 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
%115 = load i64, ptr %114, align 8
%116 = inttoptr i64 %115 to ptr
%117 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %116, i64 1
%118 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %117, i32 0, i32 3
%119 = load i64, ptr %118, align 8
%120 = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %113, i64 %119)
%121 = extractvalue { i64, i1 } %120, 0
%122 = extractvalue { i64, i1 } %120, 1
br i1 %122, label %123, label %126, !prof !0
123:
%124 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 16 }, 0
%125 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 16 }, 1
call void @luce_rt_raise(ptr %1, i32 0, ptr %124, i64 %125)
call void @luce_rt_unwound(ptr %1, i32 0, i32 14)
ret i32 1
126:
%127 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %44, i32 0, i32 3
store i64 %121, ptr %127, align 8
%128 = call i32 @luce_rt_str(ptr %1, ptr %44, ptr %47)
%129 = icmp ne i32 %128, 0
br i1 %129, label %130, label %131, !prof !0
130:
call void @luce_rt_unwound(ptr %1, i32 0, i32 15)
ret i32 1
131:
%132 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %47, i32 0, i32 3
%133 = load i64, ptr %132, align 8
%134 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %47, i32 0, i32 1
%135 = load i8, ptr %134, align 1
%136 = icmp eq i8 %135, -1
%137 = inttoptr i64 %133 to ptr
%138 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %47, i32 0, i32 2
%139 = select i1 %136, ptr %137, ptr %138
%140 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %47, i32 0, i32 4
%141 = load i64, ptr %140, align 8
%142 = zext i8 %135 to i64
%143 = select i1 %136, i64 %141, i64 %142
%144 = insertvalue { ptr, i64 } poison, ptr %139, 0
%145 = insertvalue { ptr, i64 } %144, i64 %143, 1
call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %10, ptr align 8 %47, i64 24, i1 false)
%146 = extractvalue { ptr, i64 } %145, 0
%147 = extractvalue { ptr, i64 } %145, 1
%148 = 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
%149 = load ptr, ptr %148, align 8
%150 = icmp eq ptr %149, null
br i1 %150, label %151, label %154, !prof !0
151:
%152 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 24 }, 0
%153 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 24 }, 1
call void @luce_rt_raise(ptr %1, i32 9, ptr %152, i64 %153)
call void @luce_rt_unwound(ptr %1, i32 0, i32 17)
ret i32 1
154:
%155 = 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
%156 = load ptr, ptr %155, align 8
%157 = call i32 %149(ptr %156, ptr %146, i64 %147)
%158 = icmp eq i32 %157, -1
br i1 %158, label %159, label %160, !prof !0
159:
call void @luce_rt_exhaust(ptr %1)
ret i32 1
160:
%161 = icmp ne i32 %157, 0
%162 = icmp ne i32 %157, 1
%163 = and i1 %161, %162
br i1 %163, label %164, label %167, !prof !0
164:
%165 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 24 }, 0
%166 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 24 }, 1
call void @luce_rt_raise(ptr %1, i32 9, ptr %165, i64 %166)
call void @luce_rt_unwound(ptr %1, i32 0, i32 17)
ret i32 1
167:
%168 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 3
%169 = load i64, ptr %168, align 8
%170 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 1
%171 = load i8, ptr %170, align 1
%172 = icmp eq i8 %171, -1
%173 = inttoptr i64 %169 to ptr
%174 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 2
%175 = select i1 %172, ptr %173, ptr %174
%176 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 4
%177 = load i64, ptr %176, align 8
%178 = zext i8 %171 to i64
%179 = select i1 %172, i64 %177, i64 %178
%180 = insertvalue { ptr, i64 } poison, ptr %175, 0
%181 = insertvalue { ptr, i64 } %180, i64 %179, 1
call void @luce_rt_drop_storage(ptr %1, ptr %10, ptr %48)
%182 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %48, i32 0, i32 3
%183 = load i64, ptr %182, align 8
%184 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %48, i32 0, i32 1
%185 = load i8, ptr %184, align 1
%186 = icmp eq i8 %185, -1
%187 = inttoptr i64 %183 to ptr
%188 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %48, i32 0, i32 2
%189 = select i1 %186, ptr %187, ptr %188
%190 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %48, i32 0, i32 4
%191 = load i64, ptr %190, align 8
%192 = zext i8 %185 to i64
%193 = select i1 %186, i64 %191, i64 %192
%194 = insertvalue { ptr, i64 } poison, ptr %189, 0
%195 = insertvalue { ptr, i64 } %194, i64 %193, 1
call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %10, ptr align 8 %48, i64 24, i1 false)
%196 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
%197 = load i64, ptr %196, align 8
%198 = inttoptr i64 %197 to ptr
call void @luce_rt_drop_storage(ptr %1, ptr %9, ptr %49)
%199 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %49, i32 0, i32 3
%200 = load i64, ptr %199, align 8
%201 = inttoptr i64 %200 to ptr
call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %9, ptr align 8 %49, i64 24, i1 false)
%202 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 3
%203 = load i64, ptr %202, align 8
%204 = inttoptr i64 %203 to ptr
call void @luce_rt_drop_storage(ptr %1, ptr %7, ptr %50)
%205 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %50, i32 0, i32 3
%206 = load i64, ptr %205, align 8
%207 = inttoptr i64 %206 to ptr
call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %7, ptr align 8 %50, i64 24, i1 false)
ret i32 0
}
define internal i32 @luce.1.Point.moved(ptr align 8 nocapture readonly nonnull dereferenceable(472) noundef %0, ptr align 8 nocapture nonnull noundef %1, i64 noundef %2, ptr align 8 readonly nonnull noundef %3, i64 %4, i64 %5, ptr align 8 nocapture nonnull dereferenceable(8) writeonly noundef %6) {
7:
%8 = alloca ptr, align 8
%9 = alloca i64, align 8
%10 = alloca i64, align 8
%11 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
store ptr %3, ptr %8, align 8
store i64 %4, ptr %9, align 8
store i64 %5, ptr %10, align 8
%12 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %11, i32 0, i32 0
store i8 5, ptr %12, align 1
%13 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %11, i32 0, i32 4
store i64 2, ptr %13, align 8
%14 = ptrtoint ptr null to i64
%15 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %11, i32 0, i32 3
store i64 %14, ptr %15, align 8
%16 = alloca { i8, i8, [6 x i8], i64, i64 },i64 2, align 8
%17 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %16, i64 0
%18 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %17, i32 0, i32 0
store i8 2, 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 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %16, i64 1
%21 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %20, i32 0, i32 0
store i8 2, ptr %21, align 1
%22 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %20, i32 0, i32 4
store i64 0, ptr %22, align 8
%23 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
br label %24
24:
%25 = load ptr, ptr %8, align 8
%26 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %25, i64 0
%27 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %26, i32 0, i32 3
%28 = load i64, ptr %27, align 8
%29 = load i64, ptr %9, align 8
%30 = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %28, i64 %29)
%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.4, i64 16 }, 0
%35 = extractvalue { ptr, i64 } { ptr @luce.text.4, 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 = load ptr, ptr %8, align 8
%38 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %37, i64 1
%39 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %38, i32 0, i32 3
%40 = load i64, ptr %39, align 8
%41 = load i64, ptr %10, align 8
%42 = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %40, i64 %41)
%43 = extractvalue { i64, i1 } %42, 0
%44 = extractvalue { i64, i1 } %42, 1
br i1 %44, label %45, label %48, !prof !0
45:
%46 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 16 }, 0
%47 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 16 }, 1
call void @luce_rt_raise(ptr %1, i32 0, ptr %46, i64 %47)
call void @luce_rt_unwound(ptr %1, i32 1, i32 7)
ret i32 1
48:
%49 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %17, i32 0, i32 3
store i64 %31, ptr %49, align 8
%50 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %20, i32 0, i32 3
store i64 %43, ptr %50, align 8
%51 = call i32 @luce_rt_struct_make(ptr %1, ptr %16, i64 2, ptr %23)
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %54, !prof !0
53:
call void @luce_rt_unwound(ptr %1, i32 1, i32 8)
ret i32 1
54:
%55 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %23, i32 0, i32 3
%56 = load i64, ptr %55, align 8
%57 = inttoptr i64 %56 to ptr
store ptr %57, ptr %6, 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(argmem: readwrite, inaccessiblemem: readwrite)
declare i32 @luce_rt_struct_make(ptr nocapture nonnull noundef %0, ptr align 8 nocapture readonly nonnull noundef %1, i64 %2, ptr align 8 nocapture nonnull dereferenceable(24) writeonly noundef %3) #1
; 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) #2
; Function Attrs: nounwind speculatable willreturn nofree nosync nocallback memory(none)
declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %0, i64 %1) #3
; 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) #4
; Function Attrs: nounwind cold willreturn memory(argmem: write)
declare void @luce_rt_exhaust(ptr nocapture nonnull noundef %0) #5
; 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) #1
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 2)
%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) #6
; 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) #7
; 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) #8
; 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) #7
; 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) #9
; 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) #9
; Function Attrs: cold
declare void @luce_rt_report(ptr nocapture nonnull noundef %0, ptr %1, ptr %2) #10
; Function Attrs: cold
declare void @luce_rt_report_error(ptr nocapture nonnull noundef %0, ptr %1, ptr %2) #10
; Function Attrs: nounwind willreturn memory(argmem: read)
declare i32 @luce_rt_status(ptr nocapture nonnull noundef %0, i32 %1) #11
; Function Attrs: nounwind willreturn memory(argmem: read)
declare i64 @luce_rt_leaked(ptr nocapture nonnull noundef %0) #11
; Function Attrs: nounwind memory(readwrite)
declare void @luce_rt_close(ptr nocapture nonnull noundef %0) #9
attributes #0 = { nounwind cold willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #1 = { nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #2 = { nounwind willreturn nofree nocallback memory(argmem: readwrite) }
attributes #3 = { nounwind speculatable willreturn nofree nosync nocallback memory(none) }
attributes #4 = { nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: readwrite) }
attributes #5 = { nounwind cold willreturn memory(argmem: write) }
attributes #6 = { nounwind willreturn memory(argmem: read, inaccessiblemem: readwrite) }
attributes #7 = { nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind willreturn memory(readwrite) }
attributes #9 = { nounwind memory(readwrite) }
attributes #10 = { cold }
attributes #11 = { 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/structures.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, 0x58 <ltmp0+0x58>
30: mov x0, x20
34: blr x8
38: mov x24, x0
3c: adrp x0, 0x0 <ltmp0>
40: add x0, x0, #0x0
44: mov w1, #0x2 ; =2
48: mov w23, #0x2 ; =2
4c: bl 0x4c <ltmp0+0x4c>
50: cbnz x0, 0x74 <ltmp0+0x74>
54: b 0x304 <ltmp0+0x304>
58: mov w24, #0x100 ; =256
5c: adrp x0, 0x0 <ltmp0>
60: add x0, x0, #0x0
64: mov w1, #0x2 ; =2
68: mov w23, #0x2 ; =2
6c: bl 0x6c <ltmp0+0x6c>
70: cbz x0, 0x304 <ltmp0+0x304>
74: ldp x3, x4, [x21, #0x1b0]
78: mov x22, x0
7c: ldp x5, x6, [x21, #0x1c0]
80: ldr x2, [x21, #0xe0]
84: ldp x8, x9, [x21, #0xf8]
88: ldr x7, [x21, #0x1d0]
8c: ldur q0, [x21, #0xe8]
90: sub sp, sp, #0x20
94: mov x1, x20
98: stp x8, x9, [sp, #0x10]
9c: str q0, [sp]
a0: bl 0xa0 <ltmp0+0xa0>
a4: add sp, sp, #0x20
a8: ldp x2, x3, [x21, #0x180]
ac: mov x0, x22
b0: ldp x4, x5, [x21, #0x190]
b4: mov x1, x20
b8: ldr x6, [x21, #0x1a0]
bc: bl 0xbc <ltmp0+0xbc>
c0: ldp x8, x9, [x21, #0x170]
c4: ldp x2, x3, [x21, #0x140]
c8: ldp x4, x5, [x21, #0x150]
cc: ldp x6, x7, [x21, #0x160]
d0: stp x8, x9, [sp, #-0x10]!
d4: mov x0, x22
d8: mov x1, x20
dc: bl 0xdc <ltmp0+0xdc>
e0: add sp, sp, #0x10
e4: cmp x24, #0x0
e8: b.le 0x364 <ltmp0+0x364>
ec: sub x23, sp, #0x20
f0: mov sp, x23
f4: ldp x2, x3, [x21, #0x20]
f8: mov x0, x22
fc: mov x1, x20
100: mov x4, x23
104: bl 0x104 <ltmp0+0x104>
108: cbnz w0, 0x42c <ltmp0+0x42c>
10c: mov w8, #0x5 ; =5
110: mov w9, #0x2 ; =2
114: str xzr, [x19, #0x90]
118: sturb w8, [x29, #-0xb8]
11c: mov w8, #0xff04 ; =65284
120: strh w8, [x19, #0xb0]
124: adrp x8, 0x0 <ltmp0>
128: add x8, x8, #0x0
12c: str x8, [x19, #0xb8]
130: ldr x8, [x23, #0x8]
134: stur x9, [x29, #-0xa8]
138: cmn w8, #0x1
13c: strb w9, [x19, #0x80]
140: strb w9, [x19, #0x98]
144: str xzr, [x19, #0xa8]
148: strb w9, [x19, #0x50]
14c: str xzr, [x19, #0x60]
150: b.eq 0x380 <ltmp0+0x380>
154: mov w9, #0x70 ; =112
158: ldr x10, [x22, #0x60]
15c: umaddl x9, w8, w9, x10
160: lsr x8, x8, #32
164: ldr w10, [x9, #0x60]
168: cmp w10, w8
16c: b.ne 0x324 <ltmp0+0x324>
170: tbnz w8, #0x0, 0x324 <ltmp0+0x324>
174: ldr x8, [x9, #0x10]
178: mov w9, #0x2 ; =2
17c: add x1, x19, #0x80
180: add x3, x19, #0x68
184: mov x0, x22
188: mov w2, #0x2 ; =2
18c: str x8, [x19, #0x88]
190: str x9, [x19, #0xa0]
194: bl 0x194 <ltmp0+0x194>
198: cbnz w0, 0x3a8 <ltmp0+0x3a8>
19c: ldur q0, [x19, #0x68]
1a0: ldr x8, [x19, #0x78]
1a4: add x25, x19, #0xb0
1a8: cmp x24, #0x1
1ac: str q0, [x25, #0x30]
1b0: stur x8, [x29, #-0x90]
1b4: b.eq 0x3b8 <ltmp0+0x3b8>
1b8: ldur x8, [x29, #-0x98]
1bc: mov w9, #0x2 ; =2
1c0: stur xzr, [x29, #-0x60]
1c4: sturb w9, [x29, #-0x70]
1c8: ldr x10, [x8, #0x8]
1cc: sturb w9, [x29, #-0x58]
1d0: stur xzr, [x29, #-0x48]
1d4: adds x9, x10, #0x3
1d8: b.vs 0x3d4 <ltmp0+0x3d4>
1dc: ldr x8, [x8, #0x20]
1e0: adds x8, x8, #0x4
1e4: b.vs 0x3dc <ltmp0+0x3dc>
1e8: sub x1, x29, #0x70
1ec: sub x3, x29, #0x88
1f0: mov x0, x22
1f4: mov w2, #0x2 ; =2
1f8: stur x9, [x29, #-0x68]
1fc: stur x8, [x29, #-0x50]
200: bl 0x200 <ltmp0+0x200>
204: cbnz w0, 0x3fc <ltmp0+0x3fc>
208: ldur x9, [x29, #-0x80]
20c: mov w8, #0x5 ; =5
210: mov w12, #0x2 ; =2
214: sturb w8, [x29, #-0xb8]
218: ldr x10, [x9, #0x8]
21c: ldr x11, [x9, #0x20]
220: stp x9, x12, [x29, #-0xb0]
224: adds x8, x10, x11
228: b.vs 0x458 <ltmp0+0x458>
22c: add x1, x19, #0x50
230: add x2, x19, #0x38
234: mov x0, x22
238: str x8, [x19, #0x58]
23c: bl 0x23c <ltmp0+0x23c>
240: cbnz w0, 0x480 <ltmp0+0x480>
244: ldp x9, x10, [x19, #0x40]
248: ldur q0, [x19, #0x38]
24c: ldr x8, [x21, #0x8]
250: ldrb w11, [x19, #0x39]
254: str q0, [x25]
258: str x10, [x19, #0xc0]
25c: cbz x8, 0x33c <ltmp0+0x33c>
260: add x12, x19, #0x38
264: cmp w11, #0xff
268: ldr x0, [x21]
26c: orr x12, x12, #0x2
270: csel x2, x10, x11, eq
274: csel x1, x9, x12, eq
278: blr x8
27c: cmn w0, #0x1
280: b.eq 0x490 <ltmp0+0x490>
284: cmp w0, #0x2
288: b.hs 0x33c <ltmp0+0x33c>
28c: add x1, x19, #0xb0
290: add x2, x19, #0x20
294: mov x0, x22
298: bl 0x298 <ltmp0+0x298>
29c: sub x1, x29, #0xb8
2a0: add x2, x19, #0x8
2a4: mov x0, x22
2a8: bl 0x2a8 <ltmp0+0x2a8>
2ac: add x1, x19, #0x68
2b0: sub x2, x29, #0xa0
2b4: mov x0, x22
2b8: bl 0x2b8 <ltmp0+0x2b8>
2bc: mov x0, x22
2c0: mov x1, x23
2c4: bl 0x2c4 <ltmp0+0x2c4>
2c8: mov w1, wzr
2cc: mov x0, x22
2d0: bl 0x2d0 <ltmp0+0x2d0>
2d4: mov w23, w0
2d8: cmp w0, #0x2
2dc: b.eq 0x2fc <ltmp0+0x2fc>
2e0: ldr x21, [x21, #0x18]
2e4: cbz x21, 0x2fc <ltmp0+0x2fc>
2e8: mov x0, x22
2ec: bl 0x2ec <ltmp0+0x2ec>
2f0: mov x1, x0
2f4: mov x0, x20
2f8: blr x21
2fc: mov x0, x22
300: bl 0x300 <ltmp0+0x300>
304: mov w0, w23
308: sub sp, x29, #0x40
30c: ldp x29, x30, [sp, #0x40]
310: ldp x20, x19, [sp, #0x30]
314: ldp x22, x21, [sp, #0x20]
318: ldp x24, x23, [sp, #0x10]
31c: ldp x26, x25, [sp], #0x50
320: ret
324: adrp x2, 0x0 <ltmp0>
328: add x2, x2, #0x0
32c: mov x0, x22
330: mov w1, #0xd ; =13
334: mov w3, #0x16 ; =22
338: b 0x394 <ltmp0+0x394>
33c: adrp x2, 0x0 <ltmp0>
340: add x2, x2, #0x0
344: mov x0, x22
348: mov w1, #0x9 ; =9
34c: mov w3, #0x18 ; =24
350: bl 0x350 <ltmp0+0x350>
354: mov x0, x22
358: mov w1, wzr
35c: mov w2, #0x11 ; =17
360: b 0x41c <ltmp0+0x41c>
364: adrp x2, 0x0 <ltmp0>
368: add x2, x2, #0x0
36c: mov x0, x22
370: mov w1, #0x6 ; =6
374: mov w3, #0x13 ; =19
378: bl 0x378 <ltmp0+0x378>
37c: b 0x42c <ltmp0+0x42c>
380: adrp x2, 0x0 <ltmp0>
384: add x2, x2, #0x0
388: mov x0, x22
38c: mov w1, #0xe ; =14
390: mov w3, #0x15 ; =21
394: bl 0x394 <ltmp0+0x394>
398: mov x0, x22
39c: mov w1, wzr
3a0: mov w2, #0x1 ; =1
3a4: b 0x41c <ltmp0+0x41c>
3a8: mov x0, x22
3ac: mov w1, wzr
3b0: mov w2, #0x3 ; =3
3b4: b 0x41c <ltmp0+0x41c>
3b8: adrp x2, 0x0 <ltmp0>
3bc: add x2, x2, #0x0
3c0: mov x0, x22
3c4: mov w1, #0x6 ; =6
3c8: mov w3, #0x13 ; =19
3cc: bl 0x3cc <ltmp0+0x3cc>
3d0: b 0x410 <ltmp0+0x410>
3d4: mov w24, #0x3 ; =3
3d8: b 0x3e0 <ltmp0+0x3e0>
3dc: mov w24, #0x7 ; =7
3e0: adrp x2, 0x0 <ltmp0>
3e4: add x2, x2, #0x0
3e8: mov x0, x22
3ec: mov w1, wzr
3f0: mov w3, #0x10 ; =16
3f4: bl 0x3f4 <ltmp0+0x3f4>
3f8: b 0x400 <ltmp0+0x400>
3fc: mov w24, #0x8 ; =8
400: mov x0, x22
404: mov w1, #0x1 ; =1
408: mov w2, w24
40c: bl 0x40c <ltmp0+0x40c>
410: mov x0, x22
414: mov w1, wzr
418: mov w2, #0x8 ; =8
41c: bl 0x41c <ltmp0+0x41c>
420: mov x0, x22
424: mov x1, x23
428: bl 0x428 <ltmp0+0x428>
42c: ldr x2, [x21, #0x10]
430: mov x0, x22
434: mov x1, x20
438: bl 0x438 <ltmp0+0x438>
43c: mov w1, #0x1 ; =1
440: mov x0, x22
444: bl 0x444 <ltmp0+0x444>
448: mov w23, w0
44c: cmp w0, #0x2
450: b.ne 0x2e0 <ltmp0+0x2e0>
454: b 0x2fc <ltmp0+0x2fc>
458: adrp x2, 0x0 <ltmp0>
45c: add x2, x2, #0x0
460: mov x0, x22
464: mov w1, wzr
468: mov w3, #0x10 ; =16
46c: bl 0x46c <ltmp0+0x46c>
470: mov x0, x22
474: mov w1, wzr
478: mov w2, #0xe ; =14
47c: b 0x41c <ltmp0+0x41c>
480: mov x0, x22
484: mov w1, wzr
488: mov w2, #0xf ; =15
48c: b 0x41c <ltmp0+0x41c>
490: mov x0, x22
494: bl 0x494 <ltmp0+0x494>
498: b 0x420 <ltmp0+0x420>
Flattened value layout
origin: Pointnested value fields flatten into the containing value layoutlabel: strvalue representation; outside storage follows string lifetime rulesitems: list[i64]reference field; a copied struct retains and shares this list identityConstruction and defaults
Structures support memberwise construction, named fields, and folded field defaults. A default is checked and folded at the declaration, so every construction reuses one constant value. Private fields can reserve construction for public factory functions in the declaring file.
What a copy does
Scalar and nested value fields copy. Reference fields retain the same object handle, so a copied struct continues to share those referenced identities. Destruction of the outer value releases each owned reference field when that particular copy leaves its lifetime.
own scalar fields
owns one list referenceone identity, retained by A and B
strong 2Reader and writer methods
self is implied. The compiler infers whether a method writes the value receiver. A reader can run on any value expression. A writer needs a mutable bare local because the modified value has to be stored back into that local when the call returns.
Value layout must be finite
Every struct needs a finite byte width. Recursive structures therefore cross an optional or reference boundary, whose representation has a fixed width. Layout analysis detects an unbroken value cycle before HIR.
Choosing identity
Use a struct when
The data is the value, copies should be independent at the outer level, and identity comparison would add nothing.
Use a class when
Aliases must observe the same mutation, deterministic destruction belongs to one identity, or weak graph edges are needed.