#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*/ blanks();
int /*<<< orphan*/ declare_global(int, int);
int get_type();
int /*<<< orphan*/ need_semicolon();
dodcls(int stclass) {
  int type;
  blanks();
  if (type = get_type()) {
    declare_global(type, stclass);
  } else if (stclass == 1) {
    return (0);
  } else {
    declare_global((2 << 2), stclass);
  }
  need_semicolon();
  return (1);
}


x86 assembly (clang, -O0):
<dodcls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <blanks@plt>
mov    $0x0,%al
call   1060 <get_type@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1175 <dodcls+0x35>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <declare_global@plt>
jmp    119d <dodcls+0x5d>
cmpl   $0x1,-0x8(%rbp)
jne    118b <dodcls+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    11ab <dodcls+0x6b>
mov    -0x8(%rbp),%esi
mov    $0x8,%edi
call   1050 <declare_global@plt>
jmp    119d <dodcls+0x5d>
mov    $0x0,%al
call   1030 <need_semicolon@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dodcls>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <blanks@plt>
xor    %eax,%eax
call   1060 <get_type@plt>
test   %eax,%eax
jne    1163 <dodcls+0x23>
mov    $0x8,%eax
cmp    $0x1,%ebx
je     1178 <dodcls+0x38>
mov    %eax,%edi
mov    %ebx,%esi
call   1050 <declare_global@plt>
xor    %eax,%eax
call   1030 <need_semicolon@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dodcls(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 (...) @blanks()
%6 = call i32 (...) @get_type()
store i32 %6, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = call i32 @declare_global(i32 %9, i32 %10)
br label %20
12: ; preds = %1
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 0, i32* %2
br label %22
16: ; preds = %12
%17 = load i32, i32* %3
%18 = call i32 @declare_global(i32 8, i32 %17)
br label %19
19: ; preds = %16
br label %20
20: ; preds = %19, %8
%21 = call i32 (...) @need_semicolon()
store i32 1, i32* %2
br label %22
22: ; preds = %20, %15
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @dodcls(i32 %0) {
%2 = tail call i32 (...) @blanks()
%3 = tail call i32 (...) @get_type()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = icmp eq i32 %0, 1
br i1 %6, label %11, label %7
7: ; preds = %5, %1
%8 = phi i32 [ %3, %1 ], [ 8, %5 ]
%9 = tail call i32 @declare_global(i32 %8, i32 %0)
%10 = tail call i32 (...) @need_semicolon()
br label %11
11: ; preds = %5, %7
%12 = phi i32 [ 1, %7 ], [ 0, %5 ]
ret i32 %12
}