#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*/ ft_memdel(void **);
char *ft_strdup(char *);
char *ft_strjoin_free(char *, int, char *, int);
char *ft_strsub(char *, int /*<<< orphan*/, int);
void transfer_0x(char **ppad, void **addr) {
  char *swap;
  char *pref_0x;
  if (!(ppad && addr))
    return;
  pref_0x = ft_strsub((char *)*addr, 0, 2);
  swap = ft_strdup((char *)(*addr + 2));
  ft_memdel(addr);
  *addr = swap;
  *ppad = ft_strjoin_free(pref_0x, 1, *ppad, 1);
}


x86 assembly (clang, -O0):
<transfer_0x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <transfer_0x+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    116b <transfer_0x+0x2b>
jmp    11cb <transfer_0x+0x8b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <ft_strsub@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
add    $0x2,%rdi
call   1060 <ft_strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_memdel@plt>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%ecx
mov    %ecx,%esi
call   1040 <ft_strjoin_free@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_0x>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     119c <transfer_0x+0x5c>
mov    %rsi,%rbx
test   %rsi,%rsi
je     119c <transfer_0x+0x5c>
mov    %rdi,%r14
mov    (%rbx),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <ft_strsub@plt>
mov    %rax,%r15
mov    (%rbx),%rdi
add    $0x2,%rdi
call   1060 <ft_strdup@plt>
mov    %rax,%r12
mov    %rbx,%rdi
call   1030 <ft_memdel@plt>
mov    %r12,(%rbx)
mov    (%r14),%rdx
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x1,%ecx
call   1040 <ft_strjoin_free@plt>
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @transfer_0x(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%7 = load i8**, i8*** %3
%8 = icmp ne i8** %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8**, i8*** %4
%11 = icmp ne i8** %10, null
br i1 %11, label %13, label %12
12: ; preds = %9, %2
br label %30
13: ; preds = %9
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
%16 = call i8* @ft_strsub(i8* %15, i32 0, i32 2)
store i8* %16, i8** %6
%17 = load i8**, i8*** %4
%18 = load i8*, i8** %17
%19 = getelementptr i8, i8* %18, i64 2
%20 = call i8* @ft_strdup(i8* %19)
store i8* %20, i8** %5
%21 = load i8**, i8*** %4
%22 = call i32 @ft_memdel(i8** %21)
%23 = load i8*, i8** %5
%24 = load i8**, i8*** %4
store i8* %23, i8** %24
%25 = load i8*, i8** %6
%26 = load i8**, i8*** %3
%27 = load i8*, i8** %26
%28 = call i8* @ft_strjoin_free(i8* %25, i32 1, i8* %27, i32 1)
%29 = load i8**, i8*** %3
store i8* %28, i8** %29
br label %30
30: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
define void @transfer_0x(i8** %0, i8** %1) {
%3 = icmp ne i8** %0, null
%4 = icmp ne i8** %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i8* @ft_strsub(i8* %7, i32 0, i32 2)
%9 = load i8*, i8** %1
%10 = getelementptr i8, i8* %9, i64 2
%11 = tail call i8* @ft_strdup(i8* %10)
%12 = tail call i32 @ft_memdel(i8** %1)
store i8* %11, i8** %1
%13 = load i8*, i8** %0
%14 = tail call i8* @ft_strjoin_free(i8* %8, i32 1, i8* %13, i32 1)
store i8* %14, i8** %0
br label %15
15: ; preds = %2, %6
ret void
}