#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ print_sel_bits(int /*<<< orphan*/ *, unsigned int,
                                  unsigned int const);
void print_other(FILE *out, unsigned other_mask, const unsigned other_codes[],
                 int n_other, unsigned sel_mask, unsigned sel_val) {
  int j, nn = 0;
  for (j = 0; j < n_other; ++j) {
    if ((other_codes[j] & sel_mask) != sel_val)
      continue;
    if (nn)
      fprintf(out, " || ");
    print_sel_bits(out, other_mask, other_codes[j]);
    ++nn;
  }
}


x86 assembly (clang, -O0):
<print_other>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11bc <print_other+0x9c>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
and    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     1174 <print_other+0x54>
jmp    11ae <print_other+0x8e>
cmpl   $0x0,-0x2c(%rbp)
je     118e <print_other+0x6e>
mov    -0x8(%rbp),%rdi
lea    0xe77(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
call   1030 <print_sel_bits@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    114c <print_other+0x2c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_other>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,0x10(%rsp)
mov    %esi,0x4(%rsp)
test   %ecx,%ecx
jle    11bf <print_other+0x9f>
mov    %r9d,%r14d
mov    %r8d,%r13d
mov    %rdi,%rbp
mov    %ecx,%ebx
xor    %r15d,%r15d
xor    %r12d,%r12d
mov    %rdi,0x8(%rsp)
jmp    117e <print_other+0x5e>
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    0x4(%rsp),%esi
call   1030 <print_sel_bits@plt>
mov    0x8(%rsp),%rbp
add    $0x1,%r12d
add    $0x1,%r15
cmp    %r15,%rbx
je     11bf <print_other+0x9f>
mov    0x10(%rsp),%rax
mov    (%rax,%r15,4),%edx
mov    %edx,%eax
and    %r13d,%eax
cmp    %r14d,%eax
jne    1175 <print_other+0x55>
test   %r12d,%r12d
je     1160 <print_other+0x40>
mov    $0x4,%esi
mov    $0x1,%edx
lea    0xe59(%rip),%rdi
mov    %rbp,%rcx
call   1040 <fwrite@plt>
mov    0x8(%rsp),%rbp
mov    0x10(%rsp),%rax
mov    (%rax,%r15,4),%edx
jmp    1160 <print_other+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c" || \00"
define void @print_other(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = 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
store i32 %5, i32* %12
store i32 0, i32* %14
store i32 0, i32* %13
br label %15
15: ; preds = %47, %6
%16 = load i32, i32* %13
%17 = load i32, i32* %10
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %50
19: ; preds = %15
%20 = load i32*, i32** %9
%21 = load i32, i32* %13
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
%25 = load i32, i32* %11
%26 = and i32 %24, %25
%27 = load i32, i32* %12
%28 = icmp ne i32 %26, %27
br i1 %28, label %29, label %30
29: ; preds = %19
br label %47
30: ; preds = %19
%31 = load i32, i32* %14
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i32*, i32** %7
%35 = call i32 @fprintf(i32* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %36
36: ; preds = %33, %30
%37 = load i32*, i32** %7
%38 = load i32, i32* %8
%39 = load i32*, i32** %9
%40 = load i32, i32* %13
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %39, i64 %41
%43 = load i32, i32* %42
%44 = call i32 @print_sel_bits(i32* %37, i32 %38, i32 %43)
%45 = load i32, i32* %14
%46 = add nsw i32 %45, 1
store i32 %46, i32* %14
br label %47
47: ; preds = %36, %29
%48 = load i32, i32* %13
%49 = add nsw i32 %48, 1
store i32 %49, i32* %13
br label %15
50: ; preds = %15
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" || \00"
define void @print_other(i32* %0, i32 %1, i32* nocapture %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp sgt i32 %3, 0
br i1 %7, label %8, label %30
8: ; preds = %6
%9 = zext i32 %3 to i64
br label %10
10: ; preds = %8, %26
%11 = phi i64 [ 0, %8 ], [ %28, %26 ]
%12 = phi i32 [ 0, %8 ], [ %27, %26 ]
%13 = getelementptr inbounds i32, i32* %2, i64 %11
%14 = load i32, i32* %13
%15 = and i32 %14, %4
%16 = icmp eq i32 %15, %5
br i1 %16, label %17, label %26
17: ; preds = %10
%18 = icmp eq i32 %12, 0
br i1 %18, label %22, label %19
19: ; preds = %17
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
%21 = load i32, i32* %13
br label %22
22: ; preds = %19, %17
%23 = phi i32 [ %21, %19 ], [ %14, %17 ]
%24 = tail call i32 @print_sel_bits(i32* %0, i32 %1, i32 %23)
%25 = add nsw i32 %12, 1
br label %26
26: ; preds = %10, %22
%27 = phi i32 [ %12, %10 ], [ %25, %22 ]
%28 = add nuw nsw i64 %11, 1
%29 = icmp eq i64 %28, %9
br i1 %29, label %30, label %10
30: ; preds = %26, %6
ret void
}