#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*/ do_kill();
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ match(char *);
int /*<<< orphan*/ newfunc_typed(int, char *, int);
int /*<<< orphan*/ symname(char *);
void newfunc(void) {
  char n[33];
  if (!symname(n)) {
    error("illegal function or declaration");
    do_kill();
    return;
  }
  if (!match("("))
    error("missing open paren");
  newfunc_typed(1, n, (2 << 2));
}


x86 assembly (clang, -O0):
<newfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1030 <symname@plt>
cmp    $0x0,%eax
jne    1182 <newfunc+0x32>
lea    0xe8f(%rip),%rdi
call   1050 <error@plt>
mov    $0x0,%al
call   1060 <do_kill@plt>
jmp    11b6 <newfunc+0x66>
lea    0xe97(%rip),%rdi
call   1040 <match@plt>
cmp    $0x0,%eax
jne    11a3 <newfunc+0x53>
lea    0xe84(%rip),%rdi
call   1050 <error@plt>
lea    -0x30(%rbp),%rsi
mov    $0x1,%edi
mov    $0x8,%edx
call   1070 <newfunc_typed@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newfunc>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <symname@plt>
test   %eax,%eax
je     1193 <newfunc+0x43>
lea    0xeb9(%rip),%rdi
call   1040 <match@plt>
test   %eax,%eax
jne    117c <newfunc+0x2c>
lea    0xeab(%rip),%rdi
call   1050 <error@plt>
mov    %rsp,%rsi
mov    $0x1,%edi
mov    $0x8,%edx
call   1070 <newfunc_typed@plt>
add    $0x28,%rsp
ret
lea    0xe66(%rip),%rdi
call   1050 <error@plt>
xor    %eax,%eax
call   1060 <do_kill@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"illegal function or declaration\00"
@.str.1 = [2 x i8] c"(\00"
@.str.2 = [19 x i8] c"missing open paren\00"
define void @newfunc() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = call i32 @symname(i8* %2)
%4 = icmp ne i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = call i32 @error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @do_kill()
br label %16
8: ; preds = %0
%9 = call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
%14 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%15 = call i32 @newfunc_typed(i32 1, i8* %14, i32 8)
br label %16
16: ; preds = %13, %5
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"illegal function or declaration\00"
@.str.1 = [2 x i8] c"(\00"
@.str.2 = [19 x i8] c"missing open paren\00"
define void @newfunc() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = call i32 @symname(i8* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @do_kill()
br label %15
8: ; preds = %0
%9 = call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
%14 = call i32 @newfunc_typed(i32 1, i8* %2, i32 8)
br label %15
15: ; preds = %13, %5
ret void
}