1; RUN: llc < %s -march=x86
2target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
3target triple = "i386-apple-darwin8"
4
5define hidden float @__floatundisf(i64 %u) nounwind readnone {
6entry:
7	%0 = icmp ugt i64 %u, 9007199254740991		; <i1> [#uses=1]
8	br i1 %0, label %bb, label %bb2
9
10bb:		; preds = %entry
11	%1 = and i64 %u, 2047		; <i64> [#uses=1]
12	%2 = icmp eq i64 %1, 0		; <i1> [#uses=1]
13	br i1 %2, label %bb2, label %bb1
14
15bb1:		; preds = %bb
16	%3 = or i64 %u, 2048		; <i64> [#uses=1]
17	%4 = and i64 %3, -2048		; <i64> [#uses=1]
18	br label %bb2
19
20bb2:		; preds = %bb1, %bb, %entry
21	%u_addr.0 = phi i64 [ %4, %bb1 ], [ %u, %entry ], [ %u, %bb ]		; <i64> [#uses=2]
22	%5 = lshr i64 %u_addr.0, 32		; <i64> [#uses=1]
23	%6 = trunc i64 %5 to i32		; <i32> [#uses=1]
24	%7 = uitofp i32 %6 to double		; <double> [#uses=1]
25	%8 = fmul double %7, 0x41F0000000000000		; <double> [#uses=1]
26	%9 = trunc i64 %u_addr.0 to i32		; <i32> [#uses=1]
27	%10 = uitofp i32 %9 to double		; <double> [#uses=1]
28	%11 = fadd double %10, %8		; <double> [#uses=1]
29	%12 = fptrunc double %11 to float		; <float> [#uses=1]
30	ret float %12
31}
32