#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;
};
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int major(int /*<<< orphan*/);
int minor(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
char *udev_device_get_action(struct udev_device *);
struct udev_list_entry *
udev_device_get_devlinks_list_entry(struct udev_device *);
char *udev_device_get_devnode(struct udev_device *);
int /*<<< orphan*/ udev_device_get_devnum(struct udev_device *);
char *udev_device_get_devpath(struct udev_device *);
char *udev_device_get_devtype(struct udev_device *);
char *udev_device_get_driver(struct udev_device *);
struct udev_list_entry *
udev_device_get_properties_list_entry(struct udev_device *);
char *udev_device_get_property_value(struct udev_device *, char *);
char *udev_device_get_subsystem(struct udev_device *);
char *udev_device_get_sysattr_value(struct udev_device *, char *);
char *udev_device_get_sysname(struct udev_device *);
char *udev_device_get_sysnum(struct udev_device *);
char *udev_device_get_syspath(struct udev_device *);
char *udev_list_entry_get_name(struct udev_list_entry *);
struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *);
char *udev_list_entry_get_value(struct udev_list_entry *);
void print_device(struct udev_device *device) {
  const char *str;
  dev_t devnum;
  int count;
  struct udev_list_entry *list_entry;
  printf("*** device: %p ***\n", device);
  str = udev_device_get_action(device);
  if (str != NULL)
    printf("action:    '%s'\n", str);
  str = udev_device_get_syspath(device);
  printf("syspath:   '%s'\n", str);
  str = udev_device_get_sysname(device);
  printf("sysname:   '%s'\n", str);
  str = udev_device_get_sysnum(device);
  if (str != NULL)
    printf("sysnum:    '%s'\n", str);
  str = udev_device_get_devpath(device);
  printf("devpath:   '%s'\n", str);
  str = udev_device_get_subsystem(device);
  if (str != NULL)
    printf("subsystem: '%s'\n", str);
  str = udev_device_get_devtype(device);
  if (str != NULL)
    printf("devtype:   '%s'\n", str);
  str = udev_device_get_driver(device);
  if (str != NULL)
    printf("driver:    '%s'\n", str);
  str = udev_device_get_devnode(device);
  if (str != NULL)
    printf("devname:   '%s'\n", str);
  devnum = udev_device_get_devnum(device);
  if (major(devnum) > 0)
    printf("devnum:    %u:%u\n", major(devnum), minor(devnum));
  count = 0;
  for (list_entry = udev_device_get_devlinks_list_entry(device);
       list_entry != NULL; list_entry = udev_list_entry_get_next(list_entry)) {
    printf("link:      '%s'\n", udev_list_entry_get_name(list_entry));
    count++;
  }
  if (count > 0)
    printf("found %i links\n", count);
  count = 0;
  for (list_entry = udev_device_get_properties_list_entry(device);
       list_entry != NULL; list_entry = udev_list_entry_get_next(list_entry)) {
    printf("property:  '%s=%s'\n", udev_list_entry_get_name(list_entry),
           udev_list_entry_get_value(list_entry));
    count++;
  }
  if (count > 0)
    printf("found %i properties\n", count);
  str = udev_device_get_property_value(device, "MAJOR");
  if (str != NULL)
    printf("MAJOR: '%s'\n", str);
  str = udev_device_get_sysattr_value(device, "dev");
  if (str != NULL)
    printf("attr{dev}: '%s'\n", str);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   10b0 <udev_device_get_action@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1288 <print_device+0x48>
mov    -0x10(%rbp),%rsi
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <udev_device_get_syspath@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1100 <udev_device_get_sysname@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   10f0 <udev_device_get_sysnum@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     12f0 <print_device+0xb0>
mov    -0x10(%rbp),%rsi
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1150 <udev_device_get_devpath@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <udev_device_get_subsystem@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1339 <print_device+0xf9>
mov    -0x10(%rbp),%rsi
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1160 <udev_device_get_devtype@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1363 <print_device+0x123>
mov    -0x10(%rbp),%rsi
lea    0xd1e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1130 <udev_device_get_driver@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     138d <print_device+0x14d>
mov    -0x10(%rbp),%rsi
lea    0xd05(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1140 <udev_device_get_devnode@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     13b7 <print_device+0x177>
mov    -0x10(%rbp),%rsi
lea    0xcec(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   10e0 <udev_device_get_devnum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <major@plt>
cmp    $0x0,%eax
jle    13fa <print_device+0x1ba>
mov    -0x14(%rbp),%edi
call   1060 <major@plt>
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <minor@plt>
mov    -0x24(%rbp),%esi
mov    %eax,%edx
lea    0xcba(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1080 <udev_device_get_devlinks_list_entry@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     144e <print_device+0x20e>
mov    -0x20(%rbp),%rdi
call   1120 <udev_list_entry_get_name@plt>
mov    %rax,%rsi
lea    0xc93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   10c0 <udev_list_entry_get_next@plt>
mov    %rax,-0x20(%rbp)
jmp    140e <print_device+0x1ce>
cmpl   $0x0,-0x18(%rbp)
jle    1469 <print_device+0x229>
mov    -0x18(%rbp),%esi
lea    0xc6e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   10d0 <udev_device_get_properties_list_entry@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     14ce <print_device+0x28e>
mov    -0x20(%rbp),%rdi
call   1120 <udev_list_entry_get_name@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1090 <udev_list_entry_get_value@plt>
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   10c0 <udev_list_entry_get_next@plt>
mov    %rax,-0x20(%rbp)
jmp    147d <print_device+0x23d>
cmpl   $0x0,-0x18(%rbp)
jle    14e9 <print_device+0x2a9>
mov    -0x18(%rbp),%esi
lea    0xc12(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xc15(%rip),%rsi
call   10a0 <udev_device_get_property_value@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     151a <print_device+0x2da>
mov    -0x10(%rbp),%rsi
lea    0xbfc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xbf7(%rip),%rsi
call   1110 <udev_device_get_sysattr_value@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     154b <print_device+0x30b>
mov    -0x10(%rbp),%rsi
lea    0xbdc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xb7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_device>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r14
lea    0xd9e(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   10c0 <udev_device_get_action@plt>
test   %rax,%rax
je     128a <print_device+0x3a>
lea    0xd94(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1030 <udev_device_get_syspath@plt>
lea    0xd8c(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1110 <udev_device_get_sysname@plt>
lea    0xd84(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1100 <udev_device_get_sysnum@plt>
test   %rax,%rax
je     12da <print_device+0x8a>
lea    0xd77(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1160 <udev_device_get_devpath@plt>
lea    0xd6f(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1080 <udev_device_get_subsystem@plt>
test   %rax,%rax
je     1311 <print_device+0xc1>
lea    0xd62(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1170 <udev_device_get_devtype@plt>
test   %rax,%rax
je     132f <print_device+0xdf>
lea    0xd55(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1140 <udev_device_get_driver@plt>
test   %rax,%rax
je     134d <print_device+0xfd>
lea    0xd48(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1150 <udev_device_get_devnode@plt>
test   %rax,%rax
je     136b <print_device+0x11b>
lea    0xd3b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   10f0 <udev_device_get_devnum@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1070 <major@plt>
test   %eax,%eax
jle    13a2 <print_device+0x152>
mov    %ebx,%edi
call   1070 <major@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <minor@plt>
lea    0xd16(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1090 <udev_device_get_devlinks_list_entry@plt>
test   %rax,%rax
je     13f8 <print_device+0x1a8>
mov    %rax,%rbp
lea    0xd06(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1130 <udev_list_entry_get_name@plt>
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebx
mov    %rbp,%rdi
call   10d0 <udev_list_entry_get_next@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    13c0 <print_device+0x170>
lea    0xce1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   10e0 <udev_device_get_properties_list_entry@plt>
test   %rax,%rax
je     1466 <print_device+0x216>
mov    %rax,%rbx
lea    0xcd1(%rip),%r15
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1130 <udev_list_entry_get_name@plt>
mov    %rax,%r12
mov    %rbx,%rdi
call   10a0 <udev_list_entry_get_value@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
call   10d0 <udev_list_entry_get_next@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1420 <print_device+0x1d0>
lea    0xc97(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc9c(%rip),%rsi
mov    %r14,%rdi
call   10b0 <udev_device_get_property_value@plt>
test   %rax,%rax
je     148b <print_device+0x23b>
lea    0xc8e(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc8a(%rip),%rsi
mov    %r14,%rdi
call   1120 <udev_device_get_sysattr_value@plt>
test   %rax,%rax
je     14b0 <print_device+0x260>
lea    0xc7a(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <putchar@plt>

LLVM IR (-O0):
%struct.udev_device = type { i32 }
%struct.udev_list_entry = type { i32 }
@.str = [20 x i8] c"*** device: %p ***\0A\00"
@.str.1 = [17 x i8] c"action: '%s'\0A\00"
@.str.2 = [17 x i8] c"syspath: '%s'\0A\00"
@.str.3 = [17 x i8] c"sysname: '%s'\0A\00"
@.str.4 = [17 x i8] c"sysnum: '%s'\0A\00"
@.str.5 = [17 x i8] c"devpath: '%s'\0A\00"
@.str.6 = [17 x i8] c"subsystem: '%s'\0A\00"
@.str.7 = [17 x i8] c"devtype: '%s'\0A\00"
@.str.8 = [17 x i8] c"driver: '%s'\0A\00"
@.str.9 = [17 x i8] c"devname: '%s'\0A\00"
@.str.10 = [18 x i8] c"devnum: %u:%u\0A\00"
@.str.11 = [17 x i8] c"link: '%s'\0A\00"
@.str.12 = [16 x i8] c"found %i links\0A\00"
@.str.13 = [20 x i8] c"property: '%s=%s'\0A\00"
@.str.14 = [21 x i8] c"found %i properties\0A\00"
@.str.15 = [6 x i8] c"MAJOR\00"
@.str.16 = [13 x i8] c"MAJOR: '%s'\0A\00"
@.str.17 = [4 x i8] c"dev\00"
@.str.18 = [17 x i8] c"attr{dev}: '%s'\0A\00"
@.str.19 = [2 x i8] c"\0A\00"
define void @print_device(%struct.udev_device* %0) {
%2 = alloca %struct.udev_device*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.udev_list_entry*
store %struct.udev_device* %0, %struct.udev_device** %2
%7 = load %struct.udev_device*, %struct.udev_device** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.udev_device* %7)
%9 = load %struct.udev_device*, %struct.udev_device** %2
%10 = call i8* @udev_device_get_action(%struct.udev_device* %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %1
%17 = load %struct.udev_device*, %struct.udev_device** %2
%18 = call i8* @udev_device_get_syspath(%struct.udev_device* %17)
store i8* %18, i8** %3
%19 = load i8*, i8** %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = load %struct.udev_device*, %struct.udev_device** %2
%22 = call i8* @udev_device_get_sysname(%struct.udev_device* %21)
store i8* %22, i8** %3
%23 = load i8*, i8** %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %23)
%25 = load %struct.udev_device*, %struct.udev_device** %2
%26 = call i8* @udev_device_get_sysnum(%struct.udev_device* %25)
store i8* %26, i8** %3
%27 = load i8*, i8** %3
%28 = icmp ne i8* %27, null
br i1 %28, label %29, label %32
29: ; preds = %16
%30 = load i8*, i8** %3
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %30)
br label %32
32: ; preds = %29, %16
%33 = load %struct.udev_device*, %struct.udev_device** %2
%34 = call i8* @udev_device_get_devpath(%struct.udev_device* %33)
store i8* %34, i8** %3
%35 = load i8*, i8** %3
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %35)
%37 = load %struct.udev_device*, %struct.udev_device** %2
%38 = call i8* @udev_device_get_subsystem(%struct.udev_device* %37)
store i8* %38, i8** %3
%39 = load i8*, i8** %3
%40 = icmp ne i8* %39, null
br i1 %40, label %41, label %44
41: ; preds = %32
%42 = load i8*, i8** %3
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %42)
br label %44
44: ; preds = %41, %32
%45 = load %struct.udev_device*, %struct.udev_device** %2
%46 = call i8* @udev_device_get_devtype(%struct.udev_device* %45)
store i8* %46, i8** %3
%47 = load i8*, i8** %3
%48 = icmp ne i8* %47, null
br i1 %48, label %49, label %52
49: ; preds = %44
%50 = load i8*, i8** %3
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* %50)
br label %52
52: ; preds = %49, %44
%53 = load %struct.udev_device*, %struct.udev_device** %2
%54 = call i8* @udev_device_get_driver(%struct.udev_device* %53)
store i8* %54, i8** %3
%55 = load i8*, i8** %3
%56 = icmp ne i8* %55, null
br i1 %56, label %57, label %60
57: ; preds = %52
%58 = load i8*, i8** %3
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* %58)
br label %60
60: ; preds = %57, %52
%61 = load %struct.udev_device*, %struct.udev_device** %2
%62 = call i8* @udev_device_get_devnode(%struct.udev_device* %61)
store i8* %62, i8** %3
%63 = load i8*, i8** %3
%64 = icmp ne i8* %63, null
br i1 %64, label %65, label %68
65: ; preds = %60
%66 = load i8*, i8** %3
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8* %66)
br label %68
68: ; preds = %65, %60
%69 = load %struct.udev_device*, %struct.udev_device** %2
%70 = call i32 @udev_device_get_devnum(%struct.udev_device* %69)
store i32 %70, i32* %4
%71 = load i32, i32* %4
%72 = call i32 @major(i32 %71)
%73 = icmp sgt i32 %72, 0
br i1 %73, label %74, label %80
74: ; preds = %68
%75 = load i32, i32* %4
%76 = call i32 @major(i32 %75)
%77 = load i32, i32* %4
%78 = call i32 @minor(i32 %77)
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %76, i32 %78)
br label %80
80: ; preds = %74, %68
store i32 0, i32* %5
%81 = load %struct.udev_device*, %struct.udev_device** %2
%82 = call %struct.udev_list_entry* @udev_device_get_devlinks_list_entry(%struct.udev_device* %81)
store %struct.udev_list_entry* %82, %struct.udev_list_entry** %6
br label %83
83: ; preds = %92, %80
%84 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%85 = icmp ne %struct.udev_list_entry* %84, null
br i1 %85, label %86, label %95
86: ; preds = %83
%87 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%88 = call i8* @udev_list_entry_get_name(%struct.udev_list_entry* %87)
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i8* %88)
%90 = load i32, i32* %5
%91 = add nsw i32 %90, 1
store i32 %91, i32* %5
br label %92
92: ; preds = %86
%93 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%94 = call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %93)
store %struct.udev_list_entry* %94, %struct.udev_list_entry** %6
br label %83
95: ; preds = %83
%96 = load i32, i32* %5
%97 = icmp sgt i32 %96, 0
br i1 %97, label %98, label %101
98: ; preds = %95
%99 = load i32, i32* %5
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i32 %99)
br label %101
101: ; preds = %98, %95
store i32 0, i32* %5
%102 = load %struct.udev_device*, %struct.udev_device** %2
%103 = call %struct.udev_list_entry* @udev_device_get_properties_list_entry(%struct.udev_device* %102)
store %struct.udev_list_entry* %103, %struct.udev_list_entry** %6
br label %104
104: ; preds = %115, %101
%105 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%106 = icmp ne %struct.udev_list_entry* %105, null
br i1 %106, label %107, label %118
107: ; preds = %104
%108 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%109 = call i8* @udev_list_entry_get_name(%struct.udev_list_entry* %108)
%110 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%111 = call i8* @udev_list_entry_get_value(%struct.udev_list_entry* %110)
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* %109, i8* %111)
%113 = load i32, i32* %5
%114 = add nsw i32 %113, 1
store i32 %114, i32* %5
br label %115
115: ; preds = %107
%116 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%117 = call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %116)
store %struct.udev_list_entry* %117, %struct.udev_list_entry** %6
br label %104
118: ; preds = %104
%119 = load i32, i32* %5
%120 = icmp sgt i32 %119, 0
br i1 %120, label %121, label %124
121: ; preds = %118
%122 = load i32, i32* %5
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), i32 %122)
br label %124
124: ; preds = %121, %118
%125 = load %struct.udev_device*, %struct.udev_device** %2
%126 = call i8* @udev_device_get_property_value(%struct.udev_device* %125, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
store i8* %126, i8** %3
%127 = load i8*, i8** %3
%128 = icmp ne i8* %127, null
br i1 %128, label %129, label %132
129: ; preds = %124
%130 = load i8*, i8** %3
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0), i8* %130)
br label %132
132: ; preds = %129, %124
%133 = load %struct.udev_device*, %struct.udev_device** %2
%134 = call i8* @udev_device_get_sysattr_value(%struct.udev_device* %133, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
store i8* %134, i8** %3
%135 = load i8*, i8** %3
%136 = icmp ne i8* %135, null
br i1 %136, label %137, label %140
137: ; preds = %132
%138 = load i8*, i8** %3
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0), i8* %138)
br label %140
140: ; preds = %137, %132
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.udev_device = type { i32 }
%struct.udev_list_entry = type { i32 }
@.str = [20 x i8] c"*** device: %p ***\0A\00"
@.str.1 = [17 x i8] c"action: '%s'\0A\00"
@.str.2 = [17 x i8] c"syspath: '%s'\0A\00"
@.str.3 = [17 x i8] c"sysname: '%s'\0A\00"
@.str.4 = [17 x i8] c"sysnum: '%s'\0A\00"
@.str.5 = [17 x i8] c"devpath: '%s'\0A\00"
@.str.6 = [17 x i8] c"subsystem: '%s'\0A\00"
@.str.7 = [17 x i8] c"devtype: '%s'\0A\00"
@.str.8 = [17 x i8] c"driver: '%s'\0A\00"
@.str.9 = [17 x i8] c"devname: '%s'\0A\00"
@.str.10 = [18 x i8] c"devnum: %u:%u\0A\00"
@.str.11 = [17 x i8] c"link: '%s'\0A\00"
@.str.12 = [16 x i8] c"found %i links\0A\00"
@.str.13 = [20 x i8] c"property: '%s=%s'\0A\00"
@.str.14 = [21 x i8] c"found %i properties\0A\00"
@.str.15 = [6 x i8] c"MAJOR\00"
@.str.16 = [13 x i8] c"MAJOR: '%s'\0A\00"
@.str.17 = [4 x i8] c"dev\00"
@.str.18 = [17 x i8] c"attr{dev}: '%s'\0A\00"
define void @print_device(%struct.udev_device* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.udev_device* %0)
%3 = tail call i8* @udev_device_get_action(%struct.udev_device* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %7
7: ; preds = %5, %1
%8 = tail call i8* @udev_device_get_syspath(%struct.udev_device* %0)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = tail call i8* @udev_device_get_sysname(%struct.udev_device* %0)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%12 = tail call i8* @udev_device_get_sysnum(%struct.udev_device* %0)
%13 = icmp eq i8* %12, null
br i1 %13, label %16, label %14
14: ; preds = %7
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %12)
br label %16
16: ; preds = %14, %7
%17 = tail call i8* @udev_device_get_devpath(%struct.udev_device* %0)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %17)
%19 = tail call i8* @udev_device_get_subsystem(%struct.udev_device* %0)
%20 = icmp eq i8* %19, null
br i1 %20, label %23, label %21
21: ; preds = %16
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %19)
br label %23
23: ; preds = %21, %16
%24 = tail call i8* @udev_device_get_devtype(%struct.udev_device* %0)
%25 = icmp eq i8* %24, null
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* %24)
br label %28
28: ; preds = %26, %23
%29 = tail call i8* @udev_device_get_driver(%struct.udev_device* %0)
%30 = icmp eq i8* %29, null
br i1 %30, label %33, label %31
31: ; preds = %28
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* %29)
br label %33
33: ; preds = %31, %28
%34 = tail call i8* @udev_device_get_devnode(%struct.udev_device* %0)
%35 = icmp eq i8* %34, null
br i1 %35, label %38, label %36
36: ; preds = %33
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8* %34)
br label %38
38: ; preds = %36, %33
%39 = tail call i32 @udev_device_get_devnum(%struct.udev_device* %0)
%40 = tail call i32 @major(i32 %39)
%41 = icmp sgt i32 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %38
%43 = tail call i32 @major(i32 %39)
%44 = tail call i32 @minor(i32 %39)
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %43, i32 %44)
br label %46
46: ; preds = %42, %38
%47 = tail call %struct.udev_list_entry* @udev_device_get_devlinks_list_entry(%struct.udev_device* %0)
%48 = icmp eq %struct.udev_list_entry* %47, null
br i1 %48, label %59, label %49
49: ; preds = %46, %49
%50 = phi %struct.udev_list_entry* [ %55, %49 ], [ %47, %46 ]
%51 = phi i32 [ %54, %49 ], [ 0, %46 ]
%52 = tail call i8* @udev_list_entry_get_name(%struct.udev_list_entry* %50)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i8* %52)
%54 = add nuw nsw i32 %51, 1
%55 = tail call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %50)
%56 = icmp eq %struct.udev_list_entry* %55, null
br i1 %56, label %57, label %49
57: ; preds = %49
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i32 %54)
br label %59
59: ; preds = %46, %57
%60 = tail call %struct.udev_list_entry* @udev_device_get_properties_list_entry(%struct.udev_device* %0)
%61 = icmp eq %struct.udev_list_entry* %60, null
br i1 %61, label %73, label %62
62: ; preds = %59, %62
%63 = phi %struct.udev_list_entry* [ %69, %62 ], [ %60, %59 ]
%64 = phi i32 [ %68, %62 ], [ 0, %59 ]
%65 = tail call i8* @udev_list_entry_get_name(%struct.udev_list_entry* %63)
%66 = tail call i8* @udev_list_entry_get_value(%struct.udev_list_entry* %63)
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* %65, i8* %66)
%68 = add nuw nsw i32 %64, 1
%69 = tail call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %63)
%70 = icmp eq %struct.udev_list_entry* %69, null
br i1 %70, label %71, label %62
71: ; preds = %62
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), i32 %68)
br label %73
73: ; preds = %59, %71
%74 = tail call i8* @udev_device_get_property_value(%struct.udev_device* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%75 = icmp eq i8* %74, null
br i1 %75, label %78, label %76
76: ; preds = %73
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0), i8* %74)
br label %78
78: ; preds = %76, %73
%79 = tail call i8* @udev_device_get_sysattr_value(%struct.udev_device* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%80 = icmp eq i8* %79, null
br i1 %80, label %83, label %81
81: ; preds = %78
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0), i8* %79)
br label %83
83: ; preds = %81, %78
%84 = tail call i32 @putchar(i32 10)
ret void
}