#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ __analyzer_dump_exploded_nodes(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *);
void *malloc(int);
int test_2(int a, int b) {
  void *p;
  if (a > 5)
    if (b)
      p = malloc(16);
    else
      p = malloc(32);
  __analyzer_dump_exploded_nodes(0);
  if (a > 6) {
    free(p);
    __analyzer_dump_exploded_nodes(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x5,-0x4(%rbp)
jle    1178 <test_2+0x48>
cmpl   $0x0,-0x8(%rbp)
je     1165 <test_2+0x35>
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
jmp    1173 <test_2+0x43>
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
jmp    1178 <test_2+0x48>
xor    %edi,%edi
call   1050 <__analyzer_dump_exploded_nodes@plt>
cmpl   $0x6,-0x4(%rbp)
jle    1199 <test_2+0x69>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1050 <__analyzer_dump_exploded_nodes@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_2>:
push   %r14
push   %rbx
push   %rax
cmp    $0x6,%edi
jl     1167 <test_2+0x37>
mov    %edi,%ebx
test   %esi,%esi
je     1146 <test_2+0x16>
mov    $0x10,%edi
jmp    114b <test_2+0x1b>
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
xor    %edi,%edi
call   1050 <__analyzer_dump_exploded_nodes@plt>
cmp    $0x7,%ebx
jb     116e <test_2+0x3e>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1050 <__analyzer_dump_exploded_nodes@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @test_2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 5
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i8* @malloc(i32 16)
store i8* %12, i8** %5
br label %15
13: ; preds = %8
%14 = call i8* @malloc(i32 32)
store i8* %14, i8** %5
br label %15
15: ; preds = %13, %11
br label %16
16: ; preds = %15, %2
%17 = call i32 @__analyzer_dump_exploded_nodes(i32 0)
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 6
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i8*, i8** %5
%22 = call i32 @free(i8* %21)
%23 = call i32 @__analyzer_dump_exploded_nodes(i32 0)
br label %24
24: ; preds = %20, %16
ret i32 0
}

LLVM IR (-O2):
define i32 @test_2(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 5
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call dereferenceable_or_null(16) i8* @malloc(i32 16)
br label %10
8: ; preds = %4
%9 = tail call dereferenceable_or_null(32) i8* @malloc(i32 32)
br label %10
10: ; preds = %6, %8
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
%12 = tail call i32 @__analyzer_dump_exploded_nodes(i32 0)
%13 = icmp ugt i32 %0, 6
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = tail call i32 @free(i8* %11)
br label %16
16: ; preds = %2, %14
%17 = tail call i32 @__analyzer_dump_exploded_nodes(i32 0)
br label %18
18: ; preds = %16, %10
ret i32 0
}