Luce / engineering
Learn Luce LuciaOS

Control flow and matching

A for loop reads like a sentence. A processor needs a test, a body, a step, and an edge back to the test. The compiler builds that graph and places cleanup on every exit edge.

Follow one loop and branch

This program counts command-line arguments longer than two characters. MIR exposes the loop as numbered blocks and branches. LLVM adds concrete list access and safety checks. ARM64 turns the graph into compare-and-branch instructions.

Compiler traceFollow one program through four representations
compiler build information

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

open source file

func main(args: list[str]):
    var total = 0
    for argument in args:
        if len(argument) > 2:
            total += 1
    print(str(total))

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.

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.
greater.i64
Compares two signed 64-bit values and produces a Boolean register for a later branch.
less.i64
Tests signed less-than and produces a Boolean register.
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 index_get
Checks an index and loads the selected element using the collection's value representation.
intrinsic drop_storage
Releases any reference held by a temporary value and leaves that temporary in its empty state.
branch CONDITION, TRUE, FALSE
Chooses one of two basic blocks from a Boolean register.
jump BLOCK
Continues execution at one known basic block.
ret
Returns the current function's result to its caller and closes the current control-flow path.

func main(args: list[str]) -> None
    local %1 total: i64
    local %2 (temporary): list[str]
    local %3 (temporary): i64
    local %4 argument: str
    local %5 (temporary): str
  b0:
    r0 = const 0
    local_set %1, r0
    r2 = local_get %0
    local_set %2, r2
    r4 = const 0
    local_set %3, r4
    jump b1
  b1:
    r7 = local_get %2
    r8 = intrinsic len, r7
    r9 = local_get %3
    r10 = less.i64 r9, r8
    branch r10, b2, b4
  b2:
    r12 = local_get %2
    r13 = local_get %3
    r14 = intrinsic index_get, r12, r13
    local_set %4, r14
    r16 = local_get %4
    r17 = intrinsic len, r16
    r18 = const 2
    r19 = greater.i64 r17, r18
    branch r19, b5, b6
  b3:
    r27 = local_get %3
    r28 = const 1
    r29 = add.i64 r27, r28
    local_set %3, r29
    jump b1
  b4:
    r32 = local_get %1
    r33 = intrinsic str_value, r32
    local_set %5, r33
    intrinsic print, r33
    r36 = local_get %5
    r37 = intrinsic drop_storage, r36
    local_set %5, r37
    ret
  b5:
    r21 = const 1
    r22 = local_get %1
    r23 = add.i64 r22, r21
    local_set %1, r23
    jump b6
  b6:
    jump b3

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.
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_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_len
Reads the logical length for the supplied runtime value, including Unicode-scalar length for strings.
@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/control.luc'
source_filename = "/Users/sedov/Dev/luciaos/www/lucelang/examples/control.luc"
target triple = "arm64-apple-darwin24.6.0"

@luce.text.0 = private unnamed_addr constant [0 x i8] zeroinitializer
@luce.dead.row = private constant <{ [96 x i8], i32, [12 x i8] }> <{ [96 x i8] zeroinitializer, i32 -1, [12 x i8] zeroinitializer }>, align 8
@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"index out of bounds"
@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 [58 x i8] c"/Users/sedov/Dev/luciaos/www/lucelang/examples/control.luc"
@luce.origins.0 = private constant [40 x { i32, i32 }] [{ i32, i32 } { i32 2, i32 5 }, { i32, i32 } { i32 2, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 3, i32 5 }, { i32, i32 } { i32 4, i32 9 }, { i32, i32 } { i32 4, i32 9 }, { i32, i32 } { i32 4, i32 9 }, { i32, i32 } { i32 4, i32 9 }, { i32, i32 } { i32 4, i32 9 }, { i32, i32 } { i32 5, i32 13 }, { i32, i32 } { i32 5, i32 13 }, { i32, i32 } { i32 5, i32 13 }, { i32, i32 } { i32 5, i32 13 }, { i32, i32 } { i32 5, i32 13 }, { i32, i32 } { i32 5, i32 13 }, { i32, i32 } { i32 5, i32 13 }, { i32, i32 } { i32 5, i32 13 }, { i32, i32 } { i32 5, i32 13 }, { i32, i32 } { i32 5, i32 13 }, { i32, i32 } { i32 5, i32 13 }, { i32, i32 } { i32 6, i32 5 }, { i32, i32 } { i32 6, i32 5 }, { i32, i32 } { i32 6, i32 5 }, { i32, i32 } { i32 6, i32 5 }, { i32, i32 } { i32 6, i32 5 }, { i32, i32 } { i32 6, i32 5 }, { i32, i32 } { i32 6, i32 5 }, { i32, i32 } { i32 6, i32 5 }]
@luce.functions = private constant [1 x { ptr, i64, ptr, i64, ptr, i64 }] [{ ptr, i64, ptr, i64, ptr, i64 } { ptr @luce.text.6, i64 4, ptr @luce.text.7, i64 58, ptr @luce.origins.0, i64 40 }]
@luce.text.8 = private unnamed_addr constant [19 x i8] c"call depth exceeded"
@luce_artifact = constant { i64, i64, i64, i32, i32, i32, i32, { i32, [52 x i8] } } { i64 23734338332087628, i64 0, i64 -7092229304759745108, i32 3, i32 29, i32 1, i32 0, { i32, [52 x i8] } { i32 18, [52 x i8] c"aarch64-macos-none\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" } }

