#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 */
scalar_t__ get_string(char *);
int /*<<< orphan*/ parse_declarator(char *, char *, char *);
int /*<<< orphan*/ parse_type(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int main(void) {
  char input_buffer[10 * 100];
  char type[100];
  char declarator[100];
  char identifier[100];
  while (get_string(input_buffer)) {
    type[0] = identifier[0] = declarator[0] = '\0';
    parse_type(type, input_buffer);
    parse_declarator(identifier, declarator, input_buffer);
    printf("Declare %s as %s %s\n", identifier, declarator, type);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x540,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1040 <get_string@plt>
cmp    $0x0,%rax
je     11d0 <main+0x90>
movb   $0x0,-0x4d0(%rbp)
movb   $0x0,-0x540(%rbp)
movb   $0x0,-0x460(%rbp)
lea    -0x460(%rbp),%rdi
lea    -0x3f0(%rbp),%rsi
call   1030 <parse_type@plt>
lea    -0x540(%rbp),%rdi
lea    -0x4d0(%rbp),%rsi
lea    -0x3f0(%rbp),%rdx
call   1060 <parse_declarator@plt>
lea    -0x540(%rbp),%rsi
lea    -0x4d0(%rbp),%rdx
lea    -0x460(%rbp),%rcx
lea    0xe3a(%rip),%rdi
call   1050 <printf@plt>
jmp    1152 <main+0x12>
xor    %eax,%eax
add    $0x540,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x540,%rsp
lea    0x150(%rsp),%rdi
call   1040 <get_string@plt>
test   %rax,%rax
je     11d8 <main+0x98>
lea    0xe0(%rsp),%r14
lea    0x150(%rsp),%rbx
mov    %rsp,%r15
lea    0x70(%rsp),%r12
lea    0xe7f(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movb   $0x0,0x70(%rsp)
movb   $0x0,(%rsp)
movb   $0x0,0xe0(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <parse_type@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1060 <parse_declarator@plt>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <get_string@plt>
test   %rax,%rax
jne    1190 <main+0x50>
xor    %eax,%eax
add    $0x540,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Declare %s as %s %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
store i32 0, i32* %1
br label %6
6: ; preds = %10, %0
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%8 = call i64 @get_string(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %6
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
store i8 0, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
store i8 0, i8* %12
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8 0, i8* %13
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%16 = call i32 @parse_type(i8* %14, i8* %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%20 = call i32 @parse_declarator(i8* %17, i8* %18, i8* %19)
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%24 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %21, i8* %22, i8* %23)
br label %6
25: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Declare %s as %s %s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = call i64 @get_string(i8* %5)
%10 = icmp eq i64 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %0, %11
store i8 0, i8* %7
store i8 0, i8* %8
store i8 0, i8* %6
%12 = call i32 @parse_type(i8* %6, i8* %5)
%13 = call i32 @parse_declarator(i8* %8, i8* %7, i8* %5)
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %7, i8* %6)
%15 = call i64 @get_string(i8* %5)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %11
17: ; preds = %11, %0
ret i32 0
}