#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*/ fexpect(char *, int, int, int);
int /*<<< orphan*/ fexpectd(char *, int, double, double);
int /*<<< orphan*/ fexpectf(char *, int, double, float);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ test_signedcast();
int /*<<< orphan*/ test_unsignedcast();
void testmain() {
  print("cast");
  fexpectf("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/cast.c",
           21, 1, (int)1);
  ;
  fexpectf("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/cast.c",
           22, 1.0, (float)1);
  ;
  fexpectd("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/cast.c",
           23, 2.0, (double)2);
  ;
  int a[3];
  *(int *)(a + 2) = 5;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/cast.c",
          27, 5, a[2]);
  ;
  test_signedcast();
  test_unsignedcast();
}


x86 assembly (clang, -O0):
<testmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea5(%rip),%rdi
call   1040 <print@plt>
lea    0xe9e(%rip),%rdi
mov    $0x15,%esi
movsd  0xe80(%rip),%xmm0
movss  0xe80(%rip),%xmm1
call   1070 <fexpectf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x16,%esi
movsd  0xe5f(%rip),%xmm0
movss  0xe5f(%rip),%xmm1
call   1070 <fexpectf@plt>
lea    0xe5c(%rip),%rdi
mov    $0x17,%esi
movsd  0xe36(%rip),%xmm1
movaps %xmm1,%xmm0
call   1080 <fexpectd@plt>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xe36(%rip),%rdi
mov    $0x1b,%esi
mov    $0x5,%edx
call   1060 <fexpect@plt>
mov    $0x0,%al
call   1050 <test_signedcast@plt>
mov    $0x0,%al
call   1030 <test_unsignedcast@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testmain>:
push   %rbx
lea    0xeac(%rip),%rdi
call   1040 <print@plt>
lea    0xea5(%rip),%rbx
movsd  0xe84(%rip),%xmm0
movss  0xe8c(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x15,%esi
call   1070 <fexpectf@plt>
mov    %rbx,%rdi
mov    $0x16,%esi
movsd  0xe5f(%rip),%xmm0
movss  0xe67(%rip),%xmm1
call   1070 <fexpectf@plt>
movsd  0xe52(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x17,%esi
movaps %xmm0,%xmm1
call   1080 <fexpectd@plt>
mov    %rbx,%rdi
mov    $0x1b,%esi
mov    $0x5,%edx
mov    $0x5,%ecx
call   1060 <fexpect@plt>
xor    %eax,%eax
call   1050 <test_signedcast@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <test_unsignedcast@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"cast\00"
@.str.1 = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/cast.c\00"
define void @testmain() {
%1 = alloca [3 x i32]
%2 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @fexpectf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0), i32 21, double 1.000000e+00, float 1.000000e+00)
%4 = call i32 @fexpectf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0), i32 22, double 1.000000e+00, float 1.000000e+00)
%5 = call i32 @fexpectd(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0), i32 23, double 2.000000e+00, double 2.000000e+00)
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = getelementptr inbounds i32, i32* %6, i64 2
store i32 5, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%9 = load i32, i32* %8
%10 = call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0), i32 27, i32 5, i32 %9)
%11 = call i32 (...) @test_signedcast()
%12 = call i32 (...) @test_unsignedcast()
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"cast\00"
@.str.1 = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/cast.c\00"
define void @testmain() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @fexpectf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0), i32 21, double 1.000000e+00, float 1.000000e+00)
%3 = tail call i32 @fexpectf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0), i32 22, double 1.000000e+00, float 1.000000e+00)
%4 = tail call i32 @fexpectd(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0), i32 23, double 2.000000e+00, double 2.000000e+00)
%5 = tail call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0), i32 27, i32 5, i32 5)
%6 = tail call i32 (...) @test_signedcast()
%7 = tail call i32 (...) @test_unsignedcast()
ret void
}