Luce / engineering
Learn Luce LuciaOS

Interfaces and method tables

Measured lets a function call measure() through a compiler-built method table. The interface value carries that table alongside an owned struct or class payload.

Follow one interface call

The example puts a Width struct behind Measured. MIR shows witness construction and dispatch. LLVM IR gives that witness a concrete table and payload shape. The assembly uses an indirect call when several targets remain possible. When LLVM sees one concrete target, it can inline the method body.

Compiler traceFollow one program through four representations
compiler build information

Luce source. Names and indentation describe the program for a reader.

open source file

interface Measured:
    func measure() -> i64

struct Width: Measured:
    value: i64

    func measure() -> i64:
        return self.value

func read(value: Measured) -> i64:
    return value.measure()

func main(args: list[str]):
    let width = Width(value = len(args) + 4)
    print(str(read(width)))

Luce MIR. Types, registers, blocks, calls, and lifetime operations form the instruction plan sent to the LLVM backend.

open MIR file
MIR 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.
interface NAME
Declares a method contract. A conforming value carries a payload and a witness table for these calls.
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 release
Removes one strong owner and runs destruction when the count reaches zero.
intrinsic own_storage
Turns temporary storage into an owned value that can safely outlive the current expression.
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.
interface_make
Pairs an owned payload with the witness table selected during semantic analysis.
interface_call
Loads the chosen witness slot and calls the implementation for the stored payload.
ret
Returns the current function's result to its caller and closes the current control-flow path.

struct Width:
    value: i64
interface Measured:
    measure: func() -> i64
func read(value: Measured) -> i64
  b0:
    r0 = local_get %0
    r1 = interface_call r0, Measured.measure
    ret r1
func main(args: list[str]) -> None
    local %1 (temporary): Width
    local %2 width: Width
    local %3 (temporary): Measured
    local %4 (temporary): str
  b0:
    r0 = local_get %0
    r1 = intrinsic len, r0
    r2 = const 4
    r3 = add.i64 r1, r2
    r4 = struct_make Width, r3
    local_set %2, r4
    r6 = local_get %2
    r7 = intrinsic own_storage, r6
    r8 = interface_make Measured, witness#0, r7
    local_set %3, r8
    r10 = call read, r8
    r11 = intrinsic str_value, r10
    local_set %4, r11
    intrinsic print, r11
    r14 = local_get %4
    r15 = intrinsic drop_storage, r14
    local_set %4, r15
    r17 = local_get %3
    intrinsic release, r17
    r19 = local_get %3
    r20 = intrinsic drop_storage, r19
    local_set %3, r20
    r22 = local_get %2
    r23 = intrinsic drop_storage, r22
    local_set %2, r23
    ret
func Width.measure(self: Width) -> i64
  b0:
    r0 = local_get %0
    r1 = struct_get r0, Width.value
    ret r1

LLVM IR. The backend expands MIR into typed memory operations, calls, checks, and control-flow blocks for LLVM.

open LLVM IR file
LLVM 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 i1 operand 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.
add
Adds integer values or address-related offsets under the flags attached to the instruction.
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 to main from 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_own_storage
Turns temporary storage into an owned runtime value for a destination or result.
@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/interfaces.luc'
source_filename = "/Users/sedov/Dev/luciaos/www/lucelang/examples/interfaces.luc"
target triple = "arm64-apple-darwin24.6.0"

@luce.text.0 = private unnamed_addr constant [21 x i8] c"null object reference"
@luce.interface_witness_layouts = private constant [1 x i32] [i32 1]
@luce.interface_witness_offsets = private constant [1 x i32] zeroinitializer
@luce.interface_witness_methods = private constant [1 x i32] [i32 2]
@luce.function_table = private constant [3 x ptr] [ptr null, ptr null, ptr @luce.bound.2]
@luce.text.1 = private unnamed_addr constant [19 x i8] c"call depth exceeded"
@luce.text.2 = private unnamed_addr constant [0 x i8] zeroinitializer
@luce.text.3 = private unnamed_addr constant [22 x i8] c"object used after free"
@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"read"
@luce.text.7 = private unnamed_addr constant [61 x i8] c"/Users/sedov/Dev/luciaos/www/lucelang/examples/interfaces.luc"
@luce.origins.0 = private constant [3 x { i32, i32 }] [{ 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 [4 x i8] c"main"
@luce.origins.1 = private constant [26 x { i32, i32 }] [{ 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 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }, { i32, i32 } { i32 15, i32 5 }]
@luce.text.9 = private unnamed_addr constant [13 x i8] c"Width.measure"
@luce.origins.2 = private constant [3 x { i32, i32 }] [{ i32, i32 } { i32 8, i32 9 }, { i32, i32 } { i32 8, i32 9 }, { i32, i32 } { i32 8, i32 9 }]
@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 61, ptr @luce.origins.0, i64 3 }, { ptr, i64, ptr, i64, ptr, i64 } { ptr @luce.text.8, i64 4, ptr @luce.text.7, i64 61, ptr @luce.origins.1, i64 26 }, { ptr, i64, ptr, i64, ptr, i64 } { ptr @luce.text.9, i64 13, ptr @luce.text.7, i64 61, ptr @luce.origins.2, i64 3 }]
@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.read(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, ptr align 8 nocapture nonnull dereferenceable(8) writeonly noundef %4) {
5:
  %6 = alloca ptr, align 8
  store ptr %3, ptr %6, align 8
  %7 = sub nsw i64 %2, 1
  %8 = alloca i64, align 8
  br label %9

9:
  %10 = load ptr, ptr %6, align 8
  %11 = ptrtoint ptr %10 to i64
  %12 = icmp eq i64 %11, 0
  br i1 %12, label %13, label %16, !prof !0

13:
  %14 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 21 }, 0
  %15 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 21 }, 1
  call void @luce_rt_raise(ptr %1, i32 14, ptr %14, i64 %15)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
  ret i32 1

