#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 node {
  int dummy;
};

/* Variables and functions */
struct node *findchildelement(struct node *, char *);
struct node *findchildelementwithnameattr(struct node *, char const *);
struct node *findthrowidentifier(struct node *node, const char *name) {
  struct node *node2 = findchildelement(node, "Raises");
  if (node2)
    node2 = findchildelementwithnameattr(node2, name);
  if (!node2) {
    node2 = findchildelement(node, "SetRaises");
    if (node2)
      node2 = findchildelementwithnameattr(node2, name);
  }
  return node2;
}


x86 assembly (clang, -O0):
<findthrowidentifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec8(%rip),%rsi
call   1030 <findchildelement@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <findthrowidentifier+0x40>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <findchildelementwithnameattr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11a0 <findthrowidentifier+0x80>
mov    -0x8(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <findchildelement@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     119b <findthrowidentifier+0x7b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <findchildelementwithnameattr@plt>
mov    %rax,-0x18(%rbp)
jmp    11a0 <findthrowidentifier+0x80>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findthrowidentifier>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1030 <findchildelement@plt>
test   %rax,%rax
je     114b <findthrowidentifier+0x2b>
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <findchildelementwithnameattr@plt>
test   %rax,%rax
jne    1173 <findthrowidentifier+0x53>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1030 <findchildelement@plt>
test   %rax,%rax
je     1171 <findthrowidentifier+0x51>
mov    %rax,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <findchildelementwithnameattr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [7 x i8] c"Raises\00"
@.str.1 = [10 x i8] c"SetRaises\00"
define %struct.node* @findthrowidentifier(%struct.node* %0, i8* %1) {
%3 = tail call %struct.node* @findchildelement(%struct.node* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq %struct.node* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call %struct.node* @findchildelementwithnameattr(%struct.node* %3, i8* %1)
%7 = icmp eq %struct.node* %6, null
br i1 %7, label %8, label %13
8: ; preds = %2, %5
%9 = tail call %struct.node* @findchildelement(%struct.node* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq %struct.node* %9, null
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call %struct.node* @findchildelementwithnameattr(%struct.node* %9, i8* %1)
br label %13
13: ; preds = %8, %11, %5
%14 = phi %struct.node* [ %6, %5 ], [ %12, %11 ], [ null, %8 ]
ret %struct.node* %14
}