#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;
};
struct udev {
  int dummy;
};
struct stat {
  scalar_t__ st_rdev;
};
typedef int /*<<< orphan*/ filename;

/* Variables and functions */
int /*<<< orphan*/ link_update(struct udev_device *, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int major(scalar_t__);
int minor(scalar_t__);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, int, int);
scalar_t__ stat(char const *, struct stat *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
struct udev_list_entry *
udev_device_get_devlinks_list_entry(struct udev_device *);
char *udev_device_get_devnode(struct udev_device *);
scalar_t__ udev_device_get_devnum(struct udev_device *);
int /*<<< orphan*/ udev_device_get_subsystem(struct udev_device *);
int /*<<< orphan*/ udev_device_get_syspath(struct udev_device *);
struct udev *udev_device_get_udev(struct udev_device *);
struct udev_device *udev_device_new_from_syspath(struct udev *,
                                                 int /*<<< orphan*/);
int /*<<< orphan*/ udev_device_unref(struct udev_device *);
char *udev_get_dev_path(struct udev *);
int /*<<< orphan*/ udev_list_entry_get_name(struct udev_list_entry *);
struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *);
int /*<<< orphan*/ udev_log_null(struct udev *, char *, char const *);
int /*<<< orphan*/ unlink(char *);
int /*<<< orphan*/ util_delete_path(struct udev *, char const *);
int util_unlink_secure(struct udev *, char const *);
int udev_node_remove(struct udev_device *dev) {
  struct udev *udev = udev_device_get_udev(dev);
  struct udev_list_entry *list_entry;
  const char *devnode;
  struct stat stats;
  struct udev_device *dev_check;
  char filename[1024];
  int err = 0;
  for (list_entry = udev_device_get_devlinks_list_entry(dev);
       list_entry != NULL; list_entry = udev_list_entry_get_next(list_entry))
    link_update(dev, udev_list_entry_get_name(list_entry), 0);
  devnode = udev_device_get_devnode(dev);
  if (devnode == NULL)
    goto out;
  if (stat(devnode, &stats) != 0) {
    udev_log_null(udev, "device node '%s' not found\n", devnode);
    goto out;
  }
  if (stats.st_rdev != udev_device_get_devnum(dev)) {
    udev_log_null(
        udev, "device node '%s' points to a different device, skip removal\n",
        devnode);
    err = -1;
    goto out;
  }
  dev_check = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev));
  if (dev_check != NULL) {
    udev_log_null(udev, "keeping device node of existing device'%s'\n",
                  devnode);
    udev_device_unref(dev_check);
    goto out;
  }
  udev_log_null(udev, "removing device node '%s'\n", devnode);
  err = util_unlink_secure(udev, devnode);
  if (err == 0)
    util_delete_path(udev, devnode);
  snprintf(
      filename, sizeof(filename), "%s/%s/%u:%u", udev_get_dev_path(udev),
      strcmp(udev_device_get_subsystem(dev), "block") == 0 ? "block" : "char",
      major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev)));
  unlink(filename);
out:
  return err;
}


