#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, int);
void testtripple() {
  int a = 0;
  int *pa = &a;
  int **ppa = &pa;
  int ***pppa = &ppa;
  printf("a = %d, *pa = %d **ppa = %d\n ***pppa = %d", a, *pa, **ppa, ***pppa);
  ***pppa = 2;
  printf("a = %d, *pa = %d **ppa = %d\n ***pppa = %d", a, *pa, **ppa, ***pppa);
}


x86 assembly (clang, -O0):
<testtripple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%r8d
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movl   $0x2,(%rax)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%r8d
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testtripple>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"a = %d, *pa = %d **ppa = %d\0A ***pppa = %d\00"
define void @testtripple() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
%4 = alloca i32***
store i32 0, i32* %1
store i32* %1, i32** %2
store i32** %2, i32*** %3
store i32*** %3, i32**** %4
%5 = load i32, i32* %1
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = load i32**, i32*** %3
%9 = load i32*, i32** %8
%10 = load i32, i32* %9
%11 = load i32***, i32**** %4
%12 = load i32**, i32*** %11
%13 = load i32*, i32** %12
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7, i32 %10, i32 %14)
%16 = load i32***, i32**** %4
%17 = load i32**, i32*** %16
%18 = load i32*, i32** %17
store i32 2, i32* %18
%19 = load i32, i32* %1
%20 = load i32*, i32** %2
%21 = load i32, i32* %20
%22 = load i32**, i32*** %3
%23 = load i32*, i32** %22
%24 = load i32, i32* %23
%25 = load i32***, i32**** %4
%26 = load i32**, i32*** %25
%27 = load i32*, i32** %26
%28 = load i32, i32* %27
%29 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %21, i32 %24, i32 %28)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"a = %d, *pa = %d **ppa = %d\0A ***pppa = %d\00"
define void @testtripple() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 2, i32 2)
ret void
}