define internal i32 @luce.0.main(ptr align 8 nocapture readonly nonnull dereferenceable(472) noundef %0, ptr align 8 nocapture nonnull noundef %1, i64 noundef %2, i64 %3) {
4:
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca { ptr, i64 }, align 8
  %10 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  store i64 %3, ptr %5, align 8
  store i64 0, ptr %6, align 8
  store i64 4294967295, ptr %7, align 8
  store i64 0, ptr %8, align 8
  store { ptr, i64 } { ptr @luce.text.0, i64 0 }, ptr %9, align 8
  %11 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 0
  store i8 4, ptr %11, align 1
  %12 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 1
  store i8 -1, ptr %12, align 1
  %13 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 0
  %14 = ptrtoint ptr %13 to i64
  %15 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 3
  store i64 %14, ptr %15, align 8
  %16 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 1
  %17 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 4
  store i64 %16, ptr %17, align 8
  %18 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %19 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %18, i32 0, i32 0
  store i8 4, ptr %19, align 1
  %20 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %18, i32 0, i32 1
  store i8 -1, ptr %20, align 1
  %21 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %22 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %23 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %22, i32 0, i32 0
  store i8 2, ptr %23, align 1
  %24 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %22, i32 0, i32 4
  store i64 0, ptr %24, align 8
  %25 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  %26 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
  br label %27

27:
  store i64 0, ptr %6, align 8
  %28 = load i64, ptr %5, align 8
  store i64 %28, ptr %7, align 8
  store i64 0, ptr %8, align 8
  %29 = load i64, ptr %7, align 8
  %30 = trunc i64 %29 to i32
  %31 = lshr i64 %29, 32
  %32 = trunc i64 %31 to i32
  %33 = getelementptr inbounds i8, ptr %1, i64 96
  %34 = load ptr, ptr %33, align 8!alias.scope !0, !noalias !1
  %35 = icmp eq i32 %30, -1
  %36 = zext i32 %30 to i64
  %37 = mul nsw i64 %36, 112
  %38 = getelementptr inbounds i8, ptr %34, i64 %37
  %39 = select i1 %35, ptr @luce.dead.row, ptr %38
  %40 = getelementptr inbounds i8, ptr %39, i64 96
  %41 = load i32, ptr %40, align 4, !alias.scope !0, !noalias !1
  %42 = load ptr, ptr %39, align 8, !alias.scope !0, !noalias !1
  %43 = getelementptr inbounds i8, ptr %39, i64 16
  %44 = load i64, ptr %43, align 8, !alias.scope !0, !noalias !1
  br label %45

45:
  %46 = load i64, ptr %7, align 8
  %47 = trunc i64 %46 to i32
  %48 = lshr i64 %46, 32
  %49 = trunc i64 %48 to i32
  %50 = icmp eq i32 %47, -1
  br i1 %50, label %74, label %77, !prof !2

51:
  %52 = load i64, ptr %7, align 8
  %53 = load i64, ptr %8, align 8
  %54 = trunc i64 %52 to i32
  %55 = lshr i64 %52, 32
  %56 = trunc i64 %55 to i32
  %57 = icmp eq i32 %54, -1
  br i1 %57, label %91, label %94, !prof !2

58:
  %59 = load i64, ptr %8, align 8
  %60 = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %59, i64 1)
  %61 = extractvalue { i64, i1 } %60, 0
  %62 = extractvalue { i64, i1 } %60, 1
  br i1 %62, label %143, label %146, !prof !2

