#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 httplex {
  int dummy;
};
struct http_req {
  int dummy;
};

/* Variables and functions */
scalar_t__ http__get(struct http_req *, struct httplex *);
scalar_t__ http__options(struct http_req *, struct httplex *);
scalar_t__ http__put(struct http_req *, struct httplex *);
int http__method(struct http_req *req, struct httplex *lex) {
  return http__get(req, lex) || http__put(req, lex) || http__options(req, lex);
}


x86 assembly (clang, -O0):
<http__method>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <http__get@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1195 <http__method+0x65>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <http__put@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1195 <http__method+0x65>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <http__options@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http__method>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <http__get@plt>
mov    $0x1,%r14d
test   %rax,%rax
jne    116f <http__method+0x3f>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1050 <http__put@plt>
test   %rax,%rax
jne    116f <http__method+0x3f>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <http__options@plt>
xor    %r14d,%r14d
test   %rax,%rax
setne  %r14b
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.http_req = type { i32 }
%struct.httplex = type { i32 }
define i32 @http__method(%struct.http_req* %0, %struct.httplex* %1) {
%3 = alloca %struct.http_req*
%4 = alloca %struct.httplex*
store %struct.http_req* %0, %struct.http_req** %3
store %struct.httplex* %1, %struct.httplex** %4
%5 = load %struct.http_req*, %struct.http_req** %3
%6 = load %struct.httplex*, %struct.httplex** %4
%7 = call i64 @http__get(%struct.http_req* %5, %struct.httplex* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %2
%10 = load %struct.http_req*, %struct.http_req** %3
%11 = load %struct.httplex*, %struct.httplex** %4
%12 = call i64 @http__put(%struct.http_req* %10, %struct.httplex* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %9
%15 = load %struct.http_req*, %struct.http_req** %3
%16 = load %struct.httplex*, %struct.httplex** %4
%17 = call i64 @http__options(%struct.http_req* %15, %struct.httplex* %16)
%18 = icmp ne i64 %17, 0
br label %19
19: ; preds = %14, %9, %2
%20 = phi i1 [ true, %9 ], [ true, %2 ], [ %18, %14 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.http_req = type { i32 }
%struct.httplex = type { i32 }
define i32 @http__method(%struct.http_req* %0, %struct.httplex* %1) {
%3 = tail call i64 @http__get(%struct.http_req* %0, %struct.httplex* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = tail call i64 @http__put(%struct.http_req* %0, %struct.httplex* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @http__options(%struct.http_req* %0, %struct.httplex* %1)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5, %2
%13 = phi i32 [ 1, %5 ], [ 1, %2 ], [ %11, %8 ]
ret i32 %13
}