#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 */
char *charToHexa(char);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *,
                           char *, char *);
void convertAdresse(char *adr, char *res) {
  sprintf(res, "%s:%s:%s:%s:%s:%s", charToHexa(adr[0]), charToHexa(adr[1]),
          charToHexa(adr[2]), charToHexa(adr[3]), charToHexa(adr[4]),
          charToHexa(adr[5]));
}


x86 assembly (clang, -O0):
<convertAdresse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <charToHexa@plt>
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1040 <charToHexa@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%edi
call   1040 <charToHexa@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%edi
call   1040 <charToHexa@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x4(%rax),%edi
call   1040 <charToHexa@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x5(%rax),%edi
call   1040 <charToHexa@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x18(%rbp),%r10
lea    0xe48(%rip),%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <sprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertAdresse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,(%rsp)
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1040 <charToHexa@plt>
mov    %rax,%r15
movsbl 0x1(%rbx),%edi
call   1040 <charToHexa@plt>
mov    %rax,%r12
movsbl 0x2(%rbx),%edi
call   1040 <charToHexa@plt>
mov    %rax,%r13
movsbl 0x3(%rbx),%edi
call   1040 <charToHexa@plt>
mov    %rax,%rbp
movsbl 0x4(%rbx),%edi
call   1040 <charToHexa@plt>
mov    %rax,%r14
movsbl 0x5(%rbx),%edi
call   1040 <charToHexa@plt>
lea    0xe83(%rip),%rsi
mov    (%rsp),%rdi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %rbp,%r9
push   %rax
push   %r14
call   1030 <sprintf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%s:%s:%s:%s:%s:%s\00"
define void @convertAdresse(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = call i8* @charToHexa(i8 signext %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = call i8* @charToHexa(i8 signext %12)
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = call i8* @charToHexa(i8 signext %16)
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 3
%20 = load i8, i8* %19
%21 = call i8* @charToHexa(i8 signext %20)
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 4
%24 = load i8, i8* %23
%25 = call i8* @charToHexa(i8 signext %24)
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 5
%28 = load i8, i8* %27
%29 = call i8* @charToHexa(i8 signext %28)
%30 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %13, i8* %17, i8* %21, i8* %25, i8* %29)
ret void
}

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