x86 assembly (clang, -O0):
<udev_node_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x480,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <udev_device_get_udev@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x434(%rbp)
mov    -0x8(%rbp),%rdi
call   10d0 <udev_device_get_devlinks_list_entry@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     12c4 <udev_node_remove+0x74>
mov    -0x8(%rbp),%rax
mov    %rax,-0x440(%rbp)
mov    -0x18(%rbp),%rdi
call   1160 <udev_list_entry_get_name@plt>
mov    -0x440(%rbp),%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <link_update@plt>
mov    -0x18(%rbp),%rdi
call   1120 <udev_list_entry_get_next@plt>
mov    %rax,-0x18(%rbp)
jmp    1283 <udev_node_remove+0x33>
mov    -0x8(%rbp),%rdi
call   1170 <udev_device_get_devnode@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12e1 <udev_node_remove+0x91>
jmp    14a8 <udev_node_remove+0x258>
mov    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1100 <stat@plt>
cmp    $0x0,%rax
je     1311 <udev_node_remove+0xc1>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xcf9(%rip),%rsi
call   1070 <udev_log_null@plt>
jmp    14a8 <udev_node_remove+0x258>
mov    -0x28(%rbp),%rax
mov    %rax,-0x448(%rbp)
mov    -0x8(%rbp),%rdi
call   1150 <udev_device_get_devnum@plt>
mov    %rax,%rcx
mov    -0x448(%rbp),%rax
cmp    %rcx,%rax
je     135b <udev_node_remove+0x10b>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xcd5(%rip),%rsi
call   1070 <udev_log_null@plt>
movl   $0xffffffff,-0x434(%rbp)
ff ff ff
jmp    14a8 <udev_node_remove+0x258>
mov    -0x10(%rbp),%rax
mov    %rax,-0x450(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <udev_device_get_syspath@plt>
mov    -0x450(%rbp),%rdi
mov    %eax,%esi
call   1130 <udev_device_new_from_syspath@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     13ae <udev_node_remove+0x15e>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xcbe(%rip),%rsi
call   1070 <udev_log_null@plt>
mov    -0x30(%rbp),%rdi
call   1140 <udev_device_unref@plt>
jmp    14a8 <udev_node_remove+0x258>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xcc8(%rip),%rsi
call   1070 <udev_log_null@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10e0 <util_unlink_secure@plt>
mov    %eax,-0x434(%rbp)
cmpl   $0x0,-0x434(%rbp)
jne    13ef <udev_node_remove+0x19f>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10c0 <util_delete_path@plt>
lea    -0x430(%rbp),%rax
mov    %rax,-0x470(%rbp)
mov    -0x10(%rbp),%rdi
call   1110 <udev_get_dev_path@plt>
mov    %rax,-0x468(%rbp)
mov    -0x8(%rbp),%rdi
call   10b0 <udev_device_get_subsystem@plt>
mov    %eax,%edi
lea    0xc8d(%rip),%rsi
call   10f0 <strcmp@plt>
mov    %rax,%rdx
lea    0xc84(%rip),%rax
lea    0xc77(%rip),%rcx
cmp    $0x0,%rdx
cmove  %rcx,%rax
mov    %rax,-0x460(%rbp)
mov    -0x8(%rbp),%rdi
call   1150 <udev_device_get_devnum@plt>
mov    %rax,%rdi
call   10a0 <major@plt>
mov    %eax,-0x454(%rbp)
mov    -0x8(%rbp),%rdi
call   1150 <udev_device_get_devnum@plt>
mov    %rax,%rdi
call   1080 <minor@plt>
mov    -0x470(%rbp),%rdi
mov    -0x468(%rbp),%rcx
mov    -0x460(%rbp),%r8
mov    -0x454(%rbp),%r9d
mov    $0x400,%esi
lea    0xc0c(%rip),%rdx
mov    %eax,(%rsp)
call   1090 <snprintf@plt>
lea    -0x430(%rbp),%rdi
call   1060 <unlink@plt>
mov    -0x434(%rbp),%eax
add    $0x480,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udev_node_remove>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x410,%rsp
mov    %rdi,%rbx
call   1050 <udev_device_get_udev@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   10d0 <udev_device_get_devlinks_list_entry@plt>
test   %rax,%rax
je     12a4 <udev_node_remove+0x54>
mov    %rax,%rbp
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1160 <udev_list_entry_get_name@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <link_update@plt>
mov    %rbp,%rdi
call   1120 <udev_list_entry_get_next@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1280 <udev_node_remove+0x30>
mov    %rbx,%rdi
call   1170 <udev_device_get_devnode@plt>
xor    %r15d,%r15d
test   %rax,%rax
je     13fd <udev_node_remove+0x1ad>
mov    %rax,%rbp
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1100 <stat@plt>
test   %rax,%rax
je     12e4 <udev_node_remove+0x94>
lea    0xd2c(%rip),%rsi
mov    %r14,%rdi
mov    %rbp,%rdx
call   1070 <udev_log_null@plt>
jmp    13fd <udev_node_remove+0x1ad>
mov    0x8(%rsp),%r12
mov    %rbx,%rdi
call   1150 <udev_device_get_devnum@plt>
cmp    %rax,%r12
jne    132f <udev_node_remove+0xdf>
mov    %rbx,%rdi
call   1030 <udev_device_get_syspath@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1130 <udev_device_new_from_syspath@plt>
test   %rax,%rax
je     134c <udev_node_remove+0xfc>
mov    %rax,%r12
lea    0xd42(%rip),%rsi
mov    %r14,%rdi
mov    %rbp,%rdx
call   1070 <udev_log_null@plt>
mov    %r12,%rdi
call   1140 <udev_device_unref@plt>
jmp    13fd <udev_node_remove+0x1ad>
lea    0xce6(%rip),%rsi
mov    %r14,%rdi
mov    %rbp,%rdx
call   1070 <udev_log_null@plt>
mov    $0xffffffff,%r15d
jmp    13fd <udev_node_remove+0x1ad>
lea    0xd32(%rip),%rsi
mov    %r14,%rdi
mov    %rbp,%rdx
call   1070 <udev_log_null@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   10e0 <util_unlink_secure@plt>
mov    %eax,%r15d
test   %eax,%eax
jne    137b <udev_node_remove+0x12b>
mov    %r14,%rdi
mov    %rbp,%rsi
call   10c0 <util_delete_path@plt>
mov    %r14,%rdi
call   1110 <udev_get_dev_path@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   10b0 <udev_device_get_subsystem@plt>
lea    0xd17(%rip),%r12
mov    %eax,%edi
mov    %r12,%rsi
call   10f0 <strcmp@plt>
test   %rax,%rax
lea    0xd09(%rip),%rbp
cmove  %r12,%rbp
mov    %rbx,%rdi
call   1150 <udev_device_get_devnum@plt>
mov    %rax,%rdi
call   10a0 <major@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
call   1150 <udev_device_get_devnum@plt>
mov    %rax,%rdi
call   1080 <minor@plt>
mov    %eax,(%rsp)
lea    0xcc6(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r14,%rcx
mov    %rbp,%r8
mov    %r12d,%r9d
call   1090 <snprintf@plt>
mov    %rbx,%rdi
call   1060 <unlink@plt>
mov    %r15d,%eax
add    $0x410,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.udev_device = type { i32 }
%struct.udev = type { i32 }
%struct.udev_list_entry = type { i32 }
%struct.stat = type { i64 }
@.str = [28 x i8] c"device node '%s' not found\0A\00"
@.str.1 = [61 x i8] c"device node '%s' points to a different device, skip removal\0A\00"
@.str.2 = [44 x i8] c"keeping device node of existing device'%s'\0A\00"
@.str.3 = [27 x i8] c"removing device node '%s'\0A\00"
@.str.4 = [12 x i8] c"%s/%s/%u:%u\00"
@.str.5 = [6 x i8] c"block\00"
@.str.6 = [5 x i8] c"char\00"
define i32 @udev_node_remove(%struct.udev_device* %0) {
%2 = alloca %struct.udev_device*
%3 = alloca %struct.udev*
%4 = alloca %struct.udev_list_entry*
%5 = alloca i8*
%6 = alloca %struct.stat
%7 = alloca %struct.udev_device*
%8 = alloca [1024 x i8]
%9 = alloca i32
store %struct.udev_device* %0, %struct.udev_device** %2
%10 = load %struct.udev_device*, %struct.udev_device** %2
%11 = call %struct.udev* @udev_device_get_udev(%struct.udev_device* %10)
store %struct.udev* %11, %struct.udev** %3
store i32 0, i32* %9
%12 = load %struct.udev_device*, %struct.udev_device** %2
%13 = call %struct.udev_list_entry* @udev_device_get_devlinks_list_entry(%struct.udev_device* %12)
store %struct.udev_list_entry* %13, %struct.udev_list_entry** %4
br label %14
14: ; preds = %22, %1
%15 = load %struct.udev_list_entry*, %struct.udev_list_entry** %4
%16 = icmp ne %struct.udev_list_entry* %15, null
br i1 %16, label %17, label %25
17: ; preds = %14
%18 = load %struct.udev_device*, %struct.udev_device** %2
%19 = load %struct.udev_list_entry*, %struct.udev_list_entry** %4
%20 = call i32 @udev_list_entry_get_name(%struct.udev_list_entry* %19)
%21 = call i32 @link_update(%struct.udev_device* %18, i32 %20, i32 0)
br label %22
22: ; preds = %17
%23 = load %struct.udev_list_entry*, %struct.udev_list_entry** %4
%24 = call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %23)
store %struct.udev_list_entry* %24, %struct.udev_list_entry** %4
br label %14
25: ; preds = %14
%26 = load %struct.udev_device*, %struct.udev_device** %2
%27 = call i8* @udev_device_get_devnode(%struct.udev_device* %26)
store i8* %27, i8** %5
%28 = load i8*, i8** %5
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %31
30: ; preds = %25
br label %94
31: ; preds = %25
%32 = load i8*, i8** %5
%33 = call i64 @stat(i8* %32, %struct.stat* %6)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load %struct.udev*, %struct.udev** %3
%37 = load i8*, i8** %5
%38 = call i32 @udev_log_null(%struct.udev* %36, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %37)
br label %94
39: ; preds = %31
%40 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%41 = load i64, i64* %40
%42 = load %struct.udev_device*, %struct.udev_device** %2
%43 = call i64 @udev_device_get_devnum(%struct.udev_device* %42)
%44 = icmp ne i64 %41, %43
br i1 %44, label %45, label %49
45: ; preds = %39
%46 = load %struct.udev*, %struct.udev** %3
%47 = load i8*, i8** %5
%48 = call i32 @udev_log_null(%struct.udev* %46, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i8* %47)
store i32 -1, i32* %9
br label %94
49: ; preds = %39
%50 = load %struct.udev*, %struct.udev** %3
%51 = load %struct.udev_device*, %struct.udev_device** %2
%52 = call i32 @udev_device_get_syspath(%struct.udev_device* %51)
%53 = call %struct.udev_device* @udev_device_new_from_syspath(%struct.udev* %50, i32 %52)
store %struct.udev_device* %53, %struct.udev_device** %7
%54 = load %struct.udev_device*, %struct.udev_device** %7
%55 = icmp ne %struct.udev_device* %54, null
br i1 %55, label %56, label %62
56: ; preds = %49
%57 = load %struct.udev*, %struct.udev** %3
%58 = load i8*, i8** %5
%59 = call i32 @udev_log_null(%struct.udev* %57, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* %58)
%60 = load %struct.udev_device*, %struct.udev_device** %7
%61 = call i32 @udev_device_unref(%struct.udev_device* %60)
br label %94
62: ; preds = %49
%63 = load %struct.udev*, %struct.udev** %3
%64 = load i8*, i8** %5
%65 = call i32 @udev_log_null(%struct.udev* %63, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %64)
%66 = load %struct.udev*, %struct.udev** %3
%67 = load i8*, i8** %5
%68 = call i32 @util_unlink_secure(%struct.udev* %66, i8* %67)
store i32 %68, i32* %9
%69 = load i32, i32* %9
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %75
71: ; preds = %62
%72 = load %struct.udev*, %struct.udev** %3
%73 = load i8*, i8** %5
%74 = call i32 @util_delete_path(%struct.udev* %72, i8* %73)
br label %75
75: ; preds = %71, %62
%76 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%77 = load %struct.udev*, %struct.udev** %3
%78 = call i8* @udev_get_dev_path(%struct.udev* %77)
%79 = load %struct.udev_device*, %struct.udev_device** %2
%80 = call i32 @udev_device_get_subsystem(%struct.udev_device* %79)
%81 = call i64 @strcmp(i32 %80, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
%83 = zext i1 %82 to i64
%84 = select i1 %82, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%85 = load %struct.udev_device*, %struct.udev_device** %2
%86 = call i64 @udev_device_get_devnum(%struct.udev_device* %85)
%87 = call i32 @major(i64 %86)
%88 = load %struct.udev_device*, %struct.udev_device** %2
%89 = call i64 @udev_device_get_devnum(%struct.udev_device* %88)
%90 = call i32 @minor(i64 %89)
%91 = call i32 @snprintf(i8* %76, i32 1024, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %78, i8* %84, i32 %87, i32 %90)
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%93 = call i32 @unlink(i8* %92)
br label %94
94: ; preds = %75, %56, %45, %35, %30
%95 = load i32, i32* %9
ret i32 %95
}

LLVM IR (-O2):
%struct.udev_device = type { i32 }
%struct.stat = type { i64 }
%struct.udev = type { i32 }
%struct.udev_list_entry = type { i32 }
@.str = [28 x i8] c"device node '%s' not found\0A\00"
@.str.1 = [61 x i8] c"device node '%s' points to a different device, skip removal\0A\00"
@.str.2 = [44 x i8] c"keeping device node of existing device'%s'\0A\00"
@.str.3 = [27 x i8] c"removing device node '%s'\0A\00"
@.str.4 = [12 x i8] c"%s/%s/%u:%u\00"
@.str.5 = [6 x i8] c"block\00"
@.str.6 = [5 x i8] c"char\00"
define i32 @udev_node_remove(%struct.udev_device* %0) {
%2 = alloca %struct.stat
%3 = alloca [1024 x i8]
%4 = tail call %struct.udev* @udev_device_get_udev(%struct.udev_device* %0)
%5 = bitcast %struct.stat* %2 to i8*
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = tail call %struct.udev_list_entry* @udev_device_get_devlinks_list_entry(%struct.udev_device* %0)
%8 = icmp eq %struct.udev_list_entry* %7, null
br i1 %8, label %15, label %9
9: ; preds = %1, %9
%10 = phi %struct.udev_list_entry* [ %13, %9 ], [ %7, %1 ]
%11 = tail call i32 @udev_list_entry_get_name(%struct.udev_list_entry* %10)
%12 = tail call i32 @link_update(%struct.udev_device* %0, i32 %11, i32 0)
%13 = tail call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %10)
%14 = icmp eq %struct.udev_list_entry* %13, null
br i1 %14, label %15, label %9
15: ; preds = %9, %1
%16 = tail call i8* @udev_device_get_devnode(%struct.udev_device* %0)
%17 = icmp eq i8* %16, null
br i1 %17, label %55, label %18
18: ; preds = %15
%19 = call i64 @stat(i8* %16, %struct.stat* %2)
%20 = icmp eq i64 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %18
%22 = call i32 @udev_log_null(%struct.udev* %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %55
23: ; preds = %18
%24 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%25 = load i64, i64* %24
%26 = call i64 @udev_device_get_devnum(%struct.udev_device* %0)
%27 = icmp eq i64 %25, %26
br i1 %27, label %30, label %28
28: ; preds = %23
%29 = call i32 @udev_log_null(%struct.udev* %4, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %55
30: ; preds = %23
%31 = call i32 @udev_device_get_syspath(%struct.udev_device* %0)
%32 = call %struct.udev_device* @udev_device_new_from_syspath(%struct.udev* %4, i32 %31)
%33 = icmp eq %struct.udev_device* %32, null
br i1 %33, label %37, label %34
34: ; preds = %30
%35 = call i32 @udev_log_null(%struct.udev* %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%36 = call i32 @udev_device_unref(%struct.udev_device* %32)
br label %55
37: ; preds = %30
%38 = call i32 @udev_log_null(%struct.udev* %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %16)
%39 = call i32 @util_unlink_secure(%struct.udev* %4, i8* %16)
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 @util_delete_path(%struct.udev* %4, i8* %16)
br label %43
43: ; preds = %41, %37
%44 = call i8* @udev_get_dev_path(%struct.udev* %4)
%45 = call i32 @udev_device_get_subsystem(%struct.udev_device* %0)
%46 = call i64 @strcmp(i32 %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
%48 = select i1 %47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%49 = call i64 @udev_device_get_devnum(%struct.udev_device* %0)
%50 = call i32 @major(i64 %49)
%51 = call i64 @udev_device_get_devnum(%struct.udev_device* %0)
%52 = call i32 @minor(i64 %51)
%53 = call i32 @snprintf(i8* %6, i32 1024, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %44, i8* %48, i32 %50, i32 %52)
%54 = call i32 @unlink(i8* %6)
br label %55
55: ; preds = %15, %43, %34, %28, %21
%56 = phi i32 [ 0, %15 ], [ 0, %21 ], [ -1, %28 ], [ 0, %34 ], [ %39, %43 ]
ret i32 %56
}