#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 *flu64_encode(char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int print_usage();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int c64(char **args) {
  if (args[1] == NULL) {
    fprintf(stderr, "\n** missing text to encode **\n\n");
    return print_usage();
  }
  printf("%s\n", flu64_encode(args[1], -1));
  return 0;
}


x86 assembly (clang, -O0):
<c64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    117f <c64+0x3f>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1060 <print_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    11a7 <c64+0x67>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0xffffffff,%esi
call   1050 <flu64_encode@plt>
mov    %rax,%rsi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c64>:
push   %rax
mov    0x8(%rdi),%rdi
test   %rdi,%rdi
je     1167 <c64+0x27>
mov    $0xffffffff,%esi
call   1050 <flu64_encode@plt>
lea    0xec5(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <print_usage@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"\0A** missing text to encode **\0A\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @c64(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i8**, i8*** %3
%5 = getelementptr inbounds i8*, i8** %4, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @print_usage()
store i32 %11, i32* %2
br label %18
12: ; preds = %1
%13 = load i8**, i8*** %3
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i8* @flu64_encode(i8* %15, i32 -1)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
store i32 0, i32* %2
br label %18
18: ; preds = %12, %8
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"\0A** missing text to encode **\0A\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @c64(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @print_usage()
br label %12
9: ; preds = %1
%10 = tail call i8* @flu64_encode(i8* %3, i32 -1)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %5
%13 = phi i32 [ %8, %5 ], [ 0, %9 ]
ret i32 %13
}