hugr-llvm 0.25.0

A general and extensible crate for lowering HUGRs into LLVM IR
Documentation
---
source: hugr-llvm/src/extension/int.rs
expression: mod_str
---
; ModuleID = 'test_context'
source_filename = "test_context"

@0 = private unnamed_addr constant [24 x i8] c"Attempted division by 0\00", align 1
@prelude.panic_template = private unnamed_addr constant [34 x i8] c"Program panicked (signal %i): %s\0A\00", align 1

define private i8 @_hl.main.1(i8 %0, i8 %1) {
alloca_block:
  %"0" = alloca i8, align 1
  %"2_0" = alloca i8, align 1
  %"2_1" = alloca i8, align 1
  %"4_0" = alloca i8, align 1
  br label %entry_block

entry_block:                                      ; preds = %alloca_block
  store i8 %0, i8* %"2_0", align 1
  store i8 %1, i8* %"2_1", align 1
  %"2_01" = load i8, i8* %"2_0", align 1
  %"2_12" = load i8, i8* %"2_1", align 1
  %valid_div = icmp ne i8 %"2_12", 0
  br label %panic_if_0

panic_if_0:                                       ; preds = %entry_block
  switch i1 %valid_div, label %panic [
    i1 true, label %exit
  ]

panic:                                            ; preds = %panic_if_0
  %2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @prelude.panic_template, i32 0, i32 0), i32 2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @0, i32 0, i32 0))
  call void @abort()
  br label %exit

exit:                                             ; preds = %panic_if_0, %panic
  %quotient = udiv i8 %"2_01", %"2_12"
  %remainder = urem i8 %"2_01", %"2_12"
  %3 = insertvalue { i8, i8 } poison, i8 %quotient, 0
  %4 = insertvalue { i8, i8 } %3, i8 %remainder, 1
  %5 = extractvalue { i8, i8 } %4, 0
  %6 = extractvalue { i8, i8 } %4, 1
  store i8 %5, i8* %"4_0", align 1
  %"4_03" = load i8, i8* %"4_0", align 1
  store i8 %"4_03", i8* %"0", align 1
  %"04" = load i8, i8* %"0", align 1
  ret i8 %"04"
}

declare i32 @printf(i8*, ...)

declare void @abort()