#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 */
int /*<<< orphan*/ scxfree(char *);
scalar_t__ strcmp(char *, char *);
double doeqs(char *s1, char *s2) {
  double v;
  if (!s1 && !s2)
    return ((double)1.0);
  if (!s1 || !s2)
    v = 0.0;
  else if (strcmp(s1, s2) == 0)
    v = 1.0;
  else
    v = 0.0;
  if (s1)
    scxfree(s1);
  if (s2)
    scxfree(s2);
  return (v);
}


x86 assembly (clang, -O0):
<doeqs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <doeqs+0x38>
cmpq   $0x0,-0x18(%rbp)
jne    1158 <doeqs+0x38>
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11e3 <doeqs+0xc3>
cmpq   $0x0,-0x10(%rbp)
je     116e <doeqs+0x4e>
cmpq   $0x0,-0x18(%rbp)
jne    117b <doeqs+0x5b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11b1 <doeqs+0x91>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11a4 <doeqs+0x84>
movsd  0xe66(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11ac <doeqs+0x8c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11b1 <doeqs+0x91>
cmpq   $0x0,-0x10(%rbp)
je     11c5 <doeqs+0xa5>
mov    -0x10(%rbp),%rdi
call   1030 <scxfree@plt>
cmpq   $0x0,-0x18(%rbp)
je     11d9 <doeqs+0xb9>
mov    -0x18(%rbp),%rdi
call   1030 <scxfree@plt>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doeqs>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rax
or     %rsi,%rax
je     1154 <doeqs+0x34>
mov    %rsi,%r14
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
test   %rdi,%rdi
je     1166 <doeqs+0x46>
test   %r14,%r14
je     1166 <doeqs+0x46>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     115e <doeqs+0x3e>
xorps  %xmm0,%xmm0
jmp    1166 <doeqs+0x46>
movsd  0xea4(%rip),%xmm0
jmp    118f <doeqs+0x6f>
movsd  0xe9a(%rip),%xmm0
test   %rbx,%rbx
movsd  %xmm0,(%rsp)
je     117d <doeqs+0x5d>
mov    %rbx,%rdi
call   1030 <scxfree@plt>
movsd  (%rsp),%xmm0
test   %r14,%r14
je     118f <doeqs+0x6f>
mov    %r14,%rdi
call   1030 <scxfree@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @doeqs(i8* %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %9
store double 1.000000e+00, double* %3
br label %42
13: ; preds = %9, %2
%14 = load i8*, i8** %4
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i8*, i8** %5
%18 = icmp ne i8* %17, null
br i1 %18, label %20, label %19
19: ; preds = %16, %13
store double 0.000000e+00, double* %6
br label %28
20: ; preds = %16
%21 = load i8*, i8** %4
%22 = load i8*, i8** %5
%23 = call i64 @strcmp(i8* %21, i8* %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %20
store double 1.000000e+00, double* %6
br label %27
26: ; preds = %20
store double 0.000000e+00, double* %6
br label %27
27: ; preds = %26, %25
br label %28
28: ; preds = %27, %19
%29 = load i8*, i8** %4
%30 = icmp ne i8* %29, null
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i8*, i8** %4
%33 = call i32 @scxfree(i8* %32)
br label %34
34: ; preds = %31, %28
%35 = load i8*, i8** %5
%36 = icmp ne i8* %35, null
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i8*, i8** %5
%39 = call i32 @scxfree(i8* %38)
br label %40
40: ; preds = %37, %34
%41 = load double, double* %6
store double %41, double* %3
br label %42
42: ; preds = %40, %12
%43 = load double, double* %3
ret double %43
}

LLVM IR (-O2):
define double @doeqs(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %19
6: ; preds = %2
%7 = and i1 %3, %4
br i1 %7, label %8, label %12
8: ; preds = %6
%9 = tail call i64 @strcmp(i8* %0, i8* %1)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, double 1.000000e+00, double 0.000000e+00
br label %12
12: ; preds = %8, %6
%13 = phi double [ 0.000000e+00, %6 ], [ %11, %8 ]
br i1 %3, label %14, label %16
14: ; preds = %12
%15 = tail call i32 @scxfree(i8* %0)
br label %16
16: ; preds = %14, %12
br i1 %4, label %17, label %19
17: ; preds = %16
%18 = tail call i32 @scxfree(i8* %1)
br label %19
19: ; preds = %16, %17, %2
%20 = phi double [ 1.000000e+00, %2 ], [ %13, %17 ], [ %13, %16 ]
ret double %20
}