#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*/ __ESBMC_assert(int /*<<< orphan*/, char *);
int /*<<< orphan*/ __ESBMC_assume(int);
int /*<<< orphan*/ __ESBMC_is_zero_string(char const *);
scalar_t__ __ESBMC_zero_string_length(char const *);
int strcmp_strabs(const char *s1, const char *s2) {
__ESBMC_HIDE:;
  int retval;
  if (s1 != 0 && s1 == s2)
    return 0;
  __ESBMC_assert(__ESBMC_is_zero_string(s1),
                 "strcmp zero-termination of 1st argument");
  __ESBMC_assert(__ESBMC_is_zero_string(s2),
                 "strcmp zero-termination of 2nd argument");
  if (__ESBMC_zero_string_length(s1) != __ESBMC_zero_string_length(s1))
    __ESBMC_assume(retval != 0);
  return retval;
}


x86 assembly (clang, -O0):
<strcmp_strabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1175 <strcmp_strabs+0x35>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1175 <strcmp_strabs+0x35>
movl   $0x0,-0x4(%rbp)
jmp    11e0 <strcmp_strabs+0xa0>
mov    -0x10(%rbp),%rdi
call   1060 <__ESBMC_is_zero_string@plt>
mov    %eax,%edi
lea    0xe79(%rip),%rsi
call   1030 <__ESBMC_assert@plt>
mov    -0x18(%rbp),%rdi
call   1060 <__ESBMC_is_zero_string@plt>
mov    %eax,%edi
lea    0xe8a(%rip),%rsi
call   1030 <__ESBMC_assert@plt>
mov    -0x10(%rbp),%rdi
call   1050 <__ESBMC_zero_string_length@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <__ESBMC_zero_string_length@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     11da <strcmp_strabs+0x9a>
cmpl   $0x0,-0x1c(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__ESBMC_assume@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_strabs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
je     1154 <strcmp_strabs+0x14>
cmp    %r14,%rbx
je     119f <strcmp_strabs+0x5f>
mov    %rbx,%rdi
call   1060 <__ESBMC_is_zero_string@plt>
lea    0xe9d(%rip),%rsi
mov    %eax,%edi
call   1030 <__ESBMC_assert@plt>
mov    %r14,%rdi
call   1060 <__ESBMC_is_zero_string@plt>
lea    0xeaf(%rip),%rsi
mov    %eax,%edi
call   1030 <__ESBMC_assert@plt>
mov    %rbx,%rdi
call   1050 <__ESBMC_zero_string_length@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <__ESBMC_zero_string_length@plt>
cmp    %rax,%r14
je     119f <strcmp_strabs+0x5f>
xor    %edi,%edi
call   1040 <__ESBMC_assume@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [40 x i8] c"strcmp zero-termination of 1st argument\00"
@.str.1 = [40 x i8] c"strcmp zero-termination of 2nd argument\00"
define i32 @strcmp_strabs(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
br label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = icmp eq i8* %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 0, i32* %3
br label %34
15: ; preds = %10, %7
%16 = load i8*, i8** %4
%17 = call i32 @__ESBMC_is_zero_string(i8* %16)
%18 = call i32 @__ESBMC_assert(i32 %17, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%19 = load i8*, i8** %5
%20 = call i32 @__ESBMC_is_zero_string(i8* %19)
%21 = call i32 @__ESBMC_assert(i32 %20, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%22 = load i8*, i8** %4
%23 = call i64 @__ESBMC_zero_string_length(i8* %22)
%24 = load i8*, i8** %4
%25 = call i64 @__ESBMC_zero_string_length(i8* %24)
%26 = icmp ne i64 %23, %25
br i1 %26, label %27, label %32
27: ; preds = %15
%28 = load i32, i32* %6
%29 = icmp ne i32 %28, 0
%30 = zext i1 %29 to i32
%31 = call i32 @__ESBMC_assume(i32 %30)
br label %32
32: ; preds = %27, %15
%33 = load i32, i32* %6
store i32 %33, i32* %3
br label %34
34: ; preds = %32, %14
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@.str = [40 x i8] c"strcmp zero-termination of 1st argument\00"
@.str.1 = [40 x i8] c"strcmp zero-termination of 2nd argument\00"
define i32 @strcmp_strabs(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp eq i8* %0, %1
%5 = and i1 %3, %4
br i1 %5, label %16, label %6
6: ; preds = %2
%7 = tail call i32 @__ESBMC_is_zero_string(i8* %0)
%8 = tail call i32 @__ESBMC_assert(i32 %7, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @__ESBMC_is_zero_string(i8* %1)
%10 = tail call i32 @__ESBMC_assert(i32 %9, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i64 @__ESBMC_zero_string_length(i8* %0)
%12 = tail call i64 @__ESBMC_zero_string_length(i8* %0)
%13 = icmp eq i64 %11, %12
br i1 %13, label %16, label %14
14: ; preds = %6
%15 = tail call i32 @__ESBMC_assume(i32 0)
br label %16
16: ; preds = %6, %14, %2
ret i32 0
}