#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 udev_list_entry {
  int dummy;
};
struct udev_device {
  int dummy;
};

/* Variables and functions */
scalar_t__ udev_device_get_devlink_priority(struct udev_device *);
int /*<<< orphan*/ *udev_device_get_devlinks_list_entry(struct udev_device *);
struct udev_list_entry *
udev_device_get_properties_list_entry(struct udev_device *);
int /*<<< orphan*/ *udev_device_get_tags_list_entry(struct udev_device *);
scalar_t__ udev_device_get_watch_handle(struct udev_device *);
struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *);
scalar_t__ udev_list_entry_get_num(struct udev_list_entry *);
bool device_has_info(struct udev_device *udev_device) {
  struct udev_list_entry *list_entry;
  if (udev_device_get_devlinks_list_entry(udev_device) != NULL)
    return true;
  if (udev_device_get_devlink_priority(udev_device) != 0)
    return true;
  for (list_entry = udev_device_get_properties_list_entry(udev_device);
       list_entry != NULL; list_entry = udev_list_entry_get_next(list_entry))
    if (udev_list_entry_get_num(list_entry))
      return true;
  if (udev_device_get_tags_list_entry(udev_device) != NULL)
    return true;
  if (udev_device_get_watch_handle(udev_device) >= 0)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<device_has_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <udev_device_get_devlinks_list_entry@plt>
cmp    $0x0,%rax
je     119b <device_has_info+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    124d <device_has_info+0xdd>
mov    -0x10(%rbp),%rdi
call   1090 <udev_device_get_devlink_priority@plt>
cmp    $0x0,%rax
je     11ba <device_has_info+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    124d <device_has_info+0xdd>
mov    -0x10(%rbp),%rdi
call   1080 <udev_device_get_properties_list_entry@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1208 <device_has_info+0x98>
mov    -0x18(%rbp),%rdi
call   1040 <udev_list_entry_get_num@plt>
cmp    $0x0,%rax
je     11f1 <device_has_info+0x81>
movl   $0x1,-0x4(%rbp)
jmp    124d <device_has_info+0xdd>
jmp    11f6 <device_has_info+0x86>
mov    -0x18(%rbp),%rdi
call   1060 <udev_list_entry_get_next@plt>
mov    %rax,-0x18(%rbp)
jmp    11c7 <device_has_info+0x57>
mov    -0x10(%rbp),%rdi
call   1050 <udev_device_get_tags_list_entry@plt>
cmp    $0x0,%rax
je     1227 <device_has_info+0xb7>
movl   $0x1,-0x4(%rbp)
jmp    124d <device_has_info+0xdd>
mov    -0x10(%rbp),%rdi
call   1070 <udev_device_get_watch_handle@plt>
cmp    $0x0,%rax
jl     1246 <device_has_info+0xd6>
movl   $0x1,-0x4(%rbp)
jmp    124d <device_has_info+0xdd>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<device_has_info>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <udev_device_get_devlinks_list_entry@plt>
mov    $0x1,%r14d
test   %rax,%rax
jne    11ed <device_has_info+0x7d>
mov    %r15,%rdi
call   1090 <udev_device_get_devlink_priority@plt>
test   %rax,%rax
jne    11ed <device_has_info+0x7d>
mov    %r15,%rdi
call   1080 <udev_device_get_properties_list_entry@plt>
test   %rax,%rax
je     11cd <device_has_info+0x5d>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1040 <udev_list_entry_get_num@plt>
test   %rax,%rax
jne    11ed <device_has_info+0x7d>
mov    %rbx,%rdi
call   1060 <udev_list_entry_get_next@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    11b0 <device_has_info+0x40>
mov    %r15,%rdi
call   1050 <udev_device_get_tags_list_entry@plt>
test   %rax,%rax
jne    11ed <device_has_info+0x7d>
mov    %r15,%rdi
call   1070 <udev_device_get_watch_handle@plt>
mov    %rax,%r14
shr    $0x3f,%r14
xor    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.udev_device = type { i32 }
%struct.udev_list_entry = type { i32 }
define i32 @device_has_info(%struct.udev_device* %0) {
%2 = alloca i32
%3 = alloca %struct.udev_device*
%4 = alloca %struct.udev_list_entry*
store %struct.udev_device* %0, %struct.udev_device** %3
%5 = load %struct.udev_device*, %struct.udev_device** %3
%6 = call i32* @udev_device_get_devlinks_list_entry(%struct.udev_device* %5)
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %40
9: ; preds = %1
%10 = load %struct.udev_device*, %struct.udev_device** %3
%11 = call i64 @udev_device_get_devlink_priority(%struct.udev_device* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %2
br label %40
14: ; preds = %9
%15 = load %struct.udev_device*, %struct.udev_device** %3
%16 = call %struct.udev_list_entry* @udev_device_get_properties_list_entry(%struct.udev_device* %15)
store %struct.udev_list_entry* %16, %struct.udev_list_entry** %4
br label %17
17: ; preds = %26, %14
%18 = load %struct.udev_list_entry*, %struct.udev_list_entry** %4
%19 = icmp ne %struct.udev_list_entry* %18, null
br i1 %19, label %20, label %29
20: ; preds = %17
%21 = load %struct.udev_list_entry*, %struct.udev_list_entry** %4
%22 = call i64 @udev_list_entry_get_num(%struct.udev_list_entry* %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %2
br label %40
25: ; preds = %20
br label %26
26: ; preds = %25
%27 = load %struct.udev_list_entry*, %struct.udev_list_entry** %4
%28 = call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %27)
store %struct.udev_list_entry* %28, %struct.udev_list_entry** %4
br label %17
29: ; preds = %17
%30 = load %struct.udev_device*, %struct.udev_device** %3
%31 = call i32* @udev_device_get_tags_list_entry(%struct.udev_device* %30)
%32 = icmp ne i32* %31, null
br i1 %32, label %33, label %34
33: ; preds = %29
store i32 1, i32* %2
br label %40
34: ; preds = %29
%35 = load %struct.udev_device*, %struct.udev_device** %3
%36 = call i64 @udev_device_get_watch_handle(%struct.udev_device* %35)
%37 = icmp sge i64 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %34
store i32 1, i32* %2
br label %40
39: ; preds = %34
store i32 0, i32* %2
br label %40
40: ; preds = %39, %38, %33, %24, %13, %8
%41 = load i32, i32* %2
ret i32 %41
}

LLVM IR (-O2):
%struct.udev_device = type { i32 }
%struct.udev_list_entry = type { i32 }
define i32 @device_has_info(%struct.udev_device* %0) {
%2 = tail call i32* @udev_device_get_devlinks_list_entry(%struct.udev_device* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %25
4: ; preds = %1
%5 = tail call i64 @udev_device_get_devlink_priority(%struct.udev_device* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %4
%8 = tail call %struct.udev_list_entry* @udev_device_get_properties_list_entry(%struct.udev_device* %0)
%9 = icmp eq %struct.udev_list_entry* %8, null
br i1 %9, label %17, label %10
10: ; preds = %7, %14
%11 = phi %struct.udev_list_entry* [ %15, %14 ], [ %8, %7 ]
%12 = tail call i64 @udev_list_entry_get_num(%struct.udev_list_entry* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = tail call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %11)
%16 = icmp eq %struct.udev_list_entry* %15, null
br i1 %16, label %17, label %10
17: ; preds = %14, %7
%18 = tail call i32* @udev_device_get_tags_list_entry(%struct.udev_device* %0)
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = tail call i64 @udev_device_get_watch_handle(%struct.udev_device* %0)
%22 = lshr i64 %21, 63
%23 = trunc i64 %22 to i32
%24 = xor i32 %23, 1
br label %25
25: ; preds = %10, %20, %17, %4, %1
%26 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 1, %17 ], [ %24, %20 ], [ 1, %10 ]
ret i32 %26
}