#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 show(unsigned char *st) {
  int i;
  for (i = 0; i < 28; i++) {
    printf("%02x ", st[i]);
    if (i > 0 && ((i & 3) == 3))
      printf("\n");
  }
  for (i = 0; i < 80; i++) {
    printf("%02x ", st[i + 28]);
    if (i > 0 && ((i % 10) == 9))
      printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1c,-0xc(%rbp)
jge    1181 <show+0x71>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    116e <show+0x5e>
mov    -0xc(%rbp),%eax
and    $0x3,%eax
cmp    $0x3,%eax
jne    116e <show+0x5e>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1173 <show+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <show+0x13>
movl   $0x0,-0xc(%rbp)
cmpl   $0x50,-0xc(%rbp)
jge    11f0 <show+0xe0>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1c,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    11dd <show+0xcd>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%edx
jne    11dd <show+0xcd>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e2 <show+0xd2>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1188 <show+0x78>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
lea    0xecf(%rip),%r14
xor    %ebx,%ebx
jmp    114a <show+0x2a>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
cmp    $0x1c,%rbx
je     116d <show+0x4d>
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
not    %eax
test   $0x3,%al
jne    1140 <show+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1140 <show+0x20>
mov    $0x9,%bpl
lea    0xe89(%rip),%r14
xor    %ebx,%ebx
jmp    118e <show+0x6e>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
add    $0xff,%bpl
cmp    $0x50,%rbx
je     11c6 <show+0xa6>
movzbl 0x1c(%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %rbx,%rbx
je     1180 <show+0x60>
movzbl %bl,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%eax
add    %bpl,%al
jne    1180 <show+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1180 <show+0x60>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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