double baz(const char *x) {
  if (x[0] != '\0') {
    char y[6 + strlen(x)];
    foo(y, "FOO", x);
    return bar(y, 0);
  }
  return (__extension__((union {
            unsigned __l __attribute__((__mode__(__SI__)));
            float __d;
          }){__l : 0x3f800000UL})
              .__d);
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11b3 <baz+0x83>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    %rcx,%rax
add    $0x6,%rax
mov    %rsp,%rdx
mov    %rdx,-0x18(%rbp)
add    $0x15,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1050 <foo@plt>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <bar@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
jmp    11c8 <baz+0x98>
movl   $0x3f800000,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1184 <baz+0x54>
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rsp,%r15
mov    %rsp,%rbx
add    $0x15,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <foo@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <bar@plt>
cvtsi2sd %eax,%xmm0
mov    %r15,%rsp
jmp    118c <baz+0x5c>
movsd  0xe74(%rip),%xmm0
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%union.anon = type { i32 }
@.str = [4 x i8] c"FOO\00"
define double @baz(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca %union.anon
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i64 @strlen(i8* %13)
%15 = add i64 6, %14
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %4
%17 = alloca i8, i64 %15
store i64 %15, i64* %5
%18 = load i8*, i8** %3
%19 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @foo to i32 (i8*, i8*, i8*, ...)*)(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @bar to i32 (i8*, i32, ...)*)(i8* %17, i32 0)
%21 = sitofp i32 %20 to double
store double %21, double* %2
%22 = load i8*, i8** %4
br label %28
23: ; preds = %1
%24 = bitcast %union.anon* %6 to i32*
store i32 1065353216, i32* %24
%25 = bitcast %union.anon* %6 to float*
%26 = load float, float* %25
%27 = fpext float %26 to double
store double %27, double* %2
br label %28
28: ; preds = %23, %12
%29 = load double, double* %2
ret double %29
}

LLVM IR (-O2):
@.str = [4 x i8] c"FOO\00"
define double @baz(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = tail call i64 @strlen(i8* %0)
%6 = add i64 %5, 6
%7 = tail call i8* @llvm.stacksave()
%8 = alloca i8, i64 %6
%9 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @foo to i32 (i8*, i8*, i8*, ...)*)(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @bar to i32 (i8*, i32, ...)*)(i8* %8, i32 0)
%11 = sitofp i32 %10 to double
br label %12
12: ; preds = %1, %4
%13 = phi double [ %11, %4 ], [ 1.000000e+00, %1 ]
ret double %13
}