1 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
2 target triple = "x86_64-unknown-linux-gnu"
4 @fptr = internal unnamed_addr global i32 (i32)* @f2, align 8
6 define dso_local i32 @foo(i32 %x) local_unnamed_addr {
8 %0 = load i32 (i32)*, i32 (i32)** @fptr, align 8
9 %call = tail call i32 %0(i32 %x), !callees !0
13 define internal i32 @f2(i32 %x) {
15 %tobool = icmp eq i32 %x, 0
16 br i1 %tobool, label %if.end, label %if.then
18 if.then: ; preds = %entry
19 store i32 (i32)* @f1, i32 (i32)** @fptr, align 8
20 %sub.i = add nsw i32 %x, -1
23 if.end: ; preds = %entry, %if.then
24 %phi.call = phi i32 [ %sub.i, %if.then ], [ -1, %entry ]
28 define internal i32 @f1(i32 %x) {
30 %sub = add nsw i32 %x, -1
34 !0 = !{i32 (i32)* @f1, i32 (i32)* @f2}