#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 uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int, int, int, int,
                           int);
char *Iso15693sprintUID(char *target, uint8_t *uid) {
  static char tempbuf[2 * 8 + 1] = "";
  if (target == NULL)
    target = tempbuf;
  sprintf(target, "%02X%02X%02X%02X%02X%02X%02X%02X", uid[7], uid[6], uid[5],
          uid[4], uid[3], uid[2], uid[1], uid[0]);
  return target;
}


x86 assembly (clang, -O0):
<Iso15693sprintUID>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x38,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <Iso15693sprintUID+0x27>
lea    0x2f0d(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%r8d
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%ebx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%r11d
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%r10d
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
lea    0xe83(%rip),%rsi
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Iso15693sprintUID>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
lea    0x2f22(%rip),%rbx
cmovne %rdi,%rbx
mov    0x1c(%rsi),%edx
mov    0x18(%rsi),%ecx
mov    0x14(%rsi),%r8d
mov    0x10(%rsi),%r9d
mov    0xc(%rsi),%r10d
mov    0x8(%rsi),%r11d
mov    (%rsi),%eax
mov    0x4(%rsi),%r14d
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
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):
@Iso15693sprintUID.tempbuf = internal global [17 x i8] zeroinitializer
@.str = [33 x i8] c"%02X%02X%02X%02X%02X%02X%02X%02X\00"
define i8* @Iso15693sprintUID(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 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @Iso15693sprintUID.tempbuf, i64 0, i64 0), i8** %3
br label %8
8: ; preds = %7, %2
%9 = load i8*, i8** %3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 7
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 6
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 5
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 4
%21 = load i32, i32* %20
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i64 3
%24 = load i32, i32* %23
%25 = load i32*, i32** %4
%26 = getelementptr inbounds i32, i32* %25, i64 2
%27 = load i32, i32* %26
%28 = load i32*, i32** %4
%29 = getelementptr inbounds i32, i32* %28, i64 1
%30 = load i32, i32* %29
%31 = load i32*, i32** %4
%32 = getelementptr inbounds i32, i32* %31, i64 0
%33 = load i32, i32* %32
%34 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %15, i32 %18, i32 %21, i32 %24, i32 %27, i32 %30, i32 %33)
%35 = load i8*, i8** %3
ret i8* %35
}

LLVM IR (-O2):
@Iso15693sprintUID.tempbuf = internal global [17 x i8] zeroinitializer
@.str = [33 x i8] c"%02X%02X%02X%02X%02X%02X%02X%02X\00"
define i8* @Iso15693sprintUID(i8* writeonly %0, i32* nocapture %1) {
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @Iso15693sprintUID.tempbuf, i64 0, i64 0), i8* %0
%5 = getelementptr inbounds i32, i32* %1, i64 7
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %1, i64 6
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 5
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %1, i64 4
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 3
%14 = load i32, i32* %13
%15 = getelementptr inbounds i32, i32* %1, i64 2
%16 = load i32, i32* %15
%17 = getelementptr inbounds i32, i32* %1, i64 1
%18 = load i32, i32* %17
%19 = load i32, i32* %1
%20 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, i32 %10, i32 %12, i32 %14, i32 %16, i32 %18, i32 %19)
ret i8* %4
}