#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*/ BUFSIZ;
int /*<<< orphan*/ getinput(char *);
short processquery(char *, char **);
parser() {
  char buff[BUFSIZ + 2], params[50][1024], *ptr[50];
  short loop, rcode;
  do {
    for (loop = 0; loop < (50); loop++)
      ptr[loop] = params[loop];
    getinput(buff);
    rcode = processquery(buff, ptr);
  } while (rcode == 1);
}


x86 assembly (clang, -O0):
<parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc9c0,%rsp
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x2,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xc9c0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movw   $0x0,-0xc9b2(%rbp)
movswl -0xc9b2(%rbp),%eax
cmp    $0x32,%eax
jge    11b3 <parser+0x93>
movswq -0xc9b2(%rbp),%rax
ff
lea    -0xc820(%rbp),%rcx
shl    $0xa,%rax
add    %rax,%rcx
movswq -0xc9b2(%rbp),%rax
ff
mov    %rcx,-0xc9b0(%rbp,%rax,8)
ff
mov    -0xc9b2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xc9b2(%rbp)
jmp    1166 <parser+0x46>
mov    -0xc9c0(%rbp),%rdi
call   1030 <getinput@plt>
mov    -0xc9c0(%rbp),%rdi
lea    -0xc9b0(%rbp),%rsi
call   1040 <processquery@plt>
mov    %ax,-0xc9b4(%rbp)
movswl -0xc9b4(%rbp),%eax
cmp    $0x1,%eax
je     115d <parser+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0xc9a0,%rsp
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
add    $0x2,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
movdqa 0xead(%rip),%xmm1
xor    %ecx,%ecx
lea    -0xc9b0(%rbp),%rax
movq   %rax,%xmm0
pshufd $0x44,%xmm0,%xmm2
movdqa 0xea2(%rip),%xmm3
lea    -0x1b0(%rbp),%r14
movdqa %xmm1,%xmm0
movdqa %xmm2,-0x20(%rbp)
xchg   %ax,%ax
movdqa %xmm0,%xmm1
psllq  $0xa,%xmm1
paddq  %xmm2,%xmm1
movdqa %xmm1,-0x1b0(%rbp,%rcx,8)
ff ff
add    $0x2,%rcx
paddq  %xmm3,%xmm0
cmp    $0x32,%rcx
jne    1180 <parser+0x60>
mov    %rbx,%rdi
call   1030 <getinput@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <processquery@plt>
movdqa 0xe51(%rip),%xmm3
movdqa -0x20(%rbp),%xmm2
mov    $0x0,%ecx
movdqa 0xe2f(%rip),%xmm0
cmp    $0x1,%ax
je     1180 <parser+0x60>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
define i32 @parser() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca [50 x [1024 x i8]]
%5 = alloca [50 x i8*]
%6 = alloca i16
%7 = alloca i16
%8 = load i32, i32* @BUFSIZ
%9 = add nsw i32 %8, 2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %2
%12 = alloca i8, i64 %10
store i64 %10, i64* %3
br label %13
13: ; preds = %33, %0
store i16 0, i16* %6
br label %14
14: ; preds = %26, %13
%15 = load i16, i16* %6
%16 = sext i16 %15 to i32
%17 = icmp slt i32 %16, 50
br i1 %17, label %18, label %29
18: ; preds = %14
%19 = load i16, i16* %6
%20 = sext i16 %19 to i64
%21 = getelementptr inbounds [50 x [1024 x i8]], [50 x [1024 x i8]]* %4, i64 0, i64 %20
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %21, i64 0, i64 0
%23 = load i16, i16* %6
%24 = sext i16 %23 to i64
%25 = getelementptr inbounds [50 x i8*], [50 x i8*]* %5, i64 0, i64 %24
store i8* %22, i8** %25
br label %26
26: ; preds = %18
%27 = load i16, i16* %6
%28 = add i16 %27, 1
store i16 %28, i16* %6
br label %14
29: ; preds = %14
%30 = call i32 @getinput(i8* %12)
%31 = getelementptr inbounds [50 x i8*], [50 x i8*]* %5, i64 0, i64 0
%32 = call signext i16 @processquery(i8* %12, i8** %31)
store i16 %32, i16* %7
br label %33
33: ; preds = %29
%34 = load i16, i16* %7
%35 = sext i16 %34 to i32
%36 = icmp eq i32 %35, 1
br i1 %36, label %13, label %37
37: ; preds = %33
%38 = load i8*, i8** %2
%39 = load i32, i32* %1
ret i32 %39
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
define i32 @parser() {
%1 = alloca [50 x [1024 x i8]]
%2 = alloca [50 x i8*]
%3 = load i32, i32* @BUFSIZ
%4 = add nsw i32 %3, 2
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = getelementptr inbounds [50 x [1024 x i8]], [50 x [1024 x i8]]* %1, i64 0, i64 0, i64 0
%8 = bitcast [50 x i8*]* %2 to i8*
%9 = getelementptr inbounds [50 x i8*], [50 x i8*]* %2, i64 0, i64 0
br label %10
10: ; preds = %19, %0
%11 = phi i64 [ 0, %0 ], [ %20, %19 ]
%12 = phi <2 x i64> [ <i64 0, i64 1>, %0 ], [ %21, %19 ]
%13 = getelementptr inbounds [50 x [1024 x i8]], [50 x [1024 x i8]]* %1, i64 0, <2 x i64> %12, i64 0
%14 = getelementptr inbounds [50 x i8*], [50 x i8*]* %2, i64 0, i64 %11
%15 = bitcast i8** %14 to <2 x i8*>*
store <2 x i8*> %13, <2 x i8*>* %15
%16 = add nuw i64 %11, 2
%17 = add <2 x i64> %12, <i64 2, i64 2>
%18 = icmp eq i64 %16, 50
br i1 %18, label %22, label %19
19: ; preds = %10, %22
%20 = phi i64 [ %16, %10 ], [ 0, %22 ]
%21 = phi <2 x i64> [ %17, %10 ], [ <i64 0, i64 1>, %22 ]
br label %10
22: ; preds = %10
%23 = call i32 @getinput(i8* %6)
%24 = call signext i16 @processquery(i8* %6, i8** %9)
%25 = icmp eq i16 %24, 1
br i1 %25, label %19, label %26
26: ; preds = %22
ret i32 undef
}