#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*/ f1(int *, int *);
int /*<<< orphan*/ f2(int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x, y;
  int *xp, *yp;
  xp = &x;
  yp = &y;
  printf("Para xp != yp:\n");
  x = 5;
  y = 4;
  f1(xp, yp);
  printf("Apos f1, x=%d\n", x);
  x = 5;
  y = 4;
  f2(xp, yp);
  printf("Apos f2, x=%d\n", x);
  xp = &x;
  yp = &x;
  printf("Para xp == yp:\n");
  x = 5;
  f1(xp, yp);
  printf("Apos f1, x=%d\n", x);
  x = 5;
  f2(xp, yp);
  printf("Apos f2, x=%d\n", x);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x5,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <f1@plt>
mov    -0x8(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x5,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <f2@plt>
mov    -0x8(%rbp),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x5,-0x8(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <f1@plt>
mov    -0x8(%rbp),%esi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x5,-0x8(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <f2@plt>
mov    -0x8(%rbp),%esi
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
movl   $0x5,0x8(%rsp)
movl   $0x4,0xc(%rsp)
lea    0x8(%rsp),%rbx
lea    0xc(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <f1@plt>
mov    0x8(%rsp),%esi
lea    0xe7b(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x5,0x8(%rsp)
movl   $0x4,0xc(%rsp)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <f2@plt>
mov    0x8(%rsp),%esi
lea    0xe5a(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe67(%rip),%rdi
call   1040 <puts@plt>
movl   $0x5,0x8(%rsp)
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1060 <f1@plt>
mov    0x8(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x5,0x8(%rsp)
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <f2@plt>
mov    0x8(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Para xp != yp:\0A\00"
@.str.1 = [15 x i8] c"Apos f1, x=%d\0A\00"
@.str.2 = [15 x i8] c"Apos f2, x=%d\0A\00"
@.str.3 = [16 x i8] c"Para xp == yp:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
store i32* %2, i32** %4
store i32* %3, i32** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 5, i32* %2
store i32 4, i32* %3
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = call i32 @f1(i32* %7, i32* %8)
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %10)
store i32 5, i32* %2
store i32 4, i32* %3
%12 = load i32*, i32** %4
%13 = load i32*, i32** %5
%14 = call i32 @f2(i32* %12, i32* %13)
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %15)
store i32* %2, i32** %4
store i32* %2, i32** %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
store i32 5, i32* %2
%18 = load i32*, i32** %4
%19 = load i32*, i32** %5
%20 = call i32 @f1(i32* %18, i32* %19)
%21 = load i32, i32* %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %21)
store i32 5, i32* %2
%23 = load i32*, i32** %4
%24 = load i32*, i32** %5
%25 = call i32 @f2(i32* %23, i32* %24)
%26 = load i32, i32* %2
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %26)
ret i32 1
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"Apos f1, x=%d\0A\00"
@.str.2 = [15 x i8] c"Apos f2, x=%d\0A\00"
@str = [15 x i8] c"Para xp != yp:\00"
@str.4 = [15 x i8] c"Para xp == yp:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
store i32 5, i32* %1
store i32 4, i32* %2
%6 = call i32 @f1(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %7)
store i32 5, i32* %1
store i32 4, i32* %2
%9 = call i32 @f2(i32* %1, i32* %2)
%10 = load i32, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
store i32 5, i32* %1
%13 = call i32 @f1(i32* %1, i32* %1)
%14 = load i32, i32* %1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %14)
store i32 5, i32* %1
%16 = call i32 @f2(i32* %1, i32* %1)
%17 = load i32, i32* %1
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %17)
ret i32 1
}