#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 /*<<< orphan*/ exec_btrl(int, int, int, int);
int /*<<< orphan*/ exec_btrw(int, int, int, int);
void exec_btr(int s2, int s0, int s1) {
  int o, s, z, a, c, p, flags_in;
  for (o = 0; o < 2; o++) {
    for (s = 0; s < 2; s++) {
      for (z = 0; z < 2; z++) {
        for (a = 0; a < 2; a++) {
          for (c = 0; c < 2; c++) {
            for (p = 0; p < 2; p++) {
              flags_in = (o ? 0x0800 : 0) | (s ? 0x0080 : 0) |
                         (z ? 0x0040 : 0) | (a ? 0x0010 : 0) |
                         (c ? 0x0001 : 0) | (p ? 0x0004 : 0);
              exec_btrl(s2, s0, s1, flags_in);
              exec_btrw(s2, s0, s1, flags_in);
            }
          }
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<exec_btr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1293 <exec_btr+0x173>
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1280 <exec_btr+0x160>
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jge    126d <exec_btr+0x14d>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    125a <exec_btr+0x13a>
movl   $0x0,-0x20(%rbp)
cmpl   $0x2,-0x20(%rbp)
jge    1247 <exec_btr+0x127>
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    1234 <exec_btr+0x114>
mov    -0x10(%rbp),%edx
xor    %eax,%eax
mov    $0x800,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    -0x14(%rbp),%esi
xor    %ecx,%ecx
mov    $0x80,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%esi
xor    %ecx,%ecx
mov    $0x40,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
or     %ecx,%eax
mov    -0x1c(%rbp),%esi
xor    %ecx,%ecx
mov    $0x10,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
or     %ecx,%eax
mov    -0x24(%rbp),%esi
xor    %ecx,%ecx
mov    $0x4,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x28(%rbp),%ecx
call   1040 <exec_btrl@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x28(%rbp),%ecx
call   1030 <exec_btrw@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    118d <exec_btr+0x6d>
jmp    1239 <exec_btr+0x119>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    117c <exec_btr+0x5c>
jmp    124c <exec_btr+0x12c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116b <exec_btr+0x4b>
jmp    125f <exec_btr+0x13f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115a <exec_btr+0x3a>
jmp    1272 <exec_btr+0x152>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <exec_btr+0x29>
jmp    1285 <exec_btr+0x165>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <exec_btr+0x18>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_btr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%r12d
mov    $0x1,%al
nopl   0x0(%rax)
mov    %eax,0x8(%rsp)
not    %al
movzbl %al,%eax
and    $0x1,%eax
shl    $0xb,%eax
mov    %eax,0xc(%rsp)
mov    $0x1,%al
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,0x10(%rsp)
not    %al
movzbl %al,%eax
and    $0x1,%eax
shl    $0x7,%eax
or     0xc(%rsp),%eax
mov    %eax,0x14(%rsp)
mov    $0x1,%r13b
nopw   0x0(%rax,%rax,1)
mov    %r13d,%eax
not    %al
movzbl %al,%ebx
and    $0x1,%ebx
shl    $0x6,%ebx
or     0x14(%rsp),%ebx
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <exec_btrl@plt>
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1030 <exec_btrw@plt>
mov    %ebx,%ebp
or     $0x4,%ebp
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1040 <exec_btrl@plt>
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1030 <exec_btrw@plt>
mov    %ebx,%ebp
or     $0x1,%ebp
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1040 <exec_btrl@plt>
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1030 <exec_btrw@plt>
mov    %ebx,%ebp
or     $0x5,%ebp
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1040 <exec_btrl@plt>
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1030 <exec_btrw@plt>
mov    %ebx,%ebp
or     $0x10,%ebp
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1040 <exec_btrl@plt>
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1030 <exec_btrw@plt>
mov    %ebx,%ebp
or     $0x14,%ebp
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1040 <exec_btrl@plt>
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1030 <exec_btrw@plt>
mov    %ebx,%ebp
or     $0x11,%ebp
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1040 <exec_btrl@plt>
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1030 <exec_btrw@plt>
or     $0x15,%ebx
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1040 <exec_btrl@plt>
mov    %r12d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1030 <exec_btrw@plt>
test   $0x1,%r13b
mov    $0x0,%r13d
jne    1180 <exec_btr+0x60>
testb  $0x1,0x10(%rsp)
mov    $0x0,%eax
jne    1160 <exec_btr+0x40>
testb  $0x1,0x8(%rsp)
mov    $0x0,%eax
jne    1140 <exec_btr+0x20>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @exec_btr(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %14
14: ; preds = %97, %3
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 2
br i1 %16, label %17, label %100
17: ; preds = %14
store i32 0, i32* %8
br label %18
18: ; preds = %93, %17
%19 = load i32, i32* %8
%20 = icmp slt i32 %19, 2
br i1 %20, label %21, label %96
21: ; preds = %18
store i32 0, i32* %9
br label %22
22: ; preds = %89, %21
%23 = load i32, i32* %9
%24 = icmp slt i32 %23, 2
br i1 %24, label %25, label %92
25: ; preds = %22
store i32 0, i32* %10
br label %26
26: ; preds = %85, %25
%27 = load i32, i32* %10
%28 = icmp slt i32 %27, 2
br i1 %28, label %29, label %88
29: ; preds = %26
store i32 0, i32* %11
br label %30
30: ; preds = %81, %29
%31 = load i32, i32* %11
%32 = icmp slt i32 %31, 2
br i1 %32, label %33, label %84
33: ; preds = %30
store i32 0, i32* %12
br label %34
34: ; preds = %77, %33
%35 = load i32, i32* %12
%36 = icmp slt i32 %35, 2
br i1 %36, label %37, label %80
37: ; preds = %34
%38 = load i32, i32* %7
%39 = icmp ne i32 %38, 0
%40 = zext i1 %39 to i64
%41 = select i1 %39, i32 2048, i32 0
%42 = load i32, i32* %8
%43 = icmp ne i32 %42, 0
%44 = zext i1 %43 to i64
%45 = select i1 %43, i32 128, i32 0
%46 = or i32 %41, %45
%47 = load i32, i32* %9
%48 = icmp ne i32 %47, 0
%49 = zext i1 %48 to i64
%50 = select i1 %48, i32 64, i32 0
%51 = or i32 %46, %50
%52 = load i32, i32* %10
%53 = icmp ne i32 %52, 0
%54 = zext i1 %53 to i64
%55 = select i1 %53, i32 16, i32 0
%56 = or i32 %51, %55
%57 = load i32, i32* %11
%58 = icmp ne i32 %57, 0
%59 = zext i1 %58 to i64
%60 = select i1 %58, i32 1, i32 0
%61 = or i32 %56, %60
%62 = load i32, i32* %12
%63 = icmp ne i32 %62, 0
%64 = zext i1 %63 to i64
%65 = select i1 %63, i32 4, i32 0
%66 = or i32 %61, %65
store i32 %66, i32* %13
%67 = load i32, i32* %4
%68 = load i32, i32* %5
%69 = load i32, i32* %6
%70 = load i32, i32* %13
%71 = call i32 @exec_btrl(i32 %67, i32 %68, i32 %69, i32 %70)
%72 = load i32, i32* %4
%73 = load i32, i32* %5
%74 = load i32, i32* %6
%75 = load i32, i32* %13
%76 = call i32 @exec_btrw(i32 %72, i32 %73, i32 %74, i32 %75)
br label %77
77: ; preds = %37
%78 = load i32, i32* %12
%79 = add nsw i32 %78, 1
store i32 %79, i32* %12
br label %34
80: ; preds = %34
br label %81
81: ; preds = %80
%82 = load i32, i32* %11
%83 = add nsw i32 %82, 1
store i32 %83, i32* %11
br label %30
84: ; preds = %30
br label %85
85: ; preds = %84
%86 = load i32, i32* %10
%87 = add nsw i32 %86, 1
store i32 %87, i32* %10
br label %26
88: ; preds = %26
br label %89
89: ; preds = %88
%90 = load i32, i32* %9
%91 = add nsw i32 %90, 1
store i32 %91, i32* %9
br label %22
92: ; preds = %22
br label %93
93: ; preds = %92
%94 = load i32, i32* %8
%95 = add nsw i32 %94, 1
store i32 %95, i32* %8
br label %18
96: ; preds = %18
br label %97
97: ; preds = %96
%98 = load i32, i32* %7
%99 = add nsw i32 %98, 1
store i32 %99, i32* %7
br label %14
100: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @exec_btr(i32 %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %3, %39
%5 = phi i1 [ true, %3 ], [ false, %39 ]
%6 = select i1 %5, i32 0, i32 2048
br label %7
7: ; preds = %4, %38
%8 = phi i1 [ true, %4 ], [ false, %38 ]
%9 = select i1 %8, i32 0, i32 128
%10 = or i32 %9, %6
br label %11
11: ; preds = %7, %11
%12 = phi i1 [ true, %7 ], [ false, %11 ]
%13 = select i1 %12, i32 0, i32 64
%14 = or i32 %10, %13
%15 = tail call i32 @exec_btrl(i32 %0, i32 %1, i32 %2, i32 %14)
%16 = tail call i32 @exec_btrw(i32 %0, i32 %1, i32 %2, i32 %14)
%17 = or i32 %14, 4
%18 = tail call i32 @exec_btrl(i32 %0, i32 %1, i32 %2, i32 %17)
%19 = tail call i32 @exec_btrw(i32 %0, i32 %1, i32 %2, i32 %17)
%20 = or i32 %14, 1
%21 = tail call i32 @exec_btrl(i32 %0, i32 %1, i32 %2, i32 %20)
%22 = tail call i32 @exec_btrw(i32 %0, i32 %1, i32 %2, i32 %20)
%23 = or i32 %14, 5
%24 = tail call i32 @exec_btrl(i32 %0, i32 %1, i32 %2, i32 %23)
%25 = tail call i32 @exec_btrw(i32 %0, i32 %1, i32 %2, i32 %23)
%26 = or i32 %14, 16
%27 = tail call i32 @exec_btrl(i32 %0, i32 %1, i32 %2, i32 %26)
%28 = tail call i32 @exec_btrw(i32 %0, i32 %1, i32 %2, i32 %26)
%29 = or i32 %14, 20
%30 = tail call i32 @exec_btrl(i32 %0, i32 %1, i32 %2, i32 %29)
%31 = tail call i32 @exec_btrw(i32 %0, i32 %1, i32 %2, i32 %29)
%32 = or i32 %14, 17
%33 = tail call i32 @exec_btrl(i32 %0, i32 %1, i32 %2, i32 %32)
%34 = tail call i32 @exec_btrw(i32 %0, i32 %1, i32 %2, i32 %32)
%35 = or i32 %14, 21
%36 = tail call i32 @exec_btrl(i32 %0, i32 %1, i32 %2, i32 %35)
%37 = tail call i32 @exec_btrw(i32 %0, i32 %1, i32 %2, i32 %35)
br i1 %12, label %11, label %38
38: ; preds = %11
br i1 %8, label %7, label %39
39: ; preds = %38
br i1 %5, label %4, label %40
40: ; preds = %39
ret void
}