#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 *, char *, ...);
int /*<<< orphan*/ putchar(char);
void print_tokens(char *partname, char **tokens, int num_tokens) {
  int i;
  if (tokens) {
    printf("%s tokens = (", partname);
    for (i = 0; i < num_tokens; i++) {
      printf("%s%c", tokens[i], i == num_tokens - 1 ? ')' : '|');
    }
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<print_tokens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11ad <print_tokens+0x8d>
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11a3 <print_tokens+0x83>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%edi
sub    $0x1,%edi
mov    $0x7c,%edx
mov    $0x29,%eax
cmp    %edi,%ecx
cmove  %eax,%edx
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1157 <print_tokens+0x37>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tokens>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
test   %rsi,%rsi
je     11ab <print_tokens+0x8b>
mov    %edx,%r14d
mov    %rdi,%rsi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    1193 <print_tokens+0x73>
lea    -0x1(%r14),%r12d
mov    %r14d,%ebx
mov    $0x29,%r13d
lea    0xeae(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbp,8),%rsi
cmp    %rbp,%r12
mov    $0x7c,%edx
cmove  %r13d,%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1170 <print_tokens+0x50>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s tokens = (\00"
@.str.1 = [5 x i8] c"%s%c\00"
define void @print_tokens(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%8 = load i8**, i8*** %5
%9 = icmp ne i8** %8, null
br i1 %9, label %10, label %35
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 0, i32* %7
br label %13
13: ; preds = %30, %10
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %33
17: ; preds = %13
%18 = load i8**, i8*** %5
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = sub nsw i32 %24, 1
%26 = icmp eq i32 %23, %25
%27 = zext i1 %26 to i64
%28 = select i1 %26, i32 41, i32 124
%29 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %22, i32 %28)
br label %30
30: ; preds = %17
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %13
33: ; preds = %13
%34 = call i32 @putchar(i8 signext 10)
br label %35
35: ; preds = %33, %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s tokens = (\00"
@.str.1 = [5 x i8] c"%s%c\00"
define void @print_tokens(i8* %0, i8** %1, i32 %2) {
%4 = icmp eq i8** %1, null
br i1 %4, label %23, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = icmp sgt i32 %2, 0
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = add nsw i32 %2, -1
%10 = zext i32 %9 to i64
%11 = zext i32 %2 to i64
br label %12
12: ; preds = %8, %12
%13 = phi i64 [ 0, %8 ], [ %19, %12 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = icmp eq i64 %13, %10
%17 = select i1 %16, i32 41, i32 124
%18 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %15, i32 %17)
%19 = add nuw nsw i64 %13, 1
%20 = icmp eq i64 %19, %11
br i1 %20, label %21, label %12
21: ; preds = %12, %5
%22 = tail call i32 @putchar(i8 signext 10)
br label %23
23: ; preds = %21, %3
ret void
}