note
BrowserUk
<blockquote><i></i></blockquote>
<p>Okay. I compiled run.c -> run.e using the cl /E. It produced 30,000 lines of post-precprocessed C. Most of which is unrelated to Perl having been pulled in from a crap load of OS header files. (I won't post it here, it's too big and entirely uninteresting anyway.)
<p>I then threw that file at clang -- all 30,000 lines of it -- and asked it to convert it to LLVM assembler with no optimisation. It took most of the day cleaning up stuff that clang is really pedantic about -- it deosn't allow duplicate typedefs, even if they are identical except whitespace; it doesn't like MSC source code annotations or accept most of their pragmas; and it doesn't like prototypes without ; on the end ... and there were 1000s of them produced from the perl headers -- but 9 hours work and I got there.
<p>It produced these 572 lines:<spoiler><code>
; ModuleID = '/tmp/webcompile/_8204_0.bc'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct._TP_CALLBACK_ENVIRON = type { i64, %struct._TP_POOL*, %struct._TP_CLEANUP_GROUP*, void (i8*, i8*)*, i8*, %struct._ACTIVATION_CONTEXT*, void (%struct._TP_CALLBACK_INSTANCE*, i8*)*, %union.anon }
%struct._TP_POOL = type opaque
%struct._TP_CLEANUP_GROUP = type opaque
%struct._ACTIVATION_CONTEXT = type opaque
%struct._TP_CALLBACK_INSTANCE = type opaque
%union.anon = type { i64 }
%struct.anon = type { i8, [3 x i8], [4 x i8] }
%struct.interpreter = type { %struct.sv**, %struct.op*, %struct.sv**, %struct.sv**, %struct.sv**, i64*, i8**, i64, i64, %union.any*, i64, i64, %struct.sv**, i64, i64, i64, i64, i64*, i64*, i64*, %struct.sv*, %struct.xpv*, i64, %struct._stat64, %struct._stat64, %struct.gv*, %struct.sv*, %struct.tms, %struct.pmop*, %struct.sv*, %struct.gv*, %struct.gv*, %struct.gv*, i8*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.hv*, %struct.hv*, %struct.op*, %struct.jmpenv*, %struct.cop*, %struct.av*, %struct.stackinfo*, %struct.av*, %struct.jmpenv*, %struct.jmpenv, %struct.sv*, %struct.he*, %struct.op*, %struct.op*, %struct.hv*, %struct.gv*, %struct.gv*, i8*, i64, i64*, i64*, %struct.sv*, %struct.re_save_state, %struct.regnode, i16, i8, i8, [6 x i8*], void (%struct.interpreter*, %struct.op*)*, void (%struct.interpreter*, %struct.op*)*, void (%struct.interpreter*, %struct.op*)*, i64, i64, i8**, i8*, %struct.regmatch_slab*, %struct.regmatch_state*, i16, i8, i8, i8, i8, i32, i8, i64, i32, i8**, %struct.gv*, %struct.gv*, %struct.gv*, i8*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, i8**, i8*, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8*, %struct.sv*, i64, %struct.sv*, i64, i64, i64, i32, i32*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.av*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.av*, %struct.hv*, %struct.hv*, %struct.sv*, %struct.av*, %struct.av*, %struct.av*, %struct.av*, %struct.av*, %struct.hv*, i64, i32, i64, i64, %struct.sv*, %struct.sv*, %struct.av*, i8*, %struct.cv*, %struct.op*, %struct.op*, %struct.op*, %struct.op*, %struct.cop*, i32, i32, i8*, i8**, i8*, %struct.av*, %struct.sv*, %struct.sv*, i64, i8, i8, i16, i32, i64, %struct.exitlistentry*, %struct.hv*, i64*, %struct.cop, %struct.cv*, %struct.av*, %struct.av*, i64, i64, %struct.interp_intern, %struct.cv*, i32, i8, i8, i8, i8, i64, i64, i64, i64, i64, i64, i64, i64, i8**, i8*, void (i32)*, [16 x i8*], i64, i32, {}*, %struct.sv, %struct.sv, %struct.sv, %struct.sv*, i64, i64, i64, i64, i64, i64, i64, i64, i64, i8*, i64, i64, i64, i8, i8, i8, i8, i8*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.hv*, i8*, i64, [10 x i8], i8, i8, i32, %struct.yy_parser*, %struct.sv**, %struct.sv**, %struct.ptr_tbl*, %struct.av*, i8*, %struct.sv*, %struct.sv**, %struct.av*, %struct.REENTR*, %struct.hv*, %struct.hv*, %struct._PerlIO*, %struct.PerlIO_list_s*, %struct.PerlIO_list_s*, %struct.sv*, %struct.perl_debug_pad, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, i64 (%struct.interpreter*, %struct.sv*, %struct.sv*)*, %struct.av*, %struct.av*, i64, i64, i32, %struct.hv*, void (%struct.interpreter*, %struct.sv*)*, void (%struct.interpreter*, %struct.sv*)*, void (%struct.interpreter*, %struct.sv*)*, {}*, void (%struct.interpreter*)*, i64, i64, %struct.hv*, i32, i8**, i8 (%struct.interpreter*, %struct.sv*)*, %struct.hv*, %struct.av*, %struct.hv*, %struct.hv*, %struct.hv* }
%struct.sv = type { i8*, i64, i64, %union.anon.0 }
%union.anon.0 = type { i8* }
%struct.op = type { %struct.op*, %struct.op*, %struct.op* (%struct.interpreter*)*, i64, [2 x i8], i8, i8 }
%union.any = type { i8* }
%struct.xpv = type { %struct.hv*, %union._xmgu, i64, i64 }
%struct.hv = type { %struct.xpvhv*, i64, i64, %union.anon.3 }
%struct.xpvhv = type { %struct.hv*, %union._xmgu, i64, i64 }
%union._xmgu = type { %struct.magic* }
%struct.magic = type { %struct.magic*, %struct.mgvtbl*, i16, i8, i8, i64, %struct.sv*, i8* }
%struct.mgvtbl = type { i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i64 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*, %struct.sv*, i8*, i64)*, i32 (%struct.interpreter*, %struct.magic*, %struct.clone_params*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)* }
%struct.clone_params = type { %struct.av*, i64, %struct.interpreter*, %struct.interpreter*, %struct.av* }
%struct.av = type { %struct.xpvav*, i64, i64, %union.anon.2 }
%struct.xpvav = type { %struct.hv*, %union._xmgu, i64, i64, %struct.sv** }
%union.anon.2 = type { i8* }
%union.anon.3 = type { i8* }
%struct._stat64 = type { i32, i16, i16, i16, i16, i16, i32, i64, i64, i64, i64 }
%struct.gv = type { %struct.xpvgv*, i64, i64, %union.anon.7 }
%struct.xpvgv = type { %struct.hv*, %union._xmgu, i64, i64, %union._xivu, %union._xnvu }
%union._xivu = type { i64 }
%union._xnvu = type { %struct.anon.5 }
%struct.anon.5 = type { i64, i64 }
%union.anon.7 = type { i8* }
%struct.tms = type { i64, i64, i64, i64 }
%struct.pmop = type { %struct.op*, %struct.op*, %struct.op* (%struct.interpreter*)*, i64, [2 x i8], i8, i8, %struct.op*, %struct.op*, i64, i64, %union.anon.12, %union.anon.13 }
%union.anon.12 = type { %struct.op* }
%union.anon.13 = type { %struct.op* }
%struct.jmpenv = type { %struct.jmpenv*, [16 x i32], i32, i8 }
%struct.cop = type { %struct.op*, %struct.op*, %struct.op* (%struct.interpreter*)*, i64, [2 x i8], i8, i8, i64, i8*, i8*, i64, i64, i64*, %struct.refcounted_he* }
%struct.refcounted_he = type opaque
%struct.stackinfo = type { %struct.av*, %struct.context*, %struct.stackinfo*, %struct.stackinfo*, i64, i64, i64, i64 }
%struct.context = type { %union.anon.14 }
%union.anon.14 = type { %struct.block }
%struct.block = type { i8, i8, i16, i64, %struct.cop*, i64, i64, %struct.pmop*, %union.anon.15 }
%union.anon.15 = type { %struct.block_sub }
%struct.block_sub = type { %struct.op*, %struct.cv*, %struct.av*, %struct.av*, i64, %struct.av* }
%struct.cv = type { %struct.xpvcv*, i64, i64, %union.anon.11 }
%struct.xpvcv = type { %struct.hv*, %union._xmgu, i64, i64, %struct.hv*, %union.anon.9, %union.anon.10, %struct.gv*, i8*, %struct.av*, %struct.cv*, i64, i16, i64 }
%union.anon.9 = type { %struct.op* }
%union.anon.10 = type { %struct.op* }
%union.anon.11 = type { i8* }
%struct.he = type { %struct.he*, %struct.hek*, %union.anon.1 }
%struct.hek = type { i64, i64, [1 x i8] }
%union.anon.1 = type { %struct.sv* }
%struct.re_save_state = type { i64, i64, i64, i8, i8*, i8*, i8*, %struct.regexp_paren_pair*, i64*, i64*, i8**, %struct.magic*, %struct.pmop*, %struct.pmop*, i8*, i64, i64, i64, i64, i64, i64, i8*, i8* }
%struct.regexp_paren_pair = type { i64, i64 }
%struct.regnode = type { i8, i8, i16 }
%struct.regmatch_slab = type { [42 x %struct.regmatch_state], %struct.regmatch_slab*, %struct.regmatch_slab* }
%struct.regmatch_state = type { i32, i8*, %union.anon.22 }
%union.anon.22 = type { %struct.anon.26 }
%struct.anon.26 = type { %struct.regmatch_state*, i64, i64, i64, i16*, %struct.regnode*, %struct.regnode*, i8*, i64, i16, i16, i8 }
%struct.exitlistentry = type { void (%struct.interpreter*, i8*)*, i8* }
%struct.interp_intern = type { i8*, i8**, i64, %struct.av*, %struct.child_tab*, i64, %struct.pseudo_child_tab*, i8*, %struct.thread_intern, %struct.HWND__*, i32, i32, [27 x void (i32)*] }
%struct.child_tab = type { i64, [64 x i64], [64 x i8*] }
%struct.pseudo_child_tab = type { i64, [64 x i64], [64 x i8*], [64 x %struct.HWND__*], [64 x i8] }
%struct.HWND__ = type { i32 }
%struct.thread_intern = type { [512 x i8], %struct.servent, [128 x i8], i32, [30 x i8], i32, i16 }
%struct.servent = type { i8*, i8**, i16, i8* }
%struct.yy_parser = type { %struct.yy_parser*, %union.YYSTYPE, i32, i32, i32, i32, %struct.yy_stack_frame*, %struct.yy_stack_frame*, i64, i64, i8*, i8*, i8, i8, i8, i8, i64, %struct.op*, %struct.op*, %struct.sv*, i16, i16, i64, %struct.sv*, i64, i64, i8, i8, i8, i8, i64, %struct._sublex_info, %struct.sv*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i64, i16, i8, i8, %struct.hv*, %struct._PerlIO**, %struct.av*, [5 x %union.YYSTYPE], [5 x i64], i64, %struct.cop*, [256 x i8], i8, i8 }
%union.YYSTYPE = type { i64 }
%struct.yy_stack_frame = type { %union.YYSTYPE, i16, i64, %struct.cv* }
%struct._sublex_info = type { i8, i16, %struct.op*, i8*, i8* }
%struct._PerlIO = type opaque
%struct.ptr_tbl = type { %struct.ptr_tbl_ent**, i64, i64, %struct.ptr_tbl_arena*, %struct.ptr_tbl_ent*, %struct.ptr_tbl_ent* }
%struct.ptr_tbl_ent = type { %struct.ptr_tbl_ent*, i8*, i8* }
%struct.ptr_tbl_arena = type opaque
%struct.REENTR = type { i32 }
%struct.PerlIO_list_s = type opaque
%struct.perl_debug_pad = type { [3 x %struct.sv] }
define i64 @HEAP_MAKE_TAG_FLAGS(i64 %TagBase, i64 %Tag) nounwind uwtable {
%1 = alloca i64, align 8
%2 = alloca i64, align 8
store i64 %TagBase, i64* %1, align 8
store i64 %Tag, i64* %2, align 8
%3 = load i64* %1, align 8
%4 = load i64* %2, align 8
%5 = shl i64 %4, 18
%6 = add i64 %3, %5
ret i64 %6
}
define i8* @RtlSecureZeroMemory(i8* %ptr, i64 %cnt) nounwind uwtable {
%1 = alloca i8*, align 8
%2 = alloca i64, align 8
%vptr = alloca i8*, align 8
store i8* %ptr, i8** %1, align 8
store i64 %cnt, i64* %2, align 8
%3 = load i8** %1, align 8
store i8* %3, i8** %vptr, align 8
br label %4
; <label>:4 ; preds = %7, %0
%5 = load i64* %2, align 8
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
; <label>:7 ; preds = %4
%8 = load i8** %vptr, align 8
store volatile i8 0, i8* %8
%9 = load i8** %vptr, align 8
%10 = getelementptr inbounds i8* %9, i32 1
store i8* %10, i8** %vptr, align 8
%11 = load i64* %2, align 8
%12 = add i64 %11, -1
store i64 %12, i64* %2, align 8
br label %4
; <label>:13 ; preds = %4
%14 = load i8** %1, align 8
ret i8* %14
}
define void @TpInitializeCallbackEnviron(%struct._TP_CALLBACK_ENVIRON* %CallbackEnviron) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
store %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._TP_CALLBACK_ENVIRON** %1, align 8
%2 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%3 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %2, i32 0, i32 0
store i64 1, i64* %3, align 8
%4 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%5 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %4, i32 0, i32 1
store %struct._TP_POOL* null, %struct._TP_POOL** %5, align 8
%6 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%7 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %6, i32 0, i32 2
store %struct._TP_CLEANUP_GROUP* null, %struct._TP_CLEANUP_GROUP** %7, align 8
%8 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%9 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %8, i32 0, i32 3
store void (i8*, i8*)* null, void (i8*, i8*)** %9, align 8
%10 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%11 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %10, i32 0, i32 4
store i8* null, i8** %11, align 8
%12 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%13 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %12, i32 0, i32 5
store %struct._ACTIVATION_CONTEXT* null, %struct._ACTIVATION_CONTEXT** %13, align 8
%14 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%15 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %14, i32 0, i32 6
store void (%struct._TP_CALLBACK_INSTANCE*, i8*)* null, void (%struct._TP_CALLBACK_INSTANCE*, i8*)** %15, align 8
%16 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%17 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %16, i32 0, i32 7
%18 = bitcast %union.anon* %17 to i64*
store i64 0, i64* %18, align 8
ret void
}
define void @TpSetCallbackThreadpool(%struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._TP_POOL* %Pool) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
%2 = alloca %struct._TP_POOL*, align 8
store %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._TP_CALLBACK_ENVIRON** %1, align 8
store %struct._TP_POOL* %Pool, %struct._TP_POOL** %2, align 8
%3 = load %struct._TP_POOL** %2, align 8
%4 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%5 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %4, i32 0, i32 1
store %struct._TP_POOL* %3, %struct._TP_POOL** %5, align 8
ret void
}
define void @TpSetCallbackCleanupGroup(%struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._TP_CLEANUP_GROUP* %CleanupGroup, void (i8*, i8*)* %CleanupGroupCancelCallback) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
%2 = alloca %struct._TP_CLEANUP_GROUP*, align 8
%3 = alloca void (i8*, i8*)*, align 8
store %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._TP_CALLBACK_ENVIRON** %1, align 8
store %struct._TP_CLEANUP_GROUP* %CleanupGroup, %struct._TP_CLEANUP_GROUP** %2, align 8
store void (i8*, i8*)* %CleanupGroupCancelCallback, void (i8*, i8*)** %3, align 8
%4 = load %struct._TP_CLEANUP_GROUP** %2, align 8
%5 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%6 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %5, i32 0, i32 2
store %struct._TP_CLEANUP_GROUP* %4, %struct._TP_CLEANUP_GROUP** %6, align 8
%7 = load void (i8*, i8*)** %3, align 8
%8 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%9 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %8, i32 0, i32 3
store void (i8*, i8*)* %7, void (i8*, i8*)** %9, align 8
ret void
}
define void @TpSetCallbackActivationContext(%struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._ACTIVATION_CONTEXT* %ActivationContext) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
%2 = alloca %struct._ACTIVATION_CONTEXT*, align 8
store %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._TP_CALLBACK_ENVIRON** %1, align 8
store %struct._ACTIVATION_CONTEXT* %ActivationContext, %struct._ACTIVATION_CONTEXT** %2, align 8
%3 = load %struct._ACTIVATION_CONTEXT** %2, align 8
%4 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%5 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %4, i32 0, i32 5
store %struct._ACTIVATION_CONTEXT* %3, %struct._ACTIVATION_CONTEXT** %5, align 8
ret void
}
define void @TpSetCallbackNoActivationContext(%struct._TP_CALLBACK_ENVIRON* %CallbackEnviron) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
store %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._TP_CALLBACK_ENVIRON** %1, align 8
%2 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%3 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %2, i32 0, i32 5
store %struct._ACTIVATION_CONTEXT* inttoptr (i64 -1 to %struct._ACTIVATION_CONTEXT*), %struct._ACTIVATION_CONTEXT** %3, align 8
ret void
}
define void @TpSetCallbackLongFunction(%struct._TP_CALLBACK_ENVIRON* %CallbackEnviron) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
store %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._TP_CALLBACK_ENVIRON** %1, align 8
%2 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%3 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %2, i32 0, i32 7
%4 = bitcast %union.anon* %3 to %struct.anon*
%5 = bitcast %struct.anon* %4 to i64*
%6 = load i64* %5, align 8
%7 = and i64 %6, -2
%8 = or i64 %7, 1
store i64 %8, i64* %5, align 8
ret void
}
define void @TpSetCallbackRaceWithDll(%struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i8* %DllHandle) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
%2 = alloca i8*, align 8
store %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._TP_CALLBACK_ENVIRON** %1, align 8
store i8* %DllHandle, i8** %2, align 8
%3 = load i8** %2, align 8
%4 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%5 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %4, i32 0, i32 4
store i8* %3, i8** %5, align 8
ret void
}
define void @TpSetCallbackFinalizationCallback(%struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, void (%struct._TP_CALLBACK_INSTANCE*, i8*)* %FinalizationCallback) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
%2 = alloca void (%struct._TP_CALLBACK_INSTANCE*, i8*)*, align 8
store %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._TP_CALLBACK_ENVIRON** %1, align 8
store void (%struct._TP_CALLBACK_INSTANCE*, i8*)* %FinalizationCallback, void (%struct._TP_CALLBACK_INSTANCE*, i8*)** %2, align 8
%3 = load void (%struct._TP_CALLBACK_INSTANCE*, i8*)** %2, align 8
%4 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%5 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %4, i32 0, i32 6
store void (%struct._TP_CALLBACK_INSTANCE*, i8*)* %3, void (%struct._TP_CALLBACK_INSTANCE*, i8*)** %5, align 8
ret void
}
define void @TpDestroyCallbackEnviron(%struct._TP_CALLBACK_ENVIRON* %CallbackEnviron) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
store %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, %struct._TP_CALLBACK_ENVIRON** %1, align 8
%2 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
ret void
}
define i64 @InterlockedAnd64(i64* %Destination, i64 %Value) nounwind uwtable {
%1 = alloca i64*, align 8
%2 = alloca i64, align 8
%Old = alloca i64, align 8
store i64* %Destination, i64** %1, align 8
store i64 %Value, i64* %2, align 8
br label %3
; <label>:3 ; preds = %6, %0
%4 = load i64** %1, align 8
%5 = load volatile i64* %4
store i64 %5, i64* %Old, align 8
br label %6
; <label>:6 ; preds = %3
%7 = load i64** %1, align 8
%8 = load i64* %Old, align 8
%9 = load i64* %2, align 8
%10 = and i64 %8, %9
%11 = load i64* %Old, align 8
%12 = call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %7, i64 %10, i64 %11)
%13 = load i64* %Old, align 8
%14 = icmp ne i64 %12, %13
br i1 %14, label %3, label %15
; <label>:15 ; preds = %6
%16 = load i64* %Old, align 8
ret i64 %16
}
declare x86_stdcallcc i64 @InterlockedCompareExchange64(i64*, i64, i64)
define i64 @InterlockedOr64(i64* %Destination, i64 %Value) nounwind uwtable {
%1 = alloca i64*, align 8
%2 = alloca i64, align 8
%Old = alloca i64, align 8
store i64* %Destination, i64** %1, align 8
store i64 %Value, i64* %2, align 8
br label %3
; <label>:3 ; preds = %6, %0
%4 = load i64** %1, align 8
%5 = load volatile i64* %4
store i64 %5, i64* %Old, align 8
br label %6
; <label>:6 ; preds = %3
%7 = load i64** %1, align 8
%8 = load i64* %Old, align 8
%9 = load i64* %2, align 8
%10 = or i64 %8, %9
%11 = load i64* %Old, align 8
%12 = call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %7, i64 %10, i64 %11)
%13 = load i64* %Old, align 8
%14 = icmp ne i64 %12, %13
br i1 %14, label %3, label %15
; <label>:15 ; preds = %6
%16 = load i64* %Old, align 8
ret i64 %16
}
define i64 @InterlockedXor64(i64* %Destination, i64 %Value) nounwind uwtable {
%1 = alloca i64*, align 8
%2 = alloca i64, align 8
%Old = alloca i64, align 8
store i64* %Destination, i64** %1, align 8
store i64 %Value, i64* %2, align 8
br label %3
; <label>:3 ; preds = %6, %0
%4 = load i64** %1, align 8
%5 = load volatile i64* %4
store i64 %5, i64* %Old, align 8
br label %6
; <label>:6 ; preds = %3
%7 = load i64** %1, align 8
%8 = load i64* %Old, align 8
%9 = load i64* %2, align 8
%10 = xor i64 %8, %9
%11 = load i64* %Old, align 8
%12 = call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %7, i64 %10, i64 %11)
%13 = load i64* %Old, align 8
%14 = icmp ne i64 %12, %13
br i1 %14, label %3, label %15
; <label>:15 ; preds = %6
%16 = load i64* %Old, align 8
ret i64 %16
}
define i64 @InterlockedIncrement64(i64* %Addend) nounwind uwtable {
%1 = alloca i64*, align 8
%Old = alloca i64, align 8
store i64* %Addend, i64** %1, align 8
br label %2
; <label>:2 ; preds = %5, %0
%3 = load i64** %1, align 8
%4 = load volatile i64* %3
store i64 %4, i64* %Old, align 8
br label %5
; <label>:5 ; preds = %2
%6 = load i64** %1, align 8
%7 = load i64* %Old, align 8
%8 = add nsw i64 %7, 1
%9 = load i64* %Old, align 8
%10 = call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %6, i64 %8, i64 %9)
%11 = load i64* %Old, align 8
%12 = icmp ne i64 %10, %11
br i1 %12, label %2, label %13
; <label>:13 ; preds = %5
%14 = load i64* %Old, align 8
%15 = add nsw i64 %14, 1
ret i64 %15
}
define i64 @InterlockedDecrement64(i64* %Addend) nounwind uwtable {
%1 = alloca i64*, align 8
%Old = alloca i64, align 8
store i64* %Addend, i64** %1, align 8
br label %2
; <label>:2 ; preds = %5, %0
%3 = load i64** %1, align 8
%4 = load volatile i64* %3
store i64 %4, i64* %Old, align 8
br label %5
; <label>:5 ; preds = %2
%6 = load i64** %1, align 8
%7 = load i64* %Old, align 8
%8 = sub nsw i64 %7, 1
%9 = load i64* %Old, align 8
%10 = call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %6, i64 %8, i64 %9)
%11 = load i64* %Old, align 8
%12 = icmp ne i64 %10, %11
br i1 %12, label %2, label %13
; <label>:13 ; preds = %5
%14 = load i64* %Old, align 8
%15 = sub nsw i64 %14, 1
ret i64 %15
}
define i64 @InterlockedExchange64(i64* %Target, i64 %Value) nounwind uwtable {
%1 = alloca i64*, align 8
%2 = alloca i64, align 8
%Old = alloca i64, align 8
store i64* %Target, i64** %1, align 8
store i64 %Value, i64* %2, align 8
br label %3
; <label>:3 ; preds = %6, %0
%4 = load i64** %1, align 8
%5 = load volatile i64* %4
store i64 %5, i64* %Old, align 8
br label %6
; <label>:6 ; preds = %3
%7 = load i64** %1, align 8
%8 = load i64* %2, align 8
%9 = load i64* %Old, align 8
%10 = call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %7, i64 %8, i64 %9)
%11 = load i64* %Old, align 8
%12 = icmp ne i64 %10, %11
br i1 %12, label %3, label %13
; <label>:13 ; preds = %6
%14 = load i64* %Old, align 8
ret i64 %14
}
define i64 @InterlockedExchangeAdd64(i64* %Addend, i64 %Value) nounwind uwtable {
%1 = alloca i64*, align 8
%2 = alloca i64, align 8
%Old = alloca i64, align 8
store i64* %Addend, i64** %1, align 8
store i64 %Value, i64* %2, align 8
br label %3
; <label>:3 ; preds = %6, %0
%4 = load i64** %1, align 8
%5 = load volatile i64* %4
store i64 %5, i64* %Old, align 8
br label %6
; <label>:6 ; preds = %3
%7 = load i64** %1, align 8
%8 = load i64* %Old, align 8
%9 = load i64* %2, align 8
%10 = add nsw i64 %8, %9
%11 = load i64* %Old, align 8
%12 = call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %7, i64 %10, i64 %11)
%13 = load i64* %Old, align 8
%14 = icmp ne i64 %12, %13
br i1 %14, label %3, label %15
; <label>:15 ; preds = %6
%16 = load i64* %Old, align 8
ret i64 %16
}
define void @InitializeThreadpoolEnvironment(%struct._TP_CALLBACK_ENVIRON* %pcbe) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
store %struct._TP_CALLBACK_ENVIRON* %pcbe, %struct._TP_CALLBACK_ENVIRON** %1, align 8
%2 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
call void @TpInitializeCallbackEnviron(%struct._TP_CALLBACK_ENVIRON* %2)
ret void
}
define void @SetThreadpoolCallbackPool(%struct._TP_CALLBACK_ENVIRON* %pcbe, %struct._TP_POOL* %ptpp) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
%2 = alloca %struct._TP_POOL*, align 8
store %struct._TP_CALLBACK_ENVIRON* %pcbe, %struct._TP_CALLBACK_ENVIRON** %1, align 8
store %struct._TP_POOL* %ptpp, %struct._TP_POOL** %2, align 8
%3 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%4 = load %struct._TP_POOL** %2, align 8
call void @TpSetCallbackThreadpool(%struct._TP_CALLBACK_ENVIRON* %3, %struct._TP_POOL* %4)
ret void
}
define void @SetThreadpoolCallbackCleanupGroup(%struct._TP_CALLBACK_ENVIRON* %pcbe, %struct._TP_CLEANUP_GROUP* %ptpcg, void (i8*, i8*)* %pfng) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
%2 = alloca %struct._TP_CLEANUP_GROUP*, align 8
%3 = alloca void (i8*, i8*)*, align 8
store %struct._TP_CALLBACK_ENVIRON* %pcbe, %struct._TP_CALLBACK_ENVIRON** %1, align 8
store %struct._TP_CLEANUP_GROUP* %ptpcg, %struct._TP_CLEANUP_GROUP** %2, align 8
store void (i8*, i8*)* %pfng, void (i8*, i8*)** %3, align 8
%4 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%5 = load %struct._TP_CLEANUP_GROUP** %2, align 8
%6 = load void (i8*, i8*)** %3, align 8
call void @TpSetCallbackCleanupGroup(%struct._TP_CALLBACK_ENVIRON* %4, %struct._TP_CLEANUP_GROUP* %5, void (i8*, i8*)* %6)
ret void
}
define void @SetThreadpoolCallbackRunsLong(%struct._TP_CALLBACK_ENVIRON* %pcbe) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
store %struct._TP_CALLBACK_ENVIRON* %pcbe, %struct._TP_CALLBACK_ENVIRON** %1, align 8
%2 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
call void @TpSetCallbackLongFunction(%struct._TP_CALLBACK_ENVIRON* %2)
ret void
}
define void @SetThreadpoolCallbackLibrary(%struct._TP_CALLBACK_ENVIRON* %pcbe, i8* %mod) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
%2 = alloca i8*, align 8
store %struct._TP_CALLBACK_ENVIRON* %pcbe, %struct._TP_CALLBACK_ENVIRON** %1, align 8
store i8* %mod, i8** %2, align 8
%3 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
%4 = load i8** %2, align 8
call void @TpSetCallbackRaceWithDll(%struct._TP_CALLBACK_ENVIRON* %3, i8* %4)
ret void
}
define void @DestroyThreadpoolEnvironment(%struct._TP_CALLBACK_ENVIRON* %pcbe) nounwind uwtable {
%1 = alloca %struct._TP_CALLBACK_ENVIRON*, align 8
store %struct._TP_CALLBACK_ENVIRON* %pcbe, %struct._TP_CALLBACK_ENVIRON** %1, align 8
%2 = load %struct._TP_CALLBACK_ENVIRON** %1, align 8
call void @TpDestroyCallbackEnviron(%struct._TP_CALLBACK_ENVIRON* %2)
ret void
}
define i64 @HRESULT_FROM_WIN32(i64 %x) nounwind uwtable {
%1 = alloca i64, align 8
store i64 %x, i64* %1, align 8
%2 = load i64* %1, align 8
%3 = icmp sle i64 %2, 0
br i1 %3, label %4, label %6
; <label>:4 ; preds = %0
%5 = load i64* %1, align 8
br label %11
; <label>:6 ; preds = %0
%7 = load i64* %1, align 8
%8 = and i64 %7, 65535
%9 = or i64 %8, 458752
%10 = or i64 %9, 2147483648
br label %11
; <label>:11 ; preds = %6, %4
%12 = phi i64 [ %5, %4 ], [ %10, %6 ]
ret i64 %12
}
define i32 @Perl_runops_standard(%struct.interpreter* %my_perl) nounwind uwtable {
%1 = alloca %struct.interpreter*, align 8
%op = alloca %struct.op*, align 8
store %struct.interpreter* %my_perl, %struct.interpreter** %1, align 8
%2 = load %struct.interpreter** %1, align 8
%3 = getelementptr inbounds %struct.interpreter* %2, i32 0, i32 1
%4 = load %struct.op** %3, align 8
store %struct.op* %4, %struct.op** %op, align 8
br label %5
; <label>:5 ; preds = %14, %0
%6 = load %struct.op** %op, align 8
%7 = getelementptr inbounds %struct.op* %6, i32 0, i32 2
%8 = load %struct.op* (%struct.interpreter*)** %7, align 8
%9 = load %struct.interpreter** %1, align 8
%10 = call %struct.op* %8(%struct.interpreter* %9)
store %struct.op* %10, %struct.op** %op, align 8
%11 = load %struct.interpreter** %1, align 8
%12 = getelementptr inbounds %struct.interpreter* %11, i32 0, i32 1
store %struct.op* %10, %struct.op** %12, align 8
%13 = icmp ne %struct.op* %10, null
br i1 %13, label %14, label %15
; <label>:14 ; preds = %5
br label %5
; <label>:15 ; preds = %5
%16 = load %struct.interpreter** %1, align 8
%17 = getelementptr inbounds %struct.interpreter* %16, i32 0, i32 78
store i8 0, i8* %17, align 1
ret i32 0
}
</code></spoiler>
<P>I then asked it to optimise it. This time it produced just these 363 lines:<spoiler><code>
; ModuleID = '/tmp/webcompile/_9304_0.bc'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct._TP_CALLBACK_ENVIRON = type { i64, %struct._TP_POOL*, %struct._TP_CLEANUP_GROUP*, void (i8*, i8*)*, i8*, %struct._ACTIVATION_CONTEXT*, void (%struct._TP_CALLBACK_INSTANCE*, i8*)*, %union.anon }
%struct._TP_POOL = type opaque
%struct._TP_CLEANUP_GROUP = type opaque
%struct._ACTIVATION_CONTEXT = type opaque
%struct._TP_CALLBACK_INSTANCE = type opaque
%union.anon = type { i64 }
%struct.interpreter = type { %struct.sv**, %struct.op*, %struct.sv**, %struct.sv**, %struct.sv**, i64*, i8**, i64, i64, %union.any*, i64, i64, %struct.sv**, i64, i64, i64, i64, i64*, i64*, i64*, %struct.sv*, %struct.xpv*, i64, %struct._stat64, %struct._stat64, %struct.gv*, %struct.sv*, %struct.tms, %struct.pmop*, %struct.sv*, %struct.gv*, %struct.gv*, %struct.gv*, i8*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.hv*, %struct.hv*, %struct.op*, %struct.jmpenv*, %struct.cop*, %struct.av*, %struct.stackinfo*, %struct.av*, %struct.jmpenv*, %struct.jmpenv, %struct.sv*, %struct.he*, %struct.op*, %struct.op*, %struct.hv*, %struct.gv*, %struct.gv*, i8*, i64, i64*, i64*, %struct.sv*, %struct.re_save_state, %struct.regnode, i16, i8, i8, [6 x i8*], void (%struct.interpreter*, %struct.op*)*, void (%struct.interpreter*, %struct.op*)*, void (%struct.interpreter*, %struct.op*)*, i64, i64, i8**, i8*, %struct.regmatch_slab*, %struct.regmatch_state*, i16, i8, i8, i8, i8, i32, i8, i64, i32, i8**, %struct.gv*, %struct.gv*, %struct.gv*, i8*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, i8**, i8*, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8*, %struct.sv*, i64, %struct.sv*, i64, i64, i64, i32, i32*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.av*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.av*, %struct.hv*, %struct.hv*, %struct.sv*, %struct.av*, %struct.av*, %struct.av*, %struct.av*, %struct.av*, %struct.hv*, i64, i32, i64, i64, %struct.sv*, %struct.sv*, %struct.av*, i8*, %struct.cv*, %struct.op*, %struct.op*, %struct.op*, %struct.op*, %struct.cop*, i32, i32, i8*, i8**, i8*, %struct.av*, %struct.sv*, %struct.sv*, i64, i8, i8, i16, i32, i64, %struct.exitlistentry*, %struct.hv*, i64*, %struct.cop, %struct.cv*, %struct.av*, %struct.av*, i64, i64, %struct.interp_intern, %struct.cv*, i32, i8, i8, i8, i8, i64, i64, i64, i64, i64, i64, i64, i64, i8**, i8*, void (i32)*, [16 x i8*], i64, i32, {}*, %struct.sv, %struct.sv, %struct.sv, %struct.sv*, i64, i64, i64, i64, i64, i64, i64, i64, i64, i8*, i64, i64, i64, i8, i8, i8, i8, i8*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.hv*, i8*, i64, [10 x i8], i8, i8, i32, %struct.yy_parser*, %struct.sv**, %struct.sv**, %struct.ptr_tbl*, %struct.av*, i8*, %struct.sv*, %struct.sv**, %struct.av*, %struct.REENTR*, %struct.hv*, %struct.hv*, %struct._PerlIO*, %struct.PerlIO_list_s*, %struct.PerlIO_list_s*, %struct.sv*, %struct.perl_debug_pad, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, i64 (%struct.interpreter*, %struct.sv*, %struct.sv*)*, %struct.av*, %struct.av*, i64, i64, i32, %struct.hv*, void (%struct.interpreter*, %struct.sv*)*, void (%struct.interpreter*, %struct.sv*)*, void (%struct.interpreter*, %struct.sv*)*, {}*, void (%struct.interpreter*)*, i64, i64, %struct.hv*, i32, i8**, i8 (%struct.interpreter*, %struct.sv*)*, %struct.hv*, %struct.av*, %struct.hv*, %struct.hv*, %struct.hv* }
%struct.sv = type { i8*, i64, i64, %union.anon.0 }
%union.anon.0 = type { i8* }
%struct.op = type { %struct.op*, %struct.op*, %struct.op* (%struct.interpreter*)*, i64, [2 x i8], i8, i8 }
%union.any = type { i8* }
%struct.xpv = type { %struct.hv*, %union._xmgu, i64, i64 }
%struct.hv = type { %struct.xpvhv*, i64, i64, %union.anon.3 }
%struct.xpvhv = type { %struct.hv*, %union._xmgu, i64, i64 }
%union._xmgu = type { %struct.magic* }
%struct.magic = type { %struct.magic*, %struct.mgvtbl*, i16, i8, i8, i64, %struct.sv*, i8* }
%struct.mgvtbl = type { i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i64 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*, %struct.sv*, i8*, i64)*, i32 (%struct.interpreter*, %struct.magic*, %struct.clone_params*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)* }
%struct.clone_params = type { %struct.av*, i64, %struct.interpreter*, %struct.interpreter*, %struct.av* }
%struct.av = type { %struct.xpvav*, i64, i64, %union.anon.2 }
%struct.xpvav = type { %struct.hv*, %union._xmgu, i64, i64, %struct.sv** }
%union.anon.2 = type { i8* }
%union.anon.3 = type { i8* }
%struct._stat64 = type { i32, i16, i16, i16, i16, i16, i32, i64, i64, i64, i64 }
%struct.gv = type { %struct.xpvgv*, i64, i64, %union.anon.7 }
%struct.xpvgv = type { %struct.hv*, %union._xmgu, i64, i64, %union._xivu, %union._xnvu }
%union._xivu = type { i64 }
%union._xnvu = type { %struct.anon.5 }
%struct.anon.5 = type { i64, i64 }
%union.anon.7 = type { i8* }
%struct.tms = type { i64, i64, i64, i64 }
%struct.pmop = type { %struct.op*, %struct.op*, %struct.op* (%struct.interpreter*)*, i64, [2 x i8], i8, i8, %struct.op*, %struct.op*, i64, i64, %union.anon.12, %union.anon.13 }
%union.anon.12 = type { %struct.op* }
%union.anon.13 = type { %struct.op* }
%struct.jmpenv = type { %struct.jmpenv*, [16 x i32], i32, i8 }
%struct.cop = type { %struct.op*, %struct.op*, %struct.op* (%struct.interpreter*)*, i64, [2 x i8], i8, i8, i64, i8*, i8*, i64, i64, i64*, %struct.refcounted_he* }
%struct.refcounted_he = type opaque
%struct.stackinfo = type { %struct.av*, %struct.context*, %struct.stackinfo*, %struct.stackinfo*, i64, i64, i64, i64 }
%struct.context = type { %union.anon.14 }
%union.anon.14 = type { %struct.block }
%struct.block = type { i8, i8, i16, i64, %struct.cop*, i64, i64, %struct.pmop*, %union.anon.15 }
%union.anon.15 = type { %struct.block_sub }
%struct.block_sub = type { %struct.op*, %struct.cv*, %struct.av*, %struct.av*, i64, %struct.av* }
%struct.cv = type { %struct.xpvcv*, i64, i64, %union.anon.11 }
%struct.xpvcv = type { %struct.hv*, %union._xmgu, i64, i64, %struct.hv*, %union.anon.9, %union.anon.10, %struct.gv*, i8*, %struct.av*, %struct.cv*, i64, i16, i64 }
%union.anon.9 = type { %struct.op* }
%union.anon.10 = type { %struct.op* }
%union.anon.11 = type { i8* }
%struct.he = type { %struct.he*, %struct.hek*, %union.anon.1 }
%struct.hek = type { i64, i64, [1 x i8] }
%union.anon.1 = type { %struct.sv* }
%struct.re_save_state = type { i64, i64, i64, i8, i8*, i8*, i8*, %struct.regexp_paren_pair*, i64*, i64*, i8**, %struct.magic*, %struct.pmop*, %struct.pmop*, i8*, i64, i64, i64, i64, i64, i64, i8*, i8* }
%struct.regexp_paren_pair = type { i64, i64 }
%struct.regnode = type { i8, i8, i16 }
%struct.regmatch_slab = type { [42 x %struct.regmatch_state], %struct.regmatch_slab*, %struct.regmatch_slab* }
%struct.regmatch_state = type { i32, i8*, %union.anon.22 }
%union.anon.22 = type { %struct.anon.26 }
%struct.anon.26 = type { %struct.regmatch_state*, i64, i64, i64, i16*, %struct.regnode*, %struct.regnode*, i8*, i64, i16, i16, i8 }
%struct.exitlistentry = type { void (%struct.interpreter*, i8*)*, i8* }
%struct.interp_intern = type { i8*, i8**, i64, %struct.av*, %struct.child_tab*, i64, %struct.pseudo_child_tab*, i8*, %struct.thread_intern, %struct.HWND__*, i32, i32, [27 x void (i32)*] }
%struct.child_tab = type { i64, [64 x i64], [64 x i8*] }
%struct.pseudo_child_tab = type { i64, [64 x i64], [64 x i8*], [64 x %struct.HWND__*], [64 x i8] }
%struct.HWND__ = type { i32 }
%struct.thread_intern = type { [512 x i8], %struct.servent, [128 x i8], i32, [30 x i8], i32, i16 }
%struct.servent = type { i8*, i8**, i16, i8* }
%struct.yy_parser = type { %struct.yy_parser*, %union.YYSTYPE, i32, i32, i32, i32, %struct.yy_stack_frame*, %struct.yy_stack_frame*, i64, i64, i8*, i8*, i8, i8, i8, i8, i64, %struct.op*, %struct.op*, %struct.sv*, i16, i16, i64, %struct.sv*, i64, i64, i8, i8, i8, i8, i64, %struct._sublex_info, %struct.sv*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i64, i16, i8, i8, %struct.hv*, %struct._PerlIO**, %struct.av*, [5 x %union.YYSTYPE], [5 x i64], i64, %struct.cop*, [256 x i8], i8, i8 }
%union.YYSTYPE = type { i64 }
%struct.yy_stack_frame = type { %union.YYSTYPE, i16, i64, %struct.cv* }
%struct._sublex_info = type { i8, i16, %struct.op*, i8*, i8* }
%struct._PerlIO = type opaque
%struct.ptr_tbl = type { %struct.ptr_tbl_ent**, i64, i64, %struct.ptr_tbl_arena*, %struct.ptr_tbl_ent*, %struct.ptr_tbl_ent* }
%struct.ptr_tbl_ent = type { %struct.ptr_tbl_ent*, i8*, i8* }
%struct.ptr_tbl_arena = type opaque
%struct.REENTR = type { i32 }
%struct.PerlIO_list_s = type opaque
%struct.perl_debug_pad = type { [3 x %struct.sv] }
define i64 @HEAP_MAKE_TAG_FLAGS(i64 %TagBase, i64 %Tag) nounwind uwtable readnone {
%1 = shl i64 %Tag, 18
%2 = add i64 %1, %TagBase
ret i64 %2
}
define i8* @RtlSecureZeroMemory(i8* %ptr, i64 %cnt) nounwind uwtable {
%1 = icmp eq i64 %cnt, 0
br i1 %1, label %._crit_edge, label %.lr.ph
.lr.ph: ; preds = %.lr.ph, %0
%vptr.02 = phi i8* [ %2, %.lr.ph ], [ %ptr, %0 ]
%.01 = phi i64 [ %3, %.lr.ph ], [ %cnt, %0 ]
store volatile i8 0, i8* %vptr.02, align 1, !tbaa !0
%2 = getelementptr inbounds i8* %vptr.02, i64 1
%3 = add i64 %.01, -1
%4 = icmp eq i64 %3, 0
br i1 %4, label %._crit_edge, label %.lr.ph
._crit_edge: ; preds = %.lr.ph, %0
ret i8* %ptr
}
define void @TpInitializeCallbackEnviron(%struct._TP_CALLBACK_ENVIRON* nocapture %CallbackEnviron) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 0
store i64 1, i64* %1, align 8, !tbaa !2
%2 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 1
store %struct._TP_POOL* null, %struct._TP_POOL** %2, align 8, !tbaa !3
%3 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 2
store %struct._TP_CLEANUP_GROUP* null, %struct._TP_CLEANUP_GROUP** %3, align 8, !tbaa !3
%4 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 3
store void (i8*, i8*)* null, void (i8*, i8*)** %4, align 8, !tbaa !3
%5 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 4
store i8* null, i8** %5, align 8, !tbaa !3
%6 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 5
store %struct._ACTIVATION_CONTEXT* null, %struct._ACTIVATION_CONTEXT** %6, align 8, !tbaa !3
%7 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 6
store void (%struct._TP_CALLBACK_INSTANCE*, i8*)* null, void (%struct._TP_CALLBACK_INSTANCE*, i8*)** %7, align 8, !tbaa !3
%8 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 7, i32 0
store i64 0, i64* %8, align 8, !tbaa !2
ret void
}
define void @TpSetCallbackThreadpool(%struct._TP_CALLBACK_ENVIRON* nocapture %CallbackEnviron, %struct._TP_POOL* %Pool) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 1
store %struct._TP_POOL* %Pool, %struct._TP_POOL** %1, align 8, !tbaa !3
ret void
}
define void @TpSetCallbackCleanupGroup(%struct._TP_CALLBACK_ENVIRON* nocapture %CallbackEnviron, %struct._TP_CLEANUP_GROUP* %CleanupGroup, void (i8*, i8*)* %CleanupGroupCancelCallback) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 2
store %struct._TP_CLEANUP_GROUP* %CleanupGroup, %struct._TP_CLEANUP_GROUP** %1, align 8, !tbaa !3
%2 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 3
store void (i8*, i8*)* %CleanupGroupCancelCallback, void (i8*, i8*)** %2, align 8, !tbaa !3
ret void
}
define void @TpSetCallbackActivationContext(%struct._TP_CALLBACK_ENVIRON* nocapture %CallbackEnviron, %struct._ACTIVATION_CONTEXT* %ActivationContext) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 5
store %struct._ACTIVATION_CONTEXT* %ActivationContext, %struct._ACTIVATION_CONTEXT** %1, align 8, !tbaa !3
ret void
}
define void @TpSetCallbackNoActivationContext(%struct._TP_CALLBACK_ENVIRON* nocapture %CallbackEnviron) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 5
store %struct._ACTIVATION_CONTEXT* inttoptr (i64 -1 to %struct._ACTIVATION_CONTEXT*), %struct._ACTIVATION_CONTEXT** %1, align 8, !tbaa !3
ret void
}
define void @TpSetCallbackLongFunction(%struct._TP_CALLBACK_ENVIRON* nocapture %CallbackEnviron) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 7, i32 0
%2 = load i64* %1, align 8
%3 = or i64 %2, 1
store i64 %3, i64* %1, align 8
ret void
}
define void @TpSetCallbackRaceWithDll(%struct._TP_CALLBACK_ENVIRON* nocapture %CallbackEnviron, i8* %DllHandle) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 4
store i8* %DllHandle, i8** %1, align 8, !tbaa !3
ret void
}
define void @TpSetCallbackFinalizationCallback(%struct._TP_CALLBACK_ENVIRON* nocapture %CallbackEnviron, void (%struct._TP_CALLBACK_INSTANCE*, i8*)* %FinalizationCallback) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %CallbackEnviron, i64 0, i32 6
store void (%struct._TP_CALLBACK_INSTANCE*, i8*)* %FinalizationCallback, void (%struct._TP_CALLBACK_INSTANCE*, i8*)** %1, align 8, !tbaa !3
ret void
}
define void @TpDestroyCallbackEnviron(%struct._TP_CALLBACK_ENVIRON* nocapture %CallbackEnviron) nounwind uwtable readnone {
ret void
}
define i64 @InterlockedAnd64(i64* %Destination, i64 %Value) nounwind uwtable {
br label %1
; <label>:1 ; preds = %1, %0
%2 = load volatile i64* %Destination, align 8, !tbaa !4
%3 = and i64 %2, %Value
%4 = tail call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %Destination, i64 %3, i64 %2) nounwind
%5 = icmp eq i64 %4, %2
br i1 %5, label %6, label %1
; <label>:6 ; preds = %1
ret i64 %2
}
declare x86_stdcallcc i64 @InterlockedCompareExchange64(i64*, i64, i64)
define i64 @InterlockedOr64(i64* %Destination, i64 %Value) nounwind uwtable {
br label %1
; <label>:1 ; preds = %1, %0
%2 = load volatile i64* %Destination, align 8, !tbaa !4
%3 = or i64 %2, %Value
%4 = tail call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %Destination, i64 %3, i64 %2) nounwind
%5 = icmp eq i64 %4, %2
br i1 %5, label %6, label %1
; <label>:6 ; preds = %1
ret i64 %2
}
define i64 @InterlockedXor64(i64* %Destination, i64 %Value) nounwind uwtable {
br label %1
; <label>:1 ; preds = %1, %0
%2 = load volatile i64* %Destination, align 8, !tbaa !4
%3 = xor i64 %2, %Value
%4 = tail call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %Destination, i64 %3, i64 %2) nounwind
%5 = icmp eq i64 %4, %2
br i1 %5, label %6, label %1
; <label>:6 ; preds = %1
ret i64 %2
}
define i64 @InterlockedIncrement64(i64* %Addend) nounwind uwtable {
br label %1
; <label>:1 ; preds = %1, %0
%2 = load volatile i64* %Addend, align 8, !tbaa !4
%3 = add nsw i64 %2, 1
%4 = tail call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %Addend, i64 %3, i64 %2) nounwind
%5 = icmp eq i64 %4, %2
br i1 %5, label %6, label %1
; <label>:6 ; preds = %1
ret i64 %3
}
define i64 @InterlockedDecrement64(i64* %Addend) nounwind uwtable {
br label %1
; <label>:1 ; preds = %1, %0
%2 = load volatile i64* %Addend, align 8, !tbaa !4
%3 = add nsw i64 %2, -1
%4 = tail call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %Addend, i64 %3, i64 %2) nounwind
%5 = icmp eq i64 %4, %2
br i1 %5, label %6, label %1
; <label>:6 ; preds = %1
ret i64 %3
}
define i64 @InterlockedExchange64(i64* %Target, i64 %Value) nounwind uwtable {
br label %1
; <label>:1 ; preds = %1, %0
%2 = load volatile i64* %Target, align 8, !tbaa !4
%3 = tail call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %Target, i64 %Value, i64 %2) nounwind
%4 = icmp eq i64 %3, %2
br i1 %4, label %5, label %1
; <label>:5 ; preds = %1
ret i64 %2
}
define i64 @InterlockedExchangeAdd64(i64* %Addend, i64 %Value) nounwind uwtable {
br label %1
; <label>:1 ; preds = %1, %0
%2 = load volatile i64* %Addend, align 8, !tbaa !4
%3 = add nsw i64 %2, %Value
%4 = tail call x86_stdcallcc i64 @InterlockedCompareExchange64(i64* %Addend, i64 %3, i64 %2) nounwind
%5 = icmp eq i64 %4, %2
br i1 %5, label %6, label %1
; <label>:6 ; preds = %1
ret i64 %2
}
define void @InitializeThreadpoolEnvironment(%struct._TP_CALLBACK_ENVIRON* nocapture %pcbe) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 0
store i64 1, i64* %1, align 8, !tbaa !2
%2 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 1
store %struct._TP_POOL* null, %struct._TP_POOL** %2, align 8, !tbaa !3
%3 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 2
store %struct._TP_CLEANUP_GROUP* null, %struct._TP_CLEANUP_GROUP** %3, align 8, !tbaa !3
%4 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 3
store void (i8*, i8*)* null, void (i8*, i8*)** %4, align 8, !tbaa !3
%5 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 4
store i8* null, i8** %5, align 8, !tbaa !3
%6 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 5
store %struct._ACTIVATION_CONTEXT* null, %struct._ACTIVATION_CONTEXT** %6, align 8, !tbaa !3
%7 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 6
store void (%struct._TP_CALLBACK_INSTANCE*, i8*)* null, void (%struct._TP_CALLBACK_INSTANCE*, i8*)** %7, align 8, !tbaa !3
%8 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 7, i32 0
store i64 0, i64* %8, align 8, !tbaa !2
ret void
}
define void @SetThreadpoolCallbackPool(%struct._TP_CALLBACK_ENVIRON* nocapture %pcbe, %struct._TP_POOL* %ptpp) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 1
store %struct._TP_POOL* %ptpp, %struct._TP_POOL** %1, align 8, !tbaa !3
ret void
}
define void @SetThreadpoolCallbackCleanupGroup(%struct._TP_CALLBACK_ENVIRON* nocapture %pcbe, %struct._TP_CLEANUP_GROUP* %ptpcg, void (i8*, i8*)* %pfng) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 2
store %struct._TP_CLEANUP_GROUP* %ptpcg, %struct._TP_CLEANUP_GROUP** %1, align 8, !tbaa !3
%2 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 3
store void (i8*, i8*)* %pfng, void (i8*, i8*)** %2, align 8, !tbaa !3
ret void
}
define void @SetThreadpoolCallbackRunsLong(%struct._TP_CALLBACK_ENVIRON* nocapture %pcbe) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 7, i32 0
%2 = load i64* %1, align 8
%3 = or i64 %2, 1
store i64 %3, i64* %1, align 8
ret void
}
define void @SetThreadpoolCallbackLibrary(%struct._TP_CALLBACK_ENVIRON* nocapture %pcbe, i8* %mod) nounwind uwtable {
%1 = getelementptr inbounds %struct._TP_CALLBACK_ENVIRON* %pcbe, i64 0, i32 4
store i8* %mod, i8** %1, align 8, !tbaa !3
ret void
}
define void @DestroyThreadpoolEnvironment(%struct._TP_CALLBACK_ENVIRON* nocapture %pcbe) nounwind uwtable readnone {
ret void
}
define i64 @HRESULT_FROM_WIN32(i64 %x) nounwind uwtable readnone {
%1 = icmp slt i64 %x, 1
br i1 %1, label %5, label %2
; <label>:2 ; preds = %0
%3 = and i64 %x, 65535
%4 = or i64 %3, 2147942400
br label %5
; <label>:5 ; preds = %2, %0
%6 = phi i64 [ %4, %2 ], [ %x, %0 ]
ret i64 %6
}
define i32 @Perl_runops_standard(%struct.interpreter* %my_perl) nounwind uwtable {
%1 = getelementptr inbounds %struct.interpreter* %my_perl, i64 0, i32 1
%2 = load %struct.op** %1, align 8, !tbaa !3
br label %3
; <label>:3 ; preds = %3, %0
%op.0 = phi %struct.op* [ %2, %0 ], [ %6, %3 ]
%4 = getelementptr inbounds %struct.op* %op.0, i64 0, i32 2
%5 = load %struct.op* (%struct.interpreter*)** %4, align 8, !tbaa !3
%6 = tail call %struct.op* %5(%struct.interpreter* %my_perl) nounwind
store %struct.op* %6, %struct.op** %1, align 8, !tbaa !3
%7 = icmp eq %struct.op* %6, null
br i1 %7, label %8, label %3
; <label>:8 ; preds = %3
%9 = getelementptr inbounds %struct.interpreter* %my_perl, i64 0, i32 78
store i8 0, i8* %9, align 1, !tbaa !0
ret i32 0
}
!0 = metadata !{metadata !"omnipotent char", metadata !1}
!1 = metadata !{metadata !"Simple C/C++ TBAA", null}
!2 = metadata !{metadata !"long", metadata !0}
!3 = metadata !{metadata !"any pointer", metadata !0}
!4 = metadata !{metadata !"long long", metadata !0}
</code></spoiler>
<P>Now looking at that, I can see that it has built data descriptions for a crapload of Windows internal data structures, so I've manually (and conservatively) removed anything that I don't think are used by Perl. (I could have done this at the /e stage, but it was *much* easier reading 700 lines that 30000 lines :)
<p>What I've ended up with is these 112 lines of IR:<code>
; ModuleID = '/tmp/webcompile/_9304_0.bc'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct._TP_CALLBACK_ENVIRON = type { i64, %struct._TP_POOL*, %struct._TP_CLEANUP_GROUP*, void (i8*, i8*)*, i8*, %struct._ACTIVATION_CONTEXT*, void (%struct._TP_CALLBACK_INSTANCE*, i8*)*, %union.anon }
%struct._TP_POOL = type opaque
%struct._TP_CLEANUP_GROUP = type opaque
%struct._ACTIVATION_CONTEXT = type opaque
%struct._TP_CALLBACK_INSTANCE = type opaque
%union.anon = type { i64 }
%struct.interpreter = type { %struct.sv**, %struct.op*, %struct.sv**, %struct.sv**, %struct.sv**, i64*, i8**, i64, i64, %union.any*, i64, i64, %struct.sv**, i64, i64, i64, i64, i64*, i64*, i64*, %struct.sv*, %struct.xpv*, i64, %struct._stat64, %struct._stat64, %struct.gv*, %struct.sv*, %struct.tms, %struct.pmop*, %struct.sv*, %struct.gv*, %struct.gv*, %struct.gv*, i8*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.hv*, %struct.hv*, %struct.op*, %struct.jmpenv*, %struct.cop*, %struct.av*, %struct.stackinfo*, %struct.av*, %struct.jmpenv*, %struct.jmpenv, %struct.sv*, %struct.he*, %struct.op*, %struct.op*, %struct.hv*, %struct.gv*, %struct.gv*, i8*, i64, i64*, i64*, %struct.sv*, %struct.re_save_state, %struct.regnode, i16, i8, i8, [6 x i8*], void (%struct.interpreter*, %struct.op*)*, void (%struct.interpreter*, %struct.op*)*, void (%struct.interpreter*, %struct.op*)*, i64, i64, i8**, i8*, %struct.regmatch_slab*, %struct.regmatch_state*, i16, i8, i8, i8, i8, i32, i8, i64, i32, i8**, %struct.gv*, %struct.gv*, %struct.gv*, i8*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, i8**, i8*, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8*, %struct.sv*, i64, %struct.sv*, i64, i64, i64, i32, i32*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.av*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.gv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.av*, %struct.hv*, %struct.hv*, %struct.sv*, %struct.av*, %struct.av*, %struct.av*, %struct.av*, %struct.av*, %struct.hv*, i64, i32, i64, i64, %struct.sv*, %struct.sv*, %struct.av*, i8*, %struct.cv*, %struct.op*, %struct.op*, %struct.op*, %struct.op*, %struct.cop*, i32, i32, i8*, i8**, i8*, %struct.av*, %struct.sv*, %struct.sv*, i64, i8, i8, i16, i32, i64, %struct.exitlistentry*, %struct.hv*, i64*, %struct.cop, %struct.cv*, %struct.av*, %struct.av*, i64, i64, %struct.interp_intern, %struct.cv*, i32, i8, i8, i8, i8, i64, i64, i64, i64, i64, i64, i64, i64, i8**, i8*, void (i32)*, [16 x i8*], i64, i32, {}*, %struct.sv, %struct.sv, %struct.sv, %struct.sv*, i64, i64, i64, i64, i64, i64, i64, i64, i64, i8*, i64, i64, i64, i8, i8, i8, i8, i8*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, %struct.hv*, i8*, i64, [10 x i8], i8, i8, i32, %struct.yy_parser*, %struct.sv**, %struct.sv**, %struct.ptr_tbl*, %struct.av*, i8*, %struct.sv*, %struct.sv**, %struct.av*, %struct.REENTR*, %struct.hv*, %struct.hv*, %struct._PerlIO*, %struct.PerlIO_list_s*, %struct.PerlIO_list_s*, %struct.sv*, %struct.perl_debug_pad, %struct.sv*, %struct.sv*, %struct.sv*, %struct.sv*, i64 (%struct.interpreter*, %struct.sv*, %struct.sv*)*, %struct.av*, %struct.av*, i64, i64, i32, %struct.hv*, void (%struct.interpreter*, %struct.sv*)*, void (%struct.interpreter*, %struct.sv*)*, void (%struct.interpreter*, %struct.sv*)*, {}*, void (%struct.interpreter*)*, i64, i64, %struct.hv*, i32, i8**, i8 (%struct.interpreter*, %struct.sv*)*, %struct.hv*, %struct.av*, %struct.hv*, %struct.hv*, %struct.hv* }
%struct.sv = type { i8*, i64, i64, %union.anon.0 }
%union.anon.0 = type { i8* }
%struct.op = type { %struct.op*, %struct.op*, %struct.op* (%struct.interpreter*)*, i64, [2 x i8], i8, i8 }
%union.any = type { i8* }
%struct.xpv = type { %struct.hv*, %union._xmgu, i64, i64 }
%struct.hv = type { %struct.xpvhv*, i64, i64, %union.anon.3 }
%struct.xpvhv = type { %struct.hv*, %union._xmgu, i64, i64 }
%union._xmgu = type { %struct.magic* }
%struct.magic = type { %struct.magic*, %struct.mgvtbl*, i16, i8, i8, i64, %struct.sv*, i8* }
%struct.mgvtbl = type { i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i64 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*, %struct.sv*, i8*, i64)*, i32 (%struct.interpreter*, %struct.magic*, %struct.clone_params*)*, i32 (%struct.interpreter*, %struct.sv*, %struct.magic*)* }
%struct.clone_params = type { %struct.av*, i64, %struct.interpreter*, %struct.interpreter*, %struct.av* }
%struct.av = type { %struct.xpvav*, i64, i64, %union.anon.2 }
%struct.xpvav = type { %struct.hv*, %union._xmgu, i64, i64, %struct.sv** }
%union.anon.2 = type { i8* }
%union.anon.3 = type { i8* }
%struct._stat64 = type { i32, i16, i16, i16, i16, i16, i32, i64, i64, i64, i64 }
%struct.gv = type { %struct.xpvgv*, i64, i64, %union.anon.7 }
%struct.xpvgv = type { %struct.hv*, %union._xmgu, i64, i64, %union._xivu, %union._xnvu }
%union._xivu = type { i64 }
%union._xnvu = type { %struct.anon.5 }
%struct.anon.5 = type { i64, i64 }
%union.anon.7 = type { i8* }
%struct.tms = type { i64, i64, i64, i64 }
%struct.pmop = type { %struct.op*, %struct.op*, %struct.op* (%struct.interpreter*)*, i64, [2 x i8], i8, i8, %struct.op*, %struct.op*, i64, i64, %union.anon.12, %union.anon.13 }
%union.anon.12 = type { %struct.op* }
%union.anon.13 = type { %struct.op* }
%struct.jmpenv = type { %struct.jmpenv*, [16 x i32], i32, i8 }
%struct.cop = type { %struct.op*, %struct.op*, %struct.op* (%struct.interpreter*)*, i64, [2 x i8], i8, i8, i64, i8*, i8*, i64, i64, i64*, %struct.refcounted_he* }
%struct.refcounted_he = type opaque
%struct.stackinfo = type { %struct.av*, %struct.context*, %struct.stackinfo*, %struct.stackinfo*, i64, i64, i64, i64 }
%struct.context = type { %union.anon.14 }
%union.anon.14 = type { %struct.block }
%struct.block = type { i8, i8, i16, i64, %struct.cop*, i64, i64, %struct.pmop*, %union.anon.15 }
%union.anon.15 = type { %struct.block_sub }
%struct.block_sub = type { %struct.op*, %struct.cv*, %struct.av*, %struct.av*, i64, %struct.av* }
%struct.cv = type { %struct.xpvcv*, i64, i64, %union.anon.11 }
%struct.xpvcv = type { %struct.hv*, %union._xmgu, i64, i64, %struct.hv*, %union.anon.9, %union.anon.10, %struct.gv*, i8*, %struct.av*, %struct.cv*, i64, i16, i64 }
%union.anon.9 = type { %struct.op* }
%union.anon.10 = type { %struct.op* }
%union.anon.11 = type { i8* }
%struct.he = type { %struct.he*, %struct.hek*, %union.anon.1 }
%struct.hek = type { i64, i64, [1 x i8] }
%union.anon.1 = type { %struct.sv* }
%struct.re_save_state = type { i64, i64, i64, i8, i8*, i8*, i8*, %struct.regexp_paren_pair*, i64*, i64*, i8**, %struct.magic*, %struct.pmop*, %struct.pmop*, i8*, i64, i64, i64, i64, i64, i64, i8*, i8* }
%struct.regexp_paren_pair = type { i64, i64 }
%struct.regnode = type { i8, i8, i16 }
%struct.regmatch_slab = type { [42 x %struct.regmatch_state], %struct.regmatch_slab*, %struct.regmatch_slab* }
%struct.regmatch_state = type { i32, i8*, %union.anon.22 }
%union.anon.22 = type { %struct.anon.26 }
%struct.anon.26 = type { %struct.regmatch_state*, i64, i64, i64, i16*, %struct.regnode*, %struct.regnode*, i8*, i64, i16, i16, i8 }
%struct.exitlistentry = type { void (%struct.interpreter*, i8*)*, i8* }
%struct.interp_intern = type { i8*, i8**, i64, %struct.av*, %struct.child_tab*, i64, %struct.pseudo_child_tab*, i8*, %struct.thread_intern, %struct.HWND__*, i32, i32, [27 x void (i32)*] }
%struct.child_tab = type { i64, [64 x i64], [64 x i8*] }
%struct.pseudo_child_tab = type { i64, [64 x i64], [64 x i8*], [64 x %struct.HWND__*], [64 x i8] }
%struct.HWND__ = type { i32 }
%struct.thread_intern = type { [512 x i8], %struct.servent, [128 x i8], i32, [30 x i8], i32, i16 }
%struct.servent = type { i8*, i8**, i16, i8* }
%struct.yy_parser = type { %struct.yy_parser*, %union.YYSTYPE, i32, i32, i32, i32, %struct.yy_stack_frame*, %struct.yy_stack_frame*, i64, i64, i8*, i8*, i8, i8, i8, i8, i64, %struct.op*, %struct.op*, %struct.sv*, i16, i16, i64, %struct.sv*, i64, i64, i8, i8, i8, i8, i64, %struct._sublex_info, %struct.sv*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i64, i16, i8, i8, %struct.hv*, %struct._PerlIO**, %struct.av*, [5 x %union.YYSTYPE], [5 x i64], i64, %struct.cop*, [256 x i8], i8, i8 }
%union.YYSTYPE = type { i64 }
%struct.yy_stack_frame = type { %union.YYSTYPE, i16, i64, %struct.cv* }
%struct._sublex_info = type { i8, i16, %struct.op*, i8*, i8* }
%struct._PerlIO = type opaque
%struct.ptr_tbl = type { %struct.ptr_tbl_ent**, i64, i64, %struct.ptr_tbl_arena*, %struct.ptr_tbl_ent*, %struct.ptr_tbl_ent* }
%struct.ptr_tbl_ent = type { %struct.ptr_tbl_ent*, i8*, i8* }
%struct.ptr_tbl_arena = type opaque
%struct.REENTR = type { i32 }
%struct.PerlIO_list_s = type opaque
%struct.perl_debug_pad = type { [3 x %struct.sv] }
define i64 @HEAP_MAKE_TAG_FLAGS(i64 %TagBase, i64 %Tag) nounwind uwtable readnone {
%1 = shl i64 %Tag, 18
%2 = add i64 %1, %TagBase
ret i64 %2
}
define i32 @Perl_runops_standard(%struct.interpreter* %my_perl) nounwind uwtable {
%1 = getelementptr inbounds %struct.interpreter* %my_perl, i64 0, i32 1
%2 = load %struct.op** %1, align 8, !tbaa !3
br label %3
; <label>:3 ; preds = %3, %0
%op.0 = phi %struct.op* [ %2, %0 ], [ %6, %3 ]
%4 = getelementptr inbounds %struct.op* %op.0, i64 0, i32 2
%5 = load %struct.op* (%struct.interpreter*)** %4, align 8, !tbaa !3
%6 = tail call %struct.op* %5(%struct.interpreter* %my_perl) nounwind
store %struct.op* %6, %struct.op** %1, align 8, !tbaa !3
%7 = icmp eq %struct.op* %6, null
br i1 %7, label %8, label %3
; <label>:8 ; preds = %3
%9 = getelementptr inbounds %struct.interpreter* %my_perl, i64 0, i32 78
store i8 0, i8* %9, align 1, !tbaa !0
ret i32 0
}
!0 = metadata !{metadata !"omnipotent char", metadata !1}
!1 = metadata !{metadata !"Simple C/C++ TBAA", null}
!2 = metadata !{metadata !"long", metadata !0}
!3 = metadata !{metadata !"any pointer", metadata !0}
!4 = metadata !{metadata !"long long", metadata !0}
</code>
<p>Take a close look at the data definitions for Interpreter, SV_any, HEK, COP etc. Isn't that the most concise (and thorough) description of the entire perl internals you've ever seen?
<p>Doesn't it nake you wonder (just a little), what could it do with all that information?
<div class="pmsig"><div class="pmsig-171588">
<hr />
<font size=1 >
<div>With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'</div>
<div>Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.</div>
<div>"Science is about questioning the status quo. Questioning authority". </div>
<div>In the absence of evidence, opinion is indistinguishable from prejudice.
<p align=right> [http://thebottomline.cpaaustra
990666
990860