#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 */
struct tok {
  int dummy;
};
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addnode(struct node *, struct node *);
struct tok *lexnocomment();
struct node *newattr(char *, int /*<<< orphan*/);
struct node *newelement(char *);
struct node *parsetype(struct tok *);
int /*<<< orphan*/ setcommentnode(struct node *);
int /*<<< orphan*/ setidentifier(struct tok *);
struct node *parseexceptionfield(struct tok *tok, struct node *eal) {
  struct node *node = newelement("ExceptionField");
  if (eal)
    addnode(node, eal);
  setcommentnode(node);
  addnode(node, parsetype(tok));
  addnode(node, newattr("name", setidentifier(tok)));
  tok = lexnocomment();
  return node;
}


x86 assembly (clang, -O0):
<parseexceptionfield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe79(%rip),%rdi
call   1050 <newelement@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a8 <parseexceptionfield+0x38>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <addnode@plt>
mov    -0x18(%rbp),%rdi
call   1070 <setcommentnode@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1090 <parsetype@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
call   1030 <addnode@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <setidentifier@plt>
mov    %eax,%esi
lea    0xe27(%rip),%rdi
call   1080 <newattr@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1030 <addnode@plt>
mov    $0x0,%al
call   1040 <lexnocomment@plt>
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseexceptionfield>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0xe7e(%rip),%rdi
call   1050 <newelement@plt>
mov    %rax,%rbx
test   %r15,%r15
je     119a <parseexceptionfield+0x2a>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <addnode@plt>
mov    %rbx,%rdi
call   1070 <setcommentnode@plt>
mov    %r14,%rdi
call   1090 <parsetype@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <addnode@plt>
mov    %r14,%rdi
call   1060 <setidentifier@plt>
lea    0xe4b(%rip),%rdi
mov    %eax,%esi
call   1080 <newattr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <addnode@plt>
xor    %eax,%eax
call   1040 <lexnocomment@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tok = type { i32 }
%struct.node = type { i32 }
@.str = [15 x i8] c"ExceptionField\00"
@.str.1 = [5 x i8] c"name\00"
define %struct.node* @parseexceptionfield(%struct.tok* %0, %struct.node* %1) {
%3 = alloca %struct.tok*
%4 = alloca %struct.node*
%5 = alloca %struct.node*
store %struct.tok* %0, %struct.tok** %3
store %struct.node* %1, %struct.node** %4
%6 = call %struct.node* @newelement(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store %struct.node* %6, %struct.node** %5
%7 = load %struct.node*, %struct.node** %4
%8 = icmp ne %struct.node* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load %struct.node*, %struct.node** %5
%11 = load %struct.node*, %struct.node** %4
%12 = call i32 @addnode(%struct.node* %10, %struct.node* %11)
br label %13
13: ; preds = %9, %2
%14 = load %struct.node*, %struct.node** %5
%15 = call i32 @setcommentnode(%struct.node* %14)
%16 = load %struct.node*, %struct.node** %5
%17 = load %struct.tok*, %struct.tok** %3
%18 = call %struct.node* @parsetype(%struct.tok* %17)
%19 = call i32 @addnode(%struct.node* %16, %struct.node* %18)
%20 = load %struct.node*, %struct.node** %5
%21 = load %struct.tok*, %struct.tok** %3
%22 = call i32 @setidentifier(%struct.tok* %21)
%23 = call %struct.node* @newattr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = call i32 @addnode(%struct.node* %20, %struct.node* %23)
%25 = call %struct.tok* (...) @lexnocomment()
store %struct.tok* %25, %struct.tok** %3
%26 = load %struct.node*, %struct.node** %5
ret %struct.node* %26
}

LLVM IR (-O2):
%struct.tok = type { i32 }
%struct.node = type { i32 }
@.str = [15 x i8] c"ExceptionField\00"
@.str.1 = [5 x i8] c"name\00"
define %struct.node* @parseexceptionfield(%struct.tok* %0, %struct.node* %1) {
%3 = tail call %struct.node* @newelement(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq %struct.node* %1, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @addnode(%struct.node* %3, %struct.node* %1)
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @setcommentnode(%struct.node* %3)
%9 = tail call %struct.node* @parsetype(%struct.tok* %0)
%10 = tail call i32 @addnode(%struct.node* %3, %struct.node* %9)
%11 = tail call i32 @setidentifier(%struct.tok* %0)
%12 = tail call %struct.node* @newattr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = tail call i32 @addnode(%struct.node* %3, %struct.node* %12)
%14 = tail call %struct.tok* (...) @lexnocomment()
ret %struct.node* %3
}