#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*/ memcpy(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
unsigned char strlen(char const *);
void suppplementTo12(unsigned char *data) {
  unsigned char lu8tmpStr[128] = {0};
  unsigned char lu8InputLen = 0;
  lu8InputLen = strlen((const char *)data);
  if (lu8InputLen % 2) {
    if (lu8InputLen > 2 * 6 - 1)
      return;
  } else {
    if (lu8InputLen > 2 * 6)
      return;
  }
  memset(lu8tmpStr, '0', 2 * 6 - lu8InputLen);
  memcpy(lu8tmpStr + (2 * 6 - lu8InputLen), data, lu8InputLen);
  memcpy(data, lu8tmpStr, 2 * 6);
}


x86 assembly (clang, -O0):
<suppplementTo12>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
movb   $0x0,-0x91(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %al,-0x91(%rbp)
movzbl -0x91(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     119a <suppplementTo12+0x6a>
movzbl -0x91(%rbp),%eax
cmp    $0xb,%eax
jle    1195 <suppplementTo12+0x65>
jmp    1212 <suppplementTo12+0xe2>
jmp    11b4 <suppplementTo12+0x84>
movzbl -0x91(%rbp),%eax
cmp    $0xc,%eax
jle    11af <suppplementTo12+0x7f>
jmp    1212 <suppplementTo12+0xe2>
jmp    11b4 <suppplementTo12+0x84>
lea    -0x90(%rbp),%rdi
movzbl -0x91(%rbp),%eax
mov    $0xc,%edx
sub    %eax,%edx
mov    $0x30,%esi
call   1040 <memset@plt>
lea    -0x90(%rbp),%rdi
movzbl -0x91(%rbp),%ecx
mov    $0xc,%eax
sub    %ecx,%eax
cltq
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movzbl -0x91(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0xc,%edx
call   1050 <memcpy@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suppplementTo12>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1030 <strlen@plt>
test   $0x1,%al
jne    1179 <suppplementTo12+0x49>
cmp    $0xc,%al
jbe    117d <suppplementTo12+0x4d>
jmp    11bd <suppplementTo12+0x8d>
cmp    $0xb,%al
ja     11bd <suppplementTo12+0x8d>
movzbl %al,%r14d
mov    $0xc,%ebp
sub    %r14d,%ebp
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x30,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xc,%edx
call   1050 <memcpy@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @suppplementTo12(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
%4 = alloca i8
store i8* %0, i8** %2
%5 = bitcast [128 x i8]* %3 to i8*
store i8 0, i8* %4
%6 = load i8*, i8** %2
%7 = call zeroext i8 @strlen(i8* %6)
store i8 %7, i8* %4
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = srem i32 %9, 2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %1
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = icmp sgt i32 %14, 11
br i1 %15, label %16, label %17
16: ; preds = %12
br label %43
17: ; preds = %12
br label %24
18: ; preds = %1
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = icmp sgt i32 %20, 12
br i1 %21, label %22, label %23
22: ; preds = %18
br label %43
23: ; preds = %18
br label %24
24: ; preds = %23, %17
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%26 = load i8, i8* %4
%27 = zext i8 %26 to i32
%28 = sub nsw i32 12, %27
%29 = call i32 @memset(i8* %25, i32 48, i32 %28)
%30 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%31 = load i8, i8* %4
%32 = zext i8 %31 to i32
%33 = sub nsw i32 12, %32
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %30, i64 %34
%36 = load i8*, i8** %2
%37 = load i8, i8* %4
%38 = zext i8 %37 to i32
%39 = call i32 @memcpy(i8* %35, i8* %36, i32 %38)
%40 = load i8*, i8** %2
%41 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%42 = call i32 @memcpy(i8* %40, i8* %41, i32 12)
br label %43
43: ; preds = %24, %22, %16
ret void
}

LLVM IR (-O2):
define void @suppplementTo12(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = tail call zeroext i8 @strlen(i8* %0)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = icmp ugt i8 %4, 11
br i1 %9, label %19, label %12
10: ; preds = %1
%11 = icmp ugt i8 %4, 12
br i1 %11, label %19, label %12
12: ; preds = %10, %8
%13 = sub nsw i32 12, %5
%14 = call i32 @memset(i8* %3, i32 48, i32 %13)
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %15
%17 = call i32 @memcpy(i8* %16, i8* %0, i32 %5)
%18 = call i32 @memcpy(i8* %0, i8* %3, i32 12)
br label %19
19: ; preds = %10, %8, %12
ret void
}