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;
  clang_analyzer_eval(&localInt);
  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),%rdi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    0x2df6(%rip),%rdi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <clang_analyzer_eval@plt>
mov    0x2dba(%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 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 0)
%3 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 0)
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* null)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 1)
%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 256)
%9 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 256)
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* inttoptr (i64 256 to i8*))
%11 = load i32, i32* @symbolicInt
%12 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 %11)
%13 = load i32, i32* @symbolicInt
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = load i32, i32* @symbolicInt
%17 = call i32 (i32, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32, ...)*)(i32 %16)
br label %18
18: ; preds = %15, %0
%19 = load i8*, i8** @symbolicPointer
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* %19)
%21 = load i8*, i8** @symbolicPointer
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = load i8*, i8** @symbolicPointer
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i8*, ...)*)(i8* %24)
br label %26
26: ; preds = %23, %18
%27 = call i32 (i32*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (i32*, ...)*)(i32* %1)
%28 = call i32 (void (...)*, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (void (...)*, ...)*)(void (...)* bitcast (void ()* @castsToBool to void (...)*))
%29 = 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))
%30 = load float, float* @globalFloat
%31 = fpext float %30 to double
%32 = call i32 (double, ...) bitcast (i32 (...)* @clang_analyzer_eval to i32 (double, ...)*)(double %31)
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
}