#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 sil_rb_tree {
  int dummy;
};
struct sil_rb_path {
  int dummy;
};
struct sil_rb_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sil_rb_path_reset(struct sil_rb_path *,
                                     struct sil_rb_tree *);
struct sil_rb_head *sil_rb_path_visit_leftmost_descendant(struct sil_rb_path *);
int /*<<< orphan*/ *sil_rb_path_visit_root(struct sil_rb_path *);
__attribute__((unused)) struct sil_rb_head *
sil_rb_path_visit_min(struct sil_rb_path *path, struct sil_rb_tree *tree) {
  sil_rb_path_reset(path, tree);
  if (sil_rb_path_visit_root(path) == NULL)
    return NULL;
  return sil_rb_path_visit_leftmost_descendant(path);
}


x86 assembly (clang, -O0):
<sil_rb_path_visit_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <sil_rb_path_reset@plt>
mov    -0x10(%rbp),%rdi
call   1040 <sil_rb_path_visit_root@plt>
cmp    $0x0,%rax
jne    116d <sil_rb_path_visit_min+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    117a <sil_rb_path_visit_min+0x4a>
mov    -0x10(%rbp),%rdi
call   1030 <sil_rb_path_visit_leftmost_descendant@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sil_rb_path_visit_min>:
push   %rbx
mov    %rdi,%rbx
call   1050 <sil_rb_path_reset@plt>
mov    %rbx,%rdi
call   1040 <sil_rb_path_visit_root@plt>
test   %rax,%rax
je     114f <sil_rb_path_visit_min+0x1f>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <sil_rb_path_visit_leftmost_descendant@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sil_rb_head = type { i32 }
%struct.sil_rb_path = type { i32 }
%struct.sil_rb_tree = type { i32 }
define %struct.sil_rb_head* @sil_rb_path_visit_min(%struct.sil_rb_path* %0, %struct.sil_rb_tree* %1) {
%3 = alloca %struct.sil_rb_head*
%4 = alloca %struct.sil_rb_path*
%5 = alloca %struct.sil_rb_tree*
store %struct.sil_rb_path* %0, %struct.sil_rb_path** %4
store %struct.sil_rb_tree* %1, %struct.sil_rb_tree** %5
%6 = load %struct.sil_rb_path*, %struct.sil_rb_path** %4
%7 = load %struct.sil_rb_tree*, %struct.sil_rb_tree** %5
%8 = call i32 @sil_rb_path_reset(%struct.sil_rb_path* %6, %struct.sil_rb_tree* %7)
%9 = load %struct.sil_rb_path*, %struct.sil_rb_path** %4
%10 = call i32* @sil_rb_path_visit_root(%struct.sil_rb_path* %9)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store %struct.sil_rb_head* null, %struct.sil_rb_head** %3
br label %16
13: ; preds = %2
%14 = load %struct.sil_rb_path*, %struct.sil_rb_path** %4
%15 = call %struct.sil_rb_head* @sil_rb_path_visit_leftmost_descendant(%struct.sil_rb_path* %14)
store %struct.sil_rb_head* %15, %struct.sil_rb_head** %3
br label %16
16: ; preds = %13, %12
%17 = load %struct.sil_rb_head*, %struct.sil_rb_head** %3
ret %struct.sil_rb_head* %17
}

LLVM IR (-O2):
%struct.sil_rb_head = type { i32 }
%struct.sil_rb_path = type { i32 }
%struct.sil_rb_tree = type { i32 }
define %struct.sil_rb_head* @sil_rb_path_visit_min(%struct.sil_rb_path* %0, %struct.sil_rb_tree* %1) {
%3 = tail call i32 @sil_rb_path_reset(%struct.sil_rb_path* %0, %struct.sil_rb_tree* %1)
%4 = tail call i32* @sil_rb_path_visit_root(%struct.sil_rb_path* %0)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call %struct.sil_rb_head* @sil_rb_path_visit_leftmost_descendant(%struct.sil_rb_path* %0)
br label %8
8: ; preds = %2, %6
%9 = phi %struct.sil_rb_head* [ %7, %6 ], [ null, %2 ]
ret %struct.sil_rb_head* %9
}