#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*/ addValueToPointers(int *, int *, int *);
int /*<<< orphan*/ addValueToPointersRestrict(int *, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int a = 100;
  int b = 200;
  int c = 1;
  printf("Before: a=%d b=%d c=%d\n", a, b, c);
  addValueToPointers(&a, &b, &c);
  printf("After:  a=%d b=%d c=%d\n", a, b, c);
  a = 100, b = 200, c = 1;
  printf("Before: a=%d b=%d c=%d\n", a, b, c);
  addValueToPointers(&a, &b, &a);
  printf("After:  a=%d b=%d c=%d\n", a, b, c);
  printf("\n\n");
  a = 100, b = 200, c = 1;
  printf("Before: a=%d b=%d c=%d\n", a, b, c);
  addValueToPointersRestrict(&a, &b, &c);
  printf("After:  a=%d b=%d c=%d\n", a, b, c);
  a = 100, b = 200, c = 1;
  printf("Before: a=%d b=%d c=%d\n", a, b, c);
  addValueToPointersRestrict(&a, &b, &a);
  printf("After:  a=%d b=%d c=%d\n", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
movl   $0xc8,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <addValueToPointers@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x64,-0x4(%rbp)
movl   $0xc8,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rsi
mov    %rdx,%rdi
call   1030 <addValueToPointers@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x64,-0x4(%rbp)
movl   $0xc8,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <addValueToPointersRestrict@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x64,-0x4(%rbp)
movl   $0xc8,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rsi
mov    %rdx,%rdi
call   1050 <addValueToPointersRestrict@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x64,0xc(%rsp)
movl   $0xc8,0x8(%rsp)
movl   $0x1,0x4(%rsp)
lea    0xe94(%rip),%r14
mov    %r14,%rdi
mov    $0x64,%esi
mov    $0xc8,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%r15
lea    0x4(%rsp),%r13
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   1030 <addValueToPointers@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xe63(%rip),%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x64,0xc(%rsp)
movl   $0xc8,0x8(%rsp)
movl   $0x1,0x4(%rsp)
mov    %r14,%rdi
mov    $0x64,%esi
mov    $0xc8,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <addValueToPointers@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe13(%rip),%rdi
call   1040 <puts@plt>
movl   $0x64,0xc(%rsp)
movl   $0xc8,0x8(%rsp)
movl   $0x1,0x4(%rsp)
mov    %r14,%rdi
mov    $0x64,%esi
mov    $0xc8,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   1060 <addValueToPointersRestrict@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x64,0xc(%rsp)
movl   $0xc8,0x8(%rsp)
movl   $0x1,0x4(%rsp)
mov    %r14,%rdi
mov    $0x64,%esi
mov    $0xc8,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1060 <addValueToPointersRestrict@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Before: a=%d b=%d c=%d\0A\00"
@.str.1 = [24 x i8] c"After: a=%d b=%d c=%d\0A\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 100, i32* %1
store i32 200, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %6)
%8 = call i32 @addValueToPointers(i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
store i32 100, i32* %1
store i32 200, i32* %2
store i32 1, i32* %3
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
%17 = call i32 @addValueToPointers(i32* %1, i32* %2, i32* %1)
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %19, i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 100, i32* %1
store i32 200, i32* %2
store i32 1, i32* %3
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24, i32 %25)
%27 = call i32 @addValueToPointersRestrict(i32* %1, i32* %2, i32* %3)
%28 = load i32, i32* %1
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %28, i32 %29, i32 %30)
store i32 100, i32* %1
store i32 200, i32* %2
store i32 1, i32* %3
%32 = load i32, i32* %1
%33 = load i32, i32* %2
%34 = load i32, i32* %3
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %33, i32 %34)
%36 = call i32 @addValueToPointersRestrict(i32* %1, i32* %2, i32* %1)
%37 = load i32, i32* %1
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %37, i32 %38, i32 %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Before: a=%d b=%d c=%d\0A\00"
@.str.1 = [24 x i8] c"After: a=%d b=%d c=%d\0A\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 100, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 200, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 100, i32 200, i32 1)
%8 = call i32 @addValueToPointers(i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
store i32 100, i32* %1
store i32 200, i32* %2
store i32 1, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 100, i32 200, i32 1)
%14 = call i32 @addValueToPointers(i32* %1, i32* %2, i32* %1)
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
store i32 100, i32* %1
store i32 200, i32* %2
store i32 1, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 100, i32 200, i32 1)
%21 = call i32 @addValueToPointersRestrict(i32* %1, i32* %2, i32* %3)
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23, i32 %24)
store i32 100, i32* %1
store i32 200, i32* %2
store i32 1, i32* %3
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 100, i32 200, i32 1)
%27 = call i32 @addValueToPointersRestrict(i32* %1, i32* %2, i32* %1)
%28 = load i32, i32* %1
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %28, i32 %29, i32 %30)
ret i32 0
}