#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 */
scalar_t__ atol(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
long fromBase62(char *);
long getTime();
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ toBase62(long, char *);
int shorturl(int argc, const char *argv[]) {
  char szBase62[16] = {
      0x00,
  };
  long dec = 0;
  long timeInput = 0;
  timeInput = getTime();
  toBase62((long)atol(argv[1]), szBase62);
  dec = fromBase62(szBase62);
  fprintf(stdout, "%s", szBase62);
  return 0;
}


x86 assembly (clang, -O0):
<shorturl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    $0x0,%al
call   1030 <getTime@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atol@plt>
mov    %rax,%rdi
lea    -0x20(%rbp),%rsi
call   1070 <toBase62@plt>
lea    -0x20(%rbp),%rdi
call   1080 <fromBase62@plt>
mov    %rax,-0x28(%rbp)
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rdx
lea    0xe2c(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shorturl>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <getTime@plt>
mov    0x8(%rbx),%rdi
call   1050 <atol@plt>
mov    %rsp,%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1060 <toBase62@plt>
mov    %rbx,%rdi
call   1070 <fromBase62@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe6b(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @shorturl(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [16 x i8]
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = bitcast [16 x i8]* %5 to i8*
store i64 0, i64* %6
store i64 0, i64* %7
%9 = call i64 (...) @getTime()
store i64 %9, i64* %7
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @atol(i8* %12)
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%15 = call i32 @toBase62(i64 %13, i8* %14)
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%17 = call i64 @fromBase62(i8* %16)
store i64 %17, i64* %6
%18 = load i32, i32* @stdout
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%20 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %19)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @shorturl(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = tail call i64 (...) @getTime()
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @atol(i8* %7)
%9 = call i32 @toBase62(i64 %8, i8* %4)
%10 = call i64 @fromBase62(i8* %4)
%11 = load i32, i32* @stdout
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}