#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*/ getchar();
int /*<<< orphan*/ strcpy(char *, char *);
void swap(char (*arg1)[20], char (*arg2)[20]) {
  char tempname[20];
  char tempnum[20];
  strcpy(tempname, arg1[0]);
  strcpy(arg1[0], arg2[0]);
  strcpy(arg2[0], tempname);
  strcpy(tempnum, arg1[1]);
  strcpy(arg1[1], arg2[1]);
  strcpy(arg2[1], tempnum);
  getchar();
  return;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x14,%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x14,%rdi
mov    -0x10(%rbp),%rsi
add    $0x14,%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
add    $0x14,%rdi
lea    -0x50(%rbp),%rsi
call   1030 <strcpy@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0x14,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
add    $0x14,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swap([20 x i8]* %0, [20 x i8]* %1) {
%3 = alloca [20 x i8]*
%4 = alloca [20 x i8]*
%5 = alloca [20 x i8]
%6 = alloca [20 x i8]
store [20 x i8]* %0, [20 x i8]** %3
store [20 x i8]* %1, [20 x i8]** %4
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%8 = load [20 x i8]*, [20 x i8]** %3
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%11 = call i32 @strcpy(i8* %7, i8* %10)
%12 = load [20 x i8]*, [20 x i8]** %3
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
%15 = load [20 x i8]*, [20 x i8]** %4
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %15, i64 0
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %16, i64 0, i64 0
%18 = call i32 @strcpy(i8* %14, i8* %17)
%19 = load [20 x i8]*, [20 x i8]** %4
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %19, i64 0
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %20, i64 0, i64 0
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%23 = call i32 @strcpy(i8* %21, i8* %22)
%24 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%25 = load [20 x i8]*, [20 x i8]** %3
%26 = getelementptr inbounds [20 x i8], [20 x i8]* %25, i64 1
%27 = getelementptr inbounds [20 x i8], [20 x i8]* %26, i64 0, i64 0
%28 = call i32 @strcpy(i8* %24, i8* %27)
%29 = load [20 x i8]*, [20 x i8]** %3
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %29, i64 1
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %30, i64 0, i64 0
%32 = load [20 x i8]*, [20 x i8]** %4
%33 = getelementptr inbounds [20 x i8], [20 x i8]* %32, i64 1
%34 = getelementptr inbounds [20 x i8], [20 x i8]* %33, i64 0, i64 0
%35 = call i32 @strcpy(i8* %31, i8* %34)
%36 = load [20 x i8]*, [20 x i8]** %4
%37 = getelementptr inbounds [20 x i8], [20 x i8]* %36, i64 1
%38 = getelementptr inbounds [20 x i8], [20 x i8]* %37, i64 0, i64 0
%39 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%40 = call i32 @strcpy(i8* %38, i8* %39)
%41 = call i32 (...) @getchar()
ret void
}

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