#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;
};

/* Variables and functions */
int /*<<< orphan*/ netdev_get_tx_queue(struct net_device *, int);
scalar_t__ netif_tx_queue_stopped(int /*<<< orphan*/);
int rtw_netif_queue_stopped(struct net_device *ndev) {
  return (netif_tx_queue_stopped(netdev_get_tx_queue(ndev, 0)) &&
          netif_tx_queue_stopped(netdev_get_tx_queue(ndev, 1)) &&
          netif_tx_queue_stopped(netdev_get_tx_queue(ndev, 2)) &&
          netif_tx_queue_stopped(netdev_get_tx_queue(ndev, 3)));
}


x86 assembly (clang, -O0):
<rtw_netif_queue_stopped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <netdev_get_tx_queue@plt>
mov    %eax,%edi
call   1040 <netif_tx_queue_stopped@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     11bd <rtw_netif_queue_stopped+0x9d>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <netdev_get_tx_queue@plt>
mov    %eax,%edi
call   1040 <netif_tx_queue_stopped@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     11bd <rtw_netif_queue_stopped+0x9d>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <netdev_get_tx_queue@plt>
mov    %eax,%edi
call   1040 <netif_tx_queue_stopped@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     11bd <rtw_netif_queue_stopped+0x9d>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1030 <netdev_get_tx_queue@plt>
mov    %eax,%edi
call   1040 <netif_tx_queue_stopped@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtw_netif_queue_stopped>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %esi,%esi
call   1030 <netdev_get_tx_queue@plt>
mov    %eax,%edi
call   1040 <netif_tx_queue_stopped@plt>
test   %rax,%rax
je     118a <rtw_netif_queue_stopped+0x6a>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <netdev_get_tx_queue@plt>
mov    %eax,%edi
call   1040 <netif_tx_queue_stopped@plt>
test   %rax,%rax
je     118a <rtw_netif_queue_stopped+0x6a>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <netdev_get_tx_queue@plt>
mov    %eax,%edi
call   1040 <netif_tx_queue_stopped@plt>
test   %rax,%rax
je     118a <rtw_netif_queue_stopped+0x6a>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <netdev_get_tx_queue@plt>
mov    %eax,%edi
call   1040 <netif_tx_queue_stopped@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.net_device = type { i32 }
define i32 @rtw_netif_queue_stopped(%struct.net_device* %0) {
%2 = alloca %struct.net_device*
store %struct.net_device* %0, %struct.net_device** %2
%3 = load %struct.net_device*, %struct.net_device** %2
%4 = call i32 @netdev_get_tx_queue(%struct.net_device* %3, i32 0)
%5 = call i64 @netif_tx_queue_stopped(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %1
%8 = load %struct.net_device*, %struct.net_device** %2
%9 = call i32 @netdev_get_tx_queue(%struct.net_device* %8, i32 1)
%10 = call i64 @netif_tx_queue_stopped(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %7
%13 = load %struct.net_device*, %struct.net_device** %2
%14 = call i32 @netdev_get_tx_queue(%struct.net_device* %13, i32 2)
%15 = call i64 @netif_tx_queue_stopped(i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %12
%18 = load %struct.net_device*, %struct.net_device** %2
%19 = call i32 @netdev_get_tx_queue(%struct.net_device* %18, i32 3)
%20 = call i64 @netif_tx_queue_stopped(i32 %19)
%21 = icmp ne i64 %20, 0
br label %22
22: ; preds = %17, %12, %7, %1
%23 = phi i1 [ false, %12 ], [ false, %7 ], [ false, %1 ], [ %21, %17 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
define i32 @rtw_netif_queue_stopped(%struct.net_device* %0) {
%2 = tail call i32 @netdev_get_tx_queue(%struct.net_device* %0, i32 0)
%3 = tail call i64 @netif_tx_queue_stopped(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %1
%6 = tail call i32 @netdev_get_tx_queue(%struct.net_device* %0, i32 1)
%7 = tail call i64 @netif_tx_queue_stopped(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %18, label %9
9: ; preds = %5
%10 = tail call i32 @netdev_get_tx_queue(%struct.net_device* %0, i32 2)
%11 = tail call i64 @netif_tx_queue_stopped(i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %9
%14 = tail call i32 @netdev_get_tx_queue(%struct.net_device* %0, i32 3)
%15 = tail call i64 @netif_tx_queue_stopped(i32 %14)
%16 = icmp ne i64 %15, 0
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %13, %9, %5, %1
%19 = phi i32 [ 0, %9 ], [ 0, %5 ], [ 0, %1 ], [ %17, %13 ]
ret i32 %19
}