#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 iscsiAuthClientDataToBase64(unsigned char *, unsigned int, char *,
                                unsigned int);
int iscsiAuthClientDataToHex(unsigned char *, unsigned int, char *,
                             unsigned int);
int iscsiAuthClientDataToText(int base64, unsigned char *data,
                              unsigned int dataLength, char *text,
                              unsigned int textLength) {
  int status;
  if (base64) {
    status = iscsiAuthClientDataToBase64(data, dataLength, text, textLength);
  } else {
    status = iscsiAuthClientDataToHex(data, dataLength, text, textLength);
  }
  return status;
}


x86 assembly (clang, -O0):
<iscsiAuthClientDataToText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115f <iscsiAuthClientDataToText+0x3f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <iscsiAuthClientDataToBase64@plt>
mov    %eax,-0x28(%rbp)
jmp    1175 <iscsiAuthClientDataToText+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <iscsiAuthClientDataToHex@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscsiAuthClientDataToText>:
test   %edi,%edi
je     1134 <iscsiAuthClientDataToText+0x14>
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
mov    %r8d,%ecx
jmp    1040 <iscsiAuthClientDataToBase64@plt>
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
mov    %r8d,%ecx
jmp    1030 <iscsiAuthClientDataToHex@plt>

LLVM IR (-O0):
define i32 @iscsiAuthClientDataToText(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %5
%15 = load i8*, i8** %7
%16 = load i32, i32* %8
%17 = load i8*, i8** %9
%18 = load i32, i32* %10
%19 = call i32 @iscsiAuthClientDataToBase64(i8* %15, i32 %16, i8* %17, i32 %18)
store i32 %19, i32* %11
br label %26
20: ; preds = %5
%21 = load i8*, i8** %7
%22 = load i32, i32* %8
%23 = load i8*, i8** %9
%24 = load i32, i32* %10
%25 = call i32 @iscsiAuthClientDataToHex(i8* %21, i32 %22, i8* %23, i32 %24)
store i32 %25, i32* %11
br label %26
26: ; preds = %20, %14
%27 = load i32, i32* %11
ret i32 %27
}

LLVM IR (-O2):
define i32 @iscsiAuthClientDataToText(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = icmp eq i32 %0, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @iscsiAuthClientDataToBase64(i8* %1, i32 %2, i8* %3, i32 %4)
br label %11
9: ; preds = %5
%10 = tail call i32 @iscsiAuthClientDataToHex(i8* %1, i32 %2, i8* %3, i32 %4)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}