#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 EXIT_SUCCESS;
int /*<<< orphan*/ PrintNumbers(int, int);
int /*<<< orphan*/ SwapCorrect(int *, int *);
int /*<<< orphan*/ SwapWrong(int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int num1 = 52;
  int num2 = 44;
  printf("Initial values of num1 and num2\n");
  PrintNumbers(num1, num2);
  SwapWrong(num1, num2);
  printf("\nAfter calling SwapWrong() on num1 and num2...\n");
  PrintNumbers(num1, num2);
  SwapCorrect(&num1, &num2);
  printf("\nAfter calling SwapCorrect() on num1 and num2...\n");
  PrintNumbers(num1, num2);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x34,-0x8(%rbp)
movl   $0x2c,-0xc(%rbp)
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <PrintNumbers@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <SwapWrong@plt>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <PrintNumbers@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <SwapCorrect@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <PrintNumbers@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x34,0x4(%rsp)
movl   $0x2c,(%rsp)
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x34,%edi
mov    $0x2c,%esi
call   1050 <PrintNumbers@plt>
mov    $0x34,%edi
mov    $0x2c,%esi
call   1060 <SwapWrong@plt>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x34,%edi
mov    $0x2c,%esi
call   1050 <PrintNumbers@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <SwapCorrect@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <PrintNumbers@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Initial values of num1 and num2\0A\00"
@.str.1 = [48 x i8] c"\0AAfter calling SwapWrong() on num1 and num2...\0A\00"
@.str.2 = [50 x i8] c"\0AAfter calling SwapCorrect() on num1 and num2...\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 52, i32* %2
store i32 44, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @PrintNumbers(i32 %5, i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @SwapWrong(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @PrintNumbers(i32 %12, i32 %13)
%15 = call i32 @SwapCorrect(i32* %2, i32* %3)
%16 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i32 @PrintNumbers(i32 %17, i32 %18)
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [32 x i8] c"Initial values of num1 and num2\00"
@str.3 = [47 x i8] c"\0AAfter calling SwapWrong() on num1 and num2...\00"
@str.4 = [49 x i8] c"\0AAfter calling SwapCorrect() on num1 and num2...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 52, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 44, i32* %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @PrintNumbers(i32 52, i32 44)
%7 = tail call i32 @SwapWrong(i32 52, i32 44)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.3, i64 0, i64 0))
%9 = tail call i32 @PrintNumbers(i32 52, i32 44)
%10 = call i32 @SwapCorrect(i32* %1, i32* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.4, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @PrintNumbers(i32 %12, i32 %13)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}