#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 */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ pairWiseSwap(struct node **);
int /*<<< orphan*/ printList(struct node *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ push(struct node **, int);
int main() {
  struct node *start = NULL;
  push(&start, 7);
  push(&start, 6);
  push(&start, 5);
  push(&start, 4);
  push(&start, 3);
  push(&start, 2);
  push(&start, 1);
  printf("\nLinked list before calling pairwise swap()");
  printList(start);
  pairWiseSwap(&start);
  printf("\nLinked list after calling pairwise swap()");
  printList(start);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x7,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
mov    $0x6,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <push@plt>
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <printList@plt>
lea    -0x10(%rbp),%rdi
call   1060 <pairWiseSwap@plt>
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <printList@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <push@plt>
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%rdi
call   1070 <printList@plt>
mov    %rbx,%rdi
call   1060 <pairWiseSwap@plt>
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%rdi
call   1070 <printList@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [44 x i8] c"\0ALinked list before calling pairwise swap()\00"
@.str.1 = [43 x i8] c"\0ALinked list after calling pairwise swap()\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
store i32 0, i32* %1
store %struct.node* null, %struct.node** %2
%3 = call i32 @push(%struct.node** %2, i32 7)
%4 = call i32 @push(%struct.node** %2, i32 6)
%5 = call i32 @push(%struct.node** %2, i32 5)
%6 = call i32 @push(%struct.node** %2, i32 4)
%7 = call i32 @push(%struct.node** %2, i32 3)
%8 = call i32 @push(%struct.node** %2, i32 2)
%9 = call i32 @push(%struct.node** %2, i32 1)
%10 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%11 = load %struct.node*, %struct.node** %2
%12 = call i32 @printList(%struct.node* %11)
%13 = call i32 @pairWiseSwap(%struct.node** %2)
%14 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%15 = load %struct.node*, %struct.node** %2
%16 = call i32 @printList(%struct.node* %15)
%17 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [44 x i8] c"\0ALinked list before calling pairwise swap()\00"
@.str.1 = [43 x i8] c"\0ALinked list after calling pairwise swap()\00"
define i32 @main() {
%1 = alloca %struct.node*
%2 = bitcast %struct.node** %1 to i8*
store %struct.node* null, %struct.node** %1
%3 = call i32 @push(%struct.node** %1, i32 7)
%4 = call i32 @push(%struct.node** %1, i32 6)
%5 = call i32 @push(%struct.node** %1, i32 5)
%6 = call i32 @push(%struct.node** %1, i32 4)
%7 = call i32 @push(%struct.node** %1, i32 3)
%8 = call i32 @push(%struct.node** %1, i32 2)
%9 = call i32 @push(%struct.node** %1, i32 1)
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%11 = load %struct.node*, %struct.node** %1
%12 = call i32 @printList(%struct.node* %11)
%13 = call i32 @pairWiseSwap(%struct.node** %1)
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%15 = load %struct.node*, %struct.node** %1
%16 = call i32 @printList(%struct.node* %15)
%17 = call i32 (...) @getchar()
ret i32 0
}