#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*/ strcpy(char *, char *);
void swap(int num[], int x, int y, char arr[][80]) {
  int t;
  char tc[80];
  t = num[x];
  num[x] = num[y];
  num[y] = t;
  strcpy(tc, arr[x]);
  strcpy(arr[x], arr[y]);
  strcpy(arr[y], tc);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
lea    -0x70(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0xc(%rbp),%rax
imul   $0x50,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
movslq -0xc(%rbp),%rax
imul   $0x50,%rax,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x10(%rbp),%rax
imul   $0x50,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
movslq -0x10(%rbp),%rax
imul   $0x50,%rax,%rax
add    %rax,%rdi
lea    -0x70(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rcx,%r14
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rbx
mov    (%rdi,%rbx,4),%edx
mov    %edx,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rbx,4)
lea    (%rax,%rax,4),%r12
shl    $0x4,%r12
add    %r14,%r12
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
lea    (%rbx,%rbx,4),%rbx
shl    $0x4,%rbx
add    %r14,%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2, [80 x i8]* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca [80 x i8]*
%9 = alloca i32
%10 = alloca [80 x i8]
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store [80 x i8]* %3, [80 x i8]** %8
%11 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
store i32 %15, i32* %9
%16 = load i32*, i32** %5
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = load i32*, i32** %5
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
store i32 %20, i32* %24
%25 = load i32, i32* %9
%26 = load i32*, i32** %5
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
store i32 %25, i32* %29
%30 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%31 = load [80 x i8]*, [80 x i8]** %8
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [80 x i8], [80 x i8]* %31, i64 %33
%35 = getelementptr inbounds [80 x i8], [80 x i8]* %34, i64 0, i64 0
%36 = call i32 @strcpy(i8* %30, i8* %35)
%37 = load [80 x i8]*, [80 x i8]** %8
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [80 x i8], [80 x i8]* %37, i64 %39
%41 = getelementptr inbounds [80 x i8], [80 x i8]* %40, i64 0, i64 0
%42 = load [80 x i8]*, [80 x i8]** %8
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [80 x i8], [80 x i8]* %42, i64 %44
%46 = getelementptr inbounds [80 x i8], [80 x i8]* %45, i64 0, i64 0
%47 = call i32 @strcpy(i8* %41, i8* %46)
%48 = load [80 x i8]*, [80 x i8]** %8
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [80 x i8], [80 x i8]* %48, i64 %50
%52 = getelementptr inbounds [80 x i8], [80 x i8]* %51, i64 0, i64 0
%53 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%54 = call i32 @strcpy(i8* %52, i8* %53)
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2, [80 x i8]* %3) {
%5 = alloca [80 x i8]
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %8
store i32 %9, i32* %11
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 %7, i64 0
%14 = call i32 @strcpy(i8* %6, i8* %13)
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 %10, i64 0
%16 = call i32 @strcpy(i8* %13, i8* %15)
%17 = call i32 @strcpy(i8* %15, i8* %6)
ret void
}