#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 *, ...);
pb(char *s, unsigned char *b, int cc) {
  printf("%s: ", s);
  while (cc--) {
    printf("%x|%d ", *b, *b);
    b++;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<pb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     1176 <pb+0x66>
mov    -0x18(%rbp),%rax
movzbl (%rax),%esi
mov    -0x18(%rbp),%rax
movzbl (%rax),%edx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1135 <pb+0x25>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pb>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%rsi
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
je     1169 <pb+0x49>
mov    %ebp,%ebp
lea    0xebb(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%r15,%rbx,1),%edx
mov    %r14,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1150 <pb+0x30>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s: \00"
@.str.1 = [7 x i8] c"%x|%d \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @pb(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %14, %3
%11 = load i32, i32* %7
%12 = add nsw i32 %11, -1
store i32 %12, i32* %7
%13 = icmp ne i32 %11, 0
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %6
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %20)
%22 = load i8*, i8** %6
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %6
br label %10
24: ; preds = %10
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
@.str.1 = [7 x i8] c"%x|%d \00"
define i32 @pb(i8* %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp eq i32 %2, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %2, %3 ]
%8 = phi i8* [ %13, %6 ], [ %1, %3 ]
%9 = add nsw i32 %7, -1
%10 = load i8, i8* %8
%11 = zext i8 %10 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %11)
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp eq i32 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %3
%16 = tail call i32 @putchar(i32 10)
ret i32 undef
}