#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 net_device {
  int dummy;
};
struct ethtool_pauseparam {
  scalar_t__ autoneg;
  int /*<<< orphan*/ rx_pause;
  int /*<<< orphan*/ tx_pause;
};
struct be_adapter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ be_cmd_get_flow_control(struct be_adapter *,
                                           int /*<<< orphan*/ *,
                                           int /*<<< orphan*/ *);
struct be_adapter *netdev_priv(struct net_device *);
void be_get_pauseparam(struct net_device *netdev,
                       struct ethtool_pauseparam *ecmd) {
  struct be_adapter *adapter = netdev_priv(netdev);
  be_cmd_get_flow_control(adapter, &ecmd->tx_pause, &ecmd->rx_pause);
  ecmd->autoneg = 0;
}


x86 assembly (clang, -O0):
<be_get_pauseparam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <netdev_priv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0xc,%rsi
mov    -0x10(%rbp),%rdx
add    $0x8,%rdx
call   1040 <be_cmd_get_flow_control@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_get_pauseparam>:
push   %rbx
mov    %rsi,%rbx
call   1030 <netdev_priv@plt>
lea    0xc(%rbx),%rsi
lea    0x8(%rbx),%rdx
mov    %rax,%rdi
call   1040 <be_cmd_get_flow_control@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.net_device = type { i32 }
%struct.ethtool_pauseparam = type { i64, i32, i32 }
%struct.be_adapter = type { i32 }
define void @be_get_pauseparam(%struct.net_device* %0, %struct.ethtool_pauseparam* %1) {
%3 = alloca %struct.net_device*
%4 = alloca %struct.ethtool_pauseparam*
%5 = alloca %struct.be_adapter*
store %struct.net_device* %0, %struct.net_device** %3
store %struct.ethtool_pauseparam* %1, %struct.ethtool_pauseparam** %4
%6 = load %struct.net_device*, %struct.net_device** %3
%7 = call %struct.be_adapter* @netdev_priv(%struct.net_device* %6)
store %struct.be_adapter* %7, %struct.be_adapter** %5
%8 = load %struct.be_adapter*, %struct.be_adapter** %5
%9 = load %struct.ethtool_pauseparam*, %struct.ethtool_pauseparam** %4
%10 = getelementptr inbounds %struct.ethtool_pauseparam, %struct.ethtool_pauseparam* %9, i32 0, i32 2
%11 = load %struct.ethtool_pauseparam*, %struct.ethtool_pauseparam** %4
%12 = getelementptr inbounds %struct.ethtool_pauseparam, %struct.ethtool_pauseparam* %11, i32 0, i32 1
%13 = call i32 @be_cmd_get_flow_control(%struct.be_adapter* %8, i32* %10, i32* %12)
%14 = load %struct.ethtool_pauseparam*, %struct.ethtool_pauseparam** %4
%15 = getelementptr inbounds %struct.ethtool_pauseparam, %struct.ethtool_pauseparam* %14, i32 0, i32 0
store i64 0, i64* %15
ret void
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
%struct.ethtool_pauseparam = type { i64, i32, i32 }
%struct.be_adapter = type { i32 }
define void @be_get_pauseparam(%struct.net_device* %0, %struct.ethtool_pauseparam* %1) {
%3 = tail call %struct.be_adapter* @netdev_priv(%struct.net_device* %0)
%4 = getelementptr inbounds %struct.ethtool_pauseparam, %struct.ethtool_pauseparam* %1, i64 0, i32 2
%5 = getelementptr inbounds %struct.ethtool_pauseparam, %struct.ethtool_pauseparam* %1, i64 0, i32 1
%6 = tail call i32 @be_cmd_get_flow_control(%struct.be_adapter* %3, i32* %4, i32* %5)
%7 = getelementptr inbounds %struct.ethtool_pauseparam, %struct.ethtool_pauseparam* %1, i64 0, i32 0
store i64 0, i64* %7
ret void
}