int main() {
  int a = 1;
  int b = 1;
  int *x;
  int t;
  int rnd;
  if (rnd)
    x = &a;
  else
    x = &b;
  if (rnd) {
    x = 0;
    assert(x == 0);
  }
  assert((int)0 == (int *)0);
  if (x) {
    assert(*x = 1);
    b = 2;
    assert(*x != 0);
    b = 0;
    assert(*x == 0);
    if (x != &b) {
      assert(x == &a);
      assert(*x == 1);
    }
  } else {
    assert(x == 0);
    unknown_fn(x);
  }
  unknown_fn(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1154 <main+0x34>
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    115c <main+0x3c>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1182 <main+0x62>
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
je     1229 <main+0x109>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <assert@plt>
movl   $0x2,-0xc(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
lea    -0xc(%rbp),%rax
cmp    %rax,-0x18(%rbp)
je     1224 <main+0x104>
lea    -0x8(%rbp),%rax
cmp    %rax,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x1,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
jmp    1248 <main+0x128>
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <unknown_fn@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <unknown_fn@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <assert@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1030 <unknown_fn@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32* %2, i32** %4
br label %11
10: ; preds = %0
store i32* %3, i32** %4
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
store i32* null, i32** %4
%15 = load i32*, i32** %4
%16 = icmp eq i32* %15, null
%17 = zext i1 %16 to i32
%18 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %17)
br label %19
19: ; preds = %14, %11
%20 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%21 = load i32*, i32** %4
%22 = icmp ne i32* %21, null
br i1 %22, label %23, label %49
23: ; preds = %19
%24 = load i32*, i32** %4
store i32 1, i32* %24
%25 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
store i32 2, i32* %3
%26 = load i32*, i32** %4
%27 = load i32, i32* %26
%28 = icmp ne i32 %27, 0
%29 = zext i1 %28 to i32
%30 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %29)
store i32 0, i32* %3
%31 = load i32*, i32** %4
%32 = load i32, i32* %31
%33 = icmp eq i32 %32, 0
%34 = zext i1 %33 to i32
%35 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %34)
%36 = load i32*, i32** %4
%37 = icmp ne i32* %36, %3
br i1 %37, label %38, label %48
38: ; preds = %23
%39 = load i32*, i32** %4
%40 = icmp eq i32* %39, %2
%41 = zext i1 %40 to i32
%42 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %41)
%43 = load i32*, i32** %4
%44 = load i32, i32* %43
%45 = icmp eq i32 %44, 1
%46 = zext i1 %45 to i32
%47 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %46)
br label %48
48: ; preds = %38, %23
br label %56
49: ; preds = %19
%50 = load i32*, i32** %4
%51 = icmp eq i32* %50, null
%52 = zext i1 %51 to i32
%53 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %52)
%54 = load i32*, i32** %4
%55 = call i32 (i32*, ...) bitcast (i32 (...)* @unknown_fn to i32 (i32*, ...)*)(i32* %54)
br label %56
56: ; preds = %49, %48
%57 = call i32 (i32, ...) bitcast (i32 (...)* @unknown_fn to i32 (i32, ...)*)(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @unknown_fn to i32 (i32, ...)*)(i32 0)
ret i32 0
}