#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*/ rand();
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, int /*<<< orphan*/,
                           scalar_t__);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
scalar_t__ strrchr(char *, char);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  char buff[1024];
  if (argc != 2)
    return 0;
  srand(time(NULL));
  sprintf(buff, "mv \"%s\" \"%s/%ld%s\"", argv[1],
          "/home/jrising/tmp/web-collage/", rand(), strrchr(argv[1], '/') + 1);
  system(buff);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     118f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1216 <main+0xb6>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    -0x410(%rbp),%rax
mov    %rax,-0x428(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x420(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    %eax,-0x414(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    -0x428(%rbp),%rdi
mov    -0x420(%rbp),%rdx
mov    -0x414(%rbp),%r8d
mov    %rax,%r9
add    $0x1,%r9
lea    0xe02(%rip),%rsi
lea    0xe0e(%rip),%rcx
call   1070 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    11d2 <main+0x72>
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rbx
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    0x8(%rbx),%r14
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%r9
lea    0xe59(%rip),%rsi
lea    0xe65(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %ebp,%r8d
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"mv \22%s\22 \22%s/%ld%s\22\00"
@.str.1 = [31 x i8] c"/home/jrising/tmp/web-collage/\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %26
10: ; preds = %2
%11 = call i32 @time(i32* null)
%12 = call i32 @srand(i32 %11)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 (...) @rand()
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strrchr(i8* %20, i8 signext 47)
%22 = add nsw i64 %21, 1
%23 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %16, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %17, i64 %22)
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%25 = call i32 @system(i8* %24)
br label %26
26: ; preds = %10, %9
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [19 x i8] c"mv \22%s\22 \22%s/%ld%s\22\00"
@.str.1 = [31 x i8] c"/home/jrising/tmp/web-collage/\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = tail call i32 @time(i32* null)
%8 = tail call i32 @srand(i32 %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 (...) @rand()
%12 = load i8*, i8** %9
%13 = tail call i64 @strrchr(i8* %12, i8 signext 47)
%14 = add nsw i64 %13, 1
%15 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %10, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %11, i64 %14)
%16 = call i32 @system(i8* %4)
br label %17
17: ; preds = %2, %6
ret i32 0
}