#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 */
typedef int /*<<< orphan*/ u_int8_t;
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int htonl(int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int, int, int, int);
char *print20b(char *s, const u_int8_t *b) {
  snprintf(s, 41, "%08x%08x%08x%08x%08x", htonl(*(u_int32_t *)b),
           htonl(*(u_int32_t *)(b + 4)), htonl(*(u_int32_t *)(b + 8)),
           htonl(*(u_int32_t *)(b + 12)), htonl(*(u_int32_t *)(b + 16)));
  return s;
}


x86 assembly (clang, -O0):
<print20b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <htonl@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%edi
call   1040 <htonl@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%edi
call   1040 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%edi
call   1040 <htonl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x40(%rax),%edi
call   1040 <htonl@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x14(%rbp),%r10d
mov    $0x29,%esi
lea    0xe62(%rip),%rdx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print20b>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
mov    %rdi,%r12
mov    (%rsi),%edi
call   1040 <htonl@plt>
mov    %eax,%r14d
mov    0x10(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,%r15d
mov    0x20(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,%r13d
mov    0x30(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,%ebx
mov    0x40(%rbp),%edi
call   1040 <htonl@plt>
lea    0xe96(%rip),%rdx
mov    %r12,%rdi
mov    $0x29,%esi
mov    %r14d,%ecx
mov    %r15d,%r8d
mov    %r13d,%r9d
push   %rax
push   %rbx
call   1030 <snprintf@plt>
add    $0x10,%rsp
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%08x%08x%08x%08x%08x\00"
define i8* @print20b(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = call i32 @htonl(i32 %7)
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 4
%11 = load i32, i32* %10
%12 = call i32 @htonl(i32 %11)
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 8
%15 = load i32, i32* %14
%16 = call i32 @htonl(i32 %15)
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 12
%19 = load i32, i32* %18
%20 = call i32 @htonl(i32 %19)
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 16
%23 = load i32, i32* %22
%24 = call i32 @htonl(i32 %23)
%25 = call i32 @snprintf(i8* %5, i32 41, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %12, i32 %16, i32 %20, i32 %24)
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
@.str = [21 x i8] c"%08x%08x%08x%08x%08x\00"
define i8* @print20b(i8* returned %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @htonl(i32 %3)
%5 = getelementptr inbounds i32, i32* %1, i64 4
%6 = load i32, i32* %5
%7 = tail call i32 @htonl(i32 %6)
%8 = getelementptr inbounds i32, i32* %1, i64 8
%9 = load i32, i32* %8
%10 = tail call i32 @htonl(i32 %9)
%11 = getelementptr inbounds i32, i32* %1, i64 12
%12 = load i32, i32* %11
%13 = tail call i32 @htonl(i32 %12)
%14 = getelementptr inbounds i32, i32* %1, i64 16
%15 = load i32, i32* %14
%16 = tail call i32 @htonl(i32 %15)
%17 = tail call i32 @snprintf(i8* %0, i32 41, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %10, i32 %13, i32 %16)
ret i8* %0
}