int givePtrToPtr(ptrToPtr)
int *ptrToPtr[];
{
  output(0, 0, 0, 0, 0, 0, 0);
  output(*(ptrToPtr[0]));
  *(ptrToPtr[0]) = 1;
  output(*(ptrToPtr[0]));
  output(0, 0, 0, 0, 0, 0, *ptrToPtr[0]);
  return *ptrToPtr[0];
}


x86 assembly (clang, -O0):
<givePtrToPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
mov    $0x0,%al
call   1030 <output@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <output@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <output@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <output@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<givePtrToPtr>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1030 <output@plt>
mov    (%rbx),%rax
mov    (%rax),%edi
xor    %eax,%eax
call   1030 <output@plt>
mov    (%rbx),%rax
movl   $0x1,(%rax)
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <output@plt>
mov    (%rbx),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1030 <output@plt>
mov    (%rbx),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @givePtrToPtr(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = call i32 (i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @output to i32 (i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%4 = load i32**, i32*** %2
%5 = getelementptr inbounds i32*, i32** %4, i64 0
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
%8 = call i32 (i32, ...) bitcast (i32 (...)* @output to i32 (i32, ...)*)(i32 %7)
%9 = load i32**, i32*** %2
%10 = getelementptr inbounds i32*, i32** %9, i64 0
%11 = load i32*, i32** %10
store i32 1, i32* %11
%12 = load i32**, i32*** %2
%13 = getelementptr inbounds i32*, i32** %12, i64 0
%14 = load i32*, i32** %13
%15 = load i32, i32* %14
%16 = call i32 (i32, ...) bitcast (i32 (...)* @output to i32 (i32, ...)*)(i32 %15)
%17 = load i32**, i32*** %2
%18 = getelementptr inbounds i32*, i32** %17, i64 0
%19 = load i32*, i32** %18
%20 = load i32, i32* %19
%21 = call i32 (i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @output to i32 (i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %20)
%22 = load i32**, i32*** %2
%23 = getelementptr inbounds i32*, i32** %22, i64 0
%24 = load i32*, i32** %23
%25 = load i32, i32* %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @givePtrToPtr(i32** nocapture %0) {
%2 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @output to i32 (i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%3 = load i32*, i32** %0
%4 = load i32, i32* %3
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @output to i32 (i32, ...)*)(i32 %4)
%6 = load i32*, i32** %0
store i32 1, i32* %6
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @output to i32 (i32, ...)*)(i32 1)
%8 = load i32*, i32** %0
%9 = load i32, i32* %8
%10 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @output to i32 (i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %9)
%11 = load i32*, i32** %0
%12 = load i32, i32* %11
ret i32 %12
}