16:
  %17 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i64 0
  %18 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %17, i32 0, i32 3
  %19 = load i64, ptr %18, align 8
  %20 = icmp ult i64 %19, 1
  br i1 %20, label %21, label %24, !prof !0

21:
  %22 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 21 }, 0
  %23 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 21 }, 1
  call void @luce_rt_raise(ptr %1, i32 14, ptr %22, i64 %23)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
  ret i32 1

24:
  %25 = icmp ugt i64 %19, 1
  br i1 %25, label %26, label %29, !prof !0

26:
  %27 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 21 }, 0
  %28 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 21 }, 1
  call void @luce_rt_raise(ptr %1, i32 14, ptr %27, i64 %28)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
  ret i32 1

29:
  %30 = sub i64 %19, 1
  %31 = getelementptr inbounds i32, ptr @luce.interface_witness_layouts, i64 %30
  %32 = load i32, ptr %31, align 4
  %33 = icmp ne i32 %32, 1
  br i1 %33, label %34, label %37, !prof !0

34:
  %35 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 21 }, 0
  %36 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 21 }, 1
  call void @luce_rt_raise(ptr %1, i32 14, ptr %35, i64 %36)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
  ret i32 1

37:
  %38 = getelementptr inbounds i32, ptr @luce.interface_witness_offsets, i64 %30
  %39 = load i32, ptr %38, align 4
  %40 = add i32 %39, 0
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr @luce.interface_witness_methods, i64 %41
  %43 = load i32, ptr %42, align 4
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr @luce.function_table, i64 %44
  %46 = load ptr, ptr %45, align 8
  %47 = icmp slt i64 %7, 1
  br i1 %47, label %48, label %51, !prof !0

48:
  %49 = extractvalue { ptr, i64 } { ptr @luce.text.1, i64 19 }, 0
  %50 = extractvalue { ptr, i64 } { ptr @luce.text.1, i64 19 }, 1
  call void @luce_rt_raise(ptr %1, i32 6, ptr %49, i64 %50)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
  ret i32 1

51:
  %52 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i64 1
  %53 = call i32 %46(ptr %0, ptr %1, i64 %7, ptr %52, ptr %8)
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %56, !prof !0

55:
  call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
  ret i32 1

56:
  %57 = load i64, ptr %8, align 8
  store i64 %57, ptr %4, align 8
  ret i32 0
}

define internal i32 @luce.1.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
  store i64 %3, ptr %5, align 8
  %10 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %6, i32 0, i32 0
  store i8 5, ptr %10, align 1
  %11 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %6, i32 0, i32 4
  store i64 1, ptr %11, align 8
  %12 = ptrtoint ptr null to i64
  %13 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %6, i32 0, i32 3
  store i64 %12, ptr %13, align 8
  %14 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 0
  store i8 5, ptr %14, align 1
  %15 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 4
  store i64 1, ptr %15, align 8
  %16 = ptrtoint ptr null to i64
  %17 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 3
  store i64 %16, ptr %17, align 8
  %18 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 0
  store i8 5, ptr %18, align 1
  %19 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 4
  store i64 2, ptr %19, align 8
  %20 = ptrtoint ptr null to i64
  %21 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 3
  store i64 %20, ptr %21, align 8
  %22 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 0
  store i8 4, ptr %22, align 1
  %23 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 1
  store i8 -1, ptr %23, align 1
  %24 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 0 }, 0
  %25 = ptrtoint ptr %24 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 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 0 }, 1
  %28 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 4
  store i64 %27, ptr %28, align 8
  %29 = alloca { i8, i8, [6 x i8], i64, i64 },i64 1, align 8
  %30 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %29, i64 0
  %31 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %30, i32 0, i32 0
  store i8 2, ptr %31, align 1
  %32 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %30, i32 0, i32 4
  store i64 0, ptr %32, align 8
  %33 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %34 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %35 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %34, i32 0, i32 0
  store i8 5, ptr %35, align 1
  %36 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %34, i32 0, i32 4
  store i64 1, ptr %36, align 8
  %37 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %38 = alloca { i8, i8, [6 x i8], i64, i64 },i64 2, align 8
  %39 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %38, i64 0
  %40 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %39, i32 0, i32 0
  store i8 2, ptr %40, align 1
  %41 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %39, i32 0, i32 4
  store i64 0, ptr %41, align 8
  %42 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %38, i64 1
  %43 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %44 = sub nsw i64 %2, 1
  %45 = alloca i64, align 8
  %46 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %47 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %46, i32 0, i32 0
  store i8 2, ptr %47, align 1
  %48 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %46, i32 0, i32 4
  store i64 0, ptr %48, align 8
  %49 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %50 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %51 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %52 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %51, i32 0, i32 0
  store i8 5, ptr %52, align 1
  %53 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %51, i32 0, i32 4
  store i64 2, ptr %53, align 8
  %54 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %55 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  br label %56

