#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 */
typedef struct typ const typ;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *,
                           struct typ const *, char *, struct typ const *);
char *pptyp(int /*<<< orphan*/ *, struct typ const *);
int /*<<< orphan*/ stderr;
int ppoverlay_each(const struct typ **t, struct typ ***loc, void *user) {
  fprintf(stderr, "\t%s %p\n\t-> %s %p\n", pptyp(NULL, *t), *t,
          pptyp(NULL, **loc), **loc);
  return 0;
}


x86 assembly (clang, -O0):
<ppoverlay_each>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pptyp@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pptyp@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    %rax,%r8
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%r9
lea    0xe6f(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppoverlay_each>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eac(%rip),%rax
mov    (%rax),%r15d
mov    (%rdi),%rsi
xor    %edi,%edi
call   1030 <pptyp@plt>
mov    %rax,%rbp
mov    (%rbx),%rbx
mov    (%r14),%rax
mov    (%rax),%rsi
xor    %edi,%edi
call   1030 <pptyp@plt>
mov    (%r14),%rcx
mov    (%rcx),%r9
lea    0xe9f(%rip),%rsi
mov    %r15d,%edi
mov    %rbp,%rdx
mov    %rbx,%rcx
mov    %rax,%r8
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.typ = type opaque
@stderr = global i32 0
@.str = [18 x i8] c"\09%s %p\0A\09-> %s %p\0A\00"
define i32 @ppoverlay_each(%struct.typ** %0, %struct.typ*** %1, i8* %2) {
%4 = alloca %struct.typ**
%5 = alloca %struct.typ***
%6 = alloca i8*
store %struct.typ** %0, %struct.typ*** %4
store %struct.typ*** %1, %struct.typ**** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load %struct.typ**, %struct.typ*** %4
%9 = load %struct.typ*, %struct.typ** %8
%10 = call i8* @pptyp(i32* null, %struct.typ* %9)
%11 = load %struct.typ**, %struct.typ*** %4
%12 = load %struct.typ*, %struct.typ** %11
%13 = load %struct.typ***, %struct.typ**** %5
%14 = load %struct.typ**, %struct.typ*** %13
%15 = load %struct.typ*, %struct.typ** %14
%16 = call i8* @pptyp(i32* null, %struct.typ* %15)
%17 = load %struct.typ***, %struct.typ**** %5
%18 = load %struct.typ**, %struct.typ*** %17
%19 = load %struct.typ*, %struct.typ** %18
%20 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %10, %struct.typ* %12, i8* %16, %struct.typ* %19)
ret i32 0
}

LLVM IR (-O2):
%struct.typ = type opaque
@stderr = global i32 0
@.str = [18 x i8] c"\09%s %p\0A\09-> %s %p\0A\00"
define i32 @ppoverlay_each(%struct.typ** nocapture %0, %struct.typ*** nocapture %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = load %struct.typ*, %struct.typ** %0
%6 = tail call i8* @pptyp(i32* null, %struct.typ* %5)
%7 = load %struct.typ*, %struct.typ** %0
%8 = load %struct.typ**, %struct.typ*** %1
%9 = load %struct.typ*, %struct.typ** %8
%10 = tail call i8* @pptyp(i32* null, %struct.typ* %9)
%11 = load %struct.typ**, %struct.typ*** %1
%12 = load %struct.typ*, %struct.typ** %11
%13 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6, %struct.typ* %7, i8* %10, %struct.typ* %12)
ret i32 0
}