main(v, c) char **c;
{
  srandom((int)time(!++c) * getpid());
  v-- > 1 ? printf("%s\n", c[random() % v]) : (int)v;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1060 <time@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x14(%rbp),%edi
imul   %eax,%edi
mov    $0x0,%al
call   1030 <srandom@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x1,%eax
jle    11e3 <main+0x93>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1070 <random@plt>
cltd
idivl  -0x8(%rbp)
mov    -0x20(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11e6 <main+0x96>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %edi,%edi
xor    %eax,%eax
call   1060 <time@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getpid@plt>
imul   %eax,%ebx
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <srandom@plt>
cmp    $0x2,%ebp
jl     1196 <main+0x46>
add    $0xffffffff,%ebp
xor    %eax,%eax
call   1070 <random@plt>
cltd
idiv   %ebp
movslq %edx,%rax
mov    0x8(%r14,%rax,8),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i32 1
store i8** %7, i8*** %5
%8 = icmp ne i8** %7, null
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 (i32, ...) bitcast (i32 (...)* @time to i32 (i32, ...)*)(i32 %10)
%12 = call i32 (...) @getpid()
%13 = mul nsw i32 %11, %12
%14 = call i32 (i32, ...) bitcast (i32 (...)* @srandom to i32 (i32, ...)*)(i32 %13)
%15 = load i32, i32* %4
%16 = add nsw i32 %15, -1
store i32 %16, i32* %4
%17 = icmp sgt i32 %15, 1
br i1 %17, label %18, label %27
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = call i32 (...) @random()
%21 = load i32, i32* %4
%22 = srem i32 %20, %21
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %19, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %25)
br label %29
27: ; preds = %2
%28 = load i32, i32* %4
br label %29
29: ; preds = %27, %18
%30 = phi i32 [ %26, %18 ], [ %28, %27 ]
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @time to i32 (i32, ...)*)(i32 0)
%4 = tail call i32 (...) @getpid()
%5 = mul nsw i32 %4, %3
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @srandom to i32 (i32, ...)*)(i32 %5)
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = add nsw i32 %0, -1
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = tail call i32 (...) @random()
%12 = srem i32 %11, %9
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %10, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i32 @puts(i8* dereferenceable(1) %15)
br label %17
17: ; preds = %2, %8
ret i32 0
}