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

/* Variables and functions */
struct imap *nxt(struct imap *, int);
scalar_t__ opeq(struct imap *, char const *, int /*<<< orphan*/,
                int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, char const *);
int /*<<< orphan*/ sethli(struct imap *, int, int);
void chklong(struct imap *ci, const char *op1, const char *op2, int hli) {
  struct imap *ni = nxt(ci, 1);
  if (opeq(ci, op1, 0, 0, 0) && opeq(ni, op2, 0, 0, 0)) {
    printf("Chklong: %s:%s\n", op1, op2);
    sethli(ci, hli, 1);
  }
}


x86 assembly (clang, -O0):
<chklong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1060 <nxt@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1040 <opeq@plt>
cmp    $0x0,%rax
je     11ce <chklong+0x8e>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1040 <opeq@plt>
cmp    $0x0,%rax
je     11ce <chklong+0x8e>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    $0x1,%edx
call   1050 <sethli@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chklong>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
mov    $0x1,%esi
call   1060 <nxt@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <opeq@plt>
test   %rax,%rax
je     11b9 <chklong+0x79>
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <opeq@plt>
test   %rax,%rax
je     11b9 <chklong+0x79>
lea    0xe6a(%rip),%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    $0x1,%edx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <sethli@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.imap = type { i32 }
@.str = [16 x i8] c"Chklong: %s:%s\0A\00"
define void @chklong(%struct.imap* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call %struct.imap* @nxt(%struct.imap* %0, i32 1)
%6 = tail call i64 @opeq(%struct.imap* %0, i8* %1, i32 0, i32 0, i32 0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %4
%9 = tail call i64 @opeq(%struct.imap* %5, i8* %2, i32 0, i32 0, i32 0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%13 = tail call i32 @sethli(%struct.imap* %0, i32 %3, i32 1)
br label %14
14: ; preds = %11, %8, %4
ret void
}