#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 */
scalar_t__ strcmp(char const *, char *);
int netrc_cmp(const char *wanthost, const char *foundhost, const char *wantuser,
              const char *founduser, const char *wantpwd,
              const char *foundpwd) {
  if (wanthost && strcmp(wanthost, foundhost ?: ""))
    return -1;
  if (wantuser && strcmp(wantuser, founduser ?: ""))
    return -1;
  if (wantpwd && strcmp(wantpwd, foundpwd ?: ""))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<netrc_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1198 <netrc_cmp+0x88>
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
je     1165 <netrc_cmp+0x55>
mov    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
jmp    1175 <netrc_cmp+0x65>
lea    0xe94(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    1175 <netrc_cmp+0x65>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1198 <netrc_cmp+0x88>
movl   $0xffffffff,-0x4(%rbp)
jmp    1269 <netrc_cmp+0x159>
cmpq   $0x0,-0x20(%rbp)
je     11fd <netrc_cmp+0xed>
mov    -0x20(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
je     11ca <netrc_cmp+0xba>
mov    -0x58(%rbp),%rax
mov    %rax,-0x68(%rbp)
jmp    11da <netrc_cmp+0xca>
lea    0xe2f(%rip),%rax
mov    %rax,-0x68(%rbp)
jmp    11da <netrc_cmp+0xca>
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11fd <netrc_cmp+0xed>
movl   $0xffffffff,-0x4(%rbp)
jmp    1269 <netrc_cmp+0x159>
cmpq   $0x0,-0x30(%rbp)
je     1262 <netrc_cmp+0x152>
mov    -0x30(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x70(%rbp)
cmp    $0x0,%rax
je     122f <netrc_cmp+0x11f>
mov    -0x70(%rbp),%rax
mov    %rax,-0x80(%rbp)
jmp    123f <netrc_cmp+0x12f>
lea    0xdca(%rip),%rax
mov    %rax,-0x80(%rbp)
jmp    123f <netrc_cmp+0x12f>
mov    -0x78(%rbp),%rdi
mov    -0x80(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1262 <netrc_cmp+0x152>
movl   $0xffffffff,-0x4(%rbp)
jmp    1269 <netrc_cmp+0x159>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netrc_cmp>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
test   %rdi,%rdi
je     114c <netrc_cmp+0x3c>
test   %rsi,%rsi
lea    0xecd(%rip),%rax
cmovne %rsi,%rax
mov    %rax,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    119e <netrc_cmp+0x8e>
test   %rbx,%rbx
je     1174 <netrc_cmp+0x64>
test   %r12,%r12
lea    0xea5(%rip),%rsi
cmovne %r12,%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    119e <netrc_cmp+0x8e>
test   %r15,%r15
je     119c <netrc_cmp+0x8c>
test   %r14,%r14
lea    0xe7d(%rip),%rsi
cmovne %r14,%rsi
mov    %r15,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    119e <netrc_cmp+0x8e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @netrc_cmp(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%14 = load i8*, i8** %8
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %27
16: ; preds = %6
%17 = load i8*, i8** %8
%18 = load i8*, i8** %9
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %21
20: ; preds = %16
br label %22
21: ; preds = %16
br label %22
22: ; preds = %21, %20
%23 = phi i8* [ %18, %20 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %21 ]
%24 = call i64 @strcmp(i8* %17, i8* %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 -1, i32* %7
br label %56
27: ; preds = %22, %6
%28 = load i8*, i8** %10
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %41
30: ; preds = %27
%31 = load i8*, i8** %10
%32 = load i8*, i8** %11
%33 = icmp ne i8* %32, null
br i1 %33, label %34, label %35
34: ; preds = %30
br label %36
35: ; preds = %30
br label %36
36: ; preds = %35, %34
%37 = phi i8* [ %32, %34 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %35 ]
%38 = call i64 @strcmp(i8* %31, i8* %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %36
store i32 -1, i32* %7
br label %56
41: ; preds = %36, %27
%42 = load i8*, i8** %12
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %55
44: ; preds = %41
%45 = load i8*, i8** %12
%46 = load i8*, i8** %13
%47 = icmp ne i8* %46, null
br i1 %47, label %48, label %49
48: ; preds = %44
br label %50
49: ; preds = %44
br label %50
50: ; preds = %49, %48
%51 = phi i8* [ %46, %48 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %49 ]
%52 = call i64 @strcmp(i8* %45, i8* %51)
%53 = icmp ne i64 %52, 0
br i1 %53, label %54, label %55
54: ; preds = %50
store i32 -1, i32* %7
br label %56
55: ; preds = %50, %41
store i32 0, i32* %7
br label %56
56: ; preds = %55, %54, %40, %26
%57 = load i32, i32* %7
ret i32 %57
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @netrc_cmp(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = icmp eq i8* %0, null
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = icmp eq i8* %1, null
%10 = select i1 %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%11 = tail call i64 @strcmp(i8* %0, i8* %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %28
13: ; preds = %8, %6
%14 = icmp eq i8* %2, null
br i1 %14, label %20, label %15
15: ; preds = %13
%16 = icmp eq i8* %3, null
%17 = select i1 %16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %3
%18 = tail call i64 @strcmp(i8* %2, i8* %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %28
20: ; preds = %15, %13
%21 = icmp eq i8* %4, null
br i1 %21, label %27, label %22
22: ; preds = %20
%23 = icmp eq i8* %5, null
%24 = select i1 %23, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %5
%25 = tail call i64 @strcmp(i8* %4, i8* %24)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %22, %20
br label %28
28: ; preds = %22, %15, %8, %27
%29 = phi i32 [ 0, %27 ], [ -1, %8 ], [ -1, %15 ], [ -1, %22 ]
ret i32 %29
}