#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*/ printf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ test_file(char *, char *);
void test_cdecler_1(void) {
  char obtained_str[256];
  test_file("test_file_1.txt", obtained_str);
  char expected_str[] = "next is pointer to a function returning "
                        "pointer to read-only pointer to char static\n";
  if (strcmp(obtained_str, expected_str))
    printf("TEST 1 ERROR expected cdecl and obtained output string "
           "differ:\n%s\n%s\n",
           expected_str, obtained_str);
  return;
}


x86 assembly (clang, -O0):
<test_cdecler_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
lea    -0x100(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1040 <test_file@plt>
lea    -0x160(%rbp),%rdi
lea    0xef4(%rip),%rsi
mov    $0x55,%edx
call   1060 <memcpy@plt>
lea    -0x100(%rbp),%rdi
lea    -0x160(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11ad <test_cdecler_1+0x6d>
lea    -0x160(%rbp),%rsi
lea    -0x100(%rbp),%rdx
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cdecler_1>:
push   %rbx
sub    $0x160,%rsp
lea    0xec1(%rip),%rdi
lea    0x60(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <test_file@plt>
movaps 0xf4d(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf31(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa636974617473,%rax
mov    %rax,0x4d(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11ba <test_cdecler_1+0x8a>
lea    0xe63(%rip),%rdi
mov    %rsp,%rsi
lea    0x60(%rsp),%rdx
call   1030 <printf@plt>
add    $0x160,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"test_file_1.txt\00"
@__const.test_cdecler_1.expected_str = [85 x i8] c"next is pointer to a function returning pointer to read-only pointer to char static\0A\00"
@.str.1 = [70 x i8] c"TEST 1 ERROR expected cdecl and obtained output string differ:\0A%s\0A%s\0A\00"
define void @test_cdecler_1() {
%1 = alloca [256 x i8]
%2 = alloca [85 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @test_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = bitcast [85 x i8]* %2 to i8*
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [85 x i8], [85 x i8]* %2, i64 0, i64 0
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = getelementptr inbounds [85 x i8], [85 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12)
br label %14
14: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"test_file_1.txt\00"
@__const.test_cdecler_1.expected_str = [85 x i8] c"next is pointer to a function returning pointer to read-only pointer to char static\0A\00"
@.str.1 = [70 x i8] c"TEST 1 ERROR expected cdecl and obtained output string differ:\0A%s\0A%s\0A\00"
define void @test_cdecler_1() {
%1 = alloca [256 x i8]
%2 = alloca [85 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @test_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [85 x i8], [85 x i8]* %2, i64 0, i64 0
%6 = call i64 @strcmp(i8* %3, i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %3)
br label %10
10: ; preds = %8, %0
ret void
}