#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 */

/* Variables and functions */
int ABS_MAX;
int EV_ABS;
int EV_FF;
int EV_KEY;
int EV_LED;
int EV_MAX;
int EV_MSC;
int EV_REL;
int EV_SND;
int FF_MAX;
int KEY_MAX;
int /*<<< orphan*/ KEY_MUTE;
int LED_MAX;
int MSC_MAX;
int REL_MAX;
int SND_MAX;
char *bitmap_to_bitstring(float, unsigned long *, int /*<<< orphan*/, int);
int /*<<< orphan*/ free(char *);
char *getenv(char *);
int /*<<< orphan*/ memset(unsigned long *, int /*<<< orphan*/, int);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int, unsigned int,
                            unsigned int, unsigned int, char *, char *, char *,
                            char *, char *, char *, char *, char *, char *);
char *strchr(char *, char);
char *strdup(char *);
int /*<<< orphan*/ string_to_bitmap(char *, unsigned long *, int);
unsigned int strtoul(char *, int /*<<< orphan*/ *, int);
int get_input_modalias(char *modalias, int modalias_len) {
  char *product_env;
  char *ptr;
  char *token;
  unsigned int bustype, vendor, product, version;
  char *ev, *key, *rel, *abs, *sw, *msc, *led, *snd, *ff;
  unsigned long ev_bits[((EV_MAX / (sizeof(long) * 8)) + 1)];
  unsigned long key_bits[((KEY_MAX / (sizeof(long) * 8)) + 1)];
  unsigned long rel_bits[((REL_MAX / (sizeof(long) * 8)) + 1)];
  unsigned long abs_bits[((ABS_MAX / (sizeof(long) * 8)) + 1)];
  unsigned long msc_bits[((MSC_MAX / (sizeof(long) * 8)) + 1)];
  unsigned long led_bits[((LED_MAX / (sizeof(long) * 8)) + 1)];
  unsigned long snd_bits[((SND_MAX / (sizeof(long) * 8)) + 1)];
  unsigned long ff_bits[((FF_MAX / (sizeof(long) * 8)) + 1)];
  memset(ev_bits, 0, ((EV_MAX / (sizeof(long) * 8)) + 1) * sizeof(long));
  memset(key_bits, 0, ((KEY_MAX / (sizeof(long) * 8)) + 1) * sizeof(long));
  memset(rel_bits, 0, ((REL_MAX / (sizeof(long) * 8)) + 1) * sizeof(long));
  memset(abs_bits, 0, ((ABS_MAX / (sizeof(long) * 8)) + 1) * sizeof(long));
  memset(msc_bits, 0, ((MSC_MAX / (sizeof(long) * 8)) + 1) * sizeof(long));
  memset(led_bits, 0, ((LED_MAX / (sizeof(long) * 8)) + 1) * sizeof(long));
  memset(snd_bits, 0, ((SND_MAX / (sizeof(long) * 8)) + 1) * sizeof(long));
  memset(ff_bits, 0, ((FF_MAX / (sizeof(long) * 8)) + 1) * sizeof(long));
  product_env = getenv("PRODUCT");
  if (product_env == NULL)
    return -1;
  ptr = strchr(product_env, '/');
  if (ptr == NULL || ptr[1] == '\0')
    return -1;
  bustype = strtoul(product_env, NULL, 16);
  vendor = strtoul(ptr + 1, NULL, 16);
  ptr = strchr(ptr + 1, '/');
  if (ptr == NULL || ptr[1] == '\0')
    return -1;
  product = strtoul(ptr + 1, NULL, 16);
  ptr = strchr(ptr + 1, '/');
  if (ptr == NULL || ptr[1] == '\0')
    return -1;
  version = strtoul(ptr + 1, NULL, 16);
  token = getenv("EV");
  if (token == NULL)
    return -1;
  string_to_bitmap(token, ev_bits, ((EV_MAX / (sizeof(long) * 8)) + 1));
  ev = bitmap_to_bitstring('e', ev_bits, 0, EV_MAX);
  if ((ev_bits[EV_KEY / (sizeof(long) * 8)] &
       (((unsigned long)1) << (EV_KEY % (sizeof(long) * 8))))) {
    token = getenv("KEY");
    if (token == NULL)
      return -1;
    string_to_bitmap(token, key_bits, ((KEY_MAX / (sizeof(long) * 8)) + 1));
  }
  key = bitmap_to_bitstring('k', key_bits, KEY_MUTE, KEY_MAX);
  ;
  if ((ev_bits[EV_REL / (sizeof(long) * 8)] &
       (((unsigned long)1) << (EV_REL % (sizeof(long) * 8))))) {
    token = getenv("REL");
    if (token == NULL)
      return -1;
    string_to_bitmap(token, rel_bits, ((REL_MAX / (sizeof(long) * 8)) + 1));
  }
  rel = bitmap_to_bitstring('r', rel_bits, 0, REL_MAX);
  ;
  if ((ev_bits[EV_ABS / (sizeof(long) * 8)] &
       (((unsigned long)1) << (EV_ABS % (sizeof(long) * 8))))) {
    token = getenv("ABS");
    if (token == NULL)
      return -1;
    string_to_bitmap(token, abs_bits, ((ABS_MAX / (sizeof(long) * 8)) + 1));
  }
  abs = bitmap_to_bitstring('a', abs_bits, 0, ABS_MAX);
  ;
  if ((ev_bits[EV_MSC / (sizeof(long) * 8)] &
       (((unsigned long)1) << (EV_MSC % (sizeof(long) * 8))))) {
    token = getenv("MSC");
    if (token == NULL)
      return -1;
    string_to_bitmap(token, msc_bits, ((MSC_MAX / (sizeof(long) * 8)) + 1));
  }
  msc = bitmap_to_bitstring('m', msc_bits, 0, MSC_MAX);
  ;
  if ((ev_bits[EV_LED / (sizeof(long) * 8)] &
       (((unsigned long)1) << (EV_LED % (sizeof(long) * 8))))) {
    token = getenv("LED");
    if (token == NULL)
      return -1;
    string_to_bitmap(token, led_bits, ((LED_MAX / (sizeof(long) * 8)) + 1));
  }
  led = bitmap_to_bitstring('l', led_bits, 0, LED_MAX);
  ;
  if ((ev_bits[EV_SND / (sizeof(long) * 8)] &
       (((unsigned long)1) << (EV_SND % (sizeof(long) * 8))))) {
    token = getenv("SND");
    if (token == NULL)
      return -1;
    string_to_bitmap(token, snd_bits, ((SND_MAX / (sizeof(long) * 8)) + 1));
  }
  snd = bitmap_to_bitstring('s', snd_bits, 0, SND_MAX);
  ;
  if ((ev_bits[EV_FF / (sizeof(long) * 8)] &
       (((unsigned long)1) << (EV_FF % (sizeof(long) * 8))))) {
    token = getenv("FF");
    if (token == NULL)
      return -1;
    string_to_bitmap(token, ff_bits, ((FF_MAX / (sizeof(long) * 8)) + 1));
  }
  ff = bitmap_to_bitstring('f', ff_bits, 0, FF_MAX);
  ;
  sw = strdup("");
  snprintf(modalias, modalias_len,
           "MODALIAS=input:b%04Xv%04Xp%04Xe%04X-"
           "%s%s%s%s%s%s%s%s%s",
           bustype, vendor, product, version, ev, key, rel, abs, msc, led, snd,
           ff, sw);
  free(ev);
  free(key);
  free(rel);
  free(abs);
  free(msc);
  free(led);
  free(snd);
  free(ff);
  free(sw);
  return 0;
}


