#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 *, ...);
void prn_tb(char c1, char c2, int d, int *i1, int *i2, int *i) {
  int k;
  printf("pl {p");
  for (k = d - 1; k >= 0; k--)
    printf(".%d", i[k]);
  printf("} {t%c", c1);
  for (k = d - 1; k >= 0; k--)
    printf(".%d", i1[k]);
  printf("v");
  for (k = d - 1; k >= 0; k--)
    printf(".%d", i2[k]);
  printf("} -> {t%c", c2);
  for (k = d - 1; k >= 0; k--)
    printf(".%d", i1[k]);
  printf("v");
  for (k = d - 1; k >= 0; k--)
    printf(".%d", i2[k]);
  printf("}\n");
}


x86 assembly (clang, -O0):
<prn_tb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     117c <prn_tb+0x6c>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    114b <prn_tb+0x3b>
movsbl -0x1(%rbp),%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     11c8 <prn_tb+0xb8>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1197 <prn_tb+0x87>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1210 <prn_tb+0x100>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    11df <prn_tb+0xcf>
movsbl -0x2(%rbp),%esi
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     125c <prn_tb+0x14c>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    122b <prn_tb+0x11b>
lea    0xdae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     12a4 <prn_tb+0x194>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1273 <prn_tb+0x163>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prn_tb>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%rbp
mov    %r8,%r14
mov    %rcx,%r15
mov    %edx,%ebx
mov    %esi,(%rsp)
mov    %edi,%r12d
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
jle    1297 <prn_tb+0x167>
mov    %r12d,0x4(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
lea    -0x1(%rbx),%eax
mov    %eax,%r13d
lea    0xe85(%rip),%r12
mov    %r13,%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x0(%rbp,%r14,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffffffffffff,%r14
jb     1190 <prn_tb+0x60>
movsbl 0x4(%rsp),%esi
lea    0xe59(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%r12
test   %r12d,%r12d
jle    12a9 <prn_tb+0x179>
lea    0xe39(%rip),%rbp
mov    %r13,%rbx
mov    (%r15,%rbx,4),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     11d0 <prn_tb+0xa0>
mov    $0x76,%edi
call   1030 <putchar@plt>
test   %r12d,%r12d
mov    0x8(%rsp),%rbp
jle    12b3 <prn_tb+0x183>
lea    0xe03(%rip),%r14
mov    %r13,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%rbp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1210 <prn_tb+0xe0>
movsbl (%rsp),%esi
lea    0xde2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r12d,%r12d
jle    12c5 <prn_tb+0x195>
lea    0xdc0(%rip),%r14
mov    %r13,%rbx
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1250 <prn_tb+0x120>
mov    $0x76,%edi
call   1030 <putchar@plt>
test   %r12d,%r12d
jle    12cf <prn_tb+0x19f>
lea    0xd8c(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    0x0(%rbp,%r13,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffffffffffff,%r13
jb     1280 <prn_tb+0x150>
jmp    12cf <prn_tb+0x19f>
movsbl %r12b,%esi
lea    0xd68(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x76,%edi
call   1030 <putchar@plt>
movsbl (%rsp),%esi
lea    0xd53(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x76,%edi
call   1030 <putchar@plt>
lea    0xd45(%rip),%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"pl {p\00"
@.str.1 = [4 x i8] c".%d\00"
@.str.2 = [7 x i8] c"} {t%c\00"
@.str.3 = [2 x i8] c"v\00"
@.str.4 = [10 x i8] c"} -> {t%c\00"
@.str.5 = [3 x i8] c"}\0A\00"
define void @prn_tb(i8 signext %0, i8 signext %1, i32 %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
store i8 %0, i8* %7
store i8 %1, i8* %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %9
%16 = sub nsw i32 %15, 1
store i32 %16, i32* %13
br label %17
17: ; preds = %27, %6
%18 = load i32, i32* %13
%19 = icmp sge i32 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %17
%21 = load i32*, i32** %12
%22 = load i32, i32* %13
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %20
%28 = load i32, i32* %13
%29 = add nsw i32 %28, -1
store i32 %29, i32* %13
br label %17
30: ; preds = %17
%31 = load i8, i8* %7
%32 = sext i8 %31 to i32
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = load i32, i32* %9
%35 = sub nsw i32 %34, 1
store i32 %35, i32* %13
br label %36
36: ; preds = %46, %30
%37 = load i32, i32* %13
%38 = icmp sge i32 %37, 0
br i1 %38, label %39, label %49
39: ; preds = %36
%40 = load i32*, i32** %10
%41 = load i32, i32* %13
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i32, i32* %40, i64 %42
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %44)
br label %46
46: ; preds = %39
%47 = load i32, i32* %13
%48 = add nsw i32 %47, -1
store i32 %48, i32* %13
br label %36
49: ; preds = %36
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%51 = load i32, i32* %9
%52 = sub nsw i32 %51, 1
store i32 %52, i32* %13
br label %53
53: ; preds = %63, %49
%54 = load i32, i32* %13
%55 = icmp sge i32 %54, 0
br i1 %55, label %56, label %66
56: ; preds = %53
%57 = load i32*, i32** %11
%58 = load i32, i32* %13
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %57, i64 %59
%61 = load i32, i32* %60
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %56
%64 = load i32, i32* %13
%65 = add nsw i32 %64, -1
store i32 %65, i32* %13
br label %53
66: ; preds = %53
%67 = load i8, i8* %8
%68 = sext i8 %67 to i32
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %68)
%70 = load i32, i32* %9
%71 = sub nsw i32 %70, 1
store i32 %71, i32* %13
br label %72
72: ; preds = %82, %66
%73 = load i32, i32* %13
%74 = icmp sge i32 %73, 0
br i1 %74, label %75, label %85
75: ; preds = %72
%76 = load i32*, i32** %10
%77 = load i32, i32* %13
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i32, i32* %76, i64 %78
%80 = load i32, i32* %79
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %80)
br label %82
82: ; preds = %75
%83 = load i32, i32* %13
%84 = add nsw i32 %83, -1
store i32 %84, i32* %13
br label %72
85: ; preds = %72
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%87 = load i32, i32* %9
%88 = sub nsw i32 %87, 1
store i32 %88, i32* %13
br label %89
89: ; preds = %99, %85
%90 = load i32, i32* %13
%91 = icmp sge i32 %90, 0
br i1 %91, label %92, label %102
92: ; preds = %89
%93 = load i32*, i32** %11
%94 = load i32, i32* %13
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i32, i32* %93, i64 %95
%97 = load i32, i32* %96
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %97)
br label %99
99: ; preds = %92
%100 = load i32, i32* %13
%101 = add nsw i32 %100, -1
store i32 %101, i32* %13
br label %89
102: ; preds = %89
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"pl {p\00"
@.str.1 = [4 x i8] c".%d\00"
@.str.2 = [7 x i8] c"} {t%c\00"
@.str.4 = [10 x i8] c"} -> {t%c\00"
@str = [2 x i8] c"}\00"
define void @prn_tb(i8 signext %0, i8 signext %1, i32 %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5) {
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = add i32 %2, -1
%9 = icmp sgt i32 %2, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = sext i8 %0 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %34
13: ; preds = %6
%14 = zext i32 %8 to i64
br label %15
15: ; preds = %13, %15
%16 = phi i64 [ %14, %13 ], [ %20, %15 ]
%17 = getelementptr inbounds i32, i32* %5, i64 %16
%18 = load i32, i32* %17
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = add nsw i64 %16, -1
%21 = icmp eq i64 %16, 0
br i1 %21, label %22, label %15
22: ; preds = %15
%23 = sext i8 %0 to i32
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %23)
br i1 %9, label %25, label %34
25: ; preds = %22
%26 = zext i32 %8 to i64
br label %27
27: ; preds = %25, %27
%28 = phi i64 [ %26, %25 ], [ %32, %27 ]
%29 = getelementptr inbounds i32, i32* %3, i64 %28
%30 = load i32, i32* %29
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = add nsw i64 %28, -1
%33 = icmp eq i64 %28, 0
br i1 %33, label %36, label %27
34: ; preds = %10, %22
%35 = tail call i32 @putchar(i32 118)
br label %47
36: ; preds = %27
%37 = tail call i32 @putchar(i32 118)
br i1 %9, label %38, label %47
38: ; preds = %36
%39 = zext i32 %8 to i64
br label %40
40: ; preds = %38, %40
%41 = phi i64 [ %39, %38 ], [ %45, %40 ]
%42 = getelementptr inbounds i32, i32* %4, i64 %41
%43 = load i32, i32* %42
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %43)
%45 = add nsw i64 %41, -1
%46 = icmp eq i64 %41, 0
br i1 %46, label %50, label %40
47: ; preds = %34, %36
%48 = sext i8 %1 to i32
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %48)
br label %62
50: ; preds = %40
%51 = sext i8 %1 to i32
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %51)
br i1 %9, label %53, label %62
53: ; preds = %50
%54 = zext i32 %8 to i64
br label %55
55: ; preds = %53, %55
%56 = phi i64 [ %54, %53 ], [ %60, %55 ]
%57 = getelementptr inbounds i32, i32* %3, i64 %56
%58 = load i32, i32* %57
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %58)
%60 = add nsw i64 %56, -1
%61 = icmp eq i64 %56, 0
br i1 %61, label %64, label %55
62: ; preds = %47, %50
%63 = tail call i32 @putchar(i32 118)
br label %75
64: ; preds = %55
%65 = tail call i32 @putchar(i32 118)
br i1 %9, label %66, label %75
66: ; preds = %64
%67 = zext i32 %8 to i64
br label %68
68: ; preds = %66, %68
%69 = phi i64 [ %67, %66 ], [ %73, %68 ]
%70 = getelementptr inbounds i32, i32* %4, i64 %69
%71 = load i32, i32* %70
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %71)
%73 = add nsw i64 %69, -1
%74 = icmp eq i64 %69, 0
br i1 %74, label %75, label %68
75: ; preds = %68, %62, %64
%76 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}