#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 timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
struct can_frame {
  int can_id;
  int can_dlc;
  int *data;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ memcpy(struct can_frame *, struct can_frame *, int);
int /*<<< orphan*/ memset(struct can_frame *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int read(int, struct can_frame *, int);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int /*<<< orphan*/ stderr;
int write(int, struct can_frame *, int);
int query_modules(int s, struct can_frame *modules) {
  int entries = 0;
  int have_rx = 1;
  int my_id, ret;
  fd_set rdfs;
  struct timeval tv;
  struct can_frame frame;
  memset(&frame, 0, sizeof(struct can_frame));
  frame.can_id = 0x7E7;
  frame.can_dlc = 3;
  frame.data[0] = 0x80;
  frame.data[1] = 0x00;
  frame.data[2] = 0x06;
  if (write(s, &frame, sizeof(struct can_frame)) != sizeof(struct can_frame)) {
    perror("write");
    exit(1);
  }
  while (have_rx) {
    have_rx = 0;
    FD_ZERO(&rdfs);
    FD_SET(s, &rdfs);
    tv.tv_sec = 1;
    tv.tv_usec = 0;
    ret = select(s + 1, &rdfs, NULL, NULL, &tv);
    if (ret < 0) {
      perror("select");
      exit(1);
    }
    if (FD_ISSET(s, &rdfs)) {
      have_rx = 1;
      ret = read(s, &frame, sizeof(struct can_frame));
      if (ret < 0) {
        perror("read");
        exit(1);
      }
      if ((frame.data[0] & 0xDF != 0xC6) || ((frame.data[1] & 0xF0) != 0x40) ||
          (frame.data[2] != 0x06) || (frame.can_dlc != 8)) {
        fprintf(stderr, "received wrong module query!\n");
        exit(1);
      }
      my_id = frame.data[1] & 0xF;
      if ((modules + my_id)->can_id) {
        fprintf(stderr, "received second module with ID %d!\n", my_id);
        exit(1);
      }
      memcpy(modules + my_id, &frame, sizeof(struct can_frame));
      entries++;
    }
  }
  return entries;
}


x86 assembly (clang, -O0):
<query_modules>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
movl   $0x7e7,-0x48(%rbp)
movl   $0x3,-0x44(%rbp)
mov    -0x40(%rbp),%rax
movl   $0x80,(%rax)
mov    -0x40(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x40(%rbp),%rax
movl   $0x6,0x8(%rax)
mov    -0x4(%rbp),%edi
lea    -0x48(%rbp),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
cltq
cmp    $0x10,%rax
je     123e <query_modules+0x8e>
lea    0xdd1(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
jmp    1243 <query_modules+0x93>
cmpl   $0x0,-0x18(%rbp)
je     13da <query_modules+0x22a>
movl   $0x0,-0x18(%rbp)
lea    -0x24(%rbp),%rdi
call   1090 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x24(%rbp),%rsi
call   10d0 <FD_SET@plt>
movl   $0x1,-0x38(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x38(%rbp),%r8
mov    %rcx,%rdx
call   10a0 <select@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    12b5 <query_modules+0x105>
lea    0xd60(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x4(%rbp),%edi
lea    -0x24(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     13d5 <query_modules+0x225>
movl   $0x1,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x48(%rbp),%rsi
mov    $0x10,%edx
call   1060 <read@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1306 <query_modules+0x156>
lea    0xd16(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x40(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1345 <query_modules+0x195>
mov    -0x40(%rbp),%rax
mov    0x4(%rax),%eax
and    $0xf0,%eax
cmp    $0x40,%eax
jne    1345 <query_modules+0x195>
mov    -0x40(%rbp),%rax
cmpl   $0x6,0x8(%rax)
jne    1345 <query_modules+0x195>
cmpl   $0x8,-0x44(%rbp)
je     1366 <query_modules+0x1b6>
mov    0x2c94(%rip),%rax
mov    (%rax),%edi
lea    0xcbd(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x40(%rbp),%rax
mov    0x4(%rax),%eax
and    $0xf,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
cmpl   $0x0,(%rax)
je     13af <query_modules+0x1ff>
mov    0x2c4e(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
lea    0xc92(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rdi
lea    -0x48(%rbp),%rsi
mov    $0x10,%edx
call   1080 <memcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1243 <query_modules+0x93>
mov    -0x14(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_modules>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
lea    0x8(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
movabs $0x3000007e7,%rax
mov    %rax,0x8(%rsp)
mov    0x10(%rsp),%rax
movq   $0x80,(%rax)
movl   $0x6,0x8(%rax)
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x10,%edx
call   1030 <write@plt>
cmp    $0x10,%eax
jne    13aa <query_modules+0x1fa>
lea    0x1(%rbx),%r15d
lea    0x4(%rsp),%r12
mov    %r12,%rdi
call   1090 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r12,%rsi
call   10d0 <FD_SET@plt>
movl   $0x1,0x18(%rsp)
movq   $0x0,0x20(%rsp)
xor    %ebp,%ebp
lea    0x18(%rsp),%r8
mov    %r15d,%edi
mov    %r12,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   10a0 <select@plt>
test   %eax,%eax
js     1338 <query_modules+0x188>
lea    0x4(%rsp),%r12
lea    0x8(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %r12,%rsi
call   1040 <FD_ISSET@plt>
test   %rax,%rax
je     1341 <query_modules+0x191>
mov    %ebx,%edi
mov    %r13,%rsi
mov    $0x10,%edx
call   1060 <read@plt>
test   %eax,%eax
js     1373 <query_modules+0x1c3>
mov    0x10(%rsp),%rax
testb  $0x1,(%rax)
jne    1352 <query_modules+0x1a2>
mov    0x4(%rax),%edx
mov    %edx,%ecx
and    $0xf0,%ecx
cmp    $0x40,%ecx
jne    1352 <query_modules+0x1a2>
cmpl   $0x6,0x8(%rax)
jne    1352 <query_modules+0x1a2>
cmpl   $0x8,0xc(%rsp)
jne    1352 <query_modules+0x1a2>
and    $0xf,%edx
mov    %rdx,%rdi
shl    $0x4,%rdi
cmpl   $0x0,(%r14,%rdi,1)
jne    1389 <query_modules+0x1d9>
add    %r14,%rdi
mov    %r13,%rsi
mov    $0x10,%edx
call   1080 <memcpy@plt>
add    $0x1,%ebp
mov    %r12,%rdi
call   1090 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r12,%rsi
call   10d0 <FD_SET@plt>
movl   $0x1,0x18(%rsp)
movq   $0x0,0x20(%rsp)
mov    %r15d,%edi
mov    %r12,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
lea    0x18(%rsp),%r8
call   10a0 <select@plt>
test   %eax,%eax
jns    1270 <query_modules+0xc0>
lea    0xcc7(%rip),%rdi
jmp    137a <query_modules+0x1ca>
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
lea    0xcb0(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    0xc93(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x2c50(%rip),%rax
mov    (%rax),%edi
lea    0xc97(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    0xc4f(%rip),%rdi
jmp    137a <query_modules+0x1ca>

LLVM IR (-O0):
%struct.can_frame = type { i32, i32, i32* }
%struct.timeval = type { i32, i64 }
@.str = [6 x i8] c"write\00"
@.str.1 = [7 x i8] c"select\00"
@.str.2 = [5 x i8] c"read\00"
@stderr = global i32 0
@.str.3 = [30 x i8] c"received wrong module query!\0A\00"
@.str.4 = [36 x i8] c"received second module with ID %d!\0A\00"
define i32 @query_modules(i32 %0, %struct.can_frame* %1) {
%3 = alloca i32
%4 = alloca %struct.can_frame*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.timeval
%11 = alloca %struct.can_frame
store i32 %0, i32* %3
store %struct.can_frame* %1, %struct.can_frame** %4
store i32 0, i32* %5
store i32 1, i32* %6
%12 = call i32 @memset(%struct.can_frame* %11, i32 0, i32 16)
%13 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %11, i32 0, i32 0
store i32 2023, i32* %13
%14 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %11, i32 0, i32 1
store i32 3, i32* %14
%15 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %11, i32 0, i32 2
%16 = load i32*, i32** %15
%17 = getelementptr inbounds i32, i32* %16, i64 0
store i32 128, i32* %17
%18 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %11, i32 0, i32 2
%19 = load i32*, i32** %18
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32 0, i32* %20
%21 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %11, i32 0, i32 2
%22 = load i32*, i32** %21
%23 = getelementptr inbounds i32, i32* %22, i64 2
store i32 6, i32* %23
%24 = load i32, i32* %3
%25 = call i32 @write(i32 %24, %struct.can_frame* %11, i32 16)
%26 = sext i32 %25 to i64
%27 = icmp ne i64 %26, 16
br i1 %27, label %28, label %31
28: ; preds = %2
%29 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %2
br label %32
32: ; preds = %115, %31
%33 = load i32, i32* %6
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %116
35: ; preds = %32
store i32 0, i32* %6
%36 = call i32 @FD_ZERO(i32* %9)
%37 = load i32, i32* %3
%38 = call i32 @FD_SET(i32 %37, i32* %9)
%39 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
store i32 1, i32* %39
%40 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 1
store i64 0, i64* %40
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
%43 = call i32 @select(i32 %42, i32* %9, i32* null, i32* null, %struct.timeval* %10)
store i32 %43, i32* %8
%44 = load i32, i32* %8
%45 = icmp slt i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %35
%47 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %35
%50 = load i32, i32* %3
%51 = call i64 @FD_ISSET(i32 %50, i32* %9)
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %115
53: ; preds = %49
store i32 1, i32* %6
%54 = load i32, i32* %3
%55 = call i32 @read(i32 %54, %struct.can_frame* %11, i32 16)
store i32 %55, i32* %8
%56 = load i32, i32* %8
%57 = icmp slt i32 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %53
%59 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %53
%62 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %11, i32 0, i32 2
%63 = load i32*, i32** %62
%64 = getelementptr inbounds i32, i32* %63, i64 0
%65 = load i32, i32* %64
%66 = and i32 %65, 1
%67 = icmp ne i32 %66, 0
br i1 %67, label %85, label %68
68: ; preds = %61
%69 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %11, i32 0, i32 2
%70 = load i32*, i32** %69
%71 = getelementptr inbounds i32, i32* %70, i64 1
%72 = load i32, i32* %71
%73 = and i32 %72, 240
%74 = icmp ne i32 %73, 64
br i1 %74, label %85, label %75
75: ; preds = %68
%76 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %11, i32 0, i32 2
%77 = load i32*, i32** %76
%78 = getelementptr inbounds i32, i32* %77, i64 2
%79 = load i32, i32* %78
%80 = icmp ne i32 %79, 6
br i1 %80, label %85, label %81
81: ; preds = %75
%82 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %11, i32 0, i32 1
%83 = load i32, i32* %82
%84 = icmp ne i32 %83, 8
br i1 %84, label %85, label %89
85: ; preds = %81, %75, %68, %61
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%88 = call i32 @exit(i32 1)
unreachable
89: ; preds = %81
%90 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %11, i32 0, i32 2
%91 = load i32*, i32** %90
%92 = getelementptr inbounds i32, i32* %91, i64 1
%93 = load i32, i32* %92
%94 = and i32 %93, 15
store i32 %94, i32* %7
%95 = load %struct.can_frame*, %struct.can_frame** %4
%96 = load i32, i32* %7
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %95, i64 %97
%99 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %98, i32 0, i32 0
%100 = load i32, i32* %99
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %107
102: ; preds = %89
%103 = load i32, i32* @stderr
%104 = load i32, i32* %7
%105 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %104)
%106 = call i32 @exit(i32 1)
unreachable
107: ; preds = %89
%108 = load %struct.can_frame*, %struct.can_frame** %4
%109 = load i32, i32* %7
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %108, i64 %110
%112 = call i32 @memcpy(%struct.can_frame* %111, %struct.can_frame* %11, i32 16)
%113 = load i32, i32* %5
%114 = add nsw i32 %113, 1
store i32 %114, i32* %5
br label %115
115: ; preds = %107, %49
br label %32
116: ; preds = %32
%117 = load i32, i32* %5
ret i32 %117
}

LLVM IR (-O2):
%struct.can_frame = type { i32, i32, i32* }
%struct.timeval = type { i32, i64 }
@.str = [6 x i8] c"write\00"
@.str.1 = [7 x i8] c"select\00"
@.str.2 = [5 x i8] c"read\00"
@stderr = global i32 0
@.str.3 = [30 x i8] c"received wrong module query!\0A\00"
@.str.4 = [36 x i8] c"received second module with ID %d!\0A\00"
define i32 @query_modules(i32 %0, %struct.can_frame* %1) {
%3 = alloca i32
%4 = alloca %struct.timeval
%5 = alloca %struct.can_frame
%6 = bitcast i32* %3 to i8*
%7 = bitcast %struct.timeval* %4 to i8*
%8 = bitcast %struct.can_frame* %5 to i8*
%9 = call i32 @memset(%struct.can_frame* %5, i32 0, i32 16)
%10 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i64 0, i32 0
store i32 2023, i32* %10
%11 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i64 0, i32 1
store i32 3, i32* %11
%12 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i64 0, i32 2
%13 = load i32*, i32** %12
store i32 128, i32* %13
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 0, i32* %14
%15 = getelementptr inbounds i32, i32* %13, i64 2
store i32 6, i32* %15
%16 = call i32 @write(i32 %0, %struct.can_frame* %5, i32 16)
%17 = icmp eq i32 %16, 16
br i1 %17, label %18, label %26
18: ; preds = %2
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
%21 = add nsw i32 %0, 1
%22 = call i32 @FD_ZERO(i32* %3)
%23 = call i32 @FD_SET(i32 %0, i32* %3)
store i32 1, i32* %19
store i64 0, i64* %20
%24 = call i32 @select(i32 %21, i32* %3, i32* null, i32* null, %struct.timeval* %4)
%25 = icmp slt i32 %24, 0
br i1 %25, label %29, label %32
26: ; preds = %2
%27 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %74, %18
%30 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %18, %74
%33 = phi i32 [ %76, %74 ], [ 0, %18 ]
%34 = call i64 @FD_ISSET(i32 %0, i32* %3)
%35 = icmp eq i64 %34, 0
br i1 %35, label %81, label %36
36: ; preds = %32
%37 = call i32 @read(i32 %0, %struct.can_frame* %5, i32 16)
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %36
%43 = load i32*, i32** %12
%44 = load i32, i32* %43
%45 = and i32 %44, 1
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %59
47: ; preds = %42
%48 = getelementptr inbounds i32, i32* %43, i64 1
%49 = load i32, i32* %48
%50 = and i32 %49, 240
%51 = icmp eq i32 %50, 64
br i1 %51, label %52, label %59
52: ; preds = %47
%53 = getelementptr inbounds i32, i32* %43, i64 2
%54 = load i32, i32* %53
%55 = icmp ne i32 %54, 6
%56 = load i32, i32* %11
%57 = icmp ne i32 %56, 8
%58 = select i1 %55, i1 true, i1 %57
br i1 %58, label %59, label %63
59: ; preds = %52, %47, %42
%60 = load i32, i32* @stderr
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %52
%64 = and i32 %49, 15
%65 = zext i32 %64 to i64
%66 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %1, i64 %65
%67 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %66, i64 0, i32 0
%68 = load i32, i32* %67
%69 = icmp eq i32 %68, 0
br i1 %69, label %74, label %70
70: ; preds = %63
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %64)
%73 = call i32 @exit(i32 1)
unreachable
74: ; preds = %63
%75 = call i32 @memcpy(%struct.can_frame* %66, %struct.can_frame* %5, i32 16)
%76 = add nuw nsw i32 %33, 1
%77 = call i32 @FD_ZERO(i32* %3)
%78 = call i32 @FD_SET(i32 %0, i32* %3)
store i32 1, i32* %19
store i64 0, i64* %20
%79 = call i32 @select(i32 %21, i32* %3, i32* null, i32* null, %struct.timeval* %4)
%80 = icmp slt i32 %79, 0
br i1 %80, label %29, label %32
81: ; preds = %32
ret i32 %33
}