#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 */
struct node {
  int dummy;
};

/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
int /*<<< orphan*/ create_list(struct node **, struct node *);
void create_shape(struct node **px, struct node **py) {
  struct node *x = NULL;
  struct node *y = NULL;
  if (__VERIFIER_nondet_int()) {
    create_list(&x, NULL);
    create_list(&y, x);
  } else {
    create_list(&x, NULL);
  }
  *px = x;
  *py = y;
}


x86 assembly (clang, -O0):
<create_shape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     1170 <create_shape+0x50>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <create_list@plt>
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdi
call   1030 <create_list@plt>
jmp    117d <create_shape+0x5d>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <create_list@plt>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_shape>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
xor    %r12d,%r12d
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <create_list@plt>
test   %rbx,%rbx
je     1175 <create_shape+0x55>
mov    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdi
call   1030 <create_list@plt>
mov    0x10(%rsp),%r12
mov    0x8(%rsp),%rax
mov    %rax,(%r15)
mov    %r12,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @create_shape(%struct.node** %0, %struct.node** %1) {
%3 = alloca %struct.node**
%4 = alloca %struct.node**
%5 = alloca %struct.node*
%6 = alloca %struct.node*
store %struct.node** %0, %struct.node*** %3
store %struct.node** %1, %struct.node*** %4
store %struct.node* null, %struct.node** %5
store %struct.node* null, %struct.node** %6
%7 = call i64 (...) @__VERIFIER_nondet_int()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @create_list(%struct.node** %5, %struct.node* null)
%11 = load %struct.node*, %struct.node** %5
%12 = call i32 @create_list(%struct.node** %6, %struct.node* %11)
br label %15
13: ; preds = %2
%14 = call i32 @create_list(%struct.node** %5, %struct.node* null)
br label %15
15: ; preds = %13, %9
%16 = load %struct.node*, %struct.node** %5
%17 = load %struct.node**, %struct.node*** %3
store %struct.node* %16, %struct.node** %17
%18 = load %struct.node*, %struct.node** %6
%19 = load %struct.node**, %struct.node*** %4
store %struct.node* %18, %struct.node** %19
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @create_shape(%struct.node** nocapture writeonly %0, %struct.node** nocapture writeonly %1) {
%3 = alloca %struct.node*
%4 = alloca %struct.node*
%5 = bitcast %struct.node** %3 to i8*
store %struct.node* null, %struct.node** %3
%6 = bitcast %struct.node** %4 to i8*
store %struct.node* null, %struct.node** %4
%7 = tail call i64 (...) @__VERIFIER_nondet_int()
%8 = icmp eq i64 %7, 0
%9 = call i32 @create_list(%struct.node** %3, %struct.node* null)
br i1 %8, label %14, label %10
10: ; preds = %2
%11 = load %struct.node*, %struct.node** %3
%12 = call i32 @create_list(%struct.node** %4, %struct.node* %11)
%13 = load %struct.node*, %struct.node** %4
br label %14
14: ; preds = %2, %10
%15 = phi %struct.node* [ %13, %10 ], [ null, %2 ]
%16 = load %struct.node*, %struct.node** %3
store %struct.node* %16, %struct.node** %0
store %struct.node* %15, %struct.node** %1
ret void
}