#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*/ argv;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  srand(time(NULL));
  int i, x, length, random;
  char temp;
  for (i = 1; i < argc; i++) {
    length = sizeof(argv[i]) - 2;
    if (length > 3) {
      for (x = 1; x < length; x++) {
        random = 1 + (rand() % length);
        temp = argv[i][x];
        argv[i][x] = argv[i][random];
        argv[i][random] = temp;
      }
    }
    printf("%s ", argv[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1239 <main+0xf9>
movl   $0x6,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jle    1213 <main+0xd3>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    120e <main+0xce>
mov    $0x0,%al
call   1060 <rand@plt>
cltd
idivl  -0x1c(%rbp)
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x21(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x21(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1191 <main+0x51>
jmp    1213 <main+0xd3>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xdda(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116d <main+0x2d>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r12
mov    %edi,%ebp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
cmp    $0x2,%ebp
jl     12cf <main+0x18f>
mov    %ebp,%r15d
mov    $0x1,%ebp
lea    0xe8d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cltq
mov    (%r12,%rbp,8),%rcx
movzbl 0x1(%rcx),%edx
movzbl 0x1(%rcx,%rax,1),%ebx
mov    %bl,0x1(%rcx)
mov    (%r12,%rbp,8),%rcx
mov    %dl,0x1(%rcx,%rax,1)
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cltq
mov    (%r12,%rbp,8),%rcx
movzbl 0x2(%rcx),%edx
movzbl 0x1(%rcx,%rax,1),%ebx
mov    %bl,0x2(%rcx)
mov    (%r12,%rbp,8),%rcx
mov    %dl,0x1(%rcx,%rax,1)
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cltq
mov    (%r12,%rbp,8),%rcx
movzbl 0x3(%rcx),%edx
movzbl 0x1(%rcx,%rax,1),%ebx
mov    %bl,0x3(%rcx)
mov    (%r12,%rbp,8),%rcx
mov    %dl,0x1(%rcx,%rax,1)
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cltq
mov    (%r12,%rbp,8),%rcx
movzbl 0x4(%rcx),%edx
movzbl 0x1(%rcx,%rax,1),%ebx
mov    %bl,0x4(%rcx)
mov    (%r12,%rbp,8),%rcx
mov    %dl,0x1(%rcx,%rax,1)
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cltq
mov    (%r12,%rbp,8),%rcx
movzbl 0x5(%rcx),%edx
movzbl 0x1(%rcx,%rax,1),%ebx
mov    %bl,0x5(%rcx)
mov    (%r12,%rbp,8),%rcx
mov    %dl,0x1(%rcx,%rax,1)
mov    (%r12,%rbp,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1180 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @time(i32* null)
%12 = call i32 @srand(i32 %11)
store i32 1, i32* %6
br label %13
13: ; preds = %76, %2
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %79
17: ; preds = %13
store i32 6, i32* %8
%18 = load i32, i32* %8
%19 = icmp sgt i32 %18, 3
br i1 %19, label %20, label %69
20: ; preds = %17
store i32 1, i32* %7
br label %21
21: ; preds = %65, %20
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %68
25: ; preds = %21
%26 = call i32 (...) @rand()
%27 = load i32, i32* %8
%28 = srem i32 %26, %27
%29 = add nsw i32 1, %28
store i32 %29, i32* %9
%30 = load i8**, i8*** %5
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %34, i64 %36
%38 = load i8, i8* %37
store i8 %38, i8* %10
%39 = load i8**, i8*** %5
%40 = load i32, i32* %6
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %39, i64 %41
%43 = load i8*, i8** %42
%44 = load i32, i32* %9
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %43, i64 %45
%47 = load i8, i8* %46
%48 = load i8**, i8*** %5
%49 = load i32, i32* %6
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8*, i8** %48, i64 %50
%52 = load i8*, i8** %51
%53 = load i32, i32* %7
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %52, i64 %54
store i8 %47, i8* %55
%56 = load i8, i8* %10
%57 = load i8**, i8*** %5
%58 = load i32, i32* %6
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8*, i8** %57, i64 %59
%61 = load i8*, i8** %60
%62 = load i32, i32* %9
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %61, i64 %63
store i8 %56, i8* %64
br label %65
65: ; preds = %25
%66 = load i32, i32* %7
%67 = add nsw i32 %66, 1
store i32 %67, i32* %7
br label %21
68: ; preds = %21
br label %69
69: ; preds = %68, %17
%70 = load i8**, i8*** %5
%71 = load i32, i32* %6
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8*, i8** %70, i64 %72
%74 = load i8*, i8** %73
%75 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %74)
br label %76
76: ; preds = %69
%77 = load i32, i32* %6
%78 = add nsw i32 %77, 1
store i32 %78, i32* %6
br label %13
79: ; preds = %13
%80 = load i32, i32* %3
ret i32 %80
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %70
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 1, %6 ], [ %68, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = tail call i32 (...) @rand()
%12 = srem i32 %11, 6
%13 = add nsw i32 %12, 1
%14 = load i8*, i8** %10
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = sext i32 %13 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8, i8* %18
store i8 %19, i8* %15
%20 = load i8*, i8** %10
%21 = getelementptr inbounds i8, i8* %20, i64 %17
store i8 %16, i8* %21
%22 = tail call i32 (...) @rand()
%23 = srem i32 %22, 6
%24 = add nsw i32 %23, 1
%25 = load i8*, i8** %10
%26 = getelementptr inbounds i8, i8* %25, i64 2
%27 = load i8, i8* %26
%28 = sext i32 %24 to i64
%29 = getelementptr inbounds i8, i8* %25, i64 %28
%30 = load i8, i8* %29
store i8 %30, i8* %26
%31 = load i8*, i8** %10
%32 = getelementptr inbounds i8, i8* %31, i64 %28
store i8 %27, i8* %32
%33 = tail call i32 (...) @rand()
%34 = srem i32 %33, 6
%35 = add nsw i32 %34, 1
%36 = load i8*, i8** %10
%37 = getelementptr inbounds i8, i8* %36, i64 3
%38 = load i8, i8* %37
%39 = sext i32 %35 to i64
%40 = getelementptr inbounds i8, i8* %36, i64 %39
%41 = load i8, i8* %40
store i8 %41, i8* %37
%42 = load i8*, i8** %10
%43 = getelementptr inbounds i8, i8* %42, i64 %39
store i8 %38, i8* %43
%44 = tail call i32 (...) @rand()
%45 = srem i32 %44, 6
%46 = add nsw i32 %45, 1
%47 = load i8*, i8** %10
%48 = getelementptr inbounds i8, i8* %47, i64 4
%49 = load i8, i8* %48
%50 = sext i32 %46 to i64
%51 = getelementptr inbounds i8, i8* %47, i64 %50
%52 = load i8, i8* %51
store i8 %52, i8* %48
%53 = load i8*, i8** %10
%54 = getelementptr inbounds i8, i8* %53, i64 %50
store i8 %49, i8* %54
%55 = tail call i32 (...) @rand()
%56 = srem i32 %55, 6
%57 = add nsw i32 %56, 1
%58 = load i8*, i8** %10
%59 = getelementptr inbounds i8, i8* %58, i64 5
%60 = load i8, i8* %59
%61 = sext i32 %57 to i64
%62 = getelementptr inbounds i8, i8* %58, i64 %61
%63 = load i8, i8* %62
store i8 %63, i8* %59
%64 = load i8*, i8** %10
%65 = getelementptr inbounds i8, i8* %64, i64 %61
store i8 %60, i8* %65
%66 = load i8*, i8** %10
%67 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %66)
%68 = add nuw nsw i64 %9, 1
%69 = icmp eq i64 %68, %7
br i1 %69, label %70, label %8
70: ; preds = %8, %2
ret i32 0
}