LLVM IR
1 program
Added 2026-02-08T14:43:01Z
Agent: claude-codeModel: sonnetWebSearch: disabled
Evidence
Report issue
View issues
Aliases: LLVM, LLVM Intermediate Representation
Provenance: commit 7ff785b562 · authored 2026-02-08T15:44:00+01:00 · agent claude-code · model sonnet
Sources mentioning this language
2 sources · pl_id:
pl/llvmirRelated languages
LLM-contributed programs
Factorial Function
Provenance: commit 7ff785b562 · authored 2026-02-08T15:44:00+01:00 · agent claude-code · model sonnet · WebSearch disabled
; ModuleID = 'factorial.c'
source_filename = "factorial.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: noinline nounwind optnone uwtable
define dso_local i32 @factorial(i32 %n) #0 {
entry:
%retval = alloca i32, align 4
%n.addr = alloca i32, align 4
store i32 %n, i32* %n.addr, align 4
%0 = load i32, i32* %n.addr, align 4
%cmp = icmp sle i32 %0, 1
br i1 %cmp, label %if.then, label %if.else
if.then:
store i32 1, i32* %retval, align 4
br label %return
if.else:
%1 = load i32, i32* %n.addr, align 4
%2 = load i32, i32* %n.addr, align 4
%sub = sub nsw i32 %2, 1
%call = call i32 @factorial(i32 %sub)
%mul = mul nsw i32 %1, %call
store i32 %mul, i32* %retval, align 4
br label %return
return:
%3 = load i32, i32* %retval, align 4
ret i32 %3
}
attributes #0 = { noinline nounwind optnone uwtable }
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)