63:
  %64 = load i64, ptr %6, align 8
  %65 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %22, i32 0, i32 3
  store i64 %64, ptr %65, align 8
  %66 = call i32 @luce_rt_str(ptr %1, ptr %22, ptr %25)
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %147, label %148, !prof !2

68:
  %69 = load i64, ptr %6, align 8
  %70 = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %69, i64 1)
  %71 = extractvalue { i64, i1 } %70, 0
  %72 = extractvalue { i64, i1 } %70, 1
  br i1 %72, label %213, label %216, !prof !2

73:
  br label %58

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

77:
  %78 = icmp ne i32 %41, %49
  br i1 %78, label %79, label %82, !prof !2

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

82:
  %83 = and i32 %41, 1
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %88, !prof !2

85:
  %86 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 0
  %87 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 1
  call void @luce_rt_raise(ptr %1, i32 13, ptr %86, i64 %87)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 8)
  ret i32 1

88:
  %89 = load i64, ptr %8, align 8
  %90 = icmp slt i64 %89, %44
  br i1 %90, label %51, label %63

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

94:
  %95 = icmp ne i32 %41, %56
  br i1 %95, label %96, label %99, !prof !2

96:
  %97 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 0
  %98 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 1
  call void @luce_rt_raise(ptr %1, i32 13, ptr %97, i64 %98)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 14)
  ret i32 1

99:
  %100 = and i32 %41, 1
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %105, !prof !2

102:
  %103 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 0
  %104 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 1
  call void @luce_rt_raise(ptr %1, i32 13, ptr %103, i64 %104)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 14)
  ret i32 1

105:
  %106 = icmp slt i64 %53, 0
  %107 = icmp sge i64 %53, %44
  %108 = or i1 %106, %107
  br i1 %108, label %109, label %112, !prof !2

109:
  %110 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 19 }, 0
  %111 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 19 }, 1
  call void @luce_rt_raise(ptr %1, i32 10, ptr %110, i64 %111)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 14)
  ret i32 1

112:
  %113 = mul nsw i64 0, %44
  %114 = add nsw i64 %113, %53
  %115 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %42, i64 %114
  %116 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %115, i32 0, i32 3
  %117 = load i64, ptr %116, align 8
  %118 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %115, i32 0, i32 1
  %119 = load i8, ptr %118, align 1
  %120 = icmp eq i8 %119, -1
  %121 = inttoptr i64 %117 to ptr
  %122 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %115, i32 0, i32 2
  %123 = select i1 %120, ptr %121, ptr %122
  %124 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %115, i32 0, i32 4
  %125 = load i64, ptr %124, align 8
  %126 = zext i8 %119 to i64
  %127 = select i1 %120, i64 %125, i64 %126
  %128 = insertvalue { ptr, i64 } poison, ptr %123, 0
  %129 = insertvalue { ptr, i64 } %128, i64 %127, 1
  store { ptr, i64 } %129, ptr %9, align 8
  %130 = load { ptr, i64 }, ptr %9, align 8
  %131 = extractvalue { ptr, i64 } %130, 0
  %132 = ptrtoint ptr %131 to i64
  %133 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %18, i32 0, i32 3
  store i64 %132, ptr %133, align 8
  %134 = extractvalue { ptr, i64 } %130, 1
  %135 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %18, i32 0, i32 4
  store i64 %134, ptr %135, align 8
  %136 = call i32 @luce_rt_len(ptr %1, ptr %18, ptr %21)
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %139, !prof !2

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

139:
  %140 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %21, i32 0, i32 3
  %141 = load i64, ptr %140, align 8
  %142 = icmp sgt i64 %141, 2
  br i1 %142, label %68, label %73

