#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 int /*<<< orphan*/ uint8_t;
struct can_filter {
  int can_mask;
  int /*<<< orphan*/ can_id;
};
typedef int /*<<< orphan*/ rfilter;

/* Variables and functions */
int /*<<< orphan*/ CAN_RAW_FILTER;
int /*<<< orphan*/ SOL_CAN_RAW;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              struct can_filter **, int);
int can_filter_node_set(int sock, uint8_t node) {
  struct can_filter rfilter[1];
  rfilter[0].can_id = node;
  rfilter[0].can_mask = 0x00;
  setsockopt(sock, SOL_CAN_RAW, CAN_RAW_FILTER, &rfilter, sizeof(rfilter));
  return 0;
}


x86 assembly (clang, -O0):
<can_filter_node_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
mov    $0x8,%r8d
call   1030 <setsockopt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_filter_node_set>:
push   %rax
mov    %esi,0x4(%rsp)
movl   $0x0,(%rsp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
mov    $0x8,%r8d
call   1030 <setsockopt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.can_filter = type { i32, i32 }
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
define i32 @can_filter_node_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1 x %struct.can_filter]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds [1 x %struct.can_filter], [1 x %struct.can_filter]* %5, i64 0, i64 0
%8 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %7, i32 0, i32 1
store i32 %6, i32* %8
%9 = getelementptr inbounds [1 x %struct.can_filter], [1 x %struct.can_filter]* %5, i64 0, i64 0
%10 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %9, i32 0, i32 0
store i32 0, i32* %10
%11 = load i32, i32* %3
%12 = load i32, i32* @SOL_CAN_RAW
%13 = load i32, i32* @CAN_RAW_FILTER
%14 = bitcast [1 x %struct.can_filter]* %5 to %struct.can_filter**
%15 = call i32 @setsockopt(i32 %11, i32 %12, i32 %13, %struct.can_filter** %14, i32 8)
ret i32 0
}

LLVM IR (-O2):
%struct.can_filter = type { i32, i32 }
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
define i32 @can_filter_node_set(i32 %0, i32 %1) {
%3 = alloca %struct.can_filter*
%4 = bitcast %struct.can_filter** %3 to [1 x %struct.can_filter]*
%5 = bitcast %struct.can_filter** %3 to i8*
%6 = getelementptr inbounds [1 x %struct.can_filter], [1 x %struct.can_filter]* %4, i64 0, i64 0, i32 1
store i32 %1, i32* %6
%7 = bitcast %struct.can_filter** %3 to i32*
store i32 0, i32* %7
%8 = load i32, i32* @SOL_CAN_RAW
%9 = load i32, i32* @CAN_RAW_FILTER
%10 = call i32 @setsockopt(i32 %0, i32 %8, i32 %9, %struct.can_filter** %3, i32 8)
ret i32 0
}