#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 int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ freelist(char **);
char **getlist(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int lenlist(char **);
int /*<<< orphan*/ puts(char *);
int tac(FILE *in, FILE *out) {
  char **list = getlist(in, out);
  if (!list || !list[0]) {
    freelist(list);
    return 0;
  }
  int i, len = lenlist(list);
  for (i = len; i > 0; i--)
    puts(list[i - 1]);
  freelist(list);
  return 0;
}


x86 assembly (clang, -O0):
<tac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <getlist@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117a <tac+0x3a>
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    118f <tac+0x4f>
mov    -0x20(%rbp),%rdi
call   1060 <freelist@plt>
movl   $0x0,-0x4(%rbp)
jmp    11df <tac+0x9f>
mov    -0x20(%rbp),%rdi
call   1030 <lenlist@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    11cf <tac+0x8f>
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <puts@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    11a1 <tac+0x61>
mov    -0x20(%rbp),%rdi
call   1060 <freelist@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tac>:
push   %r14
push   %rbx
push   %rax
call   1050 <getlist@plt>
mov    %rax,%r14
test   %rax,%rax
je     1186 <tac+0x46>
cmpq   $0x0,(%r14)
je     1186 <tac+0x46>
mov    %r14,%rdi
call   1030 <lenlist@plt>
test   %eax,%eax
jle    1186 <tac+0x46>
mov    %eax,%ebx
add    $0x1,%rbx
nopl   0x0(%rax)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1040 <puts@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1170 <tac+0x30>
mov    %r14,%rdi
call   1060 <freelist@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @tac(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
%9 = load i32*, i32** %4
%10 = load i32*, i32** %5
%11 = call i8** @getlist(i32* %9, i32* %10)
store i8** %11, i8*** %6
%12 = load i8**, i8*** %6
%13 = icmp ne i8** %12, null
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i8**, i8*** %6
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = icmp ne i8* %17, null
br i1 %18, label %22, label %19
19: ; preds = %14, %2
%20 = load i8**, i8*** %6
%21 = call i32 @freelist(i8** %20)
store i32 0, i32* %3
br label %43
22: ; preds = %14
%23 = load i8**, i8*** %6
%24 = call i32 @lenlist(i8** %23)
store i32 %24, i32* %8
%25 = load i32, i32* %8
store i32 %25, i32* %7
br label %26
26: ; preds = %37, %22
%27 = load i32, i32* %7
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %40
29: ; preds = %26
%30 = load i8**, i8*** %6
%31 = load i32, i32* %7
%32 = sub nsw i32 %31, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %30, i64 %33
%35 = load i8*, i8** %34
%36 = call i32 @puts(i8* %35)
br label %37
37: ; preds = %29
%38 = load i32, i32* %7
%39 = add nsw i32 %38, -1
store i32 %39, i32* %7
br label %26
40: ; preds = %26
%41 = load i8**, i8*** %6
%42 = call i32 @freelist(i8** %41)
store i32 0, i32* %3
br label %43
43: ; preds = %40, %19
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
define i32 @tac(i32* %0, i32* %1) {
%3 = tail call i8** @getlist(i32* %0, i32* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5, %2
%9 = tail call i32 @freelist(i8** %3)
br label %25
10: ; preds = %5
%11 = tail call i32 @lenlist(i8** %3)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = zext i32 %11 to i64
br label %15
15: ; preds = %13, %15
%16 = phi i64 [ %14, %13 ], [ %17, %15 ]
%17 = add nsw i64 %16, -1
%18 = and i64 %17, 4294967295
%19 = getelementptr inbounds i8*, i8** %3, i64 %18
%20 = load i8*, i8** %19
%21 = tail call i32 @puts(i8* dereferenceable(1) %20)
%22 = icmp ugt i64 %16, 1
br i1 %22, label %15, label %23
23: ; preds = %15, %10
%24 = tail call i32 @freelist(i8** %3)
br label %25
25: ; preds = %23, %8
ret i32 0
}