#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*/ dirdcl();
char gettoken();
int /*<<< orphan*/ strcat(char *, char *);
void dcl(void) {
  extern char out[100];
  int ns;
  ns = 0;
  while (gettoken() == '*') {
    ns++;
  }
  dirdcl();
  while (ns-- > 0) {
    strcat(out, " pointer to");
  }
}


x86 assembly (clang, -O0):
<dcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <gettoken@plt>
movsbl %al,%eax
cmp    $0x2a,%eax
jne    1160 <dcl+0x30>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <dcl+0xf>
mov    $0x0,%al
call   1040 <dirdcl@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1193 <dcl+0x63>
mov    0x2e66(%rip),%rdi
lea    0xe77(%rip),%rsi
call   1050 <strcat@plt>
jmp    1167 <dcl+0x37>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcl>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gettoken@plt>
add    $0x1,%ebp
cmp    $0x2a,%al
je     1140 <dcl+0x10>
xor    %eax,%eax
call   1040 <dirdcl@plt>
cmp    $0x1,%ebp
je     1183 <dcl+0x53>
mov    0x2e87(%rip),%r14
lea    0xe98(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jg     1170 <dcl+0x40>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@out = external global [100 x i8]
@.str = [12 x i8] c" pointer to\00"
define void @dcl() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @gettoken()
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 42
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = call i32 (...) @dirdcl()
br label %11
11: ; preds = %15, %9
%12 = load i32, i32* %1
%13 = add nsw i32 %12, -1
store i32 %13, i32* %1
%14 = icmp sgt i32 %12, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @strcat(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @out, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %11
17: ; preds = %11
ret void
}

LLVM IR (-O2):
@out = external global [100 x i8]
@.str = [12 x i8] c" pointer to\00"
define void @dcl() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call signext i8 (...) @gettoken()
%4 = icmp eq i8 %3, 42
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %1, label %6
6: ; preds = %1
%7 = tail call i32 (...) @dirdcl()
%8 = icmp eq i32 %2, 0
br i1 %8, label %14, label %9
9: ; preds = %6, %9
%10 = phi i32 [ %11, %9 ], [ %2, %6 ]
%11 = add nsw i32 %10, -1
%12 = tail call i32 @strcat(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @out, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%13 = icmp sgt i32 %10, 1
br i1 %13, label %9, label %14
14: ; preds = %9, %6
ret void
}