56:
  %57 = load i64, ptr %5, align 8
  %58 = trunc i64 %57 to i32
  %59 = lshr i64 %57, 32
  %60 = trunc i64 %59 to i32
  %61 = icmp eq i32 %58, -1
  br i1 %61, label %62, label %65, !prof !0

62:
  %63 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 21 }, 0
  %64 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 21 }, 1
  call void @luce_rt_raise(ptr %1, i32 14, ptr %63, i64 %64)
  call void @luce_rt_unwound(ptr %1, i32 1, i32 1)
  ret i32 1

65:
  %66 = getelementptr inbounds i8, ptr %1, i64 96
  %67 = load ptr, ptr %66, align 8!alias.scope !1, !noalias !2
  %68 = zext i32 %58 to i64
  %69 = mul nsw i64 %68, 112
  %70 = getelementptr inbounds i8, ptr %67, i64 %69
  %71 = getelementptr inbounds i8, ptr %70, i64 96
  %72 = load i32, ptr %71, align 4, !alias.scope !1, !noalias !2
  %73 = icmp ne i32 %72, %60
  br i1 %73, label %74, label %77, !prof !0

74:
  %75 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 22 }, 0
  %76 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 22 }, 1
  call void @luce_rt_raise(ptr %1, i32 13, ptr %75, i64 %76)
  call void @luce_rt_unwound(ptr %1, i32 1, i32 1)
  ret i32 1

77:
  %78 = and i32 %72, 1
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %83, !prof !0

80:
  %81 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 22 }, 0
  %82 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 22 }, 1
  call void @luce_rt_raise(ptr %1, i32 13, ptr %81, i64 %82)
  call void @luce_rt_unwound(ptr %1, i32 1, i32 1)
  ret i32 1

83:
  %84 = getelementptr inbounds i8, ptr %70, i64 16
  %85 = load i64, ptr %84, align 8!alias.scope !1, !noalias !2
  %86 = load ptr, ptr %70, align 8, !alias.scope !1, !noalias !2
  %87 = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %85, i64 4)
  %88 = extractvalue { i64, i1 } %87, 0
  %89 = extractvalue { i64, i1 } %87, 1
  br i1 %89, label %90, label %93, !prof !0

90:
  %91 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 16 }, 0
  %92 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 16 }, 1
  call void @luce_rt_raise(ptr %1, i32 0, ptr %91, i64 %92)
  call void @luce_rt_unwound(ptr %1, i32 1, i32 3)
  ret i32 1

93:
  %94 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %30, i32 0, i32 3
  store i64 %88, ptr %94, align 8
  %95 = call i32 @luce_rt_struct_make(ptr %1, ptr %29, i64 1, ptr %33)
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %98, !prof !0

97:
  call void @luce_rt_unwound(ptr %1, i32 1, i32 4)
  ret i32 1

98:
  %99 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %33, i32 0, i32 3
  %100 = load i64, ptr %99, align 8
  %101 = inttoptr i64 %100 to ptr
  call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %7, ptr align 8 %33, i64 24, i1 false)
  %102 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 3
  %103 = load i64, ptr %102, align 8
  %104 = inttoptr i64 %103 to ptr
  %105 = ptrtoint ptr %104 to i64
  %106 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %34, i32 0, i32 3
  store i64 %105, ptr %106, align 8
  %107 = call i32 @luce_rt_own_storage(ptr %1, ptr %34, ptr %37)
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %110, !prof !0

109:
  call void @luce_rt_unwound(ptr %1, i32 1, i32 7)
  ret i32 1

110:
  %111 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %37, i32 0, i32 3
  %112 = load i64, ptr %111, align 8
  %113 = inttoptr i64 %112 to ptr
  %114 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %39, i32 0, i32 3
  store i64 1, ptr %114, align 8
  call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %42, ptr align 8 %37, i64 24, i1 false)
  %115 = call i32 @luce_rt_struct_make(ptr %1, ptr %38, i64 2, ptr %43)
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %118, !prof !0

117:
  call void @luce_rt_unwound(ptr %1, i32 1, i32 8)
  ret i32 1

