#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*/ sprintf(char *, char *, char const, char const, char const,
                           char const, char const, char const, char const,
                           char const);
char *put8(char *out, const char *s) {
  sprintf(out, "%02X%02X %02X%02X %02X%02X %02X%02X", s[0] & 0xff, s[1] & 0xff,
          s[2] & 0xff, s[3] & 0xff, s[4] & 0xff, s[5] & 0xff, s[6] & 0xff,
          s[7] & 0xff);
  return out;
}


x86 assembly (clang, -O0):
<put8>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x38,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
and    $0xff,%eax
mov    %al,%r8b
mov    -0x18(%rbp),%rax
movsbl 0x3(%rax),%eax
and    $0xff,%eax
mov    %al,%r9b
mov    -0x18(%rbp),%rax
movsbl 0x4(%rax),%eax
and    $0xff,%eax
mov    %al,%bl
mov    -0x18(%rbp),%rax
movsbl 0x5(%rax),%eax
and    $0xff,%eax
mov    %al,%r11b
mov    -0x18(%rbp),%rax
movsbl 0x6(%rax),%eax
and    $0xff,%eax
mov    %al,%r10b
mov    -0x18(%rbp),%rax
movsbl 0x7(%rax),%eax
and    $0xff,%eax
lea    0xe5b(%rip),%rsi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %bl,%ebx
mov    %ebx,(%rsp)
movsbl %r11b,%r11d
mov    %r11d,0x8(%rsp)
movsbl %r10b,%r10d
mov    %r10d,0x10(%rsp)
movsbl %al,%eax
mov    %eax,0x18(%rsp)
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<put8>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rsi),%edx
movsbl 0x1(%rsi),%ecx
movsbl 0x2(%rsi),%r8d
movsbl 0x3(%rsi),%r9d
movsbl 0x4(%rsi),%r10d
movsbl 0x5(%rsi),%r11d
movsbl 0x6(%rsi),%r14d
movsbl 0x7(%rsi),%eax
lea    0xebe(%rip),%rsi
push   %rax
push   %r14
push   %r11
push   %r10
call   1030 <sprintf@plt>
add    $0x20,%rsp
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [36 x i8] c"%02X%02X %02X%02X %02X%02X %02X%02X\00"
define i8* @put8(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = and i32 %9, 255
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = and i32 %21, 255
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = and i32 %27, 255
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i64 4
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = and i32 %33, 255
%35 = trunc i32 %34 to i8
%36 = load i8*, i8** %4
%37 = getelementptr inbounds i8, i8* %36, i64 5
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = and i32 %39, 255
%41 = trunc i32 %40 to i8
%42 = load i8*, i8** %4
%43 = getelementptr inbounds i8, i8* %42, i64 6
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = and i32 %45, 255
%47 = trunc i32 %46 to i8
%48 = load i8*, i8** %4
%49 = getelementptr inbounds i8, i8* %48, i64 7
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = and i32 %51, 255
%53 = trunc i32 %52 to i8
%54 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 signext %11, i8 signext %17, i8 signext %23, i8 signext %29, i8 signext %35, i8 signext %41, i8 signext %47, i8 signext %53)
%55 = load i8*, i8** %3
ret i8* %55
}

LLVM IR (-O2):
@.str = [36 x i8] c"%02X%02X %02X%02X %02X%02X %02X%02X\00"
define i8* @put8(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = getelementptr inbounds i8, i8* %1, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %1, i64 2
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 3
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %1, i64 4
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %1, i64 5
%13 = load i8, i8* %12
%14 = getelementptr inbounds i8, i8* %1, i64 6
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %1, i64 7
%17 = load i8, i8* %16
%18 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 signext %3, i8 signext %5, i8 signext %7, i8 signext %9, i8 signext %11, i8 signext %13, i8 signext %15, i8 signext %17)
ret i8* %0
}