#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 */
struct udev_list_entry *udev_device_add_property_internal(struct udev_device *,
                                                          char const *,
                                                          char const *);
int /*<<< orphan*/ udev_list_entry_set_num(struct udev_list_entry *, int);
int udev_device_add_property(struct udev_device *udev_device, const char *key,
                             const char *value) {
  struct udev_list_entry *property;
  property = udev_device_add_property_internal(udev_device, key, value);
  if (key[0] != '.')
    udev_list_entry_set_num(property, true);
  return 0;
}


x86 assembly (clang, -O0):
<udev_device_add_property>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <udev_device_add_property_internal@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1167 <udev_device_add_property+0x47>
mov    -0x20(%rbp),%rdi
mov    $0x1,%esi
call   1030 <udev_list_entry_set_num@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udev_device_add_property>:
push   %rbx
mov    %rsi,%rbx
call   1040 <udev_device_add_property_internal@plt>
cmpb   $0x2e,(%rbx)
je     113b <udev_device_add_property+0x1b>
mov    %rax,%rdi
mov    $0x1,%esi
call   1030 <udev_list_entry_set_num@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.udev_device = type { i32 }
%struct.udev_list_entry = type { i32 }
define i32 @udev_device_add_property(%struct.udev_device* %0, i8* %1, i8* %2) {
%4 = alloca %struct.udev_device*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.udev_list_entry*
store %struct.udev_device* %0, %struct.udev_device** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load %struct.udev_device*, %struct.udev_device** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call %struct.udev_list_entry* @udev_device_add_property_internal(%struct.udev_device* %8, i8* %9, i8* %10)
store %struct.udev_list_entry* %11, %struct.udev_list_entry** %7
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 46
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = load %struct.udev_list_entry*, %struct.udev_list_entry** %7
%19 = call i32 @udev_list_entry_set_num(%struct.udev_list_entry* %18, i32 1)
br label %20
20: ; preds = %17, %3
ret i32 0
}

LLVM IR (-O2):
%struct.udev_device = type { i32 }
%struct.udev_list_entry = type { i32 }
define i32 @udev_device_add_property(%struct.udev_device* %0, i8* %1, i8* %2) {
%4 = tail call %struct.udev_list_entry* @udev_device_add_property_internal(%struct.udev_device* %0, i8* %1, i8* %2)
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 46
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @udev_list_entry_set_num(%struct.udev_list_entry* %4, i32 1)
br label %9
9: ; preds = %7, %3
ret i32 0
}