118:
  %119 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %43, i32 0, i32 3
  %120 = load i64, ptr %119, align 8
  %121 = inttoptr i64 %120 to ptr
  call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %8, ptr align 8 %43, i64 24, i1 false)
  %122 = icmp slt i64 %44, 1
  br i1 %122, label %123, label %126, !prof !0

123:
  %124 = extractvalue { ptr, i64 } { ptr @luce.text.1, i64 19 }, 0
  %125 = extractvalue { ptr, i64 } { ptr @luce.text.1, i64 19 }, 1
  call void @luce_rt_raise(ptr %1, i32 6, ptr %124, i64 %125)
  call void @luce_rt_unwound(ptr %1, i32 1, i32 10)
  ret i32 1

126:
  %127 = call i32 @luce.0.read(ptr %0, ptr %1, i64 %44, ptr %121, ptr %45)
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %130, !prof !0

129:
  call void @luce_rt_unwound(ptr %1, i32 1, i32 10)
  ret i32 1

130:
  %131 = load i64, ptr %45, align 8
  %132 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %46, i32 0, i32 3
  store i64 %131, ptr %132, align 8
  %133 = call i32 @luce_rt_str(ptr %1, ptr %46, ptr %49)
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %135, label %136, !prof !0

135:
  call void @luce_rt_unwound(ptr %1, i32 1, i32 11)
  ret i32 1

136:
  %137 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %49, i32 0, i32 3
  %138 = load i64, ptr %137, align 8
  %139 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %49, i32 0, i32 1
  %140 = load i8, ptr %139, align 1
  %141 = icmp eq i8 %140, -1
  %142 = inttoptr i64 %138 to ptr
  %143 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %49, i32 0, i32 2
  %144 = select i1 %141, ptr %142, ptr %143
  %145 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %49, i32 0, i32 4
  %146 = load i64, ptr %145, align 8
  %147 = zext i8 %140 to i64
  %148 = select i1 %141, i64 %146, i64 %147
  %149 = insertvalue { ptr, i64 } poison, ptr %144, 0
  %150 = insertvalue { ptr, i64 } %149, i64 %148, 1
  call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %9, ptr align 8 %49, i64 24, i1 false)
  %151 = extractvalue { ptr, i64 } %150, 0
  %152 = extractvalue { ptr, i64 } %150, 1
  %153 = 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
  %154 = load ptr, ptr %153, align 8
  %155 = icmp eq ptr %154, null
  br i1 %155, label %156, label %159, !prof !0

156:
  %157 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 24 }, 0
  %158 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 24 }, 1
  call void @luce_rt_raise(ptr %1, i32 9, ptr %157, i64 %158)
  call void @luce_rt_unwound(ptr %1, i32 1, i32 13)
  ret i32 1

159:
  %160 = 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
  %161 = load ptr, ptr %160, align 8
  %162 = call i32 %154(ptr %161, ptr %151, i64 %152)
  %163 = icmp eq i32 %162, -1
  br i1 %163, label %164, label %165, !prof !0

164:
  call void @luce_rt_exhaust(ptr %1)
  ret i32 1

165:
  %166 = icmp ne i32 %162, 0
  %167 = icmp ne i32 %162, 1
  %168 = and i1 %166, %167
  br i1 %168, label %169, label %172, !prof !0

169:
  %170 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 24 }, 0
  %171 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 24 }, 1
  call void @luce_rt_raise(ptr %1, i32 9, ptr %170, i64 %171)
  call void @luce_rt_unwound(ptr %1, i32 1, i32 13)
  ret i32 1

172:
  %173 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
  %174 = load i64, ptr %173, align 8
  %175 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 1
  %176 = load i8, ptr %175, align 1
  %177 = icmp eq i8 %176, -1
  %178 = inttoptr i64 %174 to ptr
  %179 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 2
  %180 = select i1 %177, ptr %178, ptr %179
  %181 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 4
  %182 = load i64, ptr %181, align 8
  %183 = zext i8 %176 to i64
  %184 = select i1 %177, i64 %182, i64 %183
  %185 = insertvalue { ptr, i64 } poison, ptr %180, 0
  %186 = insertvalue { ptr, i64 } %185, i64 %184, 1
  call void @luce_rt_drop_storage(ptr %1, ptr %9, ptr %50)
  %187 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %50, i32 0, i32 3
  %188 = load i64, ptr %187, align 8
  %189 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %50, i32 0, i32 1
  %190 = load i8, ptr %189, align 1
  %191 = icmp eq i8 %190, -1
  %192 = inttoptr i64 %188 to ptr
  %193 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %50, i32 0, i32 2
  %194 = select i1 %191, ptr %192, ptr %193
  %195 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %50, i32 0, i32 4
  %196 = load i64, ptr %195, align 8
  %197 = zext i8 %190 to i64
  %198 = select i1 %191, i64 %196, i64 %197
  %199 = insertvalue { ptr, i64 } poison, ptr %194, 0
  %200 = insertvalue { ptr, i64 } %199, i64 %198, 1
  call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %9, ptr align 8 %50, i64 24, i1 false)
  %201 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 3
  %202 = load i64, ptr %201, align 8
  %203 = inttoptr i64 %202 to ptr
  %204 = ptrtoint ptr %203 to i64
  %205 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %51, i32 0, i32 3
  store i64 %204, ptr %205, align 8
  %206 = call i32 @luce_rt_release(ptr %1, ptr %51)
  %207 = icmp ne i32 %206, 0
  br i1 %207, label %208, label %209, !prof !0

