#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 */
typedef size_t uint32_t;
typedef int /*<<< orphan*/ sockets;
typedef int int32_t;
typedef int /*<<< orphan*/ groups;
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int socket_ctrl(char const *const, char const *const, char const *const,
                size_t const);
int32_t pollin_2605_send(uint32_t igroup, uint32_t isocket, uint32_t idata) {
  const char *const groups[] = {
      "FFFFF", "0FFFF", "F0FFF", "00FFF", "FF0FF", "0F0FF", "F00FF", "000FF",
      "FFF0F", "0FF0F", "F0F0F", "00F0F", "FF00F", "0F00F", "F000F", "0000F",
      "FFFF0", "0FFF0", "F0FF0", "00FF0", "FF0F0", "0F0F0", "F00F0", "000F0",
      "FFF00", "0FF00", "F0F00", "00F00", "FF000", "0F000", "F0000", "00000"};
  const char *const sockets[] = {
      "FFFFF", "0FFFF", "F0FFF", "00FFF", "FF0FF", "0F0FF", "F00FF", "000FF",
      "FFF0F", "0FF0F", "F0F0F", "00F0F", "FF00F", "0F00F", "F000F", "0000F",
      "FFFF0", "0FFF0", "F0FF0", "00FF0", "FF0F0", "0F0F0", "F00F0", "000F0",
      "FFF00", "0FF00", "F0F00", "00F00", "FF000", "0F000", "F0000", "00000"};
  const char *const data[] = {"F0", "0F"};
  const uint32_t pulse_len = 350;
  size_t ngroups = (sizeof(groups) / sizeof((groups)[0]));
  size_t nsockets = (sizeof(sockets) / sizeof((sockets)[0]));
  size_t ndata = (sizeof(data) / sizeof((data)[0]));
  int32_t ret;
  if (igroup > (ngroups - 1)) {
    return -1;
  }
  if (isocket > (nsockets - 1)) {
    return -1;
  }
  if (idata > (ndata - 1)) {
    return -1;
  }
  ret = socket_ctrl(groups[igroup], sockets[isocket], data[idata], pulse_len);
  return ret;
}


