int main() {
  union {
    void *p0;
    struct {
      char c[2];
      int *p1;
      int *p2;
    } str;
  } data;
  data.p0 = malloc(37U);
  void *ptr = data.p0;
  if (__VERIFIER_nondet_int()) {
    data.str.p2 = 20;
  } else {
    data.str.p2 = 30;
  }
  if (25 > data.str.p2) {
    data.str.c[1] = sizeof data.str.p1;
  }
  free(data.p0);
  free(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x25,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     1173 <main+0x43>
mov    $0x14,%eax
mov    %rax,-0x10(%rbp)
jmp    117c <main+0x4c>
mov    $0x1e,%eax
mov    %rax,-0x10(%rbp)
mov    $0x19,%eax
cmp    -0x10(%rbp),%rax
jbe    118f <main+0x5f>
movb   $0x8,-0x1f(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x25,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %rbx,%rdi
and    $0xffffffffffff00ff,%rdi
or     $0x800,%rdi
test   %eax,%eax
cmove  %rbx,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%union.anon = type { %struct.anon }
%struct.anon = type { [2 x i8], i32*, i32* }
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @malloc(i64 37)
%5 = bitcast %union.anon* %2 to i8**
store i8* %4, i8** %5
%6 = bitcast %union.anon* %2 to i8**
%7 = load i8*, i8** %6
store i8* %7, i8** %3
%8 = call i32 (...) @__VERIFIER_nondet_int()
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = bitcast %union.anon* %2 to %struct.anon*
%12 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 2
store i32* inttoptr (i64 20 to i32*), i32** %12
br label %16
13: ; preds = %0
%14 = bitcast %union.anon* %2 to %struct.anon*
%15 = getelementptr inbounds %struct.anon, %struct.anon* %14, i32 0, i32 2
store i32* inttoptr (i64 30 to i32*), i32** %15
br label %16
16: ; preds = %13, %10
%17 = bitcast %union.anon* %2 to %struct.anon*
%18 = getelementptr inbounds %struct.anon, %struct.anon* %17, i32 0, i32 2
%19 = load i32*, i32** %18
%20 = icmp ugt i32* inttoptr (i64 25 to i32*), %19
br i1 %20, label %21, label %25
21: ; preds = %16
%22 = bitcast %union.anon* %2 to %struct.anon*
%23 = getelementptr inbounds %struct.anon, %struct.anon* %22, i32 0, i32 0
%24 = getelementptr inbounds [2 x i8], [2 x i8]* %23, i64 0, i64 1
store i8 8, i8* %24
br label %25
25: ; preds = %21, %16
%26 = bitcast %union.anon* %2 to i8**
%27 = load i8*, i8** %26
%28 = load i8*, i8** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(37) i8* @malloc(i64 37)
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %2, 0
%4 = ptrtoint i8* %1 to i64
%5 = and i64 %4, -65281
%6 = or i64 %5, 2048
%7 = inttoptr i64 %6 to i8*
%8 = select i1 %3, i8* %1, i8* %7
tail call void @free(i8* %8)
tail call void @free(i8* %1)
ret i32 0
}