#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 parse_state {
  int dummy;
};
struct parse_context {
  int dummy;
};

/* Variables and functions */
scalar_t__ _parse_method_call(struct parse_context *, struct parse_state *);
scalar_t__ _parse_regular_function_call(struct parse_context *,
                                        struct parse_state *);
int _parse_function_call(struct parse_context *ctx, struct parse_state *ps) {
  if (_parse_regular_function_call(ctx, ps) == 0) {
    return 0;
  }
  if (_parse_method_call(ctx, ps) == 0) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<_parse_function_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_parse_regular_function_call@plt>
cmp    $0x0,%rax
jne    1153 <_parse_function_call+0x33>
movl   $0x0,-0x4(%rbp)
jmp    117d <_parse_function_call+0x5d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <_parse_method_call@plt>
cmp    $0x0,%rax
jne    1176 <_parse_function_call+0x56>
movl   $0x0,-0x4(%rbp)
jmp    117d <_parse_function_call+0x5d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_parse_function_call>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <_parse_regular_function_call@plt>
test   %rax,%rax
je     1146 <_parse_function_call+0x26>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <_parse_method_call@plt>
neg    %rax
sbb    %eax,%eax
jmp    1148 <_parse_function_call+0x28>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.parse_context = type { i32 }
%struct.parse_state = type { i32 }
define i32 @_parse_function_call(%struct.parse_context* %0, %struct.parse_state* %1) {
%3 = alloca i32
%4 = alloca %struct.parse_context*
%5 = alloca %struct.parse_state*
store %struct.parse_context* %0, %struct.parse_context** %4
store %struct.parse_state* %1, %struct.parse_state** %5
%6 = load %struct.parse_context*, %struct.parse_context** %4
%7 = load %struct.parse_state*, %struct.parse_state** %5
%8 = call i64 @_parse_regular_function_call(%struct.parse_context* %6, %struct.parse_state* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %18
11: ; preds = %2
%12 = load %struct.parse_context*, %struct.parse_context** %4
%13 = load %struct.parse_state*, %struct.parse_state** %5
%14 = call i64 @_parse_method_call(%struct.parse_context* %12, %struct.parse_state* %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 0, i32* %3
br label %18
17: ; preds = %11
store i32 -1, i32* %3
br label %18
18: ; preds = %17, %16, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.parse_context = type { i32 }
%struct.parse_state = type { i32 }
define i32 @_parse_function_call(%struct.parse_context* %0, %struct.parse_state* %1) {
%3 = tail call i64 @_parse_regular_function_call(%struct.parse_context* %0, %struct.parse_state* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @_parse_method_call(%struct.parse_context* %0, %struct.parse_state* %1)
%7 = icmp ne i64 %6, 0
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}