#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 *, ...);
int vg_uuid_print(long int vg_uuid_loc, char *buffer) {
  int x = 0;
  printf("\t-- VG UUID: ");
  while (x < 38) {
    printf("%c", buffer[vg_uuid_loc + x]);
    x++;
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<vg_uuid_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x26,-0x14(%rbp)
jge    116e <vg_uuid_print+0x5e>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
add    %rdx,%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <vg_uuid_print+0x25>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vg_uuid_print>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    %r14,%r15
mov    $0xffffffffffffffda,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl 0x26(%r15,%rbx,1),%edi
call   1030 <putchar@plt>
inc    %rbx
jne    1150 <vg_uuid_print+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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