#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 node *newelement(char *);
struct node *parseoperationrest(struct tok *, struct node *);
struct node *parsereturntype(struct tok *);
int /*<<< orphan*/ setcommentnode(struct node *);
struct node *parsereturntypeandoperationrest(struct tok *tok, struct node *eal,
                                             struct node *attrs) {
  struct node *node = newelement("Operation");
  struct node *nodeType = parsereturntype(tok);
  if (eal)
    addnode(node, eal);
  setcommentnode(node);
  addnode(node, attrs);
  addnode(node, nodeType);
  return parseoperationrest(tok, node);
}


x86 assembly (clang, -O0):
<parsereturntypeandoperationrest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe95(%rip),%rdi
call   1050 <newelement@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <parsereturntype@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1199 <parsereturntypeandoperationrest+0x49>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <addnode@plt>
mov    -0x20(%rbp),%rdi
call   1060 <setcommentnode@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <addnode@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <addnode@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <parseoperationrest@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsereturntypeandoperationrest>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r13
mov    %rdi,%r14
lea    0xe97(%rip),%rdi
call   1050 <newelement@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1070 <parsereturntype@plt>
mov    %rax,%r12
test   %r13,%r13
je     118c <parsereturntypeandoperationrest+0x3c>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <addnode@plt>
mov    %rbx,%rdi
call   1060 <setcommentnode@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <addnode@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <addnode@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <parseoperationrest@plt>

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

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