#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 */

/* Variables and functions */
char const dash2underscore(char const);
int parameq(const char *input, const char *paramname) {
  unsigned int i;
  for (i = 0; dash2underscore(input[i]) == paramname[i]; i++)
    if (input[i] == '\0')
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<parameq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <dash2underscore@plt>
movsbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%edx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1180 <parameq+0x70>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    116d <parameq+0x5d>
movl   $0x1,-0x4(%rbp)
jmp    1187 <parameq+0x77>
jmp    1172 <parameq+0x62>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1127 <parameq+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parameq>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r12
movsbl (%rdi),%edi
call   1030 <dash2underscore@plt>
xor    %r14d,%r14d
cmp    (%r15),%al
jne    1168 <parameq+0x58>
mov    $0x1,%ebx
mov    %r12,%r13
nopl   0x0(%rax)
cmpb   $0x0,0x0(%r13)
je     1162 <parameq+0x52>
mov    %ebx,%ebp
lea    (%r12,%rbp,1),%r13
movsbl (%r12,%rbp,1),%edi
call   1030 <dash2underscore@plt>
add    $0x1,%ebx
cmp    (%r15,%rbp,1),%al
je     1140 <parameq+0x30>
jmp    1168 <parameq+0x58>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @parameq(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %32, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = call signext i8 @dash2underscore(i8 signext %12)
%14 = sext i8 %13 to i32
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %14, %20
br i1 %21, label %22, label %35
22: ; preds = %7
%23 = load i8*, i8** %4
%24 = load i32, i32* %6
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %22
store i32 1, i32* %3
br label %36
31: ; preds = %22
br label %32
32: ; preds = %31
%33 = load i32, i32* %6
%34 = add i32 %33, 1
store i32 %34, i32* %6
br label %7
35: ; preds = %7
store i32 0, i32* %3
br label %36
36: ; preds = %35, %30
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @parameq(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = tail call signext i8 @dash2underscore(i8 signext %3)
%5 = load i8, i8* %1
%6 = icmp eq i8 %4, %5
br i1 %6, label %15, label %21
7: ; preds = %15
%8 = zext i32 %20 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call signext i8 @dash2underscore(i8 signext %10)
%12 = getelementptr inbounds i8, i8* %1, i64 %8
%13 = load i8, i8* %12
%14 = icmp eq i8 %11, %13
br i1 %14, label %15, label %21
15: ; preds = %2, %7
%16 = phi i8* [ %9, %7 ], [ %0, %2 ]
%17 = phi i32 [ %20, %7 ], [ 0, %2 ]
%18 = load i8, i8* %16
%19 = icmp eq i8 %18, 0
%20 = add i32 %17, 1
br i1 %19, label %21, label %7
21: ; preds = %15, %7, %2
%22 = phi i32 [ 0, %2 ], [ 0, %7 ], [ 1, %15 ]
ret i32 %22
}