#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__content_length(struct http_req *, struct httplex *);
scalar_t__ http__content_type(struct http_req *, struct httplex *);
scalar_t__ http__dummy_kv(struct httplex *);
int http__header_kv(struct http_req *req, struct httplex *lex) {
  return http__content_length(req, lex) || http__content_type(req, lex) ||
         http__dummy_kv(lex);
}


x86 assembly (clang, -O0):
<http__header_kv>:
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   1040 <http__content_length@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1191 <http__header_kv+0x61>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <http__content_type@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1191 <http__header_kv+0x61>
mov    -0x10(%rbp),%rdi
call   1050 <http__dummy_kv@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__header_kv>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <http__content_length@plt>
mov    $0x1,%r14d
test   %rax,%rax
jne    116c <http__header_kv+0x3c>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <http__content_type@plt>
test   %rax,%rax
jne    116c <http__header_kv+0x3c>
mov    %rbx,%rdi
call   1050 <http__dummy_kv@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__header_kv(%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__content_length(%struct.http_req* %5, %struct.httplex* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %18, 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__content_type(%struct.http_req* %10, %struct.httplex* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = load %struct.httplex*, %struct.httplex** %4
%16 = call i64 @http__dummy_kv(%struct.httplex* %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %14, %9, %2
%19 = phi i1 [ true, %9 ], [ true, %2 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
%struct.http_req = type { i32 }
%struct.httplex = type { i32 }
define i32 @http__header_kv(%struct.http_req* %0, %struct.httplex* %1) {
%3 = tail call i64 @http__content_length(%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__content_type(%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__dummy_kv(%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
}