208:
  call void @luce_rt_unwound(ptr %1, i32 1, i32 18)
  ret i32 1

209:
  %210 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 3
  %211 = load i64, ptr %210, align 8
  %212 = inttoptr i64 %211 to ptr
  call void @luce_rt_drop_storage(ptr %1, ptr %8, ptr %54)
  %213 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %54, i32 0, i32 3
  %214 = load i64, ptr %213, align 8
  %215 = inttoptr i64 %214 to ptr
  call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %8, ptr align 8 %54, i64 24, i1 false)
  %216 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 3
  %217 = load i64, ptr %216, align 8
  %218 = inttoptr i64 %217 to ptr
  call void @luce_rt_drop_storage(ptr %1, ptr %7, ptr %55)
  %219 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %55, i32 0, i32 3
  %220 = load i64, ptr %219, align 8
  %221 = inttoptr i64 %220 to ptr
  call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %7, ptr align 8 %55, i64 24, i1 false)
  ret i32 0
}

define internal i32 @luce.2.Width.measure(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, ptr align 8 nocapture nonnull dereferenceable(8) writeonly noundef %4) {
5:
  %6 = alloca ptr, align 8
  store ptr %3, ptr %6, align 8
  br label %7

7:
  %8 = load ptr, ptr %6, 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 3
  %11 = load i64, ptr %10, align 8
  store i64 %11, ptr %4, align 8
  ret i32 0
}

define internal i32 @luce.bound.2(ptr %0, ptr %1, i64 %2, ptr %3, ptr %4) {
5:
  %6 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %3, i32 0, i32 3
  %7 = load i64, ptr %6, align 8
  %8 = inttoptr i64 %7 to ptr
  %9 = call i32 @luce.2.Width.measure(ptr %0, ptr %1, i64 %2, ptr %8, ptr %4)
  ret i32 %9
}

; 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 speculatable willreturn nofree nosync nocallback memory(none)
declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %0, i64 %1) #1

; 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) #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 willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare i32 @luce_rt_own_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) #2

; 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) #2

; 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

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.1, 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.1.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) #7

; 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) #8

; 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) #9

; 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) #8

; 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) #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) #6

attributes #0 = { nounwind cold willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #1 = { nounwind speculatable willreturn nofree nosync nocallback memory(none) }
attributes #2 = { nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #3 = { nounwind willreturn nofree nocallback memory(argmem: readwrite) }
attributes #4 = { nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: readwrite) }
attributes #5 = { nounwind cold willreturn memory(argmem: write) }
attributes #6 = { nounwind memory(readwrite) }
attributes #7 = { nounwind willreturn memory(argmem: read, inaccessiblemem: readwrite) }
attributes #8 = { nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { nounwind willreturn 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 file
ARM64 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.
sturh
Stores 16 bits using an unscaled byte offset.
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 x30 and ends the current machine function.


