#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(unsigned char *, char *);
int /*<<< orphan*/ strlen(char *);
unsigned char *sunday(char *, int /*<<< orphan*/, char *, int /*<<< orphan*/);
char *tc_001() {
  unsigned char *rel = sunday("1234567890", strlen("1234567890"), "1234567890",
                              strlen("1234567890"));
  do {
    return 0 == strcmp(rel, "1234567890") ? NULL
                                          : "expect ["
                                            "rel"
                                            "], but got ["
                                            "\"1234567890\""
                                            "]";
  } while (0);
  ;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
lea    0xeb2(%rip),%rdi
call   1030 <strlen@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%ecx
lea    0xea1(%rip),%rdx
mov    %rdx,%rdi
call   1050 <sunday@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    %eax,%ecx
lea    0xe82(%rip),%rax
cmp    %rdx,%rcx
cmove  %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1050 <sunday@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xe9b(%rip),%rcx
cmovne %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"1234567890\00"
@.str.1 = [37 x i8] c"expect [rel], but got [\221234567890\22]\00"
define i8* @tc_001() {
%1 = alloca i8*
%2 = call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @sunday(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
store i8* %4, i8** %1
br label %5
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 0, %7
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* null, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0)
br label %11
11: ; preds = %5
ret i8* %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"1234567890\00"
@.str.1 = [37 x i8] c"expect [rel], but got [\221234567890\22]\00"
define i8* @tc_001() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @sunday(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* null, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}