#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 ethtool_stats {
  int cmd;
  int n_stats;
  int len;
  unsigned int *data;
  int /*<<< orphan*/ string_set;
};
struct ethtool_gstrings {
  int cmd;
  int n_stats;
  int len;
  unsigned int *data;
  int /*<<< orphan*/ string_set;
};
struct ethtool_drvinfo {
  int cmd;
  int n_stats;
  int len;
  unsigned int *data;
  int /*<<< orphan*/ string_set;
};
typedef int /*<<< orphan*/ info;
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ ETH_SS_STATS;
scalar_t__ ethtool_ioctl(char const *, struct ethtool_stats *);
int /*<<< orphan*/ free(struct ethtool_stats *);
struct ethtool_stats *malloc(int);
int /*<<< orphan*/ memset(struct ethtool_stats *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcmp(char *, char *);
unsigned int ethtool_veth_peer(const char *ifname) {
  struct ethtool_drvinfo info;
  struct ethtool_gstrings *strs;
  struct ethtool_stats *stats;
  unsigned int i, res = 0;
  memset(&info, 0, sizeof(info));
  info.cmd = 0x00000003;
  if (ethtool_ioctl(ifname, &info))
    return 0;
  if (!info.n_stats)
    return 0;
  strs = malloc(sizeof(struct ethtool_gstrings) + info.n_stats * 32);
  if (!strs)
    return 0;
  memset(strs, 0, sizeof(struct ethtool_gstrings));
  strs->cmd = 0x0000001b;
  strs->string_set = ETH_SS_STATS;
  strs->len = info.n_stats;
  if (ethtool_ioctl(ifname, strs))
    goto fail_strs;
  if (strs->len != info.n_stats)
    goto fail_strs;
  stats = malloc(sizeof(struct ethtool_stats) + info.n_stats * sizeof(__u64));
  if (!stats)
    goto fail_strs;
  memset(stats, 0, sizeof(struct ethtool_stats));
  stats->cmd = 0x0000001d;
  stats->n_stats = info.n_stats;
  if (ethtool_ioctl(ifname, stats))
    goto fail_stats;
  if (stats->n_stats != info.n_stats)
    goto fail_stats;
  for (i = 0; i < info.n_stats; i++) {
    if (!strcmp((char *)strs->data + i * 32, "peer_ifindex")) {
      res = stats->data[i];
      break;
    }
  }
fail_stats:
  free(stats);
fail_strs:
  free(strs);
  return res;
}


x86 assembly (clang, -O0):
<ethtool_veth_peer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x48(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
movl   $0x3,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1070 <ethtool_ioctl@plt>
cmp    $0x0,%rax
je     119d <ethtool_veth_peer+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1343 <ethtool_veth_peer+0x1f3>
cmpl   $0x0,-0x2c(%rbp)
jne    11b3 <ethtool_veth_peer+0x63>
movl   $0x0,-0x4(%rbp)
jmp    1343 <ethtool_veth_peer+0x1f3>
mov    -0x2c(%rbp),%eax
shl    $0x5,%eax
cltq
add    $0x20,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    11e1 <ethtool_veth_peer+0x91>
movl   $0x0,-0x4(%rbp)
jmp    1343 <ethtool_veth_peer+0x1f3>
mov    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    -0x38(%rbp),%rax
movl   $0x1b,(%rax)
mov    0x2dde(%rip),%rax
mov    (%rax),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1070 <ethtool_ioctl@plt>
cmp    $0x0,%rax
je     1231 <ethtool_veth_peer+0xe1>
jmp    1334 <ethtool_veth_peer+0x1e4>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%eax
cmp    -0x2c(%rbp),%eax
je     1246 <ethtool_veth_peer+0xf6>
jmp    1334 <ethtool_veth_peer+0x1e4>
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    $0x20,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    126d <ethtool_veth_peer+0x11d>
jmp    1334 <ethtool_veth_peer+0x1e4>
mov    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    -0x40(%rbp),%rax
movl   $0x1d,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x40(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1070 <ethtool_ioctl@plt>
cmp    $0x0,%rax
je     12ad <ethtool_veth_peer+0x15d>
jmp    132b <ethtool_veth_peer+0x1db>
mov    -0x40(%rbp),%rax
mov    0x4(%rax),%eax
cmp    -0x2c(%rbp),%eax
je     12c2 <ethtool_veth_peer+0x172>
jmp    132b <ethtool_veth_peer+0x1db>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jae    1326 <ethtool_veth_peer+0x1d6>
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x44(%rbp),%eax
shl    $0x5,%eax
mov    %eax,%eax
add    %rax,%rdi
lea    0xd11(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1313 <ethtool_veth_peer+0x1c3>
mov    -0x40(%rbp),%rax
mov    0x10(%rax),%rax
mov    -0x44(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x48(%rbp)
jmp    1326 <ethtool_veth_peer+0x1d6>
jmp    1318 <ethtool_veth_peer+0x1c8>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12c9 <ethtool_veth_peer+0x179>
jmp    132b <ethtool_veth_peer+0x1db>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ethtool_veth_peer>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rbp
xor    %r12d,%r12d
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
movl   $0x3,0x8(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1070 <ethtool_ioctl@plt>
test   %rax,%rax
je     11a2 <ethtool_veth_peer+0x52>
mov    %r12d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0xc(%rsp),%edi
test   %edi,%edi
je     1190 <ethtool_veth_peer+0x40>
shl    $0x5,%edi
add    $0x20,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1190 <ethtool_veth_peer+0x40>
mov    %rax,%r15
xor    %r12d,%r12d
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
movl   $0x1b,(%r15)
mov    0x2e03(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x18(%r15)
mov    0xc(%rsp),%eax
mov    %eax,0x8(%r15)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <ethtool_ioctl@plt>
test   %rax,%rax
jne    1252 <ethtool_veth_peer+0x102>
mov    0x8(%r15),%eax
cmp    0xc(%rsp),%eax
jne    1252 <ethtool_veth_peer+0x102>
lea    0x20(,%rax,4),%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1252 <ethtool_veth_peer+0x102>
mov    %rax,%r14
xor    %r12d,%r12d
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
movl   $0x1d,(%r14)
mov    0xc(%rsp),%eax
mov    %eax,0x4(%r14)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <ethtool_ioctl@plt>
test   %rax,%rax
je     125f <ethtool_veth_peer+0x10f>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
jmp    1190 <ethtool_veth_peer+0x40>
mov    0x4(%r14),%r13d
mov    0xc(%rsp),%eax
cmp    %eax,%r13d
jne    124a <ethtool_veth_peer+0xfa>
test   %eax,%eax
je     124a <ethtool_veth_peer+0xfa>
mov    0x10(%r15),%rbx
xor    %ebp,%ebp
xor    %r12d,%r12d
mov    %ebp,%edi
and    $0xffffffe0,%edi
add    %rbx,%rdi
lea    0xd78(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12a3 <ethtool_veth_peer+0x153>
add    $0x1,%r12
add    $0x20,%rbp
cmp    %r12,%r13
jne    1279 <ethtool_veth_peer+0x129>
xor    %r12d,%r12d
jmp    124a <ethtool_veth_peer+0xfa>
mov    0x10(%r14),%rax
mov    %r12d,%ecx
mov    (%rax,%rcx,4),%r12d
jmp    124a <ethtool_veth_peer+0xfa>

LLVM IR (-O0):
%struct.ethtool_drvinfo = type { i32, i32, i32, i32*, i32 }
%struct.ethtool_gstrings = type { i32, i32, i32, i32*, i32 }
%struct.ethtool_stats = type { i32, i32, i32, i32*, i32 }
@ETH_SS_STATS = global i32 0
@.str = [13 x i8] c"peer_ifindex\00"
define i32 @ethtool_veth_peer(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.ethtool_drvinfo
%5 = alloca %struct.ethtool_gstrings*
%6 = alloca %struct.ethtool_stats*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %8
%9 = bitcast %struct.ethtool_drvinfo* %4 to %struct.ethtool_stats*
%10 = call i32 @memset(%struct.ethtool_stats* %9, i32 0, i32 32)
%11 = getelementptr inbounds %struct.ethtool_drvinfo, %struct.ethtool_drvinfo* %4, i32 0, i32 0
store i32 3, i32* %11
%12 = load i8*, i8** %3
%13 = bitcast %struct.ethtool_drvinfo* %4 to %struct.ethtool_stats*
%14 = call i64 @ethtool_ioctl(i8* %12, %struct.ethtool_stats* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %1
store i32 0, i32* %2
br label %132
17: ; preds = %1
%18 = getelementptr inbounds %struct.ethtool_drvinfo, %struct.ethtool_drvinfo* %4, i32 0, i32 1
%19 = load i32, i32* %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %17
store i32 0, i32* %2
br label %132
22: ; preds = %17
%23 = getelementptr inbounds %struct.ethtool_drvinfo, %struct.ethtool_drvinfo* %4, i32 0, i32 1
%24 = load i32, i32* %23
%25 = mul nsw i32 %24, 32
%26 = sext i32 %25 to i64
%27 = add i64 32, %26
%28 = trunc i64 %27 to i32
%29 = call %struct.ethtool_stats* @malloc(i32 %28)
%30 = bitcast %struct.ethtool_stats* %29 to %struct.ethtool_gstrings*
store %struct.ethtool_gstrings* %30, %struct.ethtool_gstrings** %5
%31 = load %struct.ethtool_gstrings*, %struct.ethtool_gstrings** %5
%32 = icmp ne %struct.ethtool_gstrings* %31, null
br i1 %32, label %34, label %33
33: ; preds = %22
store i32 0, i32* %2
br label %132
34: ; preds = %22
%35 = load %struct.ethtool_gstrings*, %struct.ethtool_gstrings** %5
%36 = bitcast %struct.ethtool_gstrings* %35 to %struct.ethtool_stats*
%37 = call i32 @memset(%struct.ethtool_stats* %36, i32 0, i32 32)
%38 = load %struct.ethtool_gstrings*, %struct.ethtool_gstrings** %5
%39 = getelementptr inbounds %struct.ethtool_gstrings, %struct.ethtool_gstrings* %38, i32 0, i32 0
store i32 27, i32* %39
%40 = load i32, i32* @ETH_SS_STATS
%41 = load %struct.ethtool_gstrings*, %struct.ethtool_gstrings** %5
%42 = getelementptr inbounds %struct.ethtool_gstrings, %struct.ethtool_gstrings* %41, i32 0, i32 4
store i32 %40, i32* %42
%43 = getelementptr inbounds %struct.ethtool_drvinfo, %struct.ethtool_drvinfo* %4, i32 0, i32 1
%44 = load i32, i32* %43
%45 = load %struct.ethtool_gstrings*, %struct.ethtool_gstrings** %5
%46 = getelementptr inbounds %struct.ethtool_gstrings, %struct.ethtool_gstrings* %45, i32 0, i32 2
store i32 %44, i32* %46
%47 = load i8*, i8** %3
%48 = load %struct.ethtool_gstrings*, %struct.ethtool_gstrings** %5
%49 = bitcast %struct.ethtool_gstrings* %48 to %struct.ethtool_stats*
%50 = call i64 @ethtool_ioctl(i8* %47, %struct.ethtool_stats* %49)
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %34
br label %127
53: ; preds = %34
%54 = load %struct.ethtool_gstrings*, %struct.ethtool_gstrings** %5
%55 = getelementptr inbounds %struct.ethtool_gstrings, %struct.ethtool_gstrings* %54, i32 0, i32 2
%56 = load i32, i32* %55
%57 = getelementptr inbounds %struct.ethtool_drvinfo, %struct.ethtool_drvinfo* %4, i32 0, i32 1
%58 = load i32, i32* %57
%59 = icmp ne i32 %56, %58
br i1 %59, label %60, label %61
60: ; preds = %53
br label %127
61: ; preds = %53
%62 = getelementptr inbounds %struct.ethtool_drvinfo, %struct.ethtool_drvinfo* %4, i32 0, i32 1
%63 = load i32, i32* %62
%64 = sext i32 %63 to i64
%65 = mul i64 %64, 4
%66 = add i64 32, %65
%67 = trunc i64 %66 to i32
%68 = call %struct.ethtool_stats* @malloc(i32 %67)
store %struct.ethtool_stats* %68, %struct.ethtool_stats** %6
%69 = load %struct.ethtool_stats*, %struct.ethtool_stats** %6
%70 = icmp ne %struct.ethtool_stats* %69, null
br i1 %70, label %72, label %71
71: ; preds = %61
br label %127
72: ; preds = %61
%73 = load %struct.ethtool_stats*, %struct.ethtool_stats** %6
%74 = call i32 @memset(%struct.ethtool_stats* %73, i32 0, i32 32)
%75 = load %struct.ethtool_stats*, %struct.ethtool_stats** %6
%76 = getelementptr inbounds %struct.ethtool_stats, %struct.ethtool_stats* %75, i32 0, i32 0
store i32 29, i32* %76
%77 = getelementptr inbounds %struct.ethtool_drvinfo, %struct.ethtool_drvinfo* %4, i32 0, i32 1
%78 = load i32, i32* %77
%79 = load %struct.ethtool_stats*, %struct.ethtool_stats** %6
%80 = getelementptr inbounds %struct.ethtool_stats, %struct.ethtool_stats* %79, i32 0, i32 1
store i32 %78, i32* %80
%81 = load i8*, i8** %3
%82 = load %struct.ethtool_stats*, %struct.ethtool_stats** %6
%83 = call i64 @ethtool_ioctl(i8* %81, %struct.ethtool_stats* %82)
%84 = icmp ne i64 %83, 0
br i1 %84, label %85, label %86
85: ; preds = %72
br label %124
86: ; preds = %72
%87 = load %struct.ethtool_stats*, %struct.ethtool_stats** %6
%88 = getelementptr inbounds %struct.ethtool_stats, %struct.ethtool_stats* %87, i32 0, i32 1
%89 = load i32, i32* %88
%90 = getelementptr inbounds %struct.ethtool_drvinfo, %struct.ethtool_drvinfo* %4, i32 0, i32 1
%91 = load i32, i32* %90
%92 = icmp ne i32 %89, %91
br i1 %92, label %93, label %94
93: ; preds = %86
br label %124
94: ; preds = %86
store i32 0, i32* %7
br label %95
95: ; preds = %120, %94
%96 = load i32, i32* %7
%97 = getelementptr inbounds %struct.ethtool_drvinfo, %struct.ethtool_drvinfo* %4, i32 0, i32 1
%98 = load i32, i32* %97
%99 = icmp ult i32 %96, %98
br i1 %99, label %100, label %123
100: ; preds = %95
%101 = load %struct.ethtool_gstrings*, %struct.ethtool_gstrings** %5
%102 = getelementptr inbounds %struct.ethtool_gstrings, %struct.ethtool_gstrings* %101, i32 0, i32 3
%103 = load i32*, i32** %102
%104 = bitcast i32* %103 to i8*
%105 = load i32, i32* %7
%106 = mul i32 %105, 32
%107 = zext i32 %106 to i64
%108 = getelementptr inbounds i8, i8* %104, i64 %107
%109 = call i32 @strcmp(i8* %108, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%110 = icmp ne i32 %109, 0
br i1 %110, label %119, label %111
111: ; preds = %100
%112 = load %struct.ethtool_stats*, %struct.ethtool_stats** %6
%113 = getelementptr inbounds %struct.ethtool_stats, %struct.ethtool_stats* %112, i32 0, i32 3
%114 = load i32*, i32** %113
%115 = load i32, i32* %7
%116 = zext i32 %115 to i64
%117 = getelementptr inbounds i32, i32* %114, i64 %116
%118 = load i32, i32* %117
store i32 %118, i32* %8
br label %123
119: ; preds = %100
br label %120
120: ; preds = %119
%121 = load i32, i32* %7
%122 = add i32 %121, 1
store i32 %122, i32* %7
br label %95
123: ; preds = %111, %95
br label %124
124: ; preds = %123, %93, %85
%125 = load %struct.ethtool_stats*, %struct.ethtool_stats** %6
%126 = call i32 @free(%struct.ethtool_stats* %125)
br label %127
127: ; preds = %124, %71, %60, %52
%128 = load %struct.ethtool_gstrings*, %struct.ethtool_gstrings** %5
%129 = bitcast %struct.ethtool_gstrings* %128 to %struct.ethtool_stats*
%130 = call i32 @free(%struct.ethtool_stats* %129)
%131 = load i32, i32* %8
store i32 %131, i32* %2
br label %132
132: ; preds = %127, %33, %21, %16
%133 = load i32, i32* %2
ret i32 %133
}

LLVM IR (-O2):
%struct.ethtool_drvinfo = type { i32, i32, i32, i32*, i32 }
%struct.ethtool_stats = type { i32, i32, i32, i32*, i32 }
@ETH_SS_STATS = global i32 0
@.str = [13 x i8] c"peer_ifindex\00"
define i32 @ethtool_veth_peer(i8* %0) {
%2 = alloca %struct.ethtool_drvinfo
%3 = bitcast %struct.ethtool_drvinfo* %2 to i8*
%4 = bitcast %struct.ethtool_drvinfo* %2 to %struct.ethtool_stats*
%5 = call i32 @memset(%struct.ethtool_stats* %4, i32 0, i32 32)
%6 = getelementptr inbounds %struct.ethtool_drvinfo, %struct.ethtool_drvinfo* %2, i64 0, i32 0
store i32 3, i32* %6
%7 = call i64 @ethtool_ioctl(i8* %0, %struct.ethtool_stats* %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %76
9: ; preds = %1
%10 = getelementptr inbounds %struct.ethtool_drvinfo, %struct.ethtool_drvinfo* %2, i64 0, i32 1
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %76, label %13
13: ; preds = %9
%14 = shl nsw i32 %11, 5
%15 = add i32 %14, 32
%16 = call %struct.ethtool_stats* @malloc(i32 %15)
%17 = icmp eq %struct.ethtool_stats* %16, null
br i1 %17, label %76, label %18
18: ; preds = %13
%19 = call i32 @memset(%struct.ethtool_stats* %16, i32 0, i32 32)
%20 = getelementptr %struct.ethtool_stats, %struct.ethtool_stats* %16, i64 0, i32 0
store i32 27, i32* %20
%21 = load i32, i32* @ETH_SS_STATS
%22 = getelementptr inbounds %struct.ethtool_stats, %struct.ethtool_stats* %16, i64 0, i32 4
store i32 %21, i32* %22
%23 = load i32, i32* %10
%24 = getelementptr inbounds %struct.ethtool_stats, %struct.ethtool_stats* %16, i64 0, i32 2
store i32 %23, i32* %24
%25 = call i64 @ethtool_ioctl(i8* %0, %struct.ethtool_stats* %16)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %73
27: ; preds = %18
%28 = load i32, i32* %24
%29 = load i32, i32* %10
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %73
31: ; preds = %27
%32 = shl i32 %28, 2
%33 = add i32 %32, 32
%34 = call %struct.ethtool_stats* @malloc(i32 %33)
%35 = icmp eq %struct.ethtool_stats* %34, null
br i1 %35, label %73, label %36
36: ; preds = %31
%37 = call i32 @memset(%struct.ethtool_stats* %34, i32 0, i32 32)
%38 = getelementptr inbounds %struct.ethtool_stats, %struct.ethtool_stats* %34, i64 0, i32 0
store i32 29, i32* %38
%39 = load i32, i32* %10
%40 = getelementptr inbounds %struct.ethtool_stats, %struct.ethtool_stats* %34, i64 0, i32 1
store i32 %39, i32* %40
%41 = call i64 @ethtool_ioctl(i8* %0, %struct.ethtool_stats* %34)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %70
43: ; preds = %36
%44 = load i32, i32* %40
%45 = load i32, i32* %10
%46 = icmp eq i32 %44, %45
%47 = icmp ne i32 %45, 0
%48 = and i1 %46, %47
br i1 %48, label %49, label %70
49: ; preds = %43
%50 = getelementptr inbounds %struct.ethtool_stats, %struct.ethtool_stats* %16, i64 0, i32 3
%51 = bitcast i32** %50 to i8**
%52 = load i8*, i8** %51
%53 = zext i32 %44 to i64
br label %54
54: ; preds = %49, %67
%55 = phi i64 [ 0, %49 ], [ %68, %67 ]
%56 = shl i64 %55, 5
%57 = and i64 %56, 4294967264
%58 = getelementptr inbounds i8, i8* %52, i64 %57
%59 = call i32 @strcmp(i8* dereferenceable(1) %58, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %67
61: ; preds = %54
%62 = getelementptr inbounds %struct.ethtool_stats, %struct.ethtool_stats* %34, i64 0, i32 3
%63 = load i32*, i32** %62
%64 = and i64 %55, 4294967295
%65 = getelementptr inbounds i32, i32* %63, i64 %64
%66 = load i32, i32* %65
br label %70
67: ; preds = %54
%68 = add nuw nsw i64 %55, 1
%69 = icmp eq i64 %68, %53
br i1 %69, label %70, label %54
70: ; preds = %67, %61, %43, %36
%71 = phi i32 [ 0, %36 ], [ 0, %43 ], [ %66, %61 ], [ 0, %67 ]
%72 = call i32 @free(%struct.ethtool_stats* %34)
br label %73
73: ; preds = %31, %27, %18, %70
%74 = phi i32 [ 0, %18 ], [ 0, %27 ], [ %71, %70 ], [ 0, %31 ]
%75 = call i32 @free(%struct.ethtool_stats* %16)
br label %76
76: ; preds = %13, %9, %1, %73
%77 = phi i32 [ %74, %73 ], [ 0, %1 ], [ 0, %9 ], [ 0, %13 ]
ret i32 %77
}