int main() {
  int x = 10, y = 20;
  printf("%s%d\t%s%d\n", "being:  x=", x, "y=", y);
  swap(x, y);
  printf("%s%d\t%s%d\n", "swap:  x=", x, "y=", y);
  swapR(x, y);
  printf("%s%d\t%s%d\n", "swapR:  x=", x, "y=", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
lea    0xea5(%rip),%rdi
lea    0xea9(%rip),%rsi
lea    0xead(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1050 <swap@plt>
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
lea    0xe75(%rip),%rdi
lea    0xe87(%rip),%rsi
lea    0xe7d(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1040 <swapR@plt>
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
lea    0xe45(%rip),%rdi
lea    0xe61(%rip),%rsi
lea    0xe4d(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rbx
lea    0xec9(%rip),%rsi
lea    0xecd(%rip),%r14
mov    %rbx,%rdi
mov    $0xa,%edx
mov    %r14,%rcx
mov    $0x14,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x14,%esi
xor    %eax,%eax
call   1050 <swap@plt>
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
mov    %r14,%rcx
mov    $0x14,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x14,%esi
xor    %eax,%eax
call   1040 <swapR@plt>
lea    0xe7a(%rip),%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
mov    %r14,%rcx
mov    $0x14,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s%d\09%s%d\0A\00"
@.str.1 = [11 x i8] c"being: x=\00"
@.str.2 = [3 x i8] c"y=\00"
@.str.3 = [10 x i8] c"swap: x=\00"
@.str.4 = [11 x i8] c"swapR: x=\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @swap to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 (i32, i32, ...) bitcast (i32 (...)* @swapR to i32 (i32, i32, ...)*)(i32 %13, i32 %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s%d\09%s%d\0A\00"
@.str.1 = [11 x i8] c"being: x=\00"
@.str.2 = [3 x i8] c"y=\00"
@.str.3 = [10 x i8] c"swap: x=\00"
@.str.4 = [11 x i8] c"swapR: x=\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 20)
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @swap to i32 (i32, i32, ...)*)(i32 10, i32 20)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 20)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @swapR to i32 (i32, i32, ...)*)(i32 10, i32 20)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 20)
ret i32 0
}