#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 */

/* Variables and functions */
int run_test_extra_modes(int, int, int, int, int);
int run_test_speed_modes(int wpconfig_flags, int test_flags, int bits,
                         int num_chans, int num_seconds) {
  int res;
  if (!(test_flags & 0x800)) {
    res = run_test_extra_modes(wpconfig_flags | 0x200, test_flags, bits,
                               num_chans, num_seconds);
    if (res)
      return res;
  }
  res = run_test_extra_modes(wpconfig_flags, test_flags, bits, num_chans,
                             num_seconds);
  if (res)
    return res;
  if (!(test_flags & 0x800)) {
    res = run_test_extra_modes(wpconfig_flags | 0x800, test_flags, bits,
                               num_chans, num_seconds);
    if (res)
      return res;
  }
  if (!(test_flags & 0x800)) {
    res = run_test_extra_modes(wpconfig_flags | 0x1000, test_flags, bits,
                               num_chans, num_seconds);
    if (res)
      return res;
  }
  return 0;
}


x86 assembly (clang, -O0):
<run_test_speed_modes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
jne    1171 <run_test_speed_modes+0x61>
mov    -0x8(%rbp),%edi
or     $0x200,%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <run_test_extra_modes@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     116c <run_test_speed_modes+0x5c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1237 <run_test_speed_modes+0x127>
jmp    1171 <run_test_speed_modes+0x61>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <run_test_extra_modes@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     119e <run_test_speed_modes+0x8e>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1237 <run_test_speed_modes+0x127>
mov    -0xc(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
jne    11e7 <run_test_speed_modes+0xd7>
mov    -0x8(%rbp),%edi
or     $0x800,%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <run_test_extra_modes@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11e2 <run_test_speed_modes+0xd2>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1237 <run_test_speed_modes+0x127>
jmp    11e7 <run_test_speed_modes+0xd7>
mov    -0xc(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
jne    1230 <run_test_speed_modes+0x120>
mov    -0x8(%rbp),%edi
or     $0x1000,%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <run_test_extra_modes@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     122b <run_test_speed_modes+0x11b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1237 <run_test_speed_modes+0x127>
jmp    1230 <run_test_speed_modes+0x120>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_test_speed_modes>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %edi,%ebx
test   $0x800,%esi
jne    1181 <run_test_speed_modes+0x71>
mov    %ebx,%edi
or     $0x200,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <run_test_extra_modes@plt>
test   %eax,%eax
jne    1199 <run_test_speed_modes+0x89>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <run_test_extra_modes@plt>
test   %eax,%eax
jne    1199 <run_test_speed_modes+0x89>
mov    %ebx,%edi
or     $0x800,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <run_test_extra_modes@plt>
test   %eax,%eax
jne    1199 <run_test_speed_modes+0x89>
or     $0x1000,%ebx
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <run_test_extra_modes@plt>
test   %eax,%eax
jne    1199 <run_test_speed_modes+0x89>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @run_test_speed_modes(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%13 = load i32, i32* %8
%14 = and i32 %13, 2048
%15 = icmp ne i32 %14, 0
br i1 %15, label %29, label %16
16: ; preds = %5
%17 = load i32, i32* %7
%18 = or i32 %17, 512
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = load i32, i32* %11
%23 = call i32 @run_test_extra_modes(i32 %18, i32 %19, i32 %20, i32 %21, i32 %22)
store i32 %23, i32* %12
%24 = load i32, i32* %12
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %16
%27 = load i32, i32* %12
store i32 %27, i32* %6
br label %75
28: ; preds = %16
br label %29
29: ; preds = %28, %5
%30 = load i32, i32* %7
%31 = load i32, i32* %8
%32 = load i32, i32* %9
%33 = load i32, i32* %10
%34 = load i32, i32* %11
%35 = call i32 @run_test_extra_modes(i32 %30, i32 %31, i32 %32, i32 %33, i32 %34)
store i32 %35, i32* %12
%36 = load i32, i32* %12
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %29
%39 = load i32, i32* %12
store i32 %39, i32* %6
br label %75
40: ; preds = %29
%41 = load i32, i32* %8
%42 = and i32 %41, 2048
%43 = icmp ne i32 %42, 0
br i1 %43, label %57, label %44
44: ; preds = %40
%45 = load i32, i32* %7
%46 = or i32 %45, 2048
%47 = load i32, i32* %8
%48 = load i32, i32* %9
%49 = load i32, i32* %10
%50 = load i32, i32* %11
%51 = call i32 @run_test_extra_modes(i32 %46, i32 %47, i32 %48, i32 %49, i32 %50)
store i32 %51, i32* %12
%52 = load i32, i32* %12
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %44
%55 = load i32, i32* %12
store i32 %55, i32* %6
br label %75
56: ; preds = %44
br label %57
57: ; preds = %56, %40
%58 = load i32, i32* %8
%59 = and i32 %58, 2048
%60 = icmp ne i32 %59, 0
br i1 %60, label %74, label %61
61: ; preds = %57
%62 = load i32, i32* %7
%63 = or i32 %62, 4096
%64 = load i32, i32* %8
%65 = load i32, i32* %9
%66 = load i32, i32* %10
%67 = load i32, i32* %11
%68 = call i32 @run_test_extra_modes(i32 %63, i32 %64, i32 %65, i32 %66, i32 %67)
store i32 %68, i32* %12
%69 = load i32, i32* %12
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %61
%72 = load i32, i32* %12
store i32 %72, i32* %6
br label %75
73: ; preds = %61
br label %74
74: ; preds = %73, %57
store i32 0, i32* %6
br label %75
75: ; preds = %74, %71, %54, %38, %26
%76 = load i32, i32* %6
ret i32 %76
}

LLVM IR (-O2):
define i32 @run_test_speed_modes(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = and i32 %1, 2048
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = or i32 %0, 512
%10 = tail call i32 @run_test_extra_modes(i32 %9, i32 %1, i32 %2, i32 %3, i32 %4)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = tail call i32 @run_test_extra_modes(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %27
15: ; preds = %5
%16 = tail call i32 @run_test_extra_modes(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
%17 = icmp eq i32 %16, 0
br i1 %17, label %26, label %27
18: ; preds = %12
%19 = or i32 %0, 2048
%20 = tail call i32 @run_test_extra_modes(i32 %19, i32 %1, i32 %2, i32 %3, i32 %4)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = or i32 %0, 4096
%24 = tail call i32 @run_test_extra_modes(i32 %23, i32 %1, i32 %2, i32 %3, i32 %4)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %15, %22
br label %27
27: ; preds = %15, %22, %18, %12, %8, %26
%28 = phi i32 [ 0, %26 ], [ %10, %8 ], [ %13, %12 ], [ %20, %18 ], [ %24, %22 ], [ %16, %15 ]
ret i32 %28
}