#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*/ chain_node(struct node **);
struct node *create_sll(const struct node **pp1, const struct node **pp2) {
  struct node *list = ((void *)0);
  do
    chain_node(&list);
  while (__VERIFIER_nondet_int());
  *pp2 = list;
  do
    chain_node(&list);
  while (__VERIFIER_nondet_int());
  *pp1 = list;
  do
    chain_node(&list);
  while (__VERIFIER_nondet_int());
  return list;
}


x86 assembly (clang, -O0):
<create_sll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <chain_node@plt>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
jne    1138 <create_sll+0x18>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
lea    -0x18(%rbp),%rdi
call   1040 <chain_node@plt>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
jne    115d <create_sll+0x3d>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
lea    -0x18(%rbp),%rdi
call   1040 <chain_node@plt>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
jne    1182 <create_sll+0x62>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_sll>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r15
mov    %rdi,%r14
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
nopl   (%rax)
mov    %rbx,%rdi
call   1040 <chain_node@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
jne    1140 <create_sll+0x20>
mov    0x8(%rsp),%rax
mov    %rax,(%r15)
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <chain_node@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
jne    1170 <create_sll+0x50>
mov    0x8(%rsp),%rax
mov    %rax,(%r14)
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <chain_node@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
jne    11a0 <create_sll+0x80>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define %struct.node* @create_sll(%struct.node** %0, %struct.node** %1) {
%3 = alloca %struct.node**
%4 = alloca %struct.node**
%5 = alloca %struct.node*
store %struct.node** %0, %struct.node*** %3
store %struct.node** %1, %struct.node*** %4
store %struct.node* null, %struct.node** %5
br label %6
6: ; preds = %8, %2
%7 = call i32 @chain_node(%struct.node** %5)
br label %8
8: ; preds = %6
%9 = call i64 (...) @__VERIFIER_nondet_int()
%10 = icmp ne i64 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %8
%12 = load %struct.node*, %struct.node** %5
%13 = load %struct.node**, %struct.node*** %4
store %struct.node* %12, %struct.node** %13
br label %14
14: ; preds = %16, %11
%15 = call i32 @chain_node(%struct.node** %5)
br label %16
16: ; preds = %14
%17 = call i64 (...) @__VERIFIER_nondet_int()
%18 = icmp ne i64 %17, 0
br i1 %18, label %14, label %19
19: ; preds = %16
%20 = load %struct.node*, %struct.node** %5
%21 = load %struct.node**, %struct.node*** %3
store %struct.node* %20, %struct.node** %21
br label %22
22: ; preds = %24, %19
%23 = call i32 @chain_node(%struct.node** %5)
br label %24
24: ; preds = %22
%25 = call i64 (...) @__VERIFIER_nondet_int()
%26 = icmp ne i64 %25, 0
br i1 %26, label %22, label %27
27: ; preds = %24
%28 = load %struct.node*, %struct.node** %5
ret %struct.node* %28
}

LLVM IR (-O2):
%struct.node = type { i32 }
define %struct.node* @create_sll(%struct.node** nocapture writeonly %0, %struct.node** nocapture writeonly %1) {
%3 = alloca %struct.node*
%4 = bitcast %struct.node** %3 to i8*
store %struct.node* null, %struct.node** %3
br label %5
5: ; preds = %5, %2
%6 = call i32 @chain_node(%struct.node** %3)
%7 = call i64 (...) @__VERIFIER_nondet_int()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
%10 = load %struct.node*, %struct.node** %3
store %struct.node* %10, %struct.node** %1
br label %11
11: ; preds = %11, %9
%12 = call i32 @chain_node(%struct.node** %3)
%13 = call i64 (...) @__VERIFIER_nondet_int()
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %11
15: ; preds = %11
%16 = load %struct.node*, %struct.node** %3
store %struct.node* %16, %struct.node** %0
br label %17
17: ; preds = %17, %15
%18 = call i32 @chain_node(%struct.node** %3)
%19 = call i64 (...) @__VERIFIER_nondet_int()
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %17
21: ; preds = %17
%22 = load %struct.node*, %struct.node** %3
ret %struct.node* %22
}