x86 assembly (clang, -O0):
<pollin_2605_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x120(%rbp),%rdi
lea    0x2acb(%rip),%rsi
mov    $0x100,%edx
call   1040 <memcpy@plt>
lea    -0x220(%rbp),%rdi
lea    0x2bb3(%rip),%rsi
mov    $0x100,%edx
call   1040 <memcpy@plt>
mov    0x2ca2(%rip),%rax
mov    %rax,-0x230(%rbp)
mov    0x2c9c(%rip),%rax
mov    %rax,-0x228(%rbp)
movq   $0x15e,-0x238(%rbp)
movq   $0x20,-0x240(%rbp)
movq   $0x20,-0x248(%rbp)
movq   $0x2,-0x250(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x240(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jbe    11d3 <pollin_2605_send+0xb3>
movl   $0xffffffff,-0x4(%rbp)
jmp    1258 <pollin_2605_send+0x138>
mov    -0x18(%rbp),%rax
mov    -0x248(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jbe    11f7 <pollin_2605_send+0xd7>
movl   $0xffffffff,-0x4(%rbp)
jmp    1258 <pollin_2605_send+0x138>
mov    -0x20(%rbp),%rax
mov    -0x250(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jbe    121b <pollin_2605_send+0xfb>
movl   $0xffffffff,-0x4(%rbp)
jmp    1258 <pollin_2605_send+0x138>
mov    -0x10(%rbp),%rax
mov    -0x120(%rbp,%rax,8),%rdi
ff
mov    -0x18(%rbp),%rax
mov    -0x220(%rbp,%rax,8),%rsi
ff
mov    -0x20(%rbp),%rax
mov    -0x230(%rbp,%rax,8),%rdx
ff
mov    $0x15e,%ecx
call   1030 <socket_ctrl@plt>
mov    %eax,-0x254(%rbp)
mov    -0x254(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pollin_2605_send>:
mov    %rsi,%rax
or     %rdi,%rax
cmp    $0x1f,%rax
ja     1149 <pollin_2605_send+0x39>
cmp    $0x1,%rdx
ja     1149 <pollin_2605_send+0x39>
lea    0x2bf7(%rip),%rax
mov    (%rax,%rdi,8),%rdi
mov    (%rax,%rsi,8),%rsi
lea    0xf88(%rip),%rax
movslq (%rax,%rdx,4),%rdx
add    %rax,%rdx
mov    $0x15e,%ecx
jmp    1030 <socket_ctrl@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"FFFFF\00"
@.str.1 = [6 x i8] c"0FFFF\00"
@.str.2 = [6 x i8] c"F0FFF\00"
@.str.3 = [6 x i8] c"00FFF\00"
@.str.4 = [6 x i8] c"FF0FF\00"
@.str.5 = [6 x i8] c"0F0FF\00"
@.str.6 = [6 x i8] c"F00FF\00"
@.str.7 = [6 x i8] c"000FF\00"
@.str.8 = [6 x i8] c"FFF0F\00"
@.str.9 = [6 x i8] c"0FF0F\00"
@.str.10 = [6 x i8] c"F0F0F\00"
@.str.11 = [6 x i8] c"00F0F\00"
@.str.12 = [6 x i8] c"FF00F\00"
@.str.13 = [6 x i8] c"0F00F\00"
@.str.14 = [6 x i8] c"F000F\00"
@.str.15 = [6 x i8] c"0000F\00"
@.str.16 = [6 x i8] c"FFFF0\00"
@.str.17 = [6 x i8] c"0FFF0\00"
@.str.18 = [6 x i8] c"F0FF0\00"
@.str.19 = [6 x i8] c"00FF0\00"
@.str.20 = [6 x i8] c"FF0F0\00"
@.str.21 = [6 x i8] c"0F0F0\00"
@.str.22 = [6 x i8] c"F00F0\00"
@.str.23 = [6 x i8] c"000F0\00"
@.str.24 = [6 x i8] c"FFF00\00"
@.str.25 = [6 x i8] c"0FF00\00"
@.str.26 = [6 x i8] c"F0F00\00"
@.str.27 = [6 x i8] c"00F00\00"
@.str.28 = [6 x i8] c"FF000\00"
@.str.29 = [6 x i8] c"0F000\00"
@.str.30 = [6 x i8] c"F0000\00"
@.str.31 = [6 x i8] c"00000\00"
@__const.pollin_2605_send.groups = [32 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.31, i32 0, i32 0)]
@__const.pollin_2605_send.sockets = [32 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.31, i32 0, i32 0)]
@.str.32 = [3 x i8] c"F0\00"
@.str.33 = [3 x i8] c"0F\00"
@__const.pollin_2605_send.data = [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.33, i32 0, i32 0)]
define i32 @pollin_2605_send(i64 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca [32 x i8*]
%9 = alloca [32 x i8*]
%10 = alloca [2 x i8*]
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%16 = bitcast [32 x i8*]* %8 to i8*
%17 = bitcast [32 x i8*]* %9 to i8*
%18 = bitcast [2 x i8*]* %10 to i8*
store i64 350, i64* %11
store i64 32, i64* %12
store i64 32, i64* %13
store i64 2, i64* %14
%19 = load i64, i64* %5
%20 = load i64, i64* %12
%21 = sub i64 %20, 1
%22 = icmp ugt i64 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %3
store i32 -1, i32* %4
br label %48
24: ; preds = %3
%25 = load i64, i64* %6
%26 = load i64, i64* %13
%27 = sub i64 %26, 1
%28 = icmp ugt i64 %25, %27
br i1 %28, label %29, label %30
29: ; preds = %24
store i32 -1, i32* %4
br label %48
30: ; preds = %24
%31 = load i64, i64* %7
%32 = load i64, i64* %14
%33 = sub i64 %32, 1
%34 = icmp ugt i64 %31, %33
br i1 %34, label %35, label %36
35: ; preds = %30
store i32 -1, i32* %4
br label %48
36: ; preds = %30
%37 = load i64, i64* %5
%38 = getelementptr inbounds [32 x i8*], [32 x i8*]* %8, i64 0, i64 %37
%39 = load i8*, i8** %38
%40 = load i64, i64* %6
%41 = getelementptr inbounds [32 x i8*], [32 x i8*]* %9, i64 0, i64 %40
%42 = load i8*, i8** %41
%43 = load i64, i64* %7
%44 = getelementptr inbounds [2 x i8*], [2 x i8*]* %10, i64 0, i64 %43
%45 = load i8*, i8** %44
%46 = call i32 @socket_ctrl(i8* %39, i8* %42, i8* %45, i64 350)
store i32 %46, i32* %15
%47 = load i32, i32* %15
store i32 %47, i32* %4
br label %48
48: ; preds = %36, %35, %29, %23
%49 = load i32, i32* %4
ret i32 %49
}

LLVM IR (-O2):
@.str = [6 x i8] c"FFFFF\00"
@.str.1 = [6 x i8] c"0FFFF\00"
@.str.2 = [6 x i8] c"F0FFF\00"
@.str.3 = [6 x i8] c"00FFF\00"
@.str.4 = [6 x i8] c"FF0FF\00"
@.str.5 = [6 x i8] c"0F0FF\00"
@.str.6 = [6 x i8] c"F00FF\00"
@.str.7 = [6 x i8] c"000FF\00"
@.str.8 = [6 x i8] c"FFF0F\00"
@.str.9 = [6 x i8] c"0FF0F\00"
@.str.10 = [6 x i8] c"F0F0F\00"
@.str.11 = [6 x i8] c"00F0F\00"
@.str.12 = [6 x i8] c"FF00F\00"
@.str.13 = [6 x i8] c"0F00F\00"
@.str.14 = [6 x i8] c"F000F\00"
@.str.15 = [6 x i8] c"0000F\00"
@.str.16 = [6 x i8] c"FFFF0\00"
@.str.17 = [6 x i8] c"0FFF0\00"
@.str.18 = [6 x i8] c"F0FF0\00"
@.str.19 = [6 x i8] c"00FF0\00"
@.str.20 = [6 x i8] c"FF0F0\00"
@.str.21 = [6 x i8] c"0F0F0\00"
@.str.22 = [6 x i8] c"F00F0\00"
@.str.23 = [6 x i8] c"000F0\00"
@.str.24 = [6 x i8] c"FFF00\00"
@.str.25 = [6 x i8] c"0FF00\00"
@.str.26 = [6 x i8] c"F0F00\00"
@.str.27 = [6 x i8] c"00F00\00"
@.str.28 = [6 x i8] c"FF000\00"
@.str.29 = [6 x i8] c"0F000\00"
@.str.30 = [6 x i8] c"F0000\00"
@.str.31 = [6 x i8] c"00000\00"
@__const.pollin_2605_send.sockets = [32 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.31, i32 0, i32 0)]
@.str.32 = [3 x i8] c"F0\00"
@.str.33 = [3 x i8] c"0F\00"
@reltable.pollin_2605_send = [2 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.32 to i64), i64 ptrtoint ([2 x i32]* @reltable.pollin_2605_send to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.33 to i64), i64 ptrtoint ([2 x i32]* @reltable.pollin_2605_send to i64)) to i32)]
define i32 @pollin_2605_send(i64 %0, i64 %1, i64 %2) {
%4 = or i64 %1, %0
%5 = icmp ugt i64 %4, 31
%6 = icmp ugt i64 %2, 1
%7 = or i1 %5, %6
br i1 %7, label %16, label %8
8: ; preds = %3
%9 = getelementptr inbounds [32 x i8*], [32 x i8*]* @__const.pollin_2605_send.sockets, i64 0, i64 %0
%10 = load i8*, i8** %9
%11 = getelementptr inbounds [32 x i8*], [32 x i8*]* @__const.pollin_2605_send.sockets, i64 0, i64 %1
%12 = load i8*, i8** %11
%13 = shl i64 %2, 2
%14 = call i8* @llvm.load.relative.i64(i8* bitcast ([2 x i32]* @reltable.pollin_2605_send to i8*), i64 %13)
%15 = tail call i32 @socket_ctrl(i8* %10, i8* %12, i8* %14, i64 350)
br label %16
16: ; preds = %3, %8
%17 = phi i32 [ %15, %8 ], [ -1, %3 ]
ret i32 %17
}