#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_2(void) {
  char obtained_str[256];
  test_file("test_file_2.txt", obtained_str);
  char expected_str[] =
      "c is an array[0..9] of pointer to a function "
      "(getting in input pointer to pointer to int, and pointer to char,"
      " and an array[0..9] of int, and an array of double long, and pointer to "
      "float) returning pointer to char\n";
  if (strcmp(obtained_str, expected_str))
    printf("TEST 2 ERROR expected cdecl and obtained output string "
           "differ:\n%s\n%s\n",
           expected_str, obtained_str);
  return;
}


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

x86 assembly (clang, -O2):
<test_cdecler_2>:
push   %r14
push   %rbx
sub    $0x1e8,%rsp
lea    0xeaf(%rip),%rdi
lea    0xe0(%rsp),%r14
mov    %r14,%rsi
call   1040 <test_file@plt>
lea    0xef8(%rip),%rsi
mov    %rsp,%rbx
mov    $0xd8,%edx
mov    %rbx,%rdi
call   1060 <memcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     119f <test_cdecler_2+0x5f>
lea    0xe81(%rip),%rdi
mov    %rsp,%rsi
lea    0xe0(%rsp),%rdx
call   1030 <printf@plt>
add    $0x1e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"test_file_2.txt\00"
@__const.test_cdecler_2.expected_str = [216 x i8] c"c is an array[0..9] of pointer to a function (getting in input pointer to pointer to int, and pointer to char, and an array[0..9] of int, and an array of double long, and pointer to float) returning pointer to char\0A\00"
@.str.1 = [70 x i8] c"TEST 2 ERROR expected cdecl and obtained output string differ:\0A%s\0A%s\0A\00"
define void @test_cdecler_2() {
%1 = alloca [256 x i8]
%2 = alloca [216 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 [216 x i8]* %2 to i8*
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [216 x i8], [216 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 [216 x i8], [216 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_2.txt\00"
@__const.test_cdecler_2.expected_str = [216 x i8] c"c is an array[0..9] of pointer to a function (getting in input pointer to pointer to int, and pointer to char, and an array[0..9] of int, and an array of double long, and pointer to float) returning pointer to char\0A\00"
@.str.1 = [70 x i8] c"TEST 2 ERROR expected cdecl and obtained output string differ:\0A%s\0A%s\0A\00"
define void @test_cdecler_2() {
%1 = alloca [256 x i8]
%2 = alloca [216 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 [216 x i8], [216 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
}