#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 */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
char *flu64_encode(char *, int /*<<< orphan*/);
char *flu64_encode_for_url(char *in, ssize_t l) {
  char *r = flu64_encode(in, l);
  for (size_t i = 0;; ++i) {
    if (r[i] == 0)
      break;
    if (r[i] == '=')
      r[i] = '.';
    else if (r[i] == '+')
      r[i] = '-';
    else if (r[i] == '/')
      r[i] = '_';
  }
  return r;
}


x86 assembly (clang, -O0):
<flu64_encode_for_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <flu64_encode@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1151 <flu64_encode_for_url+0x41>
jmp    11de <flu64_encode_for_url+0xce>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
jne    1177 <flu64_encode_for_url+0x67>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x2e,(%rax,%rcx,1)
jmp    11c8 <flu64_encode_for_url+0xb8>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2b,%eax
jne    119d <flu64_encode_for_url+0x8d>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x2d,(%rax,%rcx,1)
jmp    11c3 <flu64_encode_for_url+0xb3>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    11be <flu64_encode_for_url+0xae>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x5f,(%rax,%rcx,1)
jmp    11c3 <flu64_encode_for_url+0xb3>
jmp    11c8 <flu64_encode_for_url+0xb8>
jmp    11cd <flu64_encode_for_url+0xbd>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1137 <flu64_encode_for_url+0x27>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu64_encode_for_url>:
push   %rax
call   1030 <flu64_encode@plt>
mov    %rax,%rcx
jmp    112a <flu64_encode_for_url+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x5f,%sil
mov    %sil,(%rcx)
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x2e,%dl
jle    1150 <flu64_encode_for_url+0x40>
cmp    $0x2f,%dl
je     1120 <flu64_encode_for_url+0x10>
mov    $0x2e,%sil
cmp    $0x3d,%dl
je     1123 <flu64_encode_for_url+0x13>
jmp    1126 <flu64_encode_for_url+0x16>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x2b,%dl
jne    115a <flu64_encode_for_url+0x4a>
mov    $0x2d,%sil
jmp    1123 <flu64_encode_for_url+0x13>
test   %dl,%dl
jne    1126 <flu64_encode_for_url+0x16>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @flu64_encode_for_url(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i8* @flu64_encode(i8* %7, i32 %8)
store i8* %9, i8** %5
store i64 0, i64* %6
br label %10
10: ; preds = %54, %2
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %10
br label %57
18: ; preds = %10
%19 = load i8*, i8** %5
%20 = load i64, i64* %6
%21 = getelementptr inbounds i8, i8* %19, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 61
br i1 %24, label %25, label %29
25: ; preds = %18
%26 = load i8*, i8** %5
%27 = load i64, i64* %6
%28 = getelementptr inbounds i8, i8* %26, i64 %27
store i8 46, i8* %28
br label %53
29: ; preds = %18
%30 = load i8*, i8** %5
%31 = load i64, i64* %6
%32 = getelementptr inbounds i8, i8* %30, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 43
br i1 %35, label %36, label %40
36: ; preds = %29
%37 = load i8*, i8** %5
%38 = load i64, i64* %6
%39 = getelementptr inbounds i8, i8* %37, i64 %38
store i8 45, i8* %39
br label %52
40: ; preds = %29
%41 = load i8*, i8** %5
%42 = load i64, i64* %6
%43 = getelementptr inbounds i8, i8* %41, i64 %42
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 47
br i1 %46, label %47, label %51
47: ; preds = %40
%48 = load i8*, i8** %5
%49 = load i64, i64* %6
%50 = getelementptr inbounds i8, i8* %48, i64 %49
store i8 95, i8* %50
br label %51
51: ; preds = %47, %40
br label %52
52: ; preds = %51, %36
br label %53
53: ; preds = %52, %25
br label %54
54: ; preds = %53
%55 = load i64, i64* %6
%56 = add i64 %55, 1
store i64 %56, i64* %6
br label %10
57: ; preds = %17
%58 = load i8*, i8** %5
ret i8* %58
}

LLVM IR (-O2):
define i8* @flu64_encode_for_url(i8* %0, i32 %1) {
%3 = tail call i8* @flu64_encode(i8* %0, i32 %1)
br label %4
4: ; preds = %13, %2
%5 = phi i64 [ 0, %2 ], [ %14, %13 ]
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %13 [
i8 0, label %8
i8 61, label %11
i8 43, label %9
i8 47, label %10
]
8: ; preds = %4
ret i8* %3
9: ; preds = %4
br label %11
10: ; preds = %4
br label %11
11: ; preds = %4, %9, %10
%12 = phi i8 [ 95, %10 ], [ 45, %9 ], [ 46, %4 ]
store i8 %12, i8* %6
br label %13
13: ; preds = %11, %4
%14 = add i64 %5, 1
br label %4
}