143:
  %144 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 16 }, 0
  %145 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 16 }, 1
  call void @luce_rt_raise(ptr %1, i32 0, ptr %144, i64 %145)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 29)
  ret i32 1

146:
  store i64 %61, ptr %8, align 8
  br label %45

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

148:
  %149 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %25, i32 0, i32 3
  %150 = load i64, ptr %149, align 8
  %151 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %25, i32 0, i32 1
  %152 = load i8, ptr %151, align 1
  %153 = icmp eq i8 %152, -1
  %154 = inttoptr i64 %150 to ptr
  %155 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %25, i32 0, i32 2
  %156 = select i1 %153, ptr %154, ptr %155
  %157 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %25, i32 0, i32 4
  %158 = load i64, ptr %157, align 8
  %159 = zext i8 %152 to i64
  %160 = select i1 %153, i64 %158, i64 %159
  %161 = insertvalue { ptr, i64 } poison, ptr %156, 0
  %162 = insertvalue { ptr, i64 } %161, i64 %160, 1
  call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %10, ptr align 8 %25, i64 24, i1 false)
  %163 = extractvalue { ptr, i64 } %162, 0
  %164 = extractvalue { ptr, i64 } %162, 1
  %165 = 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
  %166 = load ptr, ptr %165, align 8
  %167 = icmp eq ptr %166, null
  br i1 %167, label %168, label %171, !prof !2

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

171:
  %172 = 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
  %173 = load ptr, ptr %172, align 8
  %174 = call i32 %166(ptr %173, ptr %163, i64 %164)
  %175 = icmp eq i32 %174, -1
  br i1 %175, label %176, label %177, !prof !2

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

177:
  %178 = icmp ne i32 %174, 0
  %179 = icmp ne i32 %174, 1
  %180 = and i1 %178, %179
  br i1 %180, label %181, label %184, !prof !2

181:
  %182 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 24 }, 0
  %183 = extractvalue { ptr, i64 } { ptr @luce.text.5, i64 24 }, 1
  call void @luce_rt_raise(ptr %1, i32 9, ptr %182, i64 %183)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 35)
  ret i32 1

184:
  %185 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 3
  %186 = load i64, ptr %185, align 8
  %187 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 1
  %188 = load i8, ptr %187, align 1
  %189 = icmp eq i8 %188, -1
  %190 = inttoptr i64 %186 to ptr
  %191 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 2
  %192 = select i1 %189, ptr %190, ptr %191
  %193 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %10, i32 0, i32 4
  %194 = load i64, ptr %193, align 8
  %195 = zext i8 %188 to i64
  %196 = select i1 %189, i64 %194, i64 %195
  %197 = insertvalue { ptr, i64 } poison, ptr %192, 0
  %198 = insertvalue { ptr, i64 } %197, i64 %196, 1
  call void @luce_rt_drop_storage(ptr %1, ptr %10, ptr %26)
  %199 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %26, i32 0, i32 3
  %200 = load i64, ptr %199, align 8
  %201 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %26, i32 0, i32 1
  %202 = load i8, ptr %201, align 1
  %203 = icmp eq i8 %202, -1
  %204 = inttoptr i64 %200 to ptr
  %205 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %26, i32 0, i32 2
  %206 = select i1 %203, ptr %204, ptr %205
  %207 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %26, i32 0, i32 4
  %208 = load i64, ptr %207, align 8
  %209 = zext i8 %202 to i64
  %210 = select i1 %203, i64 %208, i64 %209
  %211 = insertvalue { ptr, i64 } poison, ptr %206, 0
  %212 = insertvalue { ptr, i64 } %211, i64 %210, 1
  call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %10, ptr align 8 %26, i64 24, i1 false)
  ret i32 0

213:
  %214 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 16 }, 0
  %215 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 16 }, 1
  call void @luce_rt_raise(ptr %1, i32 0, ptr %214, i64 %215)
  call void @luce_rt_unwound(ptr %1, i32 0, i32 23)
  ret i32 1

216:
  store i64 %71, ptr %6, align 8
  br label %73
}

; 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(read, argmem: readwrite)
declare i32 @luce_rt_len(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

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

; 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) #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) #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 1)
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %16, !prof !2

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 !2

