#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 sockaddr_can {
  int /*<<< orphan*/ can_ifindex;
  int /*<<< orphan*/ can_family;
};
struct sockaddr {
  int dummy;
};
struct ifreq {
  int /*<<< orphan*/ ifr_ifindex;
  int /*<<< orphan*/ ifr_name;
};
struct can_frame {
  int dummy;
};
typedef int /*<<< orphan*/ frame;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int /*<<< orphan*/ AF_CAN;
int /*<<< orphan*/ CAN_RAW;
int /*<<< orphan*/ CAN_RAW_FILTER;
int /*<<< orphan*/ PF_CAN;
int /*<<< orphan*/ SIOCGIFINDEX;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ SOL_CAN_RAW;
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ ioctl(int, int /*<<< orphan*/, struct ifreq *);
scalar_t__ parse_canframe(char *, struct can_frame *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/ *, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char *);
int write(int, struct can_frame *, int);
int main(int argc, char **argv) {
  int s;
  int nbytes;
  struct sockaddr_can addr;
  struct can_frame frame;
  struct ifreq ifr;
  if (argc != 3) {
    fprintf(stderr, "Usage: %s <device> <can_frame>.\n", argv[0]);
    return 1;
  }
  if (parse_canframe(argv[2], &frame)) {
    fprintf(stderr, "\nWrong CAN-frame format!\n\n");
    fprintf(stderr, "Try: <can_id>#{R|data}\n");
    fprintf(stderr, "can_id can have 3 (SFF) or 8 (EFF) hex chars\n");
    fprintf(stderr, "data has 0 to 8 hex-values that can (optionally)");
    fprintf(stderr, " be seperated by '.'\n\n");
    fprintf(stderr, "e.g. 5A1#11.2233.44556677.88 / 123#DEADBEEF / ");
    fprintf(stderr, "5AA# /\n     1F334455#1122334455667788 / 123#R ");
    fprintf(stderr, "for remote transmission request.\n\n");
    return 1;
  }
  if ((s = socket(PF_CAN, SOCK_RAW, CAN_RAW)) < 0) {
    perror("socket");
    return 1;
  }
  addr.can_family = AF_CAN;
  strcpy(ifr.ifr_name, argv[1]);
  if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) {
    perror("SIOCGIFINDEX");
    return 1;
  }
  addr.can_ifindex = ifr.ifr_ifindex;
  setsockopt(s, SOL_CAN_RAW, CAN_RAW_FILTER, NULL, 0);
  if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
    perror("bind");
    return 1;
  }
  if ((nbytes = write(s, &frame, sizeof(frame))) != sizeof(frame)) {
    perror("write");
    return 1;
  }
  close(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11ea <main+0x4a>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe29(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1401 <main+0x261>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x28(%rbp),%rsi
call   1090 <parse_canframe@plt>
cmp    $0x0,%rax
je     12c9 <main+0x129>
mov    0x2dbc(%rip),%rax
mov    (%rax),%edi
lea    0xe0c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
lea    0xe10(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
lea    0xe11(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
lea    0xe28(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
lea    0xe42(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d49(%rip),%rax
mov    (%rax),%edi
lea    0xe42(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d32(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d1b(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1401 <main+0x261>
mov    0x2ce8(%rip),%rax
mov    (%rax),%edi
mov    0x2d07(%rip),%rax
mov    (%rax),%esi
mov    0x2cce(%rip),%rax
mov    (%rax),%edx
call   10c0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    130d <main+0x16d>
lea    0xe4f(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1401 <main+0x261>
mov    0x2cdc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%edi
mov    0x2c6d(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdx
call   1060 <ioctl@plt>
cmp    $0x0,%rax
jge    1360 <main+0x1c0>
lea    0xe03(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1401 <main+0x261>
mov    -0x30(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2c68(%rip),%rax
mov    (%rax),%esi
mov    0x2c47(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1040 <setsockopt@plt>
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   10a0 <bind@plt>
cmp    $0x0,%rax
jge    13ba <main+0x21a>
lea    0xdb6(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1401 <main+0x261>
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x4,%edx
call   1050 <write@plt>
mov    %eax,-0x18(%rbp)
cltq
cmp    $0x4,%rax
je     13f2 <main+0x252>
lea    0xd83(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1401 <main+0x261>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    1250 <main+0xb0>
mov    0x10(%rbx),%rdi
mov    %rsp,%rsi
call   1090 <parse_canframe@plt>
test   %rax,%rax
je     1276 <main+0xd6>
mov    0x2dfa(%rip),%rbx
mov    (%rbx),%edi
lea    0xe4a(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe55(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe5d(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe7b(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe9c(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rbx),%edi
lea    0xea3(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec2(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee1(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    126a <main+0xca>
mov    0x2d71(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xd9d(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2d3b(%rip),%rax
mov    (%rax),%edi
mov    0x2d5a(%rip),%rax
mov    (%rax),%esi
mov    0x2d21(%rip),%rax
mov    (%rax),%edx
call   10c0 <socket@plt>
test   %eax,%eax
js     132e <main+0x18e>
mov    %eax,%ebp
mov    0x2d49(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    0x8(%rbx),%rsi
call   1030 <strcpy@plt>
mov    0x2ce3(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdx
mov    %ebp,%edi
call   1060 <ioctl@plt>
test   %rax,%rax
js     1337 <main+0x197>
mov    0x10(%rsp),%eax
mov    %eax,0x8(%rsp)
mov    0x2cf9(%rip),%rax
mov    (%rax),%esi
mov    0x2cd8(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <setsockopt@plt>
lea    0x8(%rsp),%rsi
mov    %ebp,%edi
mov    $0x8,%edx
call   10a0 <bind@plt>
test   %rax,%rax
js     1340 <main+0x1a0>
mov    %rsp,%rsi
mov    %ebp,%edi
mov    $0x4,%edx
call   1050 <write@plt>
cmp    $0x4,%eax
jne    1349 <main+0x1a9>
mov    %ebp,%edi
call   1070 <close@plt>
xor    %eax,%eax
jmp    126f <main+0xcf>
lea    0xe16(%rip),%rdi
jmp    1350 <main+0x1b0>
lea    0xe14(%rip),%rdi
jmp    1350 <main+0x1b0>
lea    0xe18(%rip),%rdi
jmp    1350 <main+0x1b0>
lea    0xe14(%rip),%rdi
call   10b0 <perror@plt>
jmp    126a <main+0xca>

LLVM IR (-O0):
%struct.sockaddr_can = type { i32, i32 }
%struct.can_frame = type { i32 }
%struct.ifreq = type { i32, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s <device> <can_frame>.\0A\00"
@.str.1 = [27 x i8] c"\0AWrong CAN-frame format!\0A\0A\00"
@.str.2 = [24 x i8] c"Try: <can_id>#{R|data}\0A\00"
@.str.3 = [46 x i8] c"can_id can have 3 (SFF) or 8 (EFF) hex chars\0A\00"
@.str.4 = [49 x i8] c"data has 0 to 8 hex-values that can (optionally)\00"
@.str.5 = [23 x i8] c" be seperated by '.'\0A\0A\00"
@.str.6 = [47 x i8] c"e.g. 5A1.2233.44556677.88 / 123#DEADBEEF / \00"
@.str.7 = [47 x i8] c"5AA# /\0A 1F334455 / 123#R \00"
@.str.8 = [35 x i8] c"for remote transmission request.\0A\0A\00"
@PF_CAN = global i32 0
@SOCK_RAW = global i32 0
@CAN_RAW = global i32 0
@.str.9 = [7 x i8] c"socket\00"
@AF_CAN = global i32 0
@SIOCGIFINDEX = global i32 0
@.str.10 = [13 x i8] c"SIOCGIFINDEX\00"
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
@.str.11 = [5 x i8] c"bind\00"
@.str.12 = [6 x i8] c"write\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.sockaddr_can
%9 = alloca %struct.can_frame
%10 = alloca %struct.ifreq
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 3
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 1, i32* %3
br label %89
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = call i64 @parse_canframe(i8* %22, %struct.can_frame* %9)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %42
25: ; preds = %19
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %3
br label %89
42: ; preds = %19
%43 = load i32, i32* @PF_CAN
%44 = load i32, i32* @SOCK_RAW
%45 = load i32, i32* @CAN_RAW
%46 = call i32 @socket(i32 %43, i32 %44, i32 %45)
store i32 %46, i32* %6
%47 = icmp slt i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %42
%49 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %3
br label %89
50: ; preds = %42
%51 = load i32, i32* @AF_CAN
%52 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %8, i32 0, i32 1
store i32 %51, i32* %52
%53 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %10, i32 0, i32 1
%54 = load i32, i32* %53
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 1
%57 = load i8*, i8** %56
%58 = call i32 @strcpy(i32 %54, i8* %57)
%59 = load i32, i32* %6
%60 = load i32, i32* @SIOCGIFINDEX
%61 = call i64 @ioctl(i32 %59, i32 %60, %struct.ifreq* %10)
%62 = icmp slt i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %50
%64 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %3
br label %89
65: ; preds = %50
%66 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %10, i32 0, i32 0
%67 = load i32, i32* %66
%68 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %8, i32 0, i32 0
store i32 %67, i32* %68
%69 = load i32, i32* %6
%70 = load i32, i32* @SOL_CAN_RAW
%71 = load i32, i32* @CAN_RAW_FILTER
%72 = call i32 @setsockopt(i32 %69, i32 %70, i32 %71, i32* null, i32 0)
%73 = load i32, i32* %6
%74 = bitcast %struct.sockaddr_can* %8 to %struct.sockaddr*
%75 = call i64 @bind(i32 %73, %struct.sockaddr* %74, i32 8)
%76 = icmp slt i64 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %65
%78 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
store i32 1, i32* %3
br label %89
79: ; preds = %65
%80 = load i32, i32* %6
%81 = call i32 @write(i32 %80, %struct.can_frame* %9, i32 4)
store i32 %81, i32* %7
%82 = sext i32 %81 to i64
%83 = icmp ne i64 %82, 4
br i1 %83, label %84, label %86
84: ; preds = %79
%85 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
store i32 1, i32* %3
br label %89
86: ; preds = %79
%87 = load i32, i32* %6
%88 = call i32 @close(i32 %87)
store i32 0, i32* %3
br label %89
89: ; preds = %86, %84, %77, %63, %48, %25, %13
%90 = load i32, i32* %3
ret i32 %90
}

LLVM IR (-O2):
%struct.sockaddr_can = type { i32, i32 }
%struct.can_frame = type { i32 }
%struct.ifreq = type { i32, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s <device> <can_frame>.\0A\00"
@.str.1 = [27 x i8] c"\0AWrong CAN-frame format!\0A\0A\00"
@.str.2 = [24 x i8] c"Try: <can_id>#{R|data}\0A\00"
@.str.3 = [46 x i8] c"can_id can have 3 (SFF) or 8 (EFF) hex chars\0A\00"
@.str.4 = [49 x i8] c"data has 0 to 8 hex-values that can (optionally)\00"
@.str.5 = [23 x i8] c" be seperated by '.'\0A\0A\00"
@.str.6 = [47 x i8] c"e.g. 5A1.2233.44556677.88 / 123#DEADBEEF / \00"
@.str.7 = [47 x i8] c"5AA# /\0A 1F334455 / 123#R \00"
@.str.8 = [35 x i8] c"for remote transmission request.\0A\0A\00"
@PF_CAN = global i32 0
@SOCK_RAW = global i32 0
@CAN_RAW = global i32 0
@.str.9 = [7 x i8] c"socket\00"
@AF_CAN = global i32 0
@SIOCGIFINDEX = global i32 0
@.str.10 = [13 x i8] c"SIOCGIFINDEX\00"
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
@.str.11 = [5 x i8] c"bind\00"
@.str.12 = [6 x i8] c"write\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_can
%4 = alloca %struct.can_frame
%5 = alloca %struct.ifreq
%6 = bitcast %struct.sockaddr_can* %3 to i8*
%7 = bitcast %struct.can_frame* %4 to i8*
%8 = bitcast %struct.ifreq* %5 to i8*
%9 = icmp eq i32 %0, 3
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %1
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %74
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = call i64 @parse_canframe(i8* %16, %struct.can_frame* %4)
%18 = icmp eq i64 %17, 0
br i1 %18, label %36, label %19
19: ; preds = %14
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0))
br label %74
36: ; preds = %14
%37 = load i32, i32* @PF_CAN
%38 = load i32, i32* @SOCK_RAW
%39 = load i32, i32* @CAN_RAW
%40 = call i32 @socket(i32 %37, i32 %38, i32 %39)
%41 = icmp slt i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %36
%43 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
br label %74
44: ; preds = %36
%45 = load i32, i32* @AF_CAN
%46 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %3, i64 0, i32 1
store i32 %45, i32* %46
%47 = getelementptr inbounds i8*, i8** %1, i64 1
%48 = load i8*, i8** %47
%49 = call i32 @strcpy(i32 undef, i8* %48)
%50 = load i32, i32* @SIOCGIFINDEX
%51 = call i64 @ioctl(i32 %40, i32 %50, %struct.ifreq* %5)
%52 = icmp slt i64 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %44
%54 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %74
55: ; preds = %44
%56 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %5, i64 0, i32 0
%57 = load i32, i32* %56
%58 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %3, i64 0, i32 0
store i32 %57, i32* %58
%59 = load i32, i32* @SOL_CAN_RAW
%60 = load i32, i32* @CAN_RAW_FILTER
%61 = call i32 @setsockopt(i32 %40, i32 %59, i32 %60, i32* null, i32 0)
%62 = bitcast %struct.sockaddr_can* %3 to %struct.sockaddr*
%63 = call i64 @bind(i32 %40, %struct.sockaddr* %62, i32 8)
%64 = icmp slt i64 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %55
%66 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
br label %74
67: ; preds = %55
%68 = call i32 @write(i32 %40, %struct.can_frame* %4, i32 4)
%69 = icmp eq i32 %68, 4
br i1 %69, label %72, label %70
70: ; preds = %67
%71 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
br label %74
72: ; preds = %67
%73 = call i32 @close(i32 %40)
br label %74
74: ; preds = %72, %70, %65, %53, %42, %19, %10
%75 = phi i32 [ 1, %10 ], [ 1, %19 ], [ 1, %42 ], [ 1, %53 ], [ 1, %65 ], [ 1, %70 ], [ 0, %72 ]
ret i32 %75
}