#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 printMessage(const unsigned char *message) {
  printf("Got: ");
  for (int i = 0; i < 24; i += 2) {
    printf("%02x%02x ", message[i], message[i + 1]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x18,-0xc(%rbp)
jge    1174 <printMessage+0x64>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <printMessage+0x21>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMessage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl (%rbx),%esi
movzbl 0x1(%rbx),%edx
lea    0xec3(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x2(%rbx),%esi
movzbl 0x3(%rbx),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x4(%rbx),%esi
movzbl 0x5(%rbx),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x6(%rbx),%esi
movzbl 0x7(%rbx),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x8(%rbx),%esi
movzbl 0x9(%rbx),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xa(%rbx),%esi
movzbl 0xb(%rbx),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xc(%rbx),%esi
movzbl 0xd(%rbx),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xe(%rbx),%esi
movzbl 0xf(%rbx),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x10(%rbx),%esi
movzbl 0x11(%rbx),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x12(%rbx),%esi
movzbl 0x13(%rbx),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x14(%rbx),%esi
movzbl 0x15(%rbx),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x16(%rbx),%esi
movzbl 0x17(%rbx),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"Got: \00"
@.str.1 = [10 x i8] c"%02x%02x \00"
define void @printMessage(i8* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %7)
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = getelementptr inbounds i8, i8* %0, i64 3
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %14)
%16 = getelementptr inbounds i8, i8* %0, i64 4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = getelementptr inbounds i8, i8* %0, i64 5
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %21)
%23 = getelementptr inbounds i8, i8* %0, i64 6
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = getelementptr inbounds i8, i8* %0, i64 7
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %28)
%30 = getelementptr inbounds i8, i8* %0, i64 8
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = getelementptr inbounds i8, i8* %0, i64 9
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %32, i32 %35)
%37 = getelementptr inbounds i8, i8* %0, i64 10
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = getelementptr inbounds i8, i8* %0, i64 11
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %39, i32 %42)
%44 = getelementptr inbounds i8, i8* %0, i64 12
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = getelementptr inbounds i8, i8* %0, i64 13
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %46, i32 %49)
%51 = getelementptr inbounds i8, i8* %0, i64 14
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = getelementptr inbounds i8, i8* %0, i64 15
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %53, i32 %56)
%58 = getelementptr inbounds i8, i8* %0, i64 16
%59 = load i8, i8* %58
%60 = zext i8 %59 to i32
%61 = getelementptr inbounds i8, i8* %0, i64 17
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %60, i32 %63)
%65 = getelementptr inbounds i8, i8* %0, i64 18
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = getelementptr inbounds i8, i8* %0, i64 19
%69 = load i8, i8* %68
%70 = zext i8 %69 to i32
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %67, i32 %70)
%72 = getelementptr inbounds i8, i8* %0, i64 20
%73 = load i8, i8* %72
%74 = zext i8 %73 to i32
%75 = getelementptr inbounds i8, i8* %0, i64 21
%76 = load i8, i8* %75
%77 = zext i8 %76 to i32
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %74, i32 %77)
%79 = getelementptr inbounds i8, i8* %0, i64 22
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = getelementptr inbounds i8, i8* %0, i64 23
%83 = load i8, i8* %82
%84 = zext i8 %83 to i32
%85 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %81, i32 %84)
%86 = tail call i32 @putchar(i32 10)
ret void
}