#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*/ printf(char *, int, int, int);
void Pass_by_reference(int *x_p, int *y_p, int *z_p) {
  printf("In Pass_by_reference, x = %d, y = %d, z = %d\n", *x_p, *y_p, *z_p);
  *x_p = 2 + *x_p;
  *y_p = *y_p - 3;
  *z_p = 7 + *z_p;
  printf("In Pass_by_reference, x = %d, y = %d, z = %d\n\n", *x_p, *y_p, *z_p);
}


x86 assembly (clang, -O0):
<Pass_by_reference>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x3,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x7,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pass_by_reference>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%esi
mov    (%r14),%edx
mov    (%r15),%ecx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
addl   $0x2,(%rbx)
addl   $0xfffffffd,(%r14)
mov    (%r15),%ecx
add    $0x7,%ecx
mov    %ecx,(%r15)
mov    (%rbx),%esi
mov    (%r14),%edx
lea    0xee0(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"In Pass_by_reference, x = %d, y = %d, z = %d\0A\00"
@.str.1 = [47 x i8] c"In Pass_by_reference, x = %d, y = %d, z = %d\0A\0A\00"
define void @Pass_by_reference(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10, i32 %12)
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = add nsw i32 2, %15
%17 = load i32*, i32** %4
store i32 %16, i32* %17
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = sub nsw i32 %19, 3
%21 = load i32*, i32** %5
store i32 %20, i32* %21
%22 = load i32*, i32** %6
%23 = load i32, i32* %22
%24 = add nsw i32 7, %23
%25 = load i32*, i32** %6
store i32 %24, i32* %25
%26 = load i32*, i32** %4
%27 = load i32, i32* %26
%28 = load i32*, i32** %5
%29 = load i32, i32* %28
%30 = load i32*, i32** %6
%31 = load i32, i32* %30
%32 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %27, i32 %29, i32 %31)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"In Pass_by_reference, x = %d, y = %d, z = %d\0A\00"
@.str.1 = [47 x i8] c"In Pass_by_reference, x = %d, y = %d, z = %d\0A\0A\00"
define void @Pass_by_reference(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %6)
%8 = load i32, i32* %0
%9 = add nsw i32 %8, 2
store i32 %9, i32* %0
%10 = load i32, i32* %1
%11 = add nsw i32 %10, -3
store i32 %11, i32* %1
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 7
store i32 %13, i32* %2
%14 = load i32, i32* %0
%15 = load i32, i32* %1
%16 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15, i32 %13)
ret void
}