64:
  call void @luce_rt_raise(ptr %13, i32 6, ptr @luce.text.8, 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 !2

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 !2

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 !2

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) #10

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

; Function Attrs: cold
declare void @luce_rt_report(ptr nocapture nonnull noundef %0, ptr %1, ptr %2) #11

; Function Attrs: cold
declare void @luce_rt_report_error(ptr nocapture nonnull noundef %0, ptr %1, ptr %2) #11

; Function Attrs: nounwind willreturn memory(argmem: read)
declare i32 @luce_rt_status(ptr nocapture nonnull noundef %0, i32 %1) #12

; Function Attrs: nounwind willreturn memory(argmem: read)
declare i64 @luce_rt_leaked(ptr nocapture nonnull noundef %0) #12

; Function Attrs: nounwind memory(readwrite)
declare void @luce_rt_close(ptr nocapture nonnull noundef %0) #10

attributes #0 = { nounwind cold willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #1 = { nounwind willreturn memory(read, argmem: readwrite) }
attributes #2 = { nounwind speculatable willreturn nofree nosync nocallback memory(none) }
attributes #3 = { nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: readwrite) }
attributes #4 = { nounwind willreturn nofree nocallback memory(argmem: readwrite) }
attributes #5 = { nounwind cold willreturn memory(argmem: write) }
attributes #6 = { nounwind willreturn memory(argmem: readwrite, inaccessiblemem: 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 = { nounwind memory(readwrite) }
attributes #11 = { cold }
attributes #12 = { nounwind willreturn memory(argmem: read) }

!0 = !{!3}
!1 = !{!4}
!2 = !{!"branch_weights", i32 1, i32 2000}
!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.
cset
Writes 1 or 0 according to a condition, producing a Boolean value from processor flags.
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.
ldurb
Loads one byte using an unscaled byte offset.
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.lt
Branches when the signed left operand was smaller.
b.le
Branches when the signed left operand was smaller or equal.
b.ge
Branches when the signed left operand was greater or equal.
b.hs
Branches when an unsigned comparison found higher-or-same, represented by a set carry flag.
b.vc
Branches when the arithmetic overflow flag is clear.
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/control.o:	file format mach-o arm64

Disassembly of section __TEXT,__text:

0000000000000000 <ltmp0>:
; luce_main():
       0:      	stp	x28, x27, [sp, #-0x60]!
       4:      	stp	x26, x25, [sp, #0x10]
       8:      	stp	x24, x23, [sp, #0x20]
       c:      	stp	x22, x21, [sp, #0x30]
      10:      	stp	x20, x19, [sp, #0x40]
      14:      	stp	x29, x30, [sp, #0x50]
      18:      	add	x29, sp, #0x50
      1c:      	sub	sp, sp, #0xa0
      20:      	ldr	x8, [x0, #0x70]
      24:      	ldr	x19, [x0]
      28:      	mov	x20, x0
      2c:      	cbz	x8, 0x1d8 <ltmp0+0x1d8>
      30:      	mov	x0, x19
      34:      	blr	x8
      38:      	cmp	x0, #0x1
      3c:      	cset	w22, lt
      40:      	adrp	x0, 0x0 <ltmp0>
      44:      	add	x0, x0, #0x0
      48:      	mov	w1, #0x1                ; =1
      4c:      	bl	0x4c <ltmp0+0x4c>
      50:      	cbz	x0, 0x1f0 <ltmp0+0x1f0>
      54:      	ldp	x3, x4, [x20, #0x1b0]
      58:      	mov	x21, x0
      5c:      	ldp	x5, x6, [x20, #0x1c0]
      60:      	ldr	x2, [x20, #0xe0]
      64:      	ldp	x8, x9, [x20, #0xf8]
      68:      	ldr	x7, [x20, #0x1d0]
      6c:      	ldur	q0, [x20, #0xe8]
      70:      	sub	sp, sp, #0x20
      74:      	mov	x1, x19
      78:      	stp	x8, x9, [sp, #0x10]
      7c:      	str	q0, [sp]
      80:      	bl	0x80 <ltmp0+0x80>
      84:      	add	sp, sp, #0x20
      88:      	ldp	x2, x3, [x20, #0x180]
      8c:      	mov	x0, x21
      90:      	ldp	x4, x5, [x20, #0x190]
      94:      	mov	x1, x19
      98:      	ldr	x6, [x20, #0x1a0]
      9c:      	bl	0x9c <ltmp0+0x9c>
      a0:      	ldp	x8, x9, [x20, #0x170]
      a4:      	ldp	x2, x3, [x20, #0x140]
      a8:      	ldp	x4, x5, [x20, #0x150]
      ac:      	ldp	x6, x7, [x20, #0x160]
      b0:      	stp	x8, x9, [sp, #-0x10]!
      b4:      	mov	x0, x21
      b8:      	mov	x1, x19
      bc:      	bl	0xbc <ltmp0+0xbc>
      c0:      	add	sp, sp, #0x10
      c4:      	cbnz	w22, 0x388 <ltmp0+0x388>
      c8:      	sub	x22, sp, #0x20
      cc:      	mov	sp, x22
      d0:      	ldp	x2, x3, [x20, #0x20]
      d4:      	mov	x0, x21
      d8:      	mov	x1, x19
      dc:      	mov	x4, x22
      e0:      	bl	0xe0 <ltmp0+0xe0>
      e4:      	cbnz	w0, 0x31c <ltmp0+0x31c>
      e8:      	ldr	x8, [x22, #0x8]
      ec:      	mov	w9, #0xff04             ; =65284
      f0:      	mov	w10, #0x70              ; =112
      f4:      	sturh	w9, [x29, #-0x88]
      f8:      	ldr	x12, [x21, #0x60]
      fc:      	mov	w11, #0x2               ; =2
     100:      	mov	w9, w8
     104:      	cmn	w8, #0x1
     108:      	sturb	w11, [x29, #-0xb8]
     10c:      	umaddl	x10, w9, w10, x12
     110:      	adrp	x9, 0x0 <ltmp0>
     114:      	add	x9, x9, #0x0
     118:      	stur	xzr, [x29, #-0xa8]
     11c:      	csel	x9, x9, x10, eq
     120:      	b.eq	0x2e8 <ltmp0+0x2e8>
     124:      	ldr	w10, [x10, #0x60]
     128:      	lsr	x8, x8, #32
     12c:      	cmp	w10, w8
     130:      	b.ne	0x348 <ltmp0+0x348>
     134:      	tbnz	w10, #0x0, 0x348 <ltmp0+0x348>
     138:      	ldr	x24, [x9, #0x10]
     13c:      	cmp	x24, #0x1
     140:      	b.lt	0x1f8 <ltmp0+0x1f8>
     144:      	ldr	x8, [x9]
     148:      	mov	x23, xzr
     14c:      	mov	x25, xzr
     150:      	add	x26, x8, #0x10
     154:      	add	x27, x8, #0x2
     158:      	b	0x170 <ltmp0+0x170>
     15c:      	add	x25, x25, #0x1
     160:      	add	x26, x26, #0x18
     164:      	add	x27, x27, #0x18
     168:      	cmp	x25, x24
     16c:      	b.ge	0x1fc <ltmp0+0x1fc>
     170:      	ldurb	w8, [x26, #-0xf]
     174:      	ldp	x9, x10, [x26, #-0x8]
     178:      	sub	x1, x29, #0x88
     17c:      	sub	x2, x29, #0xa0
     180:      	mov	x0, x21
     184:      	cmp	w8, #0xff
     188:      	csel	x9, x9, x27, eq
     18c:      	csel	x8, x10, x8, eq
     190:      	stp	x9, x8, [x29, #-0x80]
     194:      	bl	0x194 <ltmp0+0x194>
     198:      	cbnz	w0, 0x2d8 <ltmp0+0x2d8>
     19c:      	ldur	x8, [x29, #-0x98]
     1a0:      	cmp	x8, #0x2
     1a4:      	b.le	0x15c <ltmp0+0x15c>
     1a8:      	adds	x23, x23, #0x1
     1ac:      	b.vc	0x15c <ltmp0+0x15c>
     1b0:      	adrp	x2, 0x0 <ltmp0>
     1b4:      	add	x2, x2, #0x0
     1b8:      	mov	x0, x21
     1bc:      	mov	w1, wzr
     1c0:      	mov	w3, #0x10               ; =16
     1c4:      	bl	0x1c4 <ltmp0+0x1c4>
     1c8:      	mov	x0, x21
     1cc:      	mov	w1, wzr
     1d0:      	mov	w2, #0x17               ; =23
     1d4:      	b	0x30c <ltmp0+0x30c>
     1d8:      	mov	w22, wzr
     1dc:      	adrp	x0, 0x0 <ltmp0>
     1e0:      	add	x0, x0, #0x0
     1e4:      	mov	w1, #0x1                ; =1
     1e8:      	bl	0x1e8 <ltmp0+0x1e8>
     1ec:      	cbnz	x0, 0x54 <ltmp0+0x54>
     1f0:      	mov	w22, #0x2               ; =2
     1f4:      	b	0x2b4 <ltmp0+0x2b4>
     1f8:      	mov	x23, xzr
     1fc:      	sub	x1, x29, #0xb8
     200:      	sub	x2, x29, #0xd0
     204:      	mov	x0, x21
     208:      	stur	x23, [x29, #-0xb0]
     20c:      	bl	0x20c <ltmp0+0x20c>
     210:      	cbnz	w0, 0x3a4 <ltmp0+0x3a4>
     214:      	ldp	x9, x10, [x29, #-0xc8]
     218:      	ldur	q0, [x29, #-0xd0]
     21c:      	ldr	x8, [x20, #0x8]
     220:      	ldurb	w11, [x29, #-0xcf]
     224:      	stur	q0, [x29, #-0x70]
     228:      	stur	x10, [x29, #-0x60]
     22c:      	cbz	x8, 0x360 <ltmp0+0x360>
     230:      	sub	x12, x29, #0xd0
     234:      	cmp	w11, #0xff
     238:      	ldr	x0, [x20]
     23c:      	orr	x12, x12, #0x2
     240:      	csel	x2, x10, x11, eq
     244:      	csel	x1, x9, x12, eq
     248:      	blr	x8
     24c:      	cmn	w0, #0x1
     250:      	b.eq	0x3b4 <ltmp0+0x3b4>
     254:      	cmp	w0, #0x2
     258:      	b.hs	0x360 <ltmp0+0x360>
     25c:      	sub	x1, x29, #0x70
     260:      	sub	x2, x29, #0xe8
     264:      	mov	x0, x21
     268:      	bl	0x268 <ltmp0+0x268>
     26c:      	mov	x0, x21
     270:      	mov	x1, x22
     274:      	bl	0x274 <ltmp0+0x274>
     278:      	mov	w1, wzr
     27c:      	mov	x0, x21
     280:      	bl	0x280 <ltmp0+0x280>
     284:      	mov	w22, w0
     288:      	cmp	w0, #0x2
     28c:      	b.eq	0x2ac <ltmp0+0x2ac>
     290:      	ldr	x20, [x20, #0x18]
     294:      	cbz	x20, 0x2ac <ltmp0+0x2ac>
     298:      	mov	x0, x21
     29c:      	bl	0x29c <ltmp0+0x29c>
     2a0:      	mov	x1, x0
     2a4:      	mov	x0, x19
     2a8:      	blr	x20
     2ac:      	mov	x0, x21
     2b0:      	bl	0x2b0 <ltmp0+0x2b0>
     2b4:      	mov	w0, w22
     2b8:      	sub	sp, x29, #0x50
     2bc:      	ldp	x29, x30, [sp, #0x50]
     2c0:      	ldp	x20, x19, [sp, #0x40]
     2c4:      	ldp	x22, x21, [sp, #0x30]
     2c8:      	ldp	x24, x23, [sp, #0x20]
     2cc:      	ldp	x26, x25, [sp, #0x10]
     2d0:      	ldp	x28, x27, [sp], #0x60
     2d4:      	ret
     2d8:      	mov	x0, x21
     2dc:      	mov	w1, wzr
     2e0:      	mov	w2, #0x11               ; =17
     2e4:      	b	0x30c <ltmp0+0x30c>
     2e8:      	adrp	x2, 0x0 <ltmp0>
     2ec:      	add	x2, x2, #0x0
     2f0:      	mov	x0, x21
     2f4:      	mov	w1, #0xe                ; =14
     2f8:      	mov	w3, #0x15               ; =21
     2fc:      	bl	0x2fc <ltmp0+0x2fc>
     300:      	mov	x0, x21
     304:      	mov	w1, wzr
     308:      	mov	w2, #0x8                ; =8
     30c:      	bl	0x30c <ltmp0+0x30c>
     310:      	mov	x0, x21
     314:      	mov	x1, x22
     318:      	bl	0x318 <ltmp0+0x318>
     31c:      	ldr	x2, [x20, #0x10]
     320:      	mov	x0, x21
     324:      	mov	x1, x19
     328:      	bl	0x328 <ltmp0+0x328>
     32c:      	mov	w1, #0x1                ; =1
     330:      	mov	x0, x21
     334:      	bl	0x334 <ltmp0+0x334>
     338:      	mov	w22, w0
     33c:      	cmp	w0, #0x2
     340:      	b.ne	0x290 <ltmp0+0x290>
     344:      	b	0x2ac <ltmp0+0x2ac>
     348:      	adrp	x2, 0x0 <ltmp0>
     34c:      	add	x2, x2, #0x0
     350:      	mov	x0, x21
     354:      	mov	w1, #0xd                ; =13
     358:      	mov	w3, #0x16               ; =22
     35c:      	b	0x2fc <ltmp0+0x2fc>
     360:      	adrp	x2, 0x0 <ltmp0>
     364:      	add	x2, x2, #0x0
     368:      	mov	x0, x21
     36c:      	mov	w1, #0x9                ; =9
     370:      	mov	w3, #0x18               ; =24
     374:      	bl	0x374 <ltmp0+0x374>
     378:      	mov	x0, x21
     37c:      	mov	w1, wzr
     380:      	mov	w2, #0x23               ; =35
     384:      	b	0x30c <ltmp0+0x30c>
     388:      	adrp	x2, 0x0 <ltmp0>
     38c:      	add	x2, x2, #0x0
     390:      	mov	x0, x21
     394:      	mov	w1, #0x6                ; =6
     398:      	mov	w3, #0x13               ; =19
     39c:      	bl	0x39c <ltmp0+0x39c>
     3a0:      	b	0x31c <ltmp0+0x31c>
     3a4:      	mov	x0, x21
     3a8:      	mov	w1, wzr
     3ac:      	mov	w2, #0x21               ; =33
     3b0:      	b	0x30c <ltmp0+0x30c>
     3b4:      	mov	x0, x21
     3b8:      	bl	0x3b8 <ltmp0+0x3b8>
     3bc:      	b	0x310 <ltmp0+0x310>

The control vocabulary

if/elif/else, while, counted for, sequence for, match, break, continue, and return are statements. Conditions accept bool; programs use an explicit comparison or presence check to derive that value from another type.

Structured source, explicit edges

Loop control-flow graphEvery exit knows which values to release
headerevaluate Boolean condition
bodychecked statements
continuerelease body locals
exitcontinue with agreed local state

break targets the exit instead; return targets the function epilogue. HIR preserves the loop and its exits. MIR gives each target a basic block and inserts the recorded releases before the branch.

Match is typed dispatch

An enum match dispatches on the closed member set. A union match opens the payload only inside the corresponding arm. Scalar match supports exact integer, char, str, and bool values, several literals per arm, and inclusive ranges for ordered scalar types.

Enum / unionMay omit else only when every member is covered.
Booleantrue and false can prove complete scalar coverage.
Other scalarUses else to cover the values outside the listed literals and ranges.
FloatRefused as a scrutinee; NaN and representation edges make literal coverage misleading.

Narrowing is flow state

A stable optional local or parameter can narrow after a presence check. Branches join conservatively, and a loop keeps only facts that remain valid across mutation. Each weak-storage access performs a fresh upgrade attempt, so its result is narrowed by storing that snapshot in a stable local.

Exits are ownership edges

Every structured exit carries the locals and statement temporaries it leaves. The same cleanup model covers normal fallthrough, early return, loop control, and recoverable-error propagation. Terminal traps unwind through the runtime trace channel under their own contract.

Recursion is bounded at run time

Recursive calls are ordinary calls, and each run has a call-depth budget. The budget raises a stable trap with a bounded trace before the host stack is exhausted. Debug artifacts retain source positions; stripped artifacts retain function names.