x86 assembly (clang, -O0):
<get_input_modalias>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %rdi,-0x38(%rbp)
mov    %esi,-0x3c(%rbp)
mov    0x2e36(%rip),%rax
movslq (%rax),%rcx
shr    $0x6,%rcx
mov    %rcx,%rax
add    $0x1,%rax
mov    %rsp,%rdx
mov    %rdx,-0xb8(%rbp)
lea    0x17(,%rcx,8),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x140(%rbp)
mov    %rdi,%rsp
mov    %rax,-0xc0(%rbp)
mov    0x2d8c(%rip),%rax
movslq (%rax),%rcx
shr    $0x6,%rcx
mov    %rcx,%rax
add    $0x1,%rax
lea    0x17(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x138(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xc8(%rbp)
mov    0x2d6c(%rip),%rax
movslq (%rax),%rcx
shr    $0x6,%rcx
mov    %rcx,%rax
add    $0x1,%rax
lea    0x17(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x130(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xd0(%rbp)
mov    0x2d04(%rip),%rax
movslq (%rax),%rcx
shr    $0x6,%rcx
mov    %rcx,%rax
add    $0x1,%rax
lea    0x17(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x128(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xd8(%rbp)
mov    0x2d2c(%rip),%rax
movslq (%rax),%rcx
shr    $0x6,%rcx
mov    %rcx,%rax
add    $0x1,%rax
lea    0x17(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x120(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xe0(%rbp)
mov    0x2cec(%rip),%rax
movslq (%rax),%rcx
shr    $0x6,%rcx
mov    %rcx,%rax
add    $0x1,%rax
lea    0x17(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x118(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xe8(%rbp)
mov    0x2c6c(%rip),%rax
movslq (%rax),%rcx
shr    $0x6,%rcx
mov    %rcx,%rax
add    $0x1,%rax
lea    0x17(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x110(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xf0(%rbp)
mov    0x2c9c(%rip),%rax
movslq (%rax),%rcx
shr    $0x6,%rcx
mov    %rcx,%rax
add    $0x1,%rax
lea    0x17(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x108(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xf8(%rbp)
mov    0x2c6c(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x138(%rbp),%rdi
mov    0x2bde(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x130(%rbp),%rdi
mov    0x2bd0(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x128(%rbp),%rdi
mov    0x2b7a(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x120(%rbp),%rdi
mov    0x2bb4(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x118(%rbp),%rdi
mov    0x2b86(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x110(%rbp),%rdi
mov    0x2b18(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x108(%rbp),%rdi
mov    0x2b5a(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
lea    0xb7b(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    14cf <get_input_modalias+0x33f>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x48(%rbp),%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     14fd <get_input_modalias+0x36d>
mov    -0x50(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1513 <get_input_modalias+0x383>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x48(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1090 <strtoul@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x50(%rbp),%rdi
add    $0x1,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1090 <strtoul@plt>
mov    %eax,-0x60(%rbp)
mov    -0x50(%rbp),%rdi
add    $0x1,%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     1573 <get_input_modalias+0x3e3>
mov    -0x50(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1589 <get_input_modalias+0x3f9>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x50(%rbp),%rdi
add    $0x1,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1090 <strtoul@plt>
mov    %eax,-0x64(%rbp)
mov    -0x50(%rbp),%rdi
add    $0x1,%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     15d4 <get_input_modalias+0x444>
mov    -0x50(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    15ea <get_input_modalias+0x45a>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x50(%rbp),%rdi
add    $0x1,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1090 <strtoul@plt>
mov    %eax,-0x68(%rbp)
lea    0xa1e(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    1634 <get_input_modalias+0x4a4>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x140(%rbp),%rsi
mov    -0x58(%rbp),%rdi
mov    0x29a2(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
mov    %eax,%edx
call   1080 <string_to_bitmap@plt>
mov    -0x140(%rbp),%rdi
mov    0x2982(%rip),%rax
mov    (%rax),%edx
movss  0x990(%rip),%xmm0
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,%rcx
mov    -0x140(%rbp),%rax
mov    %rcx,-0x70(%rbp)
mov    0x2924(%rip),%rcx
movslq (%rcx),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x2912(%rip),%rcx
movslq (%rcx),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1712 <get_input_modalias+0x582>
lea    0x967(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    16ee <get_input_modalias+0x55e>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x138(%rbp),%rsi
mov    -0x58(%rbp),%rdi
mov    0x2880(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
mov    %eax,%edx
call   1080 <string_to_bitmap@plt>
mov    -0x138(%rbp),%rdi
mov    0x28b0(%rip),%rax
mov    (%rax),%esi
mov    0x2857(%rip),%rax
mov    (%rax),%edx
movss  0x8d1(%rip),%xmm0
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,%rcx
mov    -0x140(%rbp),%rax
mov    %rcx,-0x78(%rbp)
mov    0x2853(%rip),%rcx
movslq (%rcx),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x2841(%rip),%rcx
movslq (%rcx),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     17d3 <get_input_modalias+0x643>
lea    0x8aa(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    17af <get_input_modalias+0x61f>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x130(%rbp),%rsi
mov    -0x58(%rbp),%rdi
mov    0x27d7(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
mov    %eax,%edx
call   1080 <string_to_bitmap@plt>
mov    -0x130(%rbp),%rdi
mov    0x27b7(%rip),%rax
mov    (%rax),%edx
movss  0x81d(%rip),%xmm0
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,%rcx
mov    -0x140(%rbp),%rax
mov    %rcx,-0x80(%rbp)
mov    0x2759(%rip),%rcx
movslq (%rcx),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x2747(%rip),%rcx
movslq (%rcx),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     188d <get_input_modalias+0x6fd>
lea    0x7f4(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    1869 <get_input_modalias+0x6d9>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x128(%rbp),%rsi
mov    -0x58(%rbp),%rdi
mov    0x26ed(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
mov    %eax,%edx
call   1080 <string_to_bitmap@plt>
mov    -0x128(%rbp),%rdi
mov    0x26cd(%rip),%rax
mov    (%rax),%edx
movss  0x767(%rip),%xmm0
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,%rcx
mov    -0x140(%rbp),%rax
mov    %rcx,-0x88(%rbp)
mov    0x26e4(%rip),%rcx
movslq (%rcx),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x26d2(%rip),%rcx
movslq (%rcx),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     194a <get_input_modalias+0x7ba>
lea    0x73b(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    1926 <get_input_modalias+0x796>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x120(%rbp),%rsi
mov    -0x58(%rbp),%rdi
mov    0x2690(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
mov    %eax,%edx
call   1080 <string_to_bitmap@plt>
mov    -0x120(%rbp),%rdi
mov    0x2670(%rip),%rax
mov    (%rax),%edx
movss  0x6ae(%rip),%xmm0
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,%rcx
mov    -0x140(%rbp),%rax
mov    %rcx,-0x98(%rbp)
mov    0x2637(%rip),%rcx
movslq (%rcx),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x2625(%rip),%rcx
movslq (%rcx),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1a07 <get_input_modalias+0x877>
lea    0x682(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    19e3 <get_input_modalias+0x853>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x118(%rbp),%rsi
mov    -0x58(%rbp),%rdi
mov    0x25cb(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
mov    %eax,%edx
call   1080 <string_to_bitmap@plt>
mov    -0x118(%rbp),%rdi
mov    0x25ab(%rip),%rax
mov    (%rax),%edx
movss  0x5f5(%rip),%xmm0
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,%rcx
mov    -0x140(%rbp),%rax
mov    %rcx,-0xa0(%rbp)
mov    0x25ba(%rip),%rcx
movslq (%rcx),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x25a8(%rip),%rcx
movslq (%rcx),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1ac4 <get_input_modalias+0x934>
lea    0x5c9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    1aa0 <get_input_modalias+0x910>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x110(%rbp),%rsi
mov    -0x58(%rbp),%rdi
mov    0x24c6(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
mov    %eax,%edx
call   1080 <string_to_bitmap@plt>
mov    -0x110(%rbp),%rdi
mov    0x24a6(%rip),%rax
mov    (%rax),%edx
movss  0x53c(%rip),%xmm0
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,%rcx
mov    -0x140(%rbp),%rax
mov    %rcx,-0xa8(%rbp)
mov    0x248d(%rip),%rcx
movslq (%rcx),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x247b(%rip),%rcx
movslq (%rcx),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1b81 <get_input_modalias+0x9f1>
lea    0x510(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    1b5d <get_input_modalias+0x9cd>
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
jmp    1cd9 <get_input_modalias+0xb49>
mov    -0x108(%rbp),%rsi
mov    -0x58(%rbp),%rdi
mov    0x2471(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
add    $0x1,%rax
mov    %eax,%edx
call   1080 <string_to_bitmap@plt>
mov    -0x108(%rbp),%rdi
mov    0x2451(%rip),%rax
mov    (%rax),%edx
movss  0x483(%rip),%xmm0
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,-0xb0(%rbp)
lea    0x48c(%rip),%rdi
call   10a0 <strdup@plt>
mov    %rax,-0x90(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    -0x5c(%rbp),%ecx
mov    -0x60(%rbp),%r8d
mov    -0x64(%rbp),%r9d
mov    -0x68(%rbp),%eax
mov    -0x70(%rbp),%rdx
mov    %rdx,-0x150(%rbp)
mov    -0x78(%rbp),%r13
mov    -0x80(%rbp),%r12
mov    -0x88(%rbp),%r15
mov    -0x98(%rbp),%r14
mov    -0xa0(%rbp),%rbx
mov    -0xa8(%rbp),%r11
mov    -0xb0(%rbp),%r10
mov    -0x90(%rbp),%rdx
mov    %rdx,-0x148(%rbp)
lea    0x42c(%rip),%rdx
sub    $0x50,%rsp
mov    %eax,(%rsp)
mov    -0x150(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x148(%rbp),%rax
mov    %r13,0x10(%rsp)
mov    %r12,0x18(%rsp)
mov    %r15,0x20(%rsp)
mov    %r14,0x28(%rsp)
mov    %rbx,0x30(%rsp)
mov    %r11,0x38(%rsp)
mov    %r10,0x40(%rsp)
mov    %rax,0x48(%rsp)
call   1060 <snprintf@plt>
add    $0x50,%rsp
mov    -0x70(%rbp),%rdi
call   1040 <free@plt>
mov    -0x78(%rbp),%rdi
call   1040 <free@plt>
mov    -0x80(%rbp),%rdi
call   1040 <free@plt>
mov    -0x88(%rbp),%rdi
call   1040 <free@plt>
mov    -0x98(%rbp),%rdi
call   1040 <free@plt>
mov    -0xa0(%rbp),%rdi
call   1040 <free@plt>
mov    -0xa8(%rbp),%rdi
call   1040 <free@plt>
mov    -0xb0(%rbp),%rdi
call   1040 <free@plt>
mov    -0x90(%rbp),%rdi
call   1040 <free@plt>
movl   $0x0,-0x2c(%rbp)
movl   $0x1,-0xfc(%rbp)
mov    -0xb8(%rbp),%rax
mov    %rax,%rsp
mov    -0x2c(%rbp),%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_input_modalias>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %esi,-0x68(%rbp)
mov    %rdi,-0x90(%rbp)
mov    0x2e36(%rip),%rax
movslq (%rax),%rdx
mov    %rdx,%rax
shr    $0x6,%rax
mov    %rsp,%rdi
lea    0x17(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
mov    0x2da8(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
mov    %rsp,%rcx
lea    0x17(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    0x2d99(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
mov    %rsp,%rcx
lea    0x17(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    0x2d42(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
mov    %rsp,%rbx
lea    0x17(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x2d7f(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
mov    %rsp,%r12
lea    0x17(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    0x2d54(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
mov    %rsp,%r15
lea    0x17(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    0x2ce9(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
mov    %rsp,%r13
lea    0x17(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    0x2d2e(%rip),%rax
movslq (%rax),%rax
shr    $0x6,%rax
mov    %rsp,%r14
lea    0x17(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
sar    $0x3,%edx
add    $0x8,%edx
and    $0xfffffff8,%edx
mov    %rdi,-0x60(%rbp)
xor    %esi,%esi
call   1070 <memset@plt>
mov    0x2c97(%rip),%rax
mov    (%rax),%edx
sar    $0x3,%edx
add    $0x8,%edx
and    $0xfffffff8,%edx
mov    -0x40(%rbp),%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    0x2c92(%rip),%rax
mov    (%rax),%edx
sar    $0x3,%edx
add    $0x8,%edx
and    $0xfffffff8,%edx
mov    -0x38(%rbp),%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    0x2c45(%rip),%rax
mov    (%rax),%edx
sar    $0x3,%edx
add    $0x8,%edx
and    $0xfffffff8,%edx
mov    %rbx,-0x30(%rbp)
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    0x2c85(%rip),%rax
mov    (%rax),%edx
sar    $0x3,%edx
add    $0x8,%edx
and    $0xfffffff8,%edx
mov    %r12,-0x58(%rbp)
mov    %r12,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    0x2c5d(%rip),%rax
mov    (%rax),%edx
sar    $0x3,%edx
add    $0x8,%edx
and    $0xfffffff8,%edx
mov    %r15,-0x50(%rbp)
mov    %r15,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    0x2bf5(%rip),%rax
mov    (%rax),%edx
sar    $0x3,%edx
add    $0x8,%edx
and    $0xfffffff8,%edx
mov    %r13,-0x48(%rbp)
mov    %r13,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    0x2c3d(%rip),%rax
mov    (%rax),%edx
sar    $0x3,%edx
add    $0x8,%edx
and    $0xfffffff8,%edx
mov    %r14,-0x70(%rbp)
mov    %r14,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
lea    0xc5d(%rip),%rdi
call   1030 <getenv@plt>
mov    $0xffffffff,%r12d
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
mov    %rax,%r15
mov    %rax,%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
mov    %rax,%r14
cmpb   $0x0,0x1(%rax)
je     1892 <get_input_modalias+0x702>
add    $0x1,%r14
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1090 <strtoul@plt>
mov    %eax,%r13d
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1090 <strtoul@plt>
mov    %eax,%r15d
mov    %r14,%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
mov    %rax,%rbx
cmpb   $0x0,0x1(%rax)
je     1892 <get_input_modalias+0x702>
add    $0x1,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1090 <strtoul@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
cmpb   $0x0,0x1(%rax)
je     1892 <get_input_modalias+0x702>
add    $0x1,%rax
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1090 <strtoul@plt>
mov    %eax,%ebx
lea    0xb8e(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
mov    %r14d,-0x64(%rbp)
mov    %rbx,-0x88(%rbp)
mov    0x2b2e(%rip),%r14
mov    (%r14),%edx
sar    $0x6,%edx
add    $0x1,%edx
mov    %rax,%rdi
mov    -0x60(%rbp),%rbx
mov    %rbx,%rsi
call   1080 <string_to_bitmap@plt>
mov    (%r14),%edx
movss  0xb23(%rip),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,-0x80(%rbp)
mov    0x2abe(%rip),%rax
movslq (%rax),%rax
mov    %rax,%rcx
shr    $0x6,%rcx
mov    (%rbx,%rcx,8),%rcx
bt     %rax,%rcx
jae    1536 <get_input_modalias+0x3a6>
lea    0xb1e(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
mov    0x2a5e(%rip),%rcx
mov    (%rcx),%edx
sar    $0x6,%edx
add    $0x1,%edx
mov    %rax,%rdi
mov    -0x40(%rbp),%rsi
call   1080 <string_to_bitmap@plt>
mov    0x2a93(%rip),%rax
mov    (%rax),%esi
mov    0x2a3a(%rip),%rax
mov    (%rax),%edx
movss  0xab4(%rip),%xmm0
mov    -0x40(%rbp),%rdi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,%r14
mov    0x2a3d(%rip),%rax
movslq (%rax),%rax
mov    %rax,%rcx
shr    $0x6,%rcx
mov    (%rbx,%rcx,8),%rcx
bt     %rax,%rcx
jae    15a7 <get_input_modalias+0x417>
lea    0xab1(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
mov    0x2a05(%rip),%rcx
mov    (%rcx),%edx
sar    $0x6,%edx
add    $0x1,%edx
mov    %rax,%rdi
mov    -0x38(%rbp),%rsi
call   1080 <string_to_bitmap@plt>
mov    0x29ea(%rip),%rax
mov    (%rax),%edx
movss  0xa50(%rip),%xmm0
mov    -0x38(%rbp),%rdi
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,-0x40(%rbp)
mov    0x2992(%rip),%rax
movslq (%rax),%rax
mov    %rax,%rcx
shr    $0x6,%rcx
mov    (%rbx,%rcx,8),%rcx
bt     %rax,%rcx
jae    1612 <get_input_modalias+0x482>
lea    0xa4a(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
mov    0x296a(%rip),%rcx
mov    (%rcx),%edx
sar    $0x6,%edx
add    $0x1,%edx
mov    %rax,%rdi
mov    -0x30(%rbp),%rsi
call   1080 <string_to_bitmap@plt>
mov    0x294f(%rip),%rax
mov    (%rax),%edx
movss  0x9e9(%rip),%xmm0
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,-0x38(%rbp)
mov    0x296f(%rip),%rax
movslq (%rax),%rax
mov    %rax,%rcx
shr    $0x6,%rcx
mov    (%rbx,%rcx,8),%rcx
bt     %rax,%rcx
jae    167d <get_input_modalias+0x4ed>
lea    0x9e3(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
mov    0x295f(%rip),%rcx
mov    (%rcx),%edx
sar    $0x6,%edx
add    $0x1,%edx
mov    %rax,%rdi
mov    -0x58(%rbp),%rsi
call   1080 <string_to_bitmap@plt>
mov    0x2944(%rip),%rax
mov    (%rax),%edx
movss  0x982(%rip),%xmm0
mov    -0x58(%rbp),%rdi
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,-0x58(%rbp)
mov    0x2914(%rip),%rax
movslq (%rax),%rax
mov    %rax,%rcx
shr    $0x6,%rcx
mov    (%rbx,%rcx,8),%rcx
bt     %rax,%rcx
jae    16e8 <get_input_modalias+0x558>
lea    0x97c(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
mov    0x28ec(%rip),%rcx
mov    (%rcx),%edx
sar    $0x6,%edx
add    $0x1,%edx
mov    %rax,%rdi
mov    -0x50(%rbp),%rsi
call   1080 <string_to_bitmap@plt>
mov    0x28d1(%rip),%rax
mov    (%rax),%edx
movss  0x91b(%rip),%xmm0
mov    -0x50(%rbp),%rdi
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,-0x30(%rbp)
mov    0x28e9(%rip),%rax
movslq (%rax),%rax
mov    %rax,%rcx
shr    $0x6,%rcx
mov    (%rbx,%rcx,8),%rcx
bt     %rax,%rcx
mov    0x2850(%rip),%rbx
jae    1753 <get_input_modalias+0x5c3>
lea    0x90e(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
mov    (%rbx),%edx
sar    $0x6,%edx
add    $0x1,%edx
mov    %rax,%rdi
mov    -0x48(%rbp),%rsi
call   1080 <string_to_bitmap@plt>
mov    %r14,-0x50(%rbp)
mov    (%rbx),%edx
movss  0x8b7(%rip),%xmm0
mov    -0x48(%rbp),%rdi
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,%r14
mov    0x2812(%rip),%rax
movslq (%rax),%rax
mov    %rax,%rcx
shr    $0x6,%rcx
mov    -0x60(%rbp),%rdx
mov    (%rdx,%rcx,8),%rcx
bt     %rax,%rcx
jae    17be <get_input_modalias+0x62e>
lea    0x8ae(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1892 <get_input_modalias+0x702>
mov    0x2836(%rip),%rcx
mov    (%rcx),%edx
sar    $0x6,%edx
add    $0x1,%edx
mov    %rax,%rdi
mov    -0x70(%rbp),%rsi
call   1080 <string_to_bitmap@plt>
mov    0x281b(%rip),%rax
mov    (%rax),%edx
movss  0x84d(%rip),%xmm0
mov    -0x70(%rbp),%rdi
xor    %esi,%esi
call   10b0 <bitmap_to_bitstring@plt>
mov    %rax,%rbx
mov    %rax,-0x48(%rbp)
lea    0x852(%rip),%rdi
call   10a0 <strdup@plt>
mov    %rax,-0x60(%rbp)
lea    0x84e(%rip),%rdx
mov    -0x90(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    %r13d,%ecx
mov    %r15d,%r8d
mov    -0x64(%rbp),%r9d
push   %rax
push   %rbx
mov    %r14,-0x78(%rbp)
push   %r14
push   -0x30(%rbp)
mov    -0x58(%rbp),%r15
push   %r15
mov    -0x38(%rbp),%r12
push   %r12
mov    -0x40(%rbp),%r14
push   %r14
mov    -0x50(%rbp),%r13
push   %r13
mov    -0x80(%rbp),%rbx
push   %rbx
push   -0x88(%rbp)
call   1060 <snprintf@plt>
add    $0x50,%rsp
mov    %rbx,%rdi
call   1040 <free@plt>
mov    %r13,%rdi
call   1040 <free@plt>
mov    %r14,%rdi
call   1040 <free@plt>
mov    %r12,%rdi
call   1040 <free@plt>
mov    %r15,%rdi
call   1040 <free@plt>
mov    -0x30(%rbp),%rdi
call   1040 <free@plt>
mov    -0x78(%rbp),%rdi
call   1040 <free@plt>
mov    -0x48(%rbp),%rdi
call   1040 <free@plt>
mov    -0x60(%rbp),%rdi
call   1040 <free@plt>
xor    %r12d,%r12d
mov    %r12d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EV_MAX = global i32 0
@KEY_MAX = global i32 0
@REL_MAX = global i32 0
@ABS_MAX = global i32 0
@MSC_MAX = global i32 0
@LED_MAX = global i32 0
@SND_MAX = global i32 0
@FF_MAX = global i32 0
@.str = [8 x i8] c"PRODUCT\00"
@.str.1 = [3 x i8] c"EV\00"
@EV_KEY = global i32 0
@.str.2 = [4 x i8] c"KEY\00"
@KEY_MUTE = global i32 0
@EV_REL = global i32 0
@.str.3 = [4 x i8] c"REL\00"
@EV_ABS = global i32 0
@.str.4 = [4 x i8] c"ABS\00"
@EV_MSC = global i32 0
@.str.5 = [4 x i8] c"MSC\00"
@EV_LED = global i32 0
@.str.6 = [4 x i8] c"LED\00"
@EV_SND = global i32 0
@.str.7 = [4 x i8] c"SND\00"
@EV_FF = global i32 0
@.str.8 = [3 x i8] c"FF\00"
@.str.9 = [1 x i8] zeroinitializer
@.str.10 = [55 x i8] c"MODALIAS=input:b%04Xv%04Xp%04Xe%04X-%s%s%s%s%s%s%s%s%s\00"
define i32 @get_input_modalias(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i64
%24 = alloca i64
%25 = alloca i64
%26 = alloca i64
%27 = alloca i64
%28 = alloca i64
%29 = alloca i64
%30 = alloca i64
%31 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%32 = load i32, i32* @EV_MAX
%33 = sext i32 %32 to i64
%34 = udiv i64 %33, 64
%35 = add i64 %34, 1
%36 = call i8* @llvm.stacksave()
store i8* %36, i8** %22
%37 = alloca i64, i64 %35
store i64 %35, i64* %23
%38 = load i32, i32* @KEY_MAX
%39 = sext i32 %38 to i64
%40 = udiv i64 %39, 64
%41 = add i64 %40, 1
%42 = alloca i64, i64 %41
store i64 %41, i64* %24
%43 = load i32, i32* @REL_MAX
%44 = sext i32 %43 to i64
%45 = udiv i64 %44, 64
%46 = add i64 %45, 1
%47 = alloca i64, i64 %46
store i64 %46, i64* %25
%48 = load i32, i32* @ABS_MAX
%49 = sext i32 %48 to i64
%50 = udiv i64 %49, 64
%51 = add i64 %50, 1
%52 = alloca i64, i64 %51
store i64 %51, i64* %26
%53 = load i32, i32* @MSC_MAX
%54 = sext i32 %53 to i64
%55 = udiv i64 %54, 64
%56 = add i64 %55, 1
%57 = alloca i64, i64 %56
store i64 %56, i64* %27
%58 = load i32, i32* @LED_MAX
%59 = sext i32 %58 to i64
%60 = udiv i64 %59, 64
%61 = add i64 %60, 1
%62 = alloca i64, i64 %61
store i64 %61, i64* %28
%63 = load i32, i32* @SND_MAX
%64 = sext i32 %63 to i64
%65 = udiv i64 %64, 64
%66 = add i64 %65, 1
%67 = alloca i64, i64 %66
store i64 %66, i64* %29
%68 = load i32, i32* @FF_MAX
%69 = sext i32 %68 to i64
%70 = udiv i64 %69, 64
%71 = add i64 %70, 1
%72 = alloca i64, i64 %71
store i64 %71, i64* %30
%73 = load i32, i32* @EV_MAX
%74 = sext i32 %73 to i64
%75 = udiv i64 %74, 64
%76 = add i64 %75, 1
%77 = mul i64 %76, 8
%78 = trunc i64 %77 to i32
%79 = call i32 @memset(i64* %37, i32 0, i32 %78)
%80 = load i32, i32* @KEY_MAX
%81 = sext i32 %80 to i64
%82 = udiv i64 %81, 64
%83 = add i64 %82, 1
%84 = mul i64 %83, 8
%85 = trunc i64 %84 to i32
%86 = call i32 @memset(i64* %42, i32 0, i32 %85)
%87 = load i32, i32* @REL_MAX
%88 = sext i32 %87 to i64
%89 = udiv i64 %88, 64
%90 = add i64 %89, 1
%91 = mul i64 %90, 8
%92 = trunc i64 %91 to i32
%93 = call i32 @memset(i64* %47, i32 0, i32 %92)
%94 = load i32, i32* @ABS_MAX
%95 = sext i32 %94 to i64
%96 = udiv i64 %95, 64
%97 = add i64 %96, 1
%98 = mul i64 %97, 8
%99 = trunc i64 %98 to i32
%100 = call i32 @memset(i64* %52, i32 0, i32 %99)
%101 = load i32, i32* @MSC_MAX
%102 = sext i32 %101 to i64
%103 = udiv i64 %102, 64
%104 = add i64 %103, 1
%105 = mul i64 %104, 8
%106 = trunc i64 %105 to i32
%107 = call i32 @memset(i64* %57, i32 0, i32 %106)
%108 = load i32, i32* @LED_MAX
%109 = sext i32 %108 to i64
%110 = udiv i64 %109, 64
%111 = add i64 %110, 1
%112 = mul i64 %111, 8
%113 = trunc i64 %112 to i32
%114 = call i32 @memset(i64* %62, i32 0, i32 %113)
%115 = load i32, i32* @SND_MAX
%116 = sext i32 %115 to i64
%117 = udiv i64 %116, 64
%118 = add i64 %117, 1
%119 = mul i64 %118, 8
%120 = trunc i64 %119 to i32
%121 = call i32 @memset(i64* %67, i32 0, i32 %120)
%122 = load i32, i32* @FF_MAX
%123 = sext i32 %122 to i64
%124 = udiv i64 %123, 64
%125 = add i64 %124, 1
%126 = mul i64 %125, 8
%127 = trunc i64 %126 to i32
%128 = call i32 @memset(i64* %72, i32 0, i32 %127)
%129 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %129, i8** %6
%130 = load i8*, i8** %6
%131 = icmp eq i8* %130, null
br i1 %131, label %132, label %133
132: ; preds = %2
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
133: ; preds = %2
%134 = load i8*, i8** %6
%135 = call i8* @strchr(i8* %134, i8 signext 47)
store i8* %135, i8** %7
%136 = load i8*, i8** %7
%137 = icmp eq i8* %136, null
br i1 %137, label %144, label %138
138: ; preds = %133
%139 = load i8*, i8** %7
%140 = getelementptr inbounds i8, i8* %139, i64 1
%141 = load i8, i8* %140
%142 = sext i8 %141 to i32
%143 = icmp eq i32 %142, 0
br i1 %143, label %144, label %145
144: ; preds = %138, %133
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
145: ; preds = %138
%146 = load i8*, i8** %6
%147 = call i32 @strtoul(i8* %146, i32* null, i32 16)
store i32 %147, i32* %9
%148 = load i8*, i8** %7
%149 = getelementptr inbounds i8, i8* %148, i64 1
%150 = call i32 @strtoul(i8* %149, i32* null, i32 16)
store i32 %150, i32* %10
%151 = load i8*, i8** %7
%152 = getelementptr inbounds i8, i8* %151, i64 1
%153 = call i8* @strchr(i8* %152, i8 signext 47)
store i8* %153, i8** %7
%154 = load i8*, i8** %7
%155 = icmp eq i8* %154, null
br i1 %155, label %162, label %156
156: ; preds = %145
%157 = load i8*, i8** %7
%158 = getelementptr inbounds i8, i8* %157, i64 1
%159 = load i8, i8* %158
%160 = sext i8 %159 to i32
%161 = icmp eq i32 %160, 0
br i1 %161, label %162, label %163
162: ; preds = %156, %145
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
163: ; preds = %156
%164 = load i8*, i8** %7
%165 = getelementptr inbounds i8, i8* %164, i64 1
%166 = call i32 @strtoul(i8* %165, i32* null, i32 16)
store i32 %166, i32* %11
%167 = load i8*, i8** %7
%168 = getelementptr inbounds i8, i8* %167, i64 1
%169 = call i8* @strchr(i8* %168, i8 signext 47)
store i8* %169, i8** %7
%170 = load i8*, i8** %7
%171 = icmp eq i8* %170, null
br i1 %171, label %178, label %172
172: ; preds = %163
%173 = load i8*, i8** %7
%174 = getelementptr inbounds i8, i8* %173, i64 1
%175 = load i8, i8* %174
%176 = sext i8 %175 to i32
%177 = icmp eq i32 %176, 0
br i1 %177, label %178, label %179
178: ; preds = %172, %163
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
179: ; preds = %172
%180 = load i8*, i8** %7
%181 = getelementptr inbounds i8, i8* %180, i64 1
%182 = call i32 @strtoul(i8* %181, i32* null, i32 16)
store i32 %182, i32* %12
%183 = call i8* @getenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i8* %183, i8** %8
%184 = load i8*, i8** %8
%185 = icmp eq i8* %184, null
br i1 %185, label %186, label %187
186: ; preds = %179
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
187: ; preds = %179
%188 = load i8*, i8** %8
%189 = load i32, i32* @EV_MAX
%190 = sext i32 %189 to i64
%191 = udiv i64 %190, 64
%192 = add i64 %191, 1
%193 = trunc i64 %192 to i32
%194 = call i32 @string_to_bitmap(i8* %188, i64* %37, i32 %193)
%195 = load i32, i32* @EV_MAX
%196 = call i8* @bitmap_to_bitstring(float 1.010000e+02, i64* %37, i32 0, i32 %195)
store i8* %196, i8** %13
%197 = load i32, i32* @EV_KEY
%198 = sext i32 %197 to i64
%199 = udiv i64 %198, 64
%200 = getelementptr inbounds i64, i64* %37, i64 %199
%201 = load i64, i64* %200
%202 = load i32, i32* @EV_KEY
%203 = sext i32 %202 to i64
%204 = urem i64 %203, 64
%205 = shl i64 1, %204
%206 = and i64 %201, %205
%207 = icmp ne i64 %206, 0
br i1 %207, label %208, label %221
208: ; preds = %187
%209 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
store i8* %209, i8** %8
%210 = load i8*, i8** %8
%211 = icmp eq i8* %210, null
br i1 %211, label %212, label %213
212: ; preds = %208
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
213: ; preds = %208
%214 = load i8*, i8** %8
%215 = load i32, i32* @KEY_MAX
%216 = sext i32 %215 to i64
%217 = udiv i64 %216, 64
%218 = add i64 %217, 1
%219 = trunc i64 %218 to i32
%220 = call i32 @string_to_bitmap(i8* %214, i64* %42, i32 %219)
br label %221
221: ; preds = %213, %187
%222 = load i32, i32* @KEY_MUTE
%223 = load i32, i32* @KEY_MAX
%224 = call i8* @bitmap_to_bitstring(float 1.070000e+02, i64* %42, i32 %222, i32 %223)
store i8* %224, i8** %14
%225 = load i32, i32* @EV_REL
%226 = sext i32 %225 to i64
%227 = udiv i64 %226, 64
%228 = getelementptr inbounds i64, i64* %37, i64 %227
%229 = load i64, i64* %228
%230 = load i32, i32* @EV_REL
%231 = sext i32 %230 to i64
%232 = urem i64 %231, 64
%233 = shl i64 1, %232
%234 = and i64 %229, %233
%235 = icmp ne i64 %234, 0
br i1 %235, label %236, label %249
236: ; preds = %221
%237 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
store i8* %237, i8** %8
%238 = load i8*, i8** %8
%239 = icmp eq i8* %238, null
br i1 %239, label %240, label %241
240: ; preds = %236
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
241: ; preds = %236
%242 = load i8*, i8** %8
%243 = load i32, i32* @REL_MAX
%244 = sext i32 %243 to i64
%245 = udiv i64 %244, 64
%246 = add i64 %245, 1
%247 = trunc i64 %246 to i32
%248 = call i32 @string_to_bitmap(i8* %242, i64* %47, i32 %247)
br label %249
249: ; preds = %241, %221
%250 = load i32, i32* @REL_MAX
%251 = call i8* @bitmap_to_bitstring(float 1.140000e+02, i64* %47, i32 0, i32 %250)
store i8* %251, i8** %15
%252 = load i32, i32* @EV_ABS
%253 = sext i32 %252 to i64
%254 = udiv i64 %253, 64
%255 = getelementptr inbounds i64, i64* %37, i64 %254
%256 = load i64, i64* %255
%257 = load i32, i32* @EV_ABS
%258 = sext i32 %257 to i64
%259 = urem i64 %258, 64
%260 = shl i64 1, %259
%261 = and i64 %256, %260
%262 = icmp ne i64 %261, 0
br i1 %262, label %263, label %276
263: ; preds = %249
%264 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
store i8* %264, i8** %8
%265 = load i8*, i8** %8
%266 = icmp eq i8* %265, null
br i1 %266, label %267, label %268
267: ; preds = %263
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
268: ; preds = %263
%269 = load i8*, i8** %8
%270 = load i32, i32* @ABS_MAX
%271 = sext i32 %270 to i64
%272 = udiv i64 %271, 64
%273 = add i64 %272, 1
%274 = trunc i64 %273 to i32
%275 = call i32 @string_to_bitmap(i8* %269, i64* %52, i32 %274)
br label %276
276: ; preds = %268, %249
%277 = load i32, i32* @ABS_MAX
%278 = call i8* @bitmap_to_bitstring(float 9.700000e+01, i64* %52, i32 0, i32 %277)
store i8* %278, i8** %16
%279 = load i32, i32* @EV_MSC
%280 = sext i32 %279 to i64
%281 = udiv i64 %280, 64
%282 = getelementptr inbounds i64, i64* %37, i64 %281
%283 = load i64, i64* %282
%284 = load i32, i32* @EV_MSC
%285 = sext i32 %284 to i64
%286 = urem i64 %285, 64
%287 = shl i64 1, %286
%288 = and i64 %283, %287
%289 = icmp ne i64 %288, 0
br i1 %289, label %290, label %303
290: ; preds = %276
%291 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
store i8* %291, i8** %8
%292 = load i8*, i8** %8
%293 = icmp eq i8* %292, null
br i1 %293, label %294, label %295
294: ; preds = %290
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
295: ; preds = %290
%296 = load i8*, i8** %8
%297 = load i32, i32* @MSC_MAX
%298 = sext i32 %297 to i64
%299 = udiv i64 %298, 64
%300 = add i64 %299, 1
%301 = trunc i64 %300 to i32
%302 = call i32 @string_to_bitmap(i8* %296, i64* %57, i32 %301)
br label %303
303: ; preds = %295, %276
%304 = load i32, i32* @MSC_MAX
%305 = call i8* @bitmap_to_bitstring(float 1.090000e+02, i64* %57, i32 0, i32 %304)
store i8* %305, i8** %18
%306 = load i32, i32* @EV_LED
%307 = sext i32 %306 to i64
%308 = udiv i64 %307, 64
%309 = getelementptr inbounds i64, i64* %37, i64 %308
%310 = load i64, i64* %309
%311 = load i32, i32* @EV_LED
%312 = sext i32 %311 to i64
%313 = urem i64 %312, 64
%314 = shl i64 1, %313
%315 = and i64 %310, %314
%316 = icmp ne i64 %315, 0
br i1 %316, label %317, label %330
317: ; preds = %303
%318 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
store i8* %318, i8** %8
%319 = load i8*, i8** %8
%320 = icmp eq i8* %319, null
br i1 %320, label %321, label %322
321: ; preds = %317
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
322: ; preds = %317
%323 = load i8*, i8** %8
%324 = load i32, i32* @LED_MAX
%325 = sext i32 %324 to i64
%326 = udiv i64 %325, 64
%327 = add i64 %326, 1
%328 = trunc i64 %327 to i32
%329 = call i32 @string_to_bitmap(i8* %323, i64* %62, i32 %328)
br label %330
330: ; preds = %322, %303
%331 = load i32, i32* @LED_MAX
%332 = call i8* @bitmap_to_bitstring(float 1.080000e+02, i64* %62, i32 0, i32 %331)
store i8* %332, i8** %19
%333 = load i32, i32* @EV_SND
%334 = sext i32 %333 to i64
%335 = udiv i64 %334, 64
%336 = getelementptr inbounds i64, i64* %37, i64 %335
%337 = load i64, i64* %336
%338 = load i32, i32* @EV_SND
%339 = sext i32 %338 to i64
%340 = urem i64 %339, 64
%341 = shl i64 1, %340
%342 = and i64 %337, %341
%343 = icmp ne i64 %342, 0
br i1 %343, label %344, label %357
344: ; preds = %330
%345 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
store i8* %345, i8** %8
%346 = load i8*, i8** %8
%347 = icmp eq i8* %346, null
br i1 %347, label %348, label %349
348: ; preds = %344
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
349: ; preds = %344
%350 = load i8*, i8** %8
%351 = load i32, i32* @SND_MAX
%352 = sext i32 %351 to i64
%353 = udiv i64 %352, 64
%354 = add i64 %353, 1
%355 = trunc i64 %354 to i32
%356 = call i32 @string_to_bitmap(i8* %350, i64* %67, i32 %355)
br label %357
357: ; preds = %349, %330
%358 = load i32, i32* @SND_MAX
%359 = call i8* @bitmap_to_bitstring(float 1.150000e+02, i64* %67, i32 0, i32 %358)
store i8* %359, i8** %20
%360 = load i32, i32* @EV_FF
%361 = sext i32 %360 to i64
%362 = udiv i64 %361, 64
%363 = getelementptr inbounds i64, i64* %37, i64 %362
%364 = load i64, i64* %363
%365 = load i32, i32* @EV_FF
%366 = sext i32 %365 to i64
%367 = urem i64 %366, 64
%368 = shl i64 1, %367
%369 = and i64 %364, %368
%370 = icmp ne i64 %369, 0
br i1 %370, label %371, label %384
371: ; preds = %357
%372 = call i8* @getenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i8* %372, i8** %8
%373 = load i8*, i8** %8
%374 = icmp eq i8* %373, null
br i1 %374, label %375, label %376
375: ; preds = %371
store i32 -1, i32* %3
store i32 1, i32* %31
br label %422
376: ; preds = %371
%377 = load i8*, i8** %8
%378 = load i32, i32* @FF_MAX
%379 = sext i32 %378 to i64
%380 = udiv i64 %379, 64
%381 = add i64 %380, 1
%382 = trunc i64 %381 to i32
%383 = call i32 @string_to_bitmap(i8* %377, i64* %72, i32 %382)
br label %384
384: ; preds = %376, %357
%385 = load i32, i32* @FF_MAX
%386 = call i8* @bitmap_to_bitstring(float 1.020000e+02, i64* %72, i32 0, i32 %385)
store i8* %386, i8** %21
%387 = call i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0))
store i8* %387, i8** %17
%388 = load i8*, i8** %4
%389 = load i32, i32* %5
%390 = load i32, i32* %9
%391 = load i32, i32* %10
%392 = load i32, i32* %11
%393 = load i32, i32* %12
%394 = load i8*, i8** %13
%395 = load i8*, i8** %14
%396 = load i8*, i8** %15
%397 = load i8*, i8** %16
%398 = load i8*, i8** %18
%399 = load i8*, i8** %19
%400 = load i8*, i8** %20
%401 = load i8*, i8** %21
%402 = load i8*, i8** %17
%403 = call i32 @snprintf(i8* %388, i32 %389, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0), i32 %390, i32 %391, i32 %392, i32 %393, i8* %394, i8* %395, i8* %396, i8* %397, i8* %398, i8* %399, i8* %400, i8* %401, i8* %402)
%404 = load i8*, i8** %13
%405 = call i32 @free(i8* %404)
%406 = load i8*, i8** %14
%407 = call i32 @free(i8* %406)
%408 = load i8*, i8** %15
%409 = call i32 @free(i8* %408)
%410 = load i8*, i8** %16
%411 = call i32 @free(i8* %410)
%412 = load i8*, i8** %18
%413 = call i32 @free(i8* %412)
%414 = load i8*, i8** %19
%415 = call i32 @free(i8* %414)
%416 = load i8*, i8** %20
%417 = call i32 @free(i8* %416)
%418 = load i8*, i8** %21
%419 = call i32 @free(i8* %418)
%420 = load i8*, i8** %17
%421 = call i32 @free(i8* %420)
store i32 0, i32* %3
store i32 1, i32* %31
br label %422
422: ; preds = %384, %375, %348, %321, %294, %267, %240, %212, %186, %178, %162, %144, %132
%423 = load i8*, i8** %22
%424 = load i32, i32* %3
ret i32 %424
}

LLVM IR (-O2):
@EV_MAX = global i32 0
@KEY_MAX = global i32 0
@REL_MAX = global i32 0
@ABS_MAX = global i32 0
@MSC_MAX = global i32 0
@LED_MAX = global i32 0
@SND_MAX = global i32 0
@FF_MAX = global i32 0
@.str = [8 x i8] c"PRODUCT\00"
@.str.1 = [3 x i8] c"EV\00"
@EV_KEY = global i32 0
@.str.2 = [4 x i8] c"KEY\00"
@KEY_MUTE = global i32 0
@EV_REL = global i32 0
@.str.3 = [4 x i8] c"REL\00"
@EV_ABS = global i32 0
@.str.4 = [4 x i8] c"ABS\00"
@EV_MSC = global i32 0
@.str.5 = [4 x i8] c"MSC\00"
@EV_LED = global i32 0
@.str.6 = [4 x i8] c"LED\00"
@EV_SND = global i32 0
@.str.7 = [4 x i8] c"SND\00"
@EV_FF = global i32 0
@.str.8 = [3 x i8] c"FF\00"
@.str.9 = [1 x i8] zeroinitializer
@.str.10 = [55 x i8] c"MODALIAS=input:b%04Xv%04Xp%04Xe%04X-%s%s%s%s%s%s%s%s%s\00"
define i32 @get_input_modalias(i8* %0, i32 %1) {
%3 = load i32, i32* @EV_MAX
%4 = sext i32 %3 to i64
%5 = lshr i64 %4, 6
%6 = add nuw nsw i64 %5, 1
%7 = alloca i64, i64 %6
%8 = load i32, i32* @KEY_MAX
%9 = sext i32 %8 to i64
%10 = lshr i64 %9, 6
%11 = add nuw nsw i64 %10, 1
%12 = alloca i64, i64 %11
%13 = load i32, i32* @REL_MAX
%14 = sext i32 %13 to i64
%15 = lshr i64 %14, 6
%16 = add nuw nsw i64 %15, 1
%17 = alloca i64, i64 %16
%18 = load i32, i32* @ABS_MAX
%19 = sext i32 %18 to i64
%20 = lshr i64 %19, 6
%21 = add nuw nsw i64 %20, 1
%22 = alloca i64, i64 %21
%23 = load i32, i32* @MSC_MAX
%24 = sext i32 %23 to i64
%25 = lshr i64 %24, 6
%26 = add nuw nsw i64 %25, 1
%27 = alloca i64, i64 %26
%28 = load i32, i32* @LED_MAX
%29 = sext i32 %28 to i64
%30 = lshr i64 %29, 6
%31 = add nuw nsw i64 %30, 1
%32 = alloca i64, i64 %31
%33 = load i32, i32* @SND_MAX
%34 = sext i32 %33 to i64
%35 = lshr i64 %34, 6
%36 = add nuw nsw i64 %35, 1
%37 = alloca i64, i64 %36
%38 = load i32, i32* @FF_MAX
%39 = sext i32 %38 to i64
%40 = lshr i64 %39, 6
%41 = add nuw nsw i64 %40, 1
%42 = alloca i64, i64 %41
%43 = ashr i32 %3, 3
%44 = add nsw i32 %43, 8
%45 = and i32 %44, -8
%46 = call i32 @memset(i64* %7, i32 0, i32 %45)
%47 = load i32, i32* @KEY_MAX
%48 = ashr i32 %47, 3
%49 = add nsw i32 %48, 8
%50 = and i32 %49, -8
%51 = call i32 @memset(i64* %12, i32 0, i32 %50)
%52 = load i32, i32* @REL_MAX
%53 = ashr i32 %52, 3
%54 = add nsw i32 %53, 8
%55 = and i32 %54, -8
%56 = call i32 @memset(i64* %17, i32 0, i32 %55)
%57 = load i32, i32* @ABS_MAX
%58 = ashr i32 %57, 3
%59 = add nsw i32 %58, 8
%60 = and i32 %59, -8
%61 = call i32 @memset(i64* %22, i32 0, i32 %60)
%62 = load i32, i32* @MSC_MAX
%63 = ashr i32 %62, 3
%64 = add nsw i32 %63, 8
%65 = and i32 %64, -8
%66 = call i32 @memset(i64* %27, i32 0, i32 %65)
%67 = load i32, i32* @LED_MAX
%68 = ashr i32 %67, 3
%69 = add nsw i32 %68, 8
%70 = and i32 %69, -8
%71 = call i32 @memset(i64* %32, i32 0, i32 %70)
%72 = load i32, i32* @SND_MAX
%73 = ashr i32 %72, 3
%74 = add nsw i32 %73, 8
%75 = and i32 %74, -8
%76 = call i32 @memset(i64* %37, i32 0, i32 %75)
%77 = load i32, i32* @FF_MAX
%78 = ashr i32 %77, 3
%79 = add nsw i32 %78, 8
%80 = and i32 %79, -8
%81 = call i32 @memset(i64* %42, i32 0, i32 %80)
%82 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%83 = icmp eq i8* %82, null
br i1 %83, label %271, label %84
84: ; preds = %2
%85 = call i8* @strchr(i8* %82, i8 signext 47)
%86 = icmp eq i8* %85, null
br i1 %86, label %271, label %87
87: ; preds = %84
%88 = getelementptr inbounds i8, i8* %85, i64 1
%89 = load i8, i8* %88
%90 = icmp eq i8 %89, 0
br i1 %90, label %271, label %91
91: ; preds = %87
%92 = call i32 @strtoul(i8* nocapture %82, i32* null, i32 16)
%93 = call i32 @strtoul(i8* nocapture %88, i32* null, i32 16)
%94 = call i8* @strchr(i8* %88, i8 signext 47)
%95 = icmp eq i8* %94, null
br i1 %95, label %271, label %96
96: ; preds = %91
%97 = getelementptr inbounds i8, i8* %94, i64 1
%98 = load i8, i8* %97
%99 = icmp eq i8 %98, 0
br i1 %99, label %271, label %100
100: ; preds = %96
%101 = call i32 @strtoul(i8* nocapture %97, i32* null, i32 16)
%102 = call i8* @strchr(i8* %97, i8 signext 47)
%103 = icmp eq i8* %102, null
br i1 %103, label %271, label %104
104: ; preds = %100
%105 = getelementptr inbounds i8, i8* %102, i64 1
%106 = load i8, i8* %105
%107 = icmp eq i8 %106, 0
br i1 %107, label %271, label %108
108: ; preds = %104
%109 = call i32 @strtoul(i8* nocapture %105, i32* null, i32 16)
%110 = call i8* @getenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%111 = icmp eq i8* %110, null
br i1 %111, label %271, label %112
112: ; preds = %108
%113 = load i32, i32* @EV_MAX
%114 = ashr i32 %113, 6
%115 = add nsw i32 %114, 1
%116 = call i32 @string_to_bitmap(i8* %110, i64* %7, i32 %115)
%117 = load i32, i32* @EV_MAX
%118 = call i8* @bitmap_to_bitstring(float 1.010000e+02, i64* %7, i32 0, i32 %117)
%119 = load i32, i32* @EV_KEY
%120 = sext i32 %119 to i64
%121 = lshr i64 %120, 6
%122 = getelementptr inbounds i64, i64* %7, i64 %121
%123 = load i64, i64* %122
%124 = and i64 %120, 63
%125 = shl nuw i64 1, %124
%126 = and i64 %125, %123
%127 = icmp eq i64 %126, 0
br i1 %127, label %136, label %128
128: ; preds = %112
%129 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%130 = icmp eq i8* %129, null
br i1 %130, label %271, label %131
131: ; preds = %128
%132 = load i32, i32* @KEY_MAX
%133 = ashr i32 %132, 6
%134 = add nsw i32 %133, 1
%135 = call i32 @string_to_bitmap(i8* %129, i64* %12, i32 %134)
br label %136
136: ; preds = %131, %112
%137 = load i32, i32* @KEY_MUTE
%138 = load i32, i32* @KEY_MAX
%139 = call i8* @bitmap_to_bitstring(float 1.070000e+02, i64* %12, i32 %137, i32 %138)
%140 = load i32, i32* @EV_REL
%141 = sext i32 %140 to i64
%142 = lshr i64 %141, 6
%143 = getelementptr inbounds i64, i64* %7, i64 %142
%144 = load i64, i64* %143
%145 = and i64 %141, 63
%146 = shl nuw i64 1, %145
%147 = and i64 %146, %144
%148 = icmp eq i64 %147, 0
br i1 %148, label %157, label %149
149: ; preds = %136
%150 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%151 = icmp eq i8* %150, null
br i1 %151, label %271, label %152
152: ; preds = %149
%153 = load i32, i32* @REL_MAX
%154 = ashr i32 %153, 6
%155 = add nsw i32 %154, 1
%156 = call i32 @string_to_bitmap(i8* %150, i64* %17, i32 %155)
br label %157
157: ; preds = %152, %136
%158 = load i32, i32* @REL_MAX
%159 = call i8* @bitmap_to_bitstring(float 1.140000e+02, i64* %17, i32 0, i32 %158)
%160 = load i32, i32* @EV_ABS
%161 = sext i32 %160 to i64
%162 = lshr i64 %161, 6
%163 = getelementptr inbounds i64, i64* %7, i64 %162
%164 = load i64, i64* %163
%165 = and i64 %161, 63
%166 = shl nuw i64 1, %165
%167 = and i64 %166, %164
%168 = icmp eq i64 %167, 0
br i1 %168, label %177, label %169
169: ; preds = %157
%170 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%171 = icmp eq i8* %170, null
br i1 %171, label %271, label %172
172: ; preds = %169
%173 = load i32, i32* @ABS_MAX
%174 = ashr i32 %173, 6
%175 = add nsw i32 %174, 1
%176 = call i32 @string_to_bitmap(i8* %170, i64* %22, i32 %175)
br label %177
177: ; preds = %172, %157
%178 = load i32, i32* @ABS_MAX
%179 = call i8* @bitmap_to_bitstring(float 9.700000e+01, i64* %22, i32 0, i32 %178)
%180 = load i32, i32* @EV_MSC
%181 = sext i32 %180 to i64
%182 = lshr i64 %181, 6
%183 = getelementptr inbounds i64, i64* %7, i64 %182
%184 = load i64, i64* %183
%185 = and i64 %181, 63
%186 = shl nuw i64 1, %185
%187 = and i64 %186, %184
%188 = icmp eq i64 %187, 0
br i1 %188, label %197, label %189
189: ; preds = %177
%190 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%191 = icmp eq i8* %190, null
br i1 %191, label %271, label %192
192: ; preds = %189
%193 = load i32, i32* @MSC_MAX
%194 = ashr i32 %193, 6
%195 = add nsw i32 %194, 1
%196 = call i32 @string_to_bitmap(i8* %190, i64* %27, i32 %195)
br label %197
197: ; preds = %192, %177
%198 = load i32, i32* @MSC_MAX
%199 = call i8* @bitmap_to_bitstring(float 1.090000e+02, i64* %27, i32 0, i32 %198)
%200 = load i32, i32* @EV_LED
%201 = sext i32 %200 to i64
%202 = lshr i64 %201, 6
%203 = getelementptr inbounds i64, i64* %7, i64 %202
%204 = load i64, i64* %203
%205 = and i64 %201, 63
%206 = shl nuw i64 1, %205
%207 = and i64 %206, %204
%208 = icmp eq i64 %207, 0
br i1 %208, label %217, label %209
209: ; preds = %197
%210 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%211 = icmp eq i8* %210, null
br i1 %211, label %271, label %212
212: ; preds = %209
%213 = load i32, i32* @LED_MAX
%214 = ashr i32 %213, 6
%215 = add nsw i32 %214, 1
%216 = call i32 @string_to_bitmap(i8* %210, i64* %32, i32 %215)
br label %217
217: ; preds = %212, %197
%218 = load i32, i32* @LED_MAX
%219 = call i8* @bitmap_to_bitstring(float 1.080000e+02, i64* %32, i32 0, i32 %218)
%220 = load i32, i32* @EV_SND
%221 = sext i32 %220 to i64
%222 = lshr i64 %221, 6
%223 = getelementptr inbounds i64, i64* %7, i64 %222
%224 = load i64, i64* %223
%225 = and i64 %221, 63
%226 = shl nuw i64 1, %225
%227 = and i64 %226, %224
%228 = icmp eq i64 %227, 0
br i1 %228, label %237, label %229
229: ; preds = %217
%230 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%231 = icmp eq i8* %230, null
br i1 %231, label %271, label %232
232: ; preds = %229
%233 = load i32, i32* @SND_MAX
%234 = ashr i32 %233, 6
%235 = add nsw i32 %234, 1
%236 = call i32 @string_to_bitmap(i8* %230, i64* %37, i32 %235)
br label %237
237: ; preds = %232, %217
%238 = load i32, i32* @SND_MAX
%239 = call i8* @bitmap_to_bitstring(float 1.150000e+02, i64* %37, i32 0, i32 %238)
%240 = load i32, i32* @EV_FF
%241 = sext i32 %240 to i64
%242 = lshr i64 %241, 6
%243 = getelementptr inbounds i64, i64* %7, i64 %242
%244 = load i64, i64* %243
%245 = and i64 %241, 63
%246 = shl nuw i64 1, %245
%247 = and i64 %246, %244
%248 = icmp eq i64 %247, 0
br i1 %248, label %257, label %249
249: ; preds = %237
%250 = call i8* @getenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%251 = icmp eq i8* %250, null
br i1 %251, label %271, label %252
252: ; preds = %249
%253 = load i32, i32* @FF_MAX
%254 = ashr i32 %253, 6
%255 = add nsw i32 %254, 1
%256 = call i32 @string_to_bitmap(i8* %250, i64* %42, i32 %255)
br label %257
257: ; preds = %252, %237
%258 = load i32, i32* @FF_MAX
%259 = call i8* @bitmap_to_bitstring(float 1.020000e+02, i64* %42, i32 0, i32 %258)
%260 = call dereferenceable_or_null(1) i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0))
%261 = call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0), i32 %92, i32 %93, i32 %101, i32 %109, i8* %118, i8* %139, i8* %159, i8* %179, i8* %199, i8* %219, i8* %239, i8* %259, i8* %260)
%262 = call i32 @free(i8* %118)
%263 = call i32 @free(i8* %139)
%264 = call i32 @free(i8* %159)
%265 = call i32 @free(i8* %179)
%266 = call i32 @free(i8* %199)
%267 = call i32 @free(i8* %219)
%268 = call i32 @free(i8* %239)
%269 = call i32 @free(i8* %259)
%270 = call i32 @free(i8* %260)
br label %271
271: ; preds = %249, %229, %209, %189, %169, %149, %128, %108, %100, %104, %91, %96, %84, %87, %2, %257
%272 = phi i32 [ 0, %257 ], [ -1, %2 ], [ -1, %87 ], [ -1, %84 ], [ -1, %96 ], [ -1, %91 ], [ -1, %104 ], [ -1, %100 ], [ -1, %108 ], [ -1, %128 ], [ -1, %149 ], [ -1, %169 ], [ -1, %189 ], [ -1, %209 ], [ -1, %229 ], [ -1, %249 ]
ret i32 %272
}