#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*/ printf(char *);
void print_mode(unsigned long long int *mode, unsigned int unit_size) {
  int u, b;
  for (u = unit_size - 1; u >= 0; u--) {
    unsigned long long tmp_unit = 0x8000000000000000ULL;
    for (b = 8 * sizeof(unsigned long long) - 1; b >= 0; b--) {
      if (mode[u] & tmp_unit) {
        printf("1");
      } else {
        printf("0");
      }
      tmp_unit >>= 1;
      if (b % 8 == 0) {
        printf("|");
      }
    }
  }
}


x86 assembly (clang, -O0):
<print_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     11da <print_mode+0xca>
movabs $0x8000000000000000,%rax
mov    %rax,-0x20(%rbp)
movl   $0x3f,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     11c7 <print_mode+0xb7>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
and    -0x20(%rbp),%rax
cmp    $0x0,%rax
je     117c <print_mode+0x6c>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <print_mode+0x78>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b4 <print_mode+0xa4>
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
jmp    11b9 <print_mode+0xa9>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <print_mode+0x37>
jmp    11cc <print_mode+0xbc>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <print_mode+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mode>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
add    $0xffffffff,%esi
js     1182 <print_mode+0x72>
mov    %rdi,%r14
mov    %esi,%r12d
movabs $0x8000000000000000,%r15
jmp    113d <print_mode+0x2d>
nop
add    $0xffffffffffffffff,%r12
test   $0x80000000,%r12d
jne    1182 <print_mode+0x72>
mov    $0x3f,%ebp
mov    %r15,%rbx
jmp    1158 <print_mode+0x48>
nopw   0x0(%rax,%rax,1)
shr    %rbx
add    $0xffffffff,%ebp
jae    1130 <print_mode+0x20>
mov    (%r14,%r12,8),%rax
and    %rbx,%rax
cmp    $0x1,%rax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
test   $0x7,%bpl
jne    1150 <print_mode+0x40>
mov    $0x7c,%edi
call   1030 <putchar@plt>
jmp    1150 <print_mode+0x40>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @print_mode(i64* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %30
5: ; preds = %2
%6 = zext i32 %3 to i64
br label %11
7: ; preds = %27
%8 = add nsw i64 %12, -1
%9 = and i64 %8, 2147483648
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %30
11: ; preds = %5, %7
%12 = phi i64 [ %6, %5 ], [ %8, %7 ]
%13 = getelementptr inbounds i64, i64* %0, i64 %12
br label %14
14: ; preds = %11, %27
%15 = phi i64 [ -9223372036854775808, %11 ], [ %22, %27 ]
%16 = phi i32 [ 63, %11 ], [ %28, %27 ]
%17 = load i64, i64* %13
%18 = and i64 %17, %15
%19 = icmp eq i64 %18, 0
%20 = select i1 %19, i32 48, i32 49
%21 = tail call i32 @putchar(i32 %20)
%22 = lshr i64 %15, 1
%23 = and i32 %16, 7
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %14
%26 = tail call i32 @putchar(i32 124)
br label %27
27: ; preds = %14, %25
%28 = add nsw i32 %16, -1
%29 = icmp eq i32 %16, 0
br i1 %29, label %7, label %14
30: ; preds = %7, %2
ret void
}