#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 *, int, char);
void show(int *ad) {
  int t, i;
  for (i = t = 0; i < 32; ++i) {
    t *= 2;
    t += ad[i];
    if ((i + 1) % 8 == 0) {
      printf("%d%c", t, i == 31 ? '\n' : '.');
      t = 0;
    }
  }
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x20,-0x10(%rbp)
jge    11a4 <show+0x94>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1191 <show+0x81>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x2e,%eax
mov    $0xa,%ecx
cmp    $0x1f,%edx
cmove  %ecx,%eax
lea    0xe7e(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
jmp    1196 <show+0x86>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <show+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
xor    %esi,%esi
mov    $0xffffffffffffffe0,%rbx
mov    $0xa,%ebp
lea    0xed1(%rip),%r14
jmp    1145 <show+0x35>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
inc    %rbx
je     116e <show+0x5e>
add    %esi,%esi
add    0x80(%r15,%rbx,4),%esi
lea    0x21(%rbx),%eax
test   $0x7,%al
jne    1140 <show+0x30>
cmp    $0xffffffffffffffff,%rbx
mov    $0x2e,%edx
cmove  %ebp,%edx
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %esi,%esi
jmp    1140 <show+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%c\00"
define void @show(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %31, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 32
br i1 %7, label %8, label %34
8: ; preds = %5
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 2
store i32 %10, i32* %3
%11 = load i32*, i32** %2
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
%20 = srem i32 %19, 8
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %30
22: ; preds = %8
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 31
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 10, i32 46
%28 = trunc i32 %27 to i8
%29 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %23, i8 signext %28)
store i32 0, i32* %3
br label %30
30: ; preds = %22, %8
br label %31
31: ; preds = %30
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %5
34: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%c\00"
define void @show(i32* nocapture %0) {
br label %2
2: ; preds = %1, %16
%3 = phi i64 [ 0, %1 ], [ %9, %16 ]
%4 = phi i32 [ 0, %1 ], [ %17, %16 ]
%5 = shl nsw i32 %4, 1
%6 = getelementptr inbounds i32, i32* %0, i64 %3
%7 = load i32, i32* %6
%8 = add nsw i32 %7, %5
%9 = add nuw nsw i64 %3, 1
%10 = and i64 %9, 7
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = icmp eq i64 %3, 31
%14 = select i1 %13, i8 10, i8 46
%15 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8, i8 signext %14)
br label %16
16: ; preds = %2, %12
%17 = phi i32 [ 0, %12 ], [ %8, %2 ]
%18 = icmp eq i64 %9, 32
br i1 %18, label %19, label %2
19: ; preds = %16
ret void
}