/Users/sedov/Dev/luciaos/www/lucelang/out/traces/interfaces.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, #0x170
      1c:      	mov	x19, sp
      20:      	ldr	x8, [x0, #0x70]
      24:      	ldr	x20, [x0]
      28:      	mov	x21, x0
      2c:      	cbz	x8, 0x32c <ltmp0+0x32c>
      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, 0x344 <ltmp0+0x344>
      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	0x3a4 <ltmp0+0x3a4>
      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, 0x4a0 <ltmp0+0x4a0>
      e8:      	mov	w8, #0xff04             ; =65284
      ec:      	adrp	x9, 0x0 <ltmp0>
      f0:      	add	x9, x9, #0x0
      f4:      	sturh	w8, [x29, #-0xa0]
      f8:      	mov	w8, #0x1                ; =1
      fc:      	mov	w10, #0x5               ; =5
     100:      	str	x8, [x19, #0xd8]
     104:      	ldr	x8, [x23, #0x8]
     108:      	stur	x9, [x29, #-0x98]
     10c:      	mov	w9, #0x2                ; =2
     110:      	cmn	w8, #0x1
     114:      	sturb	w9, [x29, #-0xb8]
     118:      	stur	xzr, [x29, #-0xa8]
     11c:      	strb	w10, [x19, #0xc8]
     120:      	strb	w9, [x19, #0x80]
     124:      	str	xzr, [x19, #0x90]
     128:      	strb	w9, [x19, #0x50]
     12c:      	str	xzr, [x19, #0x60]
     130:      	strb	w10, [x19, #0x8]
     134:      	str	x9, [x19, #0x18]
     138:      	b.eq	0x3c0 <ltmp0+0x3c0>
     13c:      	mov	w9, #0x70               ; =112
     140:      	ldr	x10, [x22, #0x60]
     144:      	umaddl	x9, w8, w9, x10
     148:      	lsr	x8, x8, #32
     14c:      	ldr	w10, [x9, #0x60]
     150:      	cmp	w10, w8
     154:      	b.ne	0x34c <ltmp0+0x34c>
     158:      	tbnz	w8, #0x0, 0x34c <ltmp0+0x34c>
     15c:      	ldr	x8, [x9, #0x10]
     160:      	adds	x8, x8, #0x4
     164:      	b.vs	0x3e8 <ltmp0+0x3e8>
     168:      	sub	x1, x29, #0xb8
     16c:      	sub	x3, x29, #0xd0
     170:      	mov	x0, x22
     174:      	mov	w2, #0x1                ; =1
     178:      	stur	x8, [x29, #-0xb0]
     17c:      	bl	0x17c <ltmp0+0x17c>
     180:      	cbnz	w0, 0x410 <ltmp0+0x410>
     184:      	add	x25, x19, #0xb0
     188:      	ldur	x8, [x29, #-0xc0]
     18c:      	add	x1, x19, #0xc8
     190:      	ldr	q0, [x25, #0x30]
     194:      	add	x2, x19, #0xb0
     198:      	mov	x0, x22
     19c:      	stur	x8, [x29, #-0x50]
     1a0:      	str	q0, [x25, #0xa0]
     1a4:      	ldur	x9, [x29, #-0x58]
     1a8:      	str	x9, [x19, #0xd0]
     1ac:      	bl	0x1ac <ltmp0+0x1ac>
     1b0:      	cbnz	w0, 0x420 <ltmp0+0x420>
     1b4:      	ldr	q0, [x25]
     1b8:      	ldr	x10, [x19, #0xc0]
     1bc:      	mov	w8, #0x1                ; =1
     1c0:      	add	x9, x19, #0x80
     1c4:      	add	x1, x19, #0x80
     1c8:      	add	x3, x19, #0x68
     1cc:      	mov	x0, x22
     1d0:      	mov	w2, #0x2                ; =2
     1d4:      	str	x8, [x19, #0x88]
     1d8:      	stur	q0, [x9, #0x18]
     1dc:      	stur	x10, [x9, #0x28]
     1e0:      	bl	0x1e0 <ltmp0+0x1e0>
     1e4:      	cbnz	w0, 0x430 <ltmp0+0x430>
     1e8:      	ldp	x8, x9, [x19, #0x70]
     1ec:      	cmp	x24, #0x1
     1f0:      	ldur	q0, [x19, #0x68]
     1f4:      	str	q0, [x25, #0x80]
     1f8:      	stur	x9, [x29, #-0x70]
     1fc:      	b.eq	0x440 <ltmp0+0x440>
     200:      	ldr	x9, [x8, #0x8]
     204:      	cmp	x9, #0x1
     208:      	b.ne	0x364 <ltmp0+0x364>
     20c:      	cmp	x24, #0x2
     210:      	b.eq	0x45c <ltmp0+0x45c>
     214:      	ldr	x8, [x8, #0x20]
     218:      	add	x1, x19, #0x50
     21c:      	add	x2, x19, #0x38
     220:      	mov	x0, x22
     224:      	ldr	x8, [x8, #0x8]
     228:      	str	x8, [x19, #0x58]
     22c:      	bl	0x22c <ltmp0+0x22c>
     230:      	cbnz	w0, 0x4cc <ltmp0+0x4cc>
     234:      	ldp	x9, x10, [x19, #0x40]
     238:      	ldur	q0, [x19, #0x38]
     23c:      	ldr	x8, [x21, #0x8]
     240:      	ldrb	w11, [x19, #0x39]
     244:      	str	q0, [x25, #0x60]
     248:      	stur	x10, [x29, #-0x90]
     24c:      	cbz	x8, 0x37c <ltmp0+0x37c>
     250:      	add	x12, x19, #0x38
     254:      	cmp	w11, #0xff
     258:      	ldr	x0, [x21]
     25c:      	orr	x12, x12, #0x2
     260:      	csel	x2, x10, x11, eq
     264:      	csel	x1, x9, x12, eq
     268:      	blr	x8
     26c:      	cmn	w0, #0x1
     270:      	b.eq	0x4dc <ltmp0+0x4dc>
     274:      	cmp	w0, #0x2
     278:      	b.hs	0x37c <ltmp0+0x37c>
     27c:      	sub	x1, x29, #0xa0
     280:      	add	x2, x19, #0x20
     284:      	mov	x0, x22
     288:      	bl	0x288 <ltmp0+0x288>
     28c:      	ldur	x8, [x29, #-0x78]
     290:      	add	x1, x19, #0x8
     294:      	mov	x0, x22
     298:      	str	x8, [x19, #0x10]
     29c:      	bl	0x29c <ltmp0+0x29c>
     2a0:      	cbnz	w0, 0x4e8 <ltmp0+0x4e8>
     2a4:      	add	x1, x19, #0x68
     2a8:      	sub	x2, x29, #0x80
     2ac:      	mov	x0, x22
     2b0:      	bl	0x2b0 <ltmp0+0x2b0>
     2b4:      	sub	x1, x29, #0xd0
     2b8:      	sub	x2, x29, #0x60
     2bc:      	mov	x0, x22
     2c0:      	bl	0x2c0 <ltmp0+0x2c0>
     2c4:      	mov	x0, x22
     2c8:      	mov	x1, x23
     2cc:      	bl	0x2cc <ltmp0+0x2cc>
     2d0:      	mov	w1, wzr
     2d4:      	mov	x0, x22
     2d8:      	bl	0x2d8 <ltmp0+0x2d8>
     2dc:      	mov	w23, w0
     2e0:      	cmp	w0, #0x2
     2e4:      	b.eq	0x304 <ltmp0+0x304>
     2e8:      	ldr	x21, [x21, #0x18]
     2ec:      	cbz	x21, 0x304 <ltmp0+0x304>
     2f0:      	mov	x0, x22
     2f4:      	bl	0x2f4 <ltmp0+0x2f4>
     2f8:      	mov	x1, x0
     2fc:      	mov	x0, x20
     300:      	blr	x21
     304:      	mov	x0, x22
     308:      	bl	0x308 <ltmp0+0x308>
     30c:      	mov	w0, w23
     310:      	sub	sp, x29, #0x40
     314:      	ldp	x29, x30, [sp, #0x40]
     318:      	ldp	x20, x19, [sp, #0x30]
     31c:      	ldp	x22, x21, [sp, #0x20]
     320:      	ldp	x24, x23, [sp, #0x10]
     324:      	ldp	x26, x25, [sp], #0x50
     328:      	ret
     32c:      	mov	w24, #0x100             ; =256
     330:      	adrp	x0, 0x0 <ltmp0>
     334:      	add	x0, x0, #0x0
     338:      	mov	w1, #0x3                ; =3
     33c:      	bl	0x33c <ltmp0+0x33c>
     340:      	cbnz	x0, 0x50 <ltmp0+0x50>
     344:      	mov	w23, #0x2               ; =2
     348:      	b	0x30c <ltmp0+0x30c>
     34c:      	adrp	x2, 0x0 <ltmp0>
     350:      	add	x2, x2, #0x0
     354:      	mov	x0, x22
     358:      	mov	w1, #0xd                ; =13
     35c:      	mov	w3, #0x16               ; =22
     360:      	b	0x3d4 <ltmp0+0x3d4>
     364:      	adrp	x2, 0x0 <ltmp0>
     368:      	add	x2, x2, #0x0
     36c:      	mov	x0, x22
     370:      	mov	w1, #0xe                ; =14
     374:      	mov	w3, #0x15               ; =21
     378:      	b	0x470 <ltmp0+0x470>
     37c:      	adrp	x2, 0x0 <ltmp0>
     380:      	add	x2, x2, #0x0
     384:      	mov	x0, x22
     388:      	mov	w1, #0x9                ; =9
     38c:      	mov	w3, #0x18               ; =24
     390:      	bl	0x390 <ltmp0+0x390>
     394:      	mov	x0, x22
     398:      	mov	w1, #0x1                ; =1
     39c:      	mov	w2, #0xd                ; =13
     3a0:      	b	0x490 <ltmp0+0x490>
     3a4:      	adrp	x2, 0x0 <ltmp0>
     3a8:      	add	x2, x2, #0x0
     3ac:      	mov	x0, x22
     3b0:      	mov	w1, #0x6                ; =6
     3b4:      	mov	w3, #0x13               ; =19
     3b8:      	bl	0x3b8 <ltmp0+0x3b8>
     3bc:      	b	0x4a0 <ltmp0+0x4a0>
     3c0:      	adrp	x2, 0x0 <ltmp0>
     3c4:      	add	x2, x2, #0x0
     3c8:      	mov	x0, x22
     3cc:      	mov	w1, #0xe                ; =14
     3d0:      	mov	w3, #0x15               ; =21
     3d4:      	bl	0x3d4 <ltmp0+0x3d4>
     3d8:      	mov	x0, x22
     3dc:      	mov	w1, #0x1                ; =1
     3e0:      	mov	w2, #0x1                ; =1
     3e4:      	b	0x490 <ltmp0+0x490>
     3e8:      	adrp	x2, 0x0 <ltmp0>
     3ec:      	add	x2, x2, #0x0
     3f0:      	mov	x0, x22
     3f4:      	mov	w1, wzr
     3f8:      	mov	w3, #0x10               ; =16
     3fc:      	bl	0x3fc <ltmp0+0x3fc>
     400:      	mov	x0, x22
     404:      	mov	w1, #0x1                ; =1
     408:      	mov	w2, #0x3                ; =3
     40c:      	b	0x490 <ltmp0+0x490>
     410:      	mov	x0, x22
     414:      	mov	w1, #0x1                ; =1
     418:      	mov	w2, #0x4                ; =4
     41c:      	b	0x490 <ltmp0+0x490>
     420:      	mov	x0, x22
     424:      	mov	w1, #0x1                ; =1
     428:      	mov	w2, #0x7                ; =7
     42c:      	b	0x490 <ltmp0+0x490>
     430:      	mov	x0, x22
     434:      	mov	w1, #0x1                ; =1
     438:      	mov	w2, #0x8                ; =8
     43c:      	b	0x490 <ltmp0+0x490>
     440:      	adrp	x2, 0x0 <ltmp0>
     444:      	add	x2, x2, #0x0
     448:      	mov	x0, x22
     44c:      	mov	w1, #0x6                ; =6
     450:      	mov	w3, #0x13               ; =19
     454:      	bl	0x454 <ltmp0+0x454>
     458:      	b	0x484 <ltmp0+0x484>
     45c:      	adrp	x2, 0x0 <ltmp0>
     460:      	add	x2, x2, #0x0
     464:      	mov	x0, x22
     468:      	mov	w1, #0x6                ; =6
     46c:      	mov	w3, #0x13               ; =19
     470:      	bl	0x470 <ltmp0+0x470>
     474:      	mov	x0, x22
     478:      	mov	w1, wzr
     47c:      	mov	w2, #0x1                ; =1
     480:      	bl	0x480 <ltmp0+0x480>
     484:      	mov	x0, x22
     488:      	mov	w1, #0x1                ; =1
     48c:      	mov	w2, #0xa                ; =10
     490:      	bl	0x490 <ltmp0+0x490>
     494:      	mov	x0, x22
     498:      	mov	x1, x23
     49c:      	bl	0x49c <ltmp0+0x49c>
     4a0:      	ldr	x2, [x21, #0x10]
     4a4:      	mov	x0, x22
     4a8:      	mov	x1, x20
     4ac:      	bl	0x4ac <ltmp0+0x4ac>
     4b0:      	mov	w1, #0x1                ; =1
     4b4:      	mov	x0, x22
     4b8:      	bl	0x4b8 <ltmp0+0x4b8>
     4bc:      	mov	w23, w0
     4c0:      	cmp	w0, #0x2
     4c4:      	b.ne	0x2e8 <ltmp0+0x2e8>
     4c8:      	b	0x304 <ltmp0+0x304>
     4cc:      	mov	x0, x22
     4d0:      	mov	w1, #0x1                ; =1
     4d4:      	mov	w2, #0xb                ; =11
     4d8:      	b	0x490 <ltmp0+0x490>
     4dc:      	mov	x0, x22
     4e0:      	bl	0x4e0 <ltmp0+0x4e0>
     4e4:      	b	0x494 <ltmp0+0x494>
     4e8:      	mov	x0, x22
     4ec:      	mov	w1, #0x1                ; =1
     4f0:      	mov	w2, #0x12               ; =18
     4f4:      	b	0x490 <ltmp0+0x490>

Contract matching

Every required slot checks parameter count and order, parameter and result types, receiver mutation, and fallibility. Requirement parameter names define call labels; a conformer may use different local parameter names. A non-fallible method satisfies a fallible requirement because callers already handle the broader outcome set.

What an interface value carries

One interface valuePayload ownership + static dispatch identity
Owned payload

A copied struct value or a retained class identity.

Witness identity

A static table naming the concrete method implementations.

Interface type

The public set of callable slots and receiver effects.

The interface value is self-contained: it owns what it needs to remain valid when returned, captured, stored in an optional, or placed in a collection of different conforming types.

Dispatch path

  1. Static interface checkThe call is validated against the interface requirement and labels.
  2. Load witness slotThe concrete function identity comes from the value's static witness.
  3. Pass owned payloadThe method receives the copied struct or retained class representation.
  4. Return results or errorsMultiple answers, optionals, and allowed error directions use the same ordinary call machinery.

Two kinds of mutation

A class witness can mutate its shared identity through any interface value that retains it. A value struct witness needs a mutating requirement and a mutable bare local receiver; after the indirect call, the updated payload is written back into that local.

Class conformer

Payload retains identity. Mutation is visible to every alias of the class.

Struct conformer

Payload is an owned copy. A mutating call writes that value back into a mutable local receiver.

Where interface values can travel

Interface values support fields, returns, optionals, closure captures, and heterogeneous lists, maps, and arrays. Their witness contains process-local function identity, so worker sendability excludes them. Weak storage targets reference identities directly, while an interface also contains a witness and owned payload.

The current interface model

Conformance is nominal and produces a fixed witness table for the declared methods. This model gives the compiler a finite dispatch layout and keeps each type’s opt-in visible at its declaration. Interface inheritance, associated types, and runtime casts would require additional representation and resolution rules.