Text, bytes, and builders
The + in "arguments: " + count calls Luce’s text concatenation operation. The runtime allocates valid UTF-8 storage, copies both strings, and returns a new value whose lifetime the compiler tracks.
Follow one string concatenation
The source is short. MIR names text operations and the drops required for temporary storage. LLVM IR turns those operations into calls through Luce’s runtime ABI. The assembly sets up arguments, calls those runtime functions, checks their results, and cleans up temporary values.
Luce source. Names and indentation describe the program for a reader.
open source file
func main(args: list[str]):
let count = str(len(args))
let message = "arguments: " + count
print(message)
Luce MIR. Types, registers, blocks, calls, and lifetime operations form the instruction plan sent to the LLVM backend.
open MIR fileMIR instruction guide hover, focus, or tap dotted terms
r7 is one typed intermediate value, %2 is a local storage slot, and b1 is a basic block. Read each block from top to bottom, then follow its final control-flow instruction.
Hover or focus a dotted term in the file for its explanation. On a touch screen, tap a term to keep the note open and tap elsewhere to close it. The list includes the operations that appear in this file.
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.str- Requests string concatenation. The runtime allocates UTF-8 storage and returns an owned string value.
intrinsic NAME- Invokes a language operation with runtime rules recorded by the compiler. The name identifies the operation.
intrinsic len- Reads the logical length defined by the value's type, such as argument count or Unicode-scalar count.
intrinsic str_value- Converts a typed value into owned text through Luce's string conversion rules.
intrinsic print- Sends text through the installed host output capability.
intrinsic drop_storage- Releases any reference held by a temporary value and leaves that temporary in its empty state.
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 (temporary): str
local %2 count: str
local %3 (temporary): str
local %4 message: str
b0:
r0 = local_get %0
r1 = intrinsic len, r0
r2 = intrinsic str_value, r1
local_set %2, r2
r4 = const data#0
r5 = local_get %2
r6 = add.str r4, r5
local_set %4, r6
r8 = local_get %4
intrinsic print, r8
r10 = local_get %4
r11 = intrinsic drop_storage, r10
local_set %4, r11
r13 = local_get %2
r14 = intrinsic drop_storage, r13
local_set %2, r14
ret
LLVM IR. The backend expands MIR into typed memory operations, calls, checks, and control-flow blocks for LLVM.
open LLVM IR fileLLVM IR instruction guide hover, focus, or tap dotted terms
%7 is an SSA value, i64 is a 64-bit integer type, ptr is a pointer, and @name is a module symbol. Numbered labels divide the function into basic blocks.
Hover or focus a dotted term in the file for its explanation. On a touch screen, tap a term to keep the note open and tap elsewhere to close it. The list includes the operations that appear in this file.
@name = …- Defines module data such as text constants, source positions, function records, and the artifact identity tag.
define … @name- Begins a generated function. The parameter attributes tell LLVM which pointers are valid, writable, or read-only.
declare … @name- Declares a runtime or LLVM helper whose body is provided elsewhere.
numeric label- Starts an LLVM basic block. Every branch names one of these labels as its destination.
%0, %1, …- Names an SSA value. Each name is assigned once, allowing LLVM to trace definitions and uses directly.
alloca- Reserves a stack slot for a local value, return area, or temporary aggregate.
getelementptr- Calculates the address of a field or indexed element while preserving LLVM's type and bounds information.
load- Copies a typed value from memory into an SSA value.
store- Copies an SSA value into a stack slot, object field, return area, or runtime structure.
icmp- Compares integers or pointers and produces the one-bit condition consumed by a branch or select.
br- Transfers control to another block. With an
i1operand it chooses between two destinations. select- Chooses one of two SSA values from a condition, which can become a branch-free machine instruction.
call- Invokes a generated function, a runtime helper, a host callback, or an LLVM intrinsic.
extractvalue- Reads one field from an SSA aggregate, such as the result and overflow bit returned together.
insertvalue- Builds an SSA aggregate one field at a time.
ptrtoint- Encodes a pointer as an integer field inside Luce's uniform runtime value representation.
inttoptr- Recovers a pointer from the integer field of Luce's uniform runtime value representation.
zext- Widens an unsigned value by filling the new high bits with zero.
trunc- Keeps the low bits while converting to a narrower integer representation.
lshr- Shifts bits right and fills the high side with zero; this is useful for unpacking handle fields.
and- Combines or masks bits, often to inspect a flag in a packed handle or status value.
or- Sets or combines bits in a packed value.
mul- Multiplies integers after the language-specific checks have been represented.
ret- Returns a status or value and ends the current basic block.
@llvm.memcpy.inline- Copies a small fixed-size value representation; LLVM can expand it directly for the target.
@luce_rt_open- Creates the per-run runtime state and installs the table used to turn function numbers into source-aware traces.
@luce_rt_close- Closes the per-run runtime state after the final status and reports have been collected.
@luce_rt_args_list- Builds the owned
list[str]passed tomainfrom the host's argument callbacks. @luce_rt_status- Combines the generated function result with runtime trap, error, exhaustion, and exit state.
@luce_rt_report_error- Sends an uncaught recoverable error through the host's error-report callback.
@luce_rt_report- Sends the completed trap report through the host callback selected by the entry wrapper.
@luce_rt_leaked- Reads the live-object count used to detect references that remain after program cleanup.
@luce_rt_exhaust- Records allocation exhaustion in the current run so the entry wrapper returns the corresponding status.
@luce_rt_raise- Records a source-aware trap in the runtime so every execution path reports the same code and location.
@luce_rt_unwound- Adds one generated function frame while a trap or uncaught error travels toward the entry point.
@luce_rt_release- Removes a strong owner and triggers destruction at zero.
@luce_rt_drop_storage- Releases reference-bearing fields in a temporary runtime value.
@luce_rt_str- Converts a uniform runtime value into owned UTF-8 text.
@luce_rt_concat- Allocates and joins two UTF-8 string values under Luce's text rules.
@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/text.luc'
source_filename = "/Users/sedov/Dev/luciaos/www/lucelang/examples/text.luc"
target triple = "arm64-apple-darwin24.6.0"
@luce.text.0 = private unnamed_addr constant [0 x i8] zeroinitializer
@luce.text.1 = private unnamed_addr constant [21 x i8] c"null object reference"
@luce.text.2 = private unnamed_addr constant [22 x i8] c"object used after free"
@luce.text.3 = private unnamed_addr constant [11 x i8] c"arguments: "
@luce.text.4 = private unnamed_addr constant [24 x i8] c"host service unavailable"
@luce.text.5 = private unnamed_addr constant [4 x i8] c"main"
@luce.text.6 = private unnamed_addr constant [55 x i8] c"/Users/sedov/Dev/luciaos/www/lucelang/examples/text.luc"
@luce.origins.0 = private constant [17 x { i32, i32 }] [{ i32, i32 } { i32 2, i32 5 }, { i32, i32 } { i32 2, i32 5 }, { 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 4, i32 5 }, { i32, i32 } { i32 4, i32 5 }, { i32, i32 } { i32 4, i32 5 }, { i32, i32 } { i32 4, i32 5 }, { i32, i32 } { i32 4, i32 5 }, { i32, i32 } { i32 4, i32 5 }, { i32, i32 } { i32 4, i32 5 }, { i32, i32 } { i32 4, i32 5 }, { i32, i32 } { i32 4, i32 5 }]
@luce.functions = private constant [1 x { ptr, i64, ptr, i64, ptr, i64 }] [{ ptr, i64, ptr, i64, ptr, i64 } { ptr @luce.text.5, i64 4, ptr @luce.text.6, i64 55, ptr @luce.origins.0, i64 17 }]
@luce.text.7 = 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 { 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 4, ptr %10, align 1
%11 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %6, i32 0, i32 1
store i8 -1, ptr %11, align 1
%12 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 0
%13 = ptrtoint ptr %12 to i64
%14 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %6, i32 0, i32 3
store i64 %13, ptr %14, align 8
%15 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 1
%16 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %6, i32 0, i32 4
store i64 %15, ptr %16, align 8
%17 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 0
store i8 4, ptr %17, align 1
%18 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 1
store i8 -1, ptr %18, align 1
%19 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 0
%20 = ptrtoint ptr %19 to i64
%21 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 3
store i64 %20, ptr %21, align 8
%22 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 1
%23 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 4
store i64 %22, ptr %23, align 8
%24 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 0
store i8 4, ptr %24, align 1
%25 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 1
store i8 -1, ptr %25, align 1
%26 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 0
%27 = ptrtoint ptr %26 to i64
%28 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 3
store i64 %27, ptr %28, align 8
%29 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 1
%30 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %8, i32 0, i32 4
store i64 %29, ptr %30, align 8
%31 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 0
store i8 4, ptr %31, align 1
%32 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 1
store i8 -1, ptr %32, align 1
%33 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 0
%34 = ptrtoint ptr %33 to i64
%35 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
store i64 %34, ptr %35, align 8
%36 = extractvalue { ptr, i64 } { ptr @luce.text.0, i64 0 }, 1
%37 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 4
store i64 %36, ptr %37, align 8
%38 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%39 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %38, i32 0, i32 0
store i8 2, ptr %39, align 1
%40 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %38, i32 0, i32 4
store i64 0, ptr %40, align 8
%41 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%42 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%43 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %42, i32 0, i32 0
store i8 4, ptr %43, align 1
%44 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %42, i32 0, i32 1
store i8 -1, ptr %44, align 1
%45 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%46 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %45, i32 0, i32 0
store i8 4, ptr %46, align 1
%47 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %45, i32 0, i32 1
store i8 -1, ptr %47, align 1
%48 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%49 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%50 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
br label %51
51:
%52 = load i64, ptr %5, align 8
%53 = trunc i64 %52 to i32
%54 = lshr i64 %52, 32
%55 = trunc i64 %54 to i32
%56 = icmp eq i32 %53, -1
br i1 %56, label %57, label %60, !prof !0
57:
%58 = extractvalue { ptr, i64 } { ptr @luce.text.1, i64 21 }, 0
%59 = extractvalue { ptr, i64 } { ptr @luce.text.1, i64 21 }, 1
call void @luce_rt_raise(ptr %1, i32 14, ptr %58, i64 %59)
call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
ret i32 1
60:
%61 = getelementptr inbounds i8, ptr %1, i64 96
%62 = load ptr, ptr %61, align 8!alias.scope !1, !noalias !2
%63 = zext i32 %53 to i64
%64 = mul nsw i64 %63, 112
%65 = getelementptr inbounds i8, ptr %62, i64 %64
%66 = getelementptr inbounds i8, ptr %65, i64 96
%67 = load i32, ptr %66, align 4, !alias.scope !1, !noalias !2
%68 = icmp ne i32 %67, %55
br i1 %68, label %69, label %72, !prof !0
69:
%70 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 0
%71 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 1
call void @luce_rt_raise(ptr %1, i32 13, ptr %70, i64 %71)
call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
ret i32 1
72:
%73 = and i32 %67, 1
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %78, !prof !0
75:
%76 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 0
%77 = extractvalue { ptr, i64 } { ptr @luce.text.2, i64 22 }, 1
call void @luce_rt_raise(ptr %1, i32 13, ptr %76, i64 %77)
call void @luce_rt_unwound(ptr %1, i32 0, i32 1)
ret i32 1
78:
%79 = getelementptr inbounds i8, ptr %65, i64 16
%80 = load i64, ptr %79, align 8!alias.scope !1, !noalias !2
%81 = load ptr, ptr %65, align 8, !alias.scope !1, !noalias !2
%82 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %38, i32 0, i32 3
store i64 %80, ptr %82, align 8
%83 = call i32 @luce_rt_str(ptr %1, ptr %38, ptr %41)
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %86, !prof !0
85:
call void @luce_rt_unwound(ptr %1, i32 0, i32 2)
ret i32 1
86:
%87 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %41, i32 0, i32 3
%88 = load i64, ptr %87, align 8
%89 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %41, i32 0, i32 1
%90 = load i8, ptr %89, align 1
%91 = icmp eq i8 %90, -1
%92 = inttoptr i64 %88 to ptr
%93 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %41, i32 0, i32 2
%94 = select i1 %91, ptr %92, ptr %93
%95 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %41, i32 0, i32 4
%96 = load i64, ptr %95, align 8
%97 = zext i8 %90 to i64
%98 = select i1 %91, i64 %96, i64 %97
%99 = insertvalue { ptr, i64 } poison, ptr %94, 0
%100 = insertvalue { ptr, i64 } %99, i64 %98, 1
call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %7, ptr align 8 %41, i64 24, i1 false)
%101 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 3
%102 = load i64, ptr %101, align 8
%103 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 1
%104 = load i8, ptr %103, align 1
%105 = icmp eq i8 %104, -1
%106 = inttoptr i64 %102 to ptr
%107 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 2
%108 = select i1 %105, ptr %106, ptr %107
%109 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 4
%110 = load i64, ptr %109, align 8
%111 = zext i8 %104 to i64
%112 = select i1 %105, i64 %110, i64 %111
%113 = insertvalue { ptr, i64 } poison, ptr %108, 0
%114 = insertvalue { ptr, i64 } %113, i64 %112, 1
%115 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 11 }, 0
%116 = ptrtoint ptr %115 to i64
%117 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %42, i32 0, i32 3
store i64 %116, ptr %117, align 8
%118 = extractvalue { ptr, i64 } { ptr @luce.text.3, i64 11 }, 1
%119 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %42, i32 0, i32 4
store i64 %118, ptr %119, align 8
%120 = extractvalue { ptr, i64 } %114, 0
%121 = ptrtoint ptr %120 to i64
%122 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %45, i32 0, i32 3
store i64 %121, ptr %122, align 8
%123 = extractvalue { ptr, i64 } %114, 1
%124 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %45, i32 0, i32 4
store i64 %123, ptr %124, align 8
%125 = call i32 @luce_rt_concat(ptr %1, ptr %42, ptr %45, ptr %48)
%126 = icmp ne i32 %125, 0
br i1 %126, label %127, label %128, !prof !0
127:
call void @luce_rt_unwound(ptr %1, i32 0, i32 6)
ret i32 1
128:
%129 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %48, i32 0, i32 3
%130 = load i64, ptr %129, align 8
%131 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %48, i32 0, i32 1
%132 = load i8, ptr %131, align 1
%133 = icmp eq i8 %132, -1
%134 = inttoptr i64 %130 to ptr
%135 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %48, i32 0, i32 2
%136 = select i1 %133, ptr %134, ptr %135
%137 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %48, i32 0, i32 4
%138 = load i64, ptr %137, align 8
%139 = zext i8 %132 to i64
%140 = select i1 %133, i64 %138, i64 %139
%141 = insertvalue { ptr, i64 } poison, ptr %136, 0
%142 = insertvalue { ptr, i64 } %141, i64 %140, 1
call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %9, ptr align 8 %48, i64 24, i1 false)
%143 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
%144 = load i64, ptr %143, align 8
%145 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 1
%146 = load i8, ptr %145, align 1
%147 = icmp eq i8 %146, -1
%148 = inttoptr i64 %144 to ptr
%149 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 2
%150 = select i1 %147, ptr %148, ptr %149
%151 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 4
%152 = load i64, ptr %151, align 8
%153 = zext i8 %146 to i64
%154 = select i1 %147, i64 %152, i64 %153
%155 = insertvalue { ptr, i64 } poison, ptr %150, 0
%156 = insertvalue { ptr, i64 } %155, i64 %154, 1
%157 = extractvalue { ptr, i64 } %156, 0
%158 = extractvalue { ptr, i64 } %156, 1
%159 = 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
%160 = load ptr, ptr %159, align 8
%161 = icmp eq ptr %160, null
br i1 %161, label %162, label %165, !prof !0
162:
%163 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 24 }, 0
%164 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 24 }, 1
call void @luce_rt_raise(ptr %1, i32 9, ptr %163, i64 %164)
call void @luce_rt_unwound(ptr %1, i32 0, i32 9)
ret i32 1
165:
%166 = 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
%167 = load ptr, ptr %166, align 8
%168 = call i32 %160(ptr %167, ptr %157, i64 %158)
%169 = icmp eq i32 %168, -1
br i1 %169, label %170, label %171, !prof !0
170:
call void @luce_rt_exhaust(ptr %1)
ret i32 1
171:
%172 = icmp ne i32 %168, 0
%173 = icmp ne i32 %168, 1
%174 = and i1 %172, %173
br i1 %174, label %175, label %178, !prof !0
175:
%176 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 24 }, 0
%177 = extractvalue { ptr, i64 } { ptr @luce.text.4, i64 24 }, 1
call void @luce_rt_raise(ptr %1, i32 9, ptr %176, i64 %177)
call void @luce_rt_unwound(ptr %1, i32 0, i32 9)
ret i32 1
178:
%179 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 3
%180 = load i64, ptr %179, align 8
%181 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 1
%182 = load i8, ptr %181, align 1
%183 = icmp eq i8 %182, -1
%184 = inttoptr i64 %180 to ptr
%185 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 2
%186 = select i1 %183, ptr %184, ptr %185
%187 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %9, i32 0, i32 4
%188 = load i64, ptr %187, align 8
%189 = zext i8 %182 to i64
%190 = select i1 %183, i64 %188, i64 %189
%191 = insertvalue { ptr, i64 } poison, ptr %186, 0
%192 = insertvalue { ptr, i64 } %191, i64 %190, 1
call void @luce_rt_drop_storage(ptr %1, ptr %9, ptr %49)
%193 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %49, i32 0, i32 3
%194 = load i64, ptr %193, align 8
%195 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %49, i32 0, i32 1
%196 = load i8, ptr %195, align 1
%197 = icmp eq i8 %196, -1
%198 = inttoptr i64 %194 to ptr
%199 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %49, i32 0, i32 2
%200 = select i1 %197, ptr %198, ptr %199
%201 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %49, i32 0, i32 4
%202 = load i64, ptr %201, align 8
%203 = zext i8 %196 to i64
%204 = select i1 %197, i64 %202, i64 %203
%205 = insertvalue { ptr, i64 } poison, ptr %200, 0
%206 = insertvalue { ptr, i64 } %205, i64 %204, 1
call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %9, ptr align 8 %49, i64 24, i1 false)
%207 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 3
%208 = load i64, ptr %207, align 8
%209 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 1
%210 = load i8, ptr %209, align 1
%211 = icmp eq i8 %210, -1
%212 = inttoptr i64 %208 to ptr
%213 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 2
%214 = select i1 %211, ptr %212, ptr %213
%215 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %7, i32 0, i32 4
%216 = load i64, ptr %215, align 8
%217 = zext i8 %210 to i64
%218 = select i1 %211, i64 %216, i64 %217
%219 = insertvalue { ptr, i64 } poison, ptr %214, 0
%220 = insertvalue { ptr, i64 } %219, i64 %218, 1
call void @luce_rt_drop_storage(ptr %1, ptr %7, ptr %50)
%221 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %50, i32 0, i32 3
%222 = load i64, ptr %221, align 8
%223 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %50, i32 0, i32 1
%224 = load i8, ptr %223, align 1
%225 = icmp eq i8 %224, -1
%226 = inttoptr i64 %222 to ptr
%227 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %50, i32 0, i32 2
%228 = select i1 %225, ptr %226, ptr %227
%229 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %50, i32 0, i32 4
%230 = load i64, ptr %229, align 8
%231 = zext i8 %224 to i64
%232 = select i1 %225, i64 %230, i64 %231
%233 = insertvalue { ptr, i64 } poison, ptr %228, 0
%234 = insertvalue { ptr, i64 } %233, i64 %232, 1
call void @llvm.memcpy.inline.p0.p0.i64(ptr align 8 %7, ptr align 8 %50, i64 24, i1 false)
ret i32 0
}
; Function Attrs: nounwind cold willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @luce_rt_raise(ptr nocapture nonnull noundef %0, i32 %1, ptr nocapture readonly %2, i64 %3) #0
; Function Attrs: nounwind cold willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @luce_rt_unwound(ptr nocapture nonnull noundef %0, i32 %1, i32 %2) #0
; Function Attrs: nounwind willreturn memory(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) #1
; Function Attrs: nounwind willreturn nofree nocallback memory(argmem: readwrite)
declare void @llvm.memcpy.inline.p0.p0.i64(ptr noalias nocapture writeonly %0, ptr noalias nocapture readonly %1, i64 %2, i1 immarg %3) #2
; Function Attrs: nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare i32 @luce_rt_concat(ptr nocapture nonnull noundef %0, ptr align 8 nocapture readonly nonnull dereferenceable(24) noundef %1, ptr align 8 nocapture readonly nonnull dereferenceable(24) noundef %2, ptr align 8 nocapture nonnull dereferenceable(24) writeonly noundef %3) #3
; Function Attrs: nounwind cold willreturn memory(argmem: write)
declare void @luce_rt_exhaust(ptr nocapture nonnull noundef %0) #4
; Function Attrs: nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @luce_rt_drop_storage(ptr nocapture nonnull noundef %0, ptr align 8 nocapture readonly nonnull dereferenceable(24) noundef %1, ptr align 8 nocapture nonnull dereferenceable(24) writeonly noundef %2) #3
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 !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.7, i64 19)
store i32 1, ptr %3, align 8
br label %73
65:
%66 = alloca { i8, i8, [6 x i8], i64, i64 }, align 8
%67 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 4
%68 = load ptr, ptr %67, align 8
%69 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 5
%70 = load ptr, ptr %69, align 8
%71 = call i32 @luce_rt_args_list(ptr %13, ptr %5, ptr %68, ptr %70, ptr %66)
%72 = icmp ne i32 %71, 0
br i1 %72, label %77, label %78, !prof !0
73:
%74 = load i32, ptr %3, align 8
%75 = icmp eq i32 %74, 1
%76 = icmp eq i32 %74, 2
br i1 %75, label %83, label %86, !prof !0
77:
store i32 1, ptr %3, align 8
br label %73
78:
%79 = getelementptr inbounds { i8, i8, [6 x i8], i64, i64 }, ptr %66, i32 0, i32 3
%80 = load i64, ptr %79, align 8
%81 = call i32 @luce.0.main(ptr %0, ptr %13, i64 %12, i64 %80)
store i32 %81, ptr %3, align 8
%82 = call i32 @luce_rt_release(ptr %13, ptr %66)
br label %73
83:
%84 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 2
%85 = load ptr, ptr %84, align 8
call void @luce_rt_report(ptr %13, ptr %5, ptr %85)
br label %86
86:
br i1 %76, label %87, label %90, !prof !0
87:
%88 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 15
%89 = load ptr, ptr %88, align 8
call void @luce_rt_report_error(ptr %13, ptr %5, ptr %89)
br label %90
90:
%91 = call i32 @luce_rt_status(ptr %13, i32 %74)
%92 = icmp eq i32 %91, 2
%93 = getelementptr inbounds { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }, ptr %0, i32 0, i32 3
%94 = load ptr, ptr %93, align 8
%95 = icmp eq ptr %94, null
%96 = or i1 %95, %92
br i1 %96, label %97, label %98
97:
call void @luce_rt_close(ptr %13)
ret i32 %91
98:
%99 = call i64 @luce_rt_leaked(ptr %13)
call void %94(ptr %5, i64 %99)
br label %97
}
; Function Attrs: nounwind willreturn memory(argmem: read, inaccessiblemem: readwrite)
declare noalias ptr @luce_rt_open(ptr readonly %0, i64 %1) #5
; 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) #6
; 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) #7
; 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) #6
; 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) #8
; 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) #8
; Function Attrs: cold
declare void @luce_rt_report(ptr nocapture nonnull noundef %0, ptr %1, ptr %2) #9
; Function Attrs: cold
declare void @luce_rt_report_error(ptr nocapture nonnull noundef %0, ptr %1, ptr %2) #9
; Function Attrs: nounwind willreturn memory(argmem: read)
declare i32 @luce_rt_status(ptr nocapture nonnull noundef %0, i32 %1) #10
; Function Attrs: nounwind willreturn memory(argmem: read)
declare i64 @luce_rt_leaked(ptr nocapture nonnull noundef %0) #10
; Function Attrs: nounwind memory(readwrite)
declare void @luce_rt_close(ptr nocapture nonnull noundef %0) #8
attributes #0 = { nounwind cold willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #1 = { nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: readwrite) }
attributes #2 = { nounwind willreturn nofree nocallback memory(argmem: readwrite) }
attributes #3 = { nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
attributes #4 = { nounwind cold willreturn memory(argmem: write) }
attributes #5 = { nounwind willreturn memory(argmem: read, inaccessiblemem: readwrite) }
attributes #6 = { nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind willreturn memory(readwrite) }
attributes #8 = { nounwind memory(readwrite) }
attributes #9 = { cold }
attributes #10 = { nounwind willreturn memory(argmem: read) }
!0 = !{!"branch_weights", i32 1, i32 2000}
!1 = !{!3}
!2 = !{!4}
!3 = !{!"luce.rows", !5}
!4 = !{!"luce.elements", !5}
!5 = !{!"luce.alias"}
ARM64 object code. LLVM selected these instructions, registers, calls, and branch conditions for this target.
open assembly fileARM64 instruction guide hover, focus, or tap dotted terms
x8 is a 64-bit register; w8 is its low 32 bits. A leading # marks a constant, brackets describe a memory address, and conditional instructions read the processor flags set by the preceding arithmetic or comparison.
Hover or focus a dotted term in the file for its explanation. On a touch screen, tap a term to keep the note open and tap elsewhere to close it. The list includes the operations that appear in this file.
mov- Copies a register value or loads a small constant. Calls also use it to place arguments in the required registers.
add- Adds registers or a constant. Address setup and stack restoration frequently use this instruction.
sub- Subtracts registers or a constant. Function prologues use it to reserve stack space.
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.hs- Branches when an unsigned comparison found higher-or-same, represented by a set carry flag.
cbz- Compares a register with zero and branches when it is zero.
cbnz- Compares a register with zero and branches when it contains a nonzero value.
tbnz- Tests one selected bit and branches when that bit is set; packed runtime flags use this form.
lsr- Shifts bits right and fills with zero, often extracting the upper field of a packed handle.
umaddl- Widens two 32-bit unsigned operands, multiplies them, and adds a 64-bit base address.
orr- Combines bits, commonly setting tag or flag bits in a packed value.
ret- Returns to the address in
x30and ends the current machine function.
/Users/sedov/Dev/luciaos/www/lucelang/out/traces/text.o: file format mach-o arm64
Disassembly of section __TEXT,__text:
0000000000000000 <ltmp0>:
; luce_main():
0: stp x24, x23, [sp, #-0x40]!
4: stp x22, x21, [sp, #0x10]
8: stp x20, x19, [sp, #0x20]
c: stp x29, x30, [sp, #0x30]
10: add x29, sp, #0x30
14: sub sp, sp, #0xf0
18: ldr x8, [x0, #0x70]
1c: ldr x19, [x0]
20: mov x20, x0
24: cbz x8, 0x26c <ltmp0+0x26c>
28: mov x0, x19
2c: blr x8
30: cmp x0, #0x1
34: cset w22, lt
38: adrp x0, 0x0 <ltmp0>
3c: add x0, x0, #0x0
40: mov w1, #0x1 ; =1
44: bl 0x44 <ltmp0+0x44>
48: cbz x0, 0x284 <ltmp0+0x284>
4c: ldp x3, x4, [x20, #0x1b0]
50: mov x21, x0
54: ldp x5, x6, [x20, #0x1c0]
58: ldr x2, [x20, #0xe0]
5c: ldp x8, x9, [x20, #0xf8]
60: ldr x7, [x20, #0x1d0]
64: ldur q0, [x20, #0xe8]
68: sub sp, sp, #0x20
6c: mov x1, x19
70: stp x8, x9, [sp, #0x10]
74: str q0, [sp]
78: bl 0x78 <ltmp0+0x78>
7c: add sp, sp, #0x20
80: ldp x2, x3, [x20, #0x180]
84: mov x0, x21
88: ldp x4, x5, [x20, #0x190]
8c: mov x1, x19
90: ldr x6, [x20, #0x1a0]
94: bl 0x94 <ltmp0+0x94>
98: ldp x8, x9, [x20, #0x170]
9c: ldp x2, x3, [x20, #0x140]
a0: ldp x4, x5, [x20, #0x150]
a4: ldp x6, x7, [x20, #0x160]
a8: stp x8, x9, [sp, #-0x10]!
ac: mov x0, x21
b0: mov x1, x19
b4: bl 0xb4 <ltmp0+0xb4>
b8: add sp, sp, #0x10
bc: cbnz w22, 0x2cc <ltmp0+0x2cc>
c0: sub x22, sp, #0x20
c4: mov sp, x22
c8: ldp x2, x3, [x20, #0x20]
cc: mov x0, x21
d0: mov x1, x19
d4: mov x4, x22
d8: bl 0xd8 <ltmp0+0xd8>
dc: cbnz w0, 0x33c <ltmp0+0x33c>
e0: ldr x8, [x22, #0x8]
e4: mov w9, #0x2 ; =2
e8: stur xzr, [x29, #-0x78]
ec: sturb w9, [x29, #-0x88]
f0: mov w9, #0xff04 ; =65284
f4: cmn w8, #0x1
f8: sturh w9, [x29, #-0xb8]
fc: sturh w9, [x29, #-0xd0]
100: b.eq 0x2e8 <ltmp0+0x2e8>
104: mov w9, #0x70 ; =112
108: ldr x10, [x21, #0x60]
10c: umaddl x9, w8, w9, x10
110: lsr x8, x8, #32
114: ldr w10, [x9, #0x60]
118: cmp w10, w8
11c: b.ne 0x28c <ltmp0+0x28c>
120: tbnz w8, #0x0, 0x28c <ltmp0+0x28c>
124: ldr x8, [x9, #0x10]
128: sub x1, x29, #0x88
12c: sub x2, x29, #0xa0
130: mov x0, x21
134: stur x8, [x29, #-0x80]
138: bl 0x138 <ltmp0+0x138>
13c: cbnz w0, 0x310 <ltmp0+0x310>
140: ldur q0, [x29, #-0xa0]
144: sub x23, x29, #0x70
148: ldur x8, [x29, #-0x90]
14c: sub x9, x29, #0x50
150: adrp x10, 0x0 <ltmp0>
154: add x10, x10, #0x0
158: str q0, [x23, #0x20]
15c: orr x9, x9, #0x2
160: mov w12, #0xb ; =11
164: ldurb w11, [x29, #-0x4f]
168: ldur x13, [x29, #-0x48]
16c: stur x8, [x29, #-0x40]
170: sub x1, x29, #0xb8
174: sub x2, x29, #0xd0
178: sub x3, x29, #0xe8
17c: cmp w11, #0xff
180: mov x0, x21
184: stp x10, x12, [x29, #-0xb0]
188: csel x9, x13, x9, eq
18c: csel x8, x8, x11, eq
190: stp x9, x8, [x29, #-0xc8]
194: bl 0x194 <ltmp0+0x194>
198: cbnz w0, 0x320 <ltmp0+0x320>
19c: ldur q0, [x29, #-0xe8]
1a0: ldur x9, [x29, #-0xd8]
1a4: ldr x8, [x20, #0x8]
1a8: str q0, [x23]
1ac: stur x9, [x29, #-0x60]
1b0: cbz x8, 0x2a4 <ltmp0+0x2a4>
1b4: ldurb w9, [x29, #-0x6f]
1b8: ldp x11, x10, [x29, #-0x68]
1bc: sub x12, x29, #0x70
1c0: ldr x0, [x20]
1c4: cmp w9, #0xff
1c8: orr x12, x12, #0x2
1cc: csel x2, x10, x9, eq
1d0: csel x1, x11, x12, eq
1d4: blr x8
1d8: cmn w0, #0x1
1dc: b.eq 0x368 <ltmp0+0x368>
1e0: cmp w0, #0x2
1e4: b.hs 0x2a4 <ltmp0+0x2a4>
1e8: sub x1, x29, #0x70
1ec: sub x2, x29, #0x100
1f0: mov x0, x21
1f4: bl 0x1f4 <ltmp0+0x1f4>
1f8: sub x1, x29, #0x50
1fc: sub x2, x29, #0x118
200: mov x0, x21
204: bl 0x204 <ltmp0+0x204>
208: mov x0, x21
20c: mov x1, x22
210: bl 0x210 <ltmp0+0x210>
214: mov w1, wzr
218: mov x0, x21
21c: bl 0x21c <ltmp0+0x21c>
220: mov w22, w0
224: cmp w0, #0x2
228: b.eq 0x248 <ltmp0+0x248>
22c: ldr x20, [x20, #0x18]
230: cbz x20, 0x248 <ltmp0+0x248>
234: mov x0, x21
238: bl 0x238 <ltmp0+0x238>
23c: mov x1, x0
240: mov x0, x19
244: blr x20
248: mov x0, x21
24c: bl 0x24c <ltmp0+0x24c>
250: mov w0, w22
254: sub sp, x29, #0x30
258: ldp x29, x30, [sp, #0x30]
25c: ldp x20, x19, [sp, #0x20]
260: ldp x22, x21, [sp, #0x10]
264: ldp x24, x23, [sp], #0x40
268: ret
26c: mov w22, wzr
270: adrp x0, 0x0 <ltmp0>
274: add x0, x0, #0x0
278: mov w1, #0x1 ; =1
27c: bl 0x27c <ltmp0+0x27c>
280: cbnz x0, 0x4c <ltmp0+0x4c>
284: mov w22, #0x2 ; =2
288: b 0x250 <ltmp0+0x250>
28c: adrp x2, 0x0 <ltmp0>
290: add x2, x2, #0x0
294: mov x0, x21
298: mov w1, #0xd ; =13
29c: mov w3, #0x16 ; =22
2a0: b 0x2fc <ltmp0+0x2fc>
2a4: adrp x2, 0x0 <ltmp0>
2a8: add x2, x2, #0x0
2ac: mov x0, x21
2b0: mov w1, #0x9 ; =9
2b4: mov w3, #0x18 ; =24
2b8: bl 0x2b8 <ltmp0+0x2b8>
2bc: mov x0, x21
2c0: mov w1, wzr
2c4: mov w2, #0x9 ; =9
2c8: b 0x32c <ltmp0+0x32c>
2cc: adrp x2, 0x0 <ltmp0>
2d0: add x2, x2, #0x0
2d4: mov x0, x21
2d8: mov w1, #0x6 ; =6
2dc: mov w3, #0x13 ; =19
2e0: bl 0x2e0 <ltmp0+0x2e0>
2e4: b 0x33c <ltmp0+0x33c>
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, #0x1 ; =1
30c: b 0x32c <ltmp0+0x32c>
310: mov x0, x21
314: mov w1, wzr
318: mov w2, #0x2 ; =2
31c: b 0x32c <ltmp0+0x32c>
320: mov x0, x21
324: mov w1, wzr
328: mov w2, #0x6 ; =6
32c: bl 0x32c <ltmp0+0x32c>
330: mov x0, x21
334: mov x1, x22
338: bl 0x338 <ltmp0+0x338>
33c: ldr x2, [x20, #0x10]
340: mov x0, x21
344: mov x1, x19
348: bl 0x348 <ltmp0+0x348>
34c: mov w1, #0x1 ; =1
350: mov x0, x21
354: bl 0x354 <ltmp0+0x354>
358: mov w22, w0
35c: cmp w0, #0x2
360: b.ne 0x22c <ltmp0+0x22c>
364: b 0x248 <ltmp0+0x248>
368: mov x0, x21
36c: bl 0x36c <ltmp0+0x36c>
370: b 0x330 <ltmp0+0x330>
Four related shapes
| Type | Meaning | Index unit | Mutation |
|---|---|---|---|
char | One Unicode scalar | one value | value is immutable |
str | Valid immutable UTF-8 | Unicode scalar position | operations return new text |
bytes | Immutable arbitrary binary data | u8 byte position | operations return new bytes |
builder | Mutable text accumulator | append-oriented | shared ARC object; build() returns str |
String positions are scalar positions
Length, indexing, slicing, and iteration over str use Unicode scalars as their unit. Byte APIs expose UTF-8 code units, while grapheme segmentation belongs to higher-level text processing. The same definition applies on every host.
Small text and outside text
The runtime's C-layout Value is 24 bytes. Short text can live inside that value; longer text points at runtime-owned storage. Generated code reads both forms through documented layout constants, while the runtime remains the owner of allocation, copying, comparison, and release.
Crossing text and binary
Raw UTF-8 access and text/byte conversion are explicit. Whole-file text APIs validate UTF-8 in the runtime; byte APIs preserve arbitrary data. The interpreter, standalone executable, and loom therefore share one definition of valid text.
Literals and interpolation
String literals accept a small explicit escape set. An f-string evaluates each hole and renders it through str(...), using the ordinary conversion path. chr and ord express conversion between a Unicode scalar and its numeric code point.
Value semantics with managed storage
str and bytes are language values even when their backing storage is outside the 24-byte value. Copy behavior is value behavior; internal storage lifetime is managed by the runtime. A builder is different on purpose: it is a shared reference identity optimized for repeated append.