void castsToBool() {
  clang_analyzer_eval(0);
  clang_analyzer_eval(0U);
  clang_analyzer_eval((void *)0);
  clang_analyzer_eval(1);
  clang_analyzer_eval(1U);
  clang_analyzer_eval(-1);
  clang_analyzer_eval(0x100);
  clang_analyzer_eval(0x100U);
  clang_analyzer_eval((void *)0x100);
  extern int symbolicInt;
  clang_analyzer_eval(symbolicInt);
  if (symbolicInt)
    clang_analyzer_eval(symbolicInt);
  extern void *symbolicPointer;
  clang_analyzer_eval(symbolicPointer);
  if (symbolicPointer)
    clang_analyzer_eval(symbolicPointer);
  int localInt;
  int *ptr = &localInt;
  clang_analyzer_eval(ptr);
  clang_analyzer_eval(&castsToBool);
  clang_analyzer_eval("abc");
  extern float globalFloat;
  clang_analyzer_eval(globalFloat);
}


x86 assembly (clang, -O0):
<castsToBool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
xor    %eax,%eax
mov    %eax,%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    $0xffffffff,%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    $0x100,%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    $0x100,%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    $0x100,%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    0x2e4c(%rip),%rax
cmpl   $0x0,(%rax)
je     11ad <castsToBool+0x9d>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    0x2e13(%rip),%rax
cmpq   $0x0,(%rax)
je     11e0 <castsToBool+0xd0>
mov    0x2e02(%rip),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    0x2dee(%rip),%rdi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    0x2db2(%rip),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<castsToBool>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    $0xffffffff,%edi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    $0x100,%edi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    $0x100,%edi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    $0x100,%edi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    0x2e61(%rip),%rbx
mov    (%rbx),%edi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    (%rbx),%edi
test   %edi,%edi
je     1195 <castsToBool+0x85>
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    0x2e3c(%rip),%rbx
mov    (%rbx),%rdi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    (%rbx),%rdi
test   %rdi,%rdi
je     11b5 <castsToBool+0xa5>
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
lea    0xc(%rsp),%rdi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    0x2e20(%rip),%rdi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
lea    0xe2a(%rip),%rdi
xor    %eax,%eax
call   1030 <clang_analyzer_eval@plt>
mov    0x2de4(%rip),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@symbolicInt = external global i32
@symbolicPointer = external global i8*
@.str = [4 x i8] c"abc\00"
@globalFloat = external global float
define void @castsToBool() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 0)
%4 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 0)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* null)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 1)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 1)
%8 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 -1)
%9 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 256)
%10 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 256)
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* inttoptr (i64 256 to i8*))
%12 = load i32, i32* @symbolicInt
%13 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 %12)
%14 = load i32, i32* @symbolicInt
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %0
%17 = load i32, i32* @symbolicInt
%18 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 %17)
br label %19
19: ; preds = %16, %0
%20 = load i8*, i8** @symbolicPointer
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* %20)
%22 = load i8*, i8** @symbolicPointer
%23 = icmp ne i8* %22, null
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = load i8*, i8** @symbolicPointer
%26 = call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* %25)
br label %27
27: ; preds = %24, %19
store i32* %1, i32** %2
%28 = load i32*, i32** %2
%29 = call i32 (i32*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32*, ...)*)(i32* %28)
%30 = call i32 (void (...)*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (void (...)*, ...)*)(void (...)* bitcast (void ()* @castsToBool to void (...)*))
%31 = call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%32 = load float, float* @globalFloat
%33 = fpext float %32 to double
%34 = call i32 (double, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (double, ...)*)(double %33)
ret void
}

LLVM IR (-O2):
@symbolicInt = external global i32
@symbolicPointer = external global i8*
@.str = [4 x i8] c"abc\00"
@globalFloat = external global float
define void @castsToBool() {
%1 = alloca i32
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* null)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 1)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 1)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 -1)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 256)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 256)
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* inttoptr (i64 256 to i8*))
%11 = load i32, i32* @symbolicInt
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 %11)
%13 = load i32, i32* @symbolicInt
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %0
%16 = tail call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 %13)
br label %17
17: ; preds = %15, %0
%18 = load i8*, i8** @symbolicPointer
%19 = tail call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* %18)
%20 = load i8*, i8** @symbolicPointer
%21 = icmp eq i8* %20, null
br i1 %21, label %24, label %22
22: ; preds = %17
%23 = tail call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* %20)
br label %24
24: ; preds = %22, %17
%25 = bitcast i32* %1 to i8*
%26 = call i32 (i32*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32*, ...)*)(i32* %1)
%27 = call i32 (void (...)*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (void (...)*, ...)*)(void (...)* bitcast (void ()* @castsToBool to void (...)*))
%28 = call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%29 = load float, float* @globalFloat
%30 = fpext float %29 to double
%31 = call i32 (double, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (double, ...)*)(double %30)
ret void
}