#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 */
scalar_t__ isFPLsbs(int);
int /*<<< orphan*/ printf(char *, ...);
void show(unsigned char *buf, int xx) {
  int i;
  for (i = 0; i < 512; i++) {
    if ((i % 16) == 0)
      printf("%3d   ", i);
    if (xx && isFPLsbs(i))
      printf("xx ");
    else
      printf("%02x ", buf[i]);
    if (i > 0 && ((i % 16) == 15))
      printf("\n");
  }
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x200,-0x10(%rbp)
jge    11f0 <show+0xd0>
mov    -0x10(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1168 <show+0x48>
mov    -0x10(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     1197 <show+0x77>
mov    -0x10(%rbp),%edi
call   1030 <isFPLsbs@plt>
cmp    $0x0,%rax
je     1197 <show+0x77>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b1 <show+0x91>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x10(%rbp)
jle    11dd <show+0xbd>
mov    -0x10(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0xf,%edx
jne    11dd <show+0xbd>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e2 <show+0xc2>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <show+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xec4(%rip),%r12
lea    0xeb9(%rip),%r13
xor    %ebp,%ebp
jmp    116d <show+0x3d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbp
cmp    $0x200,%rbp
je     11e4 <show+0xb4>
mov    %ebp,%r15d
and    $0xf,%r15d
je     1180 <show+0x50>
test   %ebx,%ebx
jne    1194 <show+0x64>
jmp    11c0 <show+0x90>
nopl   0x0(%rax)
lea    0xe79(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
je     11c0 <show+0x90>
mov    %ebp,%edi
call   1040 <isFPLsbs@plt>
test   %rax,%rax
je     11c0 <show+0x90>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xf,%r15d
jne    1160 <show+0x30>
jmp    11d5 <show+0xa5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbp,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xf,%r15d
jne    1160 <show+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1160 <show+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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