#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*/ assertTrue(char *, int);
int charToUnsigned16(int);
int int16ToUnsigned32(int);
int uint32ToInt16(int);
int uint32ToInt8(int);
int uint32ToUint16(int);
int uint32ToUint64(int);
void test_casting() {
  assertTrue("charToUnsigned16(0) == 0", charToUnsigned16(0) == 0);
  ;
  assertTrue("charToUnsigned16(120) == 120", charToUnsigned16(120) == 120);
  ;
  assertTrue("charToUnsigned16(-62) == 65474", charToUnsigned16(-62) == 65474);
  ;
  assertTrue("int16ToUnsigned32(0) == 0", int16ToUnsigned32(0) == 0);
  ;
  assertTrue("int16ToUnsigned32(4096) == 0x1000",
             int16ToUnsigned32(4096) == 0x1000);
  ;
  assertTrue("int16ToUnsigned32(-34) == 0xffffffde",
             int16ToUnsigned32(-34) == 0xffffffde);
  ;
  assertTrue("int16ToUnsigned32(-4142) == 0xffffefd2",
             int16ToUnsigned32(-4142) == 0xffffefd2);
  ;
  assertTrue("uint32ToInt8(0) == 0", uint32ToInt8(0) == 0);
  ;
  assertTrue("uint32ToInt8(3000) == -72", uint32ToInt8(3000) == -72);
  ;
  assertTrue("uint32ToInt8(4096) == 0", uint32ToInt8(4096) == 0);
  ;
  assertTrue("uint32ToInt8(0xffffffff) == -1", uint32ToInt8(0xffffffff) == -1);
  ;
  assertTrue("uint32ToInt8(0xfffffffe) == -2", uint32ToInt8(0xfffffffe) == -2);
  ;
  assertTrue("uint32ToInt16(0) == 0", uint32ToInt16(0) == 0);
  ;
  assertTrue("uint32ToInt16(0xbb8) == 3000", uint32ToInt16(0xbb8) == 3000);
  ;
  assertTrue("uint32ToInt16(0x40000) == 0", uint32ToInt16(0x40000) == 0);
  ;
  assertTrue("uint32ToUint16(0) == 0", uint32ToUint16(0) == 0);
  ;
  assertTrue("uint32ToUint16(0x402) == 1026", uint32ToUint16(0x402) == 1026);
  ;
  assertTrue("uint32ToUint16(0x1000) == 4096", uint32ToUint16(0x1000) == 4096);
  ;
  assertTrue("uint32ToUint16(0xFFFF) == 65535",
             uint32ToUint16(0xFFFF) == 65535);
  ;
  assertTrue("uint32ToUint16(0x10003) == 3", uint32ToUint16(0x10003) == 3);
  ;
  assertTrue("uint32ToUint64(0) == 0x0", uint32ToUint64(0) == 0x0);
  ;
  assertTrue("uint32ToUint64(0xFF) == 0xFF", uint32ToUint64(0xFF) == 0xFF);
  ;
  assertTrue("uint32ToUint64(0xFFFFFFFF) == 0xFFFFFFFFL",
             uint32ToUint64(0xFFFFFFFF) == 0xFFFFFFFFL);
  ;
  assertTrue("uint32ToUint64(0) == 0", uint32ToUint64(0) == 0);
  ;
  assertTrue("uint32ToUint64(0xFF) == 0xFFL", uint32ToUint64(0xFF) == 0xFFL);
  ;
  assertTrue("uint32ToUint64(0xFFFFFFFF) == 0xFFFFFFFFL",
             uint32ToUint64(0xFFFFFFFF) == 0xFFFFFFFFL);
  ;
}


x86 assembly (clang, -O0):
<test_casting>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <charToUnsigned16@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe73(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x78,%edi
call   1040 <charToUnsigned16@plt>
cmp    $0x78,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe6b(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffffc2,%edi
call   1040 <charToUnsigned16@plt>
cmp    $0xffc2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe65(%rip),%rdi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1030 <int16ToUnsigned32@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe66(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x1000,%edi
call   1030 <int16ToUnsigned32@plt>
cmp    $0x1000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe5d(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffffde,%edi
call   1030 <int16ToUnsigned32@plt>
cmp    $0xffffffde,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe5e(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffefd2,%edi
call   1030 <int16ToUnsigned32@plt>
cmp    $0xffffefd2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe60(%rip),%rdi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1090 <uint32ToInt8@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe69(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xbb8,%edi
call   1090 <uint32ToInt8@plt>
cmp    $0xffffffb8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe5d(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x1000,%edi
call   1090 <uint32ToInt8@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe56(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffffff,%edi
call   1090 <uint32ToInt8@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe4d(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xfffffffe,%edi
call   1090 <uint32ToInt8@plt>
cmp    $0xfffffffe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe4b(%rip),%rdi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1080 <uint32ToInt16@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe4c(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xbb8,%edi
call   1080 <uint32ToInt16@plt>
cmp    $0xbb8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe3f(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x40000,%edi
call   1080 <uint32ToInt16@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe3b(%rip),%rdi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1070 <uint32ToUint16@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe39(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x402,%edi
call   1070 <uint32ToUint16@plt>
cmp    $0x402,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe2d(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x1000,%edi
call   1070 <uint32ToUint16@plt>
cmp    $0x1000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe28(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffff,%edi
call   1070 <uint32ToUint16@plt>
cmp    $0xffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe24(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x10003,%edi
call   1070 <uint32ToUint16@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe23(%rip),%rdi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1060 <uint32ToUint64@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe22(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xff,%edi
call   1060 <uint32ToUint64@plt>
cmp    $0xff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe18(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffffff,%edi
call   1060 <uint32ToUint64@plt>
cltq
mov    $0xffffffff,%ecx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe0d(%rip),%rdi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1060 <uint32ToUint64@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe19(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xff,%edi
call   1060 <uint32ToUint64@plt>
cltq
cmp    $0xff,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe0a(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffffff,%edi
call   1060 <uint32ToUint64@plt>
cltq
mov    $0xffffffff,%ecx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xda1(%rip),%rdi
call   1050 <assertTrue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_casting>:
push   %rbx
xor    %edi,%edi
call   1040 <charToUnsigned16@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe79(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x78,%edi
call   1040 <charToUnsigned16@plt>
xor    %esi,%esi
cmp    $0x78,%eax
sete   %sil
lea    0xe73(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffffc2,%edi
call   1040 <charToUnsigned16@plt>
xor    %esi,%esi
cmp    $0xffc2,%eax
sete   %sil
lea    0xe6f(%rip),%rdi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1030 <int16ToUnsigned32@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe73(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x1000,%edi
call   1030 <int16ToUnsigned32@plt>
xor    %esi,%esi
cmp    $0x1000,%eax
sete   %sil
lea    0xe6c(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffffde,%edi
call   1030 <int16ToUnsigned32@plt>
xor    %esi,%esi
cmp    $0xffffffde,%eax
sete   %sil
lea    0xe6f(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffefd2,%edi
call   1030 <int16ToUnsigned32@plt>
xor    %esi,%esi
cmp    $0xffffefd2,%eax
sete   %sil
lea    0xe73(%rip),%rdi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1090 <uint32ToInt8@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe7f(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xbb8,%edi
call   1090 <uint32ToInt8@plt>
xor    %esi,%esi
cmp    $0xffffffb8,%eax
sete   %sil
lea    0xe75(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x1000,%edi
call   1090 <uint32ToInt8@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe71(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffffff,%edi
call   1090 <uint32ToInt8@plt>
xor    %esi,%esi
cmp    $0xffffffff,%eax
sete   %sil
lea    0xe6a(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xfffffffe,%edi
call   1090 <uint32ToInt8@plt>
xor    %esi,%esi
cmp    $0xfffffffe,%eax
sete   %sil
lea    0xe6a(%rip),%rdi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1080 <uint32ToInt16@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe6e(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xbb8,%edi
call   1080 <uint32ToInt16@plt>
xor    %esi,%esi
cmp    $0xbb8,%eax
sete   %sil
lea    0xe63(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x40000,%edi
call   1080 <uint32ToInt16@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe62(%rip),%rdi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1070 <uint32ToUint16@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe63(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x402,%edi
call   1070 <uint32ToUint16@plt>
xor    %esi,%esi
cmp    $0x402,%eax
sete   %sil
lea    0xe59(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x1000,%edi
call   1070 <uint32ToUint16@plt>
xor    %esi,%esi
cmp    $0x1000,%eax
sete   %sil
lea    0xe56(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffff,%edi
call   1070 <uint32ToUint16@plt>
xor    %esi,%esi
cmp    $0xffff,%eax
sete   %sil
lea    0xe54(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0x10003,%edi
call   1070 <uint32ToUint16@plt>
xor    %esi,%esi
cmp    $0x3,%eax
sete   %sil
lea    0xe55(%rip),%rdi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1060 <uint32ToUint64@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe57(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xff,%edi
call   1060 <uint32ToUint64@plt>
xor    %esi,%esi
cmp    $0xff,%eax
sete   %sil
lea    0xe4f(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffffff,%edi
call   1060 <uint32ToUint64@plt>
lea    0xe56(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <assertTrue@plt>
xor    %edi,%edi
call   1060 <uint32ToUint64@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe60(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xff,%edi
call   1060 <uint32ToUint64@plt>
xor    %esi,%esi
cmp    $0xff,%eax
sete   %sil
lea    0xe56(%rip),%rdi
call   1050 <assertTrue@plt>
mov    $0xffffffff,%edi
call   1060 <uint32ToUint64@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1050 <assertTrue@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"charToUnsigned16(0) == 0\00"
@.str.1 = [29 x i8] c"charToUnsigned16(120) == 120\00"
@.str.2 = [31 x i8] c"charToUnsigned16(-62) == 65474\00"
@.str.3 = [26 x i8] c"int16ToUnsigned32(0) == 0\00"
@.str.4 = [34 x i8] c"int16ToUnsigned32(4096) == 0x1000\00"
@.str.5 = [37 x i8] c"int16ToUnsigned32(-34) == 0xffffffde\00"
@.str.6 = [39 x i8] c"int16ToUnsigned32(-4142) == 0xffffefd2\00"
@.str.7 = [21 x i8] c"uint32ToInt8(0) == 0\00"
@.str.8 = [26 x i8] c"uint32ToInt8(3000) == -72\00"
@.str.9 = [24 x i8] c"uint32ToInt8(4096) == 0\00"
@.str.10 = [31 x i8] c"uint32ToInt8(0xffffffff) == -1\00"
@.str.11 = [31 x i8] c"uint32ToInt8(0xfffffffe) == -2\00"
@.str.12 = [22 x i8] c"uint32ToInt16(0) == 0\00"
@.str.13 = [29 x i8] c"uint32ToInt16(0xbb8) == 3000\00"
@.str.14 = [28 x i8] c"uint32ToInt16(0x40000) == 0\00"
@.str.15 = [23 x i8] c"uint32ToUint16(0) == 0\00"
@.str.16 = [30 x i8] c"uint32ToUint16(0x402) == 1026\00"
@.str.17 = [31 x i8] c"uint32ToUint16(0x1000) == 4096\00"
@.str.18 = [32 x i8] c"uint32ToUint16(0xFFFF) == 65535\00"
@.str.19 = [29 x i8] c"uint32ToUint16(0x10003) == 3\00"
@.str.20 = [25 x i8] c"uint32ToUint64(0) == 0x0\00"
@.str.21 = [29 x i8] c"uint32ToUint64(0xFF) == 0xFF\00"
@.str.22 = [42 x i8] c"uint32ToUint64(0xFFFFFFFF) == 0xFFFFFFFFL\00"
@.str.23 = [23 x i8] c"uint32ToUint64(0) == 0\00"
@.str.24 = [30 x i8] c"uint32ToUint64(0xFF) == 0xFFL\00"
define void @test_casting() {
%1 = call i32 @charToUnsigned16(i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @assertTrue(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @charToUnsigned16(i32 120)
%6 = icmp eq i32 %5, 120
%7 = zext i1 %6 to i32
%8 = call i32 @assertTrue(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @charToUnsigned16(i32 -62)
%10 = icmp eq i32 %9, 65474
%11 = zext i1 %10 to i32
%12 = call i32 @assertTrue(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 @int16ToUnsigned32(i32 0)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assertTrue(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = call i32 @int16ToUnsigned32(i32 4096)
%18 = icmp eq i32 %17, 4096
%19 = zext i1 %18 to i32
%20 = call i32 @assertTrue(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = call i32 @int16ToUnsigned32(i32 -34)
%22 = icmp eq i32 %21, -34
%23 = zext i1 %22 to i32
%24 = call i32 @assertTrue(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %23)
%25 = call i32 @int16ToUnsigned32(i32 -4142)
%26 = icmp eq i32 %25, -4142
%27 = zext i1 %26 to i32
%28 = call i32 @assertTrue(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %27)
%29 = call i32 @uint32ToInt8(i32 0)
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
%32 = call i32 @assertTrue(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %31)
%33 = call i32 @uint32ToInt8(i32 3000)
%34 = icmp eq i32 %33, -72
%35 = zext i1 %34 to i32
%36 = call i32 @assertTrue(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %35)
%37 = call i32 @uint32ToInt8(i32 4096)
%38 = icmp eq i32 %37, 0
%39 = zext i1 %38 to i32
%40 = call i32 @assertTrue(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %39)
%41 = call i32 @uint32ToInt8(i32 -1)
%42 = icmp eq i32 %41, -1
%43 = zext i1 %42 to i32
%44 = call i32 @assertTrue(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i32 %43)
%45 = call i32 @uint32ToInt8(i32 -2)
%46 = icmp eq i32 %45, -2
%47 = zext i1 %46 to i32
%48 = call i32 @assertTrue(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i32 %47)
%49 = call i32 @uint32ToInt16(i32 0)
%50 = icmp eq i32 %49, 0
%51 = zext i1 %50 to i32
%52 = call i32 @assertTrue(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i32 %51)
%53 = call i32 @uint32ToInt16(i32 3000)
%54 = icmp eq i32 %53, 3000
%55 = zext i1 %54 to i32
%56 = call i32 @assertTrue(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0), i32 %55)
%57 = call i32 @uint32ToInt16(i32 262144)
%58 = icmp eq i32 %57, 0
%59 = zext i1 %58 to i32
%60 = call i32 @assertTrue(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0), i32 %59)
%61 = call i32 @uint32ToUint16(i32 0)
%62 = icmp eq i32 %61, 0
%63 = zext i1 %62 to i32
%64 = call i32 @assertTrue(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0), i32 %63)
%65 = call i32 @uint32ToUint16(i32 1026)
%66 = icmp eq i32 %65, 1026
%67 = zext i1 %66 to i32
%68 = call i32 @assertTrue(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i32 %67)
%69 = call i32 @uint32ToUint16(i32 4096)
%70 = icmp eq i32 %69, 4096
%71 = zext i1 %70 to i32
%72 = call i32 @assertTrue(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0), i32 %71)
%73 = call i32 @uint32ToUint16(i32 65535)
%74 = icmp eq i32 %73, 65535
%75 = zext i1 %74 to i32
%76 = call i32 @assertTrue(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), i32 %75)
%77 = call i32 @uint32ToUint16(i32 65539)
%78 = icmp eq i32 %77, 3
%79 = zext i1 %78 to i32
%80 = call i32 @assertTrue(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.19, i64 0, i64 0), i32 %79)
%81 = call i32 @uint32ToUint64(i32 0)
%82 = icmp eq i32 %81, 0
%83 = zext i1 %82 to i32
%84 = call i32 @assertTrue(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i64 0, i64 0), i32 %83)
%85 = call i32 @uint32ToUint64(i32 255)
%86 = icmp eq i32 %85, 255
%87 = zext i1 %86 to i32
%88 = call i32 @assertTrue(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.21, i64 0, i64 0), i32 %87)
%89 = call i32 @uint32ToUint64(i32 -1)
%90 = sext i32 %89 to i64
%91 = icmp eq i64 %90, 4294967295
%92 = zext i1 %91 to i32
%93 = call i32 @assertTrue(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.22, i64 0, i64 0), i32 %92)
%94 = call i32 @uint32ToUint64(i32 0)
%95 = icmp eq i32 %94, 0
%96 = zext i1 %95 to i32
%97 = call i32 @assertTrue(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.23, i64 0, i64 0), i32 %96)
%98 = call i32 @uint32ToUint64(i32 255)
%99 = sext i32 %98 to i64
%100 = icmp eq i64 %99, 255
%101 = zext i1 %100 to i32
%102 = call i32 @assertTrue(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.24, i64 0, i64 0), i32 %101)
%103 = call i32 @uint32ToUint64(i32 -1)
%104 = sext i32 %103 to i64
%105 = icmp eq i64 %104, 4294967295
%106 = zext i1 %105 to i32
%107 = call i32 @assertTrue(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.22, i64 0, i64 0), i32 %106)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"charToUnsigned16(0) == 0\00"
@.str.1 = [29 x i8] c"charToUnsigned16(120) == 120\00"
@.str.2 = [31 x i8] c"charToUnsigned16(-62) == 65474\00"
@.str.3 = [26 x i8] c"int16ToUnsigned32(0) == 0\00"
@.str.4 = [34 x i8] c"int16ToUnsigned32(4096) == 0x1000\00"
@.str.5 = [37 x i8] c"int16ToUnsigned32(-34) == 0xffffffde\00"
@.str.6 = [39 x i8] c"int16ToUnsigned32(-4142) == 0xffffefd2\00"
@.str.7 = [21 x i8] c"uint32ToInt8(0) == 0\00"
@.str.8 = [26 x i8] c"uint32ToInt8(3000) == -72\00"
@.str.9 = [24 x i8] c"uint32ToInt8(4096) == 0\00"
@.str.10 = [31 x i8] c"uint32ToInt8(0xffffffff) == -1\00"
@.str.11 = [31 x i8] c"uint32ToInt8(0xfffffffe) == -2\00"
@.str.12 = [22 x i8] c"uint32ToInt16(0) == 0\00"
@.str.13 = [29 x i8] c"uint32ToInt16(0xbb8) == 3000\00"
@.str.14 = [28 x i8] c"uint32ToInt16(0x40000) == 0\00"
@.str.15 = [23 x i8] c"uint32ToUint16(0) == 0\00"
@.str.16 = [30 x i8] c"uint32ToUint16(0x402) == 1026\00"
@.str.17 = [31 x i8] c"uint32ToUint16(0x1000) == 4096\00"
@.str.18 = [32 x i8] c"uint32ToUint16(0xFFFF) == 65535\00"
@.str.19 = [29 x i8] c"uint32ToUint16(0x10003) == 3\00"
@.str.20 = [25 x i8] c"uint32ToUint64(0) == 0x0\00"
@.str.21 = [29 x i8] c"uint32ToUint64(0xFF) == 0xFF\00"
@.str.22 = [42 x i8] c"uint32ToUint64(0xFFFFFFFF) == 0xFFFFFFFFL\00"
@.str.23 = [23 x i8] c"uint32ToUint64(0) == 0\00"
@.str.24 = [30 x i8] c"uint32ToUint64(0xFF) == 0xFFL\00"
define void @test_casting() {
%1 = tail call i32 @charToUnsigned16(i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assertTrue(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @charToUnsigned16(i32 120)
%6 = icmp eq i32 %5, 120
%7 = zext i1 %6 to i32
%8 = tail call i32 @assertTrue(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @charToUnsigned16(i32 -62)
%10 = icmp eq i32 %9, 65474
%11 = zext i1 %10 to i32
%12 = tail call i32 @assertTrue(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = tail call i32 @int16ToUnsigned32(i32 0)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assertTrue(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = tail call i32 @int16ToUnsigned32(i32 4096)
%18 = icmp eq i32 %17, 4096
%19 = zext i1 %18 to i32
%20 = tail call i32 @assertTrue(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = tail call i32 @int16ToUnsigned32(i32 -34)
%22 = icmp eq i32 %21, -34
%23 = zext i1 %22 to i32
%24 = tail call i32 @assertTrue(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %23)
%25 = tail call i32 @int16ToUnsigned32(i32 -4142)
%26 = icmp eq i32 %25, -4142
%27 = zext i1 %26 to i32
%28 = tail call i32 @assertTrue(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %27)
%29 = tail call i32 @uint32ToInt8(i32 0)
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
%32 = tail call i32 @assertTrue(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %31)
%33 = tail call i32 @uint32ToInt8(i32 3000)
%34 = icmp eq i32 %33, -72
%35 = zext i1 %34 to i32
%36 = tail call i32 @assertTrue(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %35)
%37 = tail call i32 @uint32ToInt8(i32 4096)
%38 = icmp eq i32 %37, 0
%39 = zext i1 %38 to i32
%40 = tail call i32 @assertTrue(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %39)
%41 = tail call i32 @uint32ToInt8(i32 -1)
%42 = icmp eq i32 %41, -1
%43 = zext i1 %42 to i32
%44 = tail call i32 @assertTrue(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i32 %43)
%45 = tail call i32 @uint32ToInt8(i32 -2)
%46 = icmp eq i32 %45, -2
%47 = zext i1 %46 to i32
%48 = tail call i32 @assertTrue(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i32 %47)
%49 = tail call i32 @uint32ToInt16(i32 0)
%50 = icmp eq i32 %49, 0
%51 = zext i1 %50 to i32
%52 = tail call i32 @assertTrue(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i32 %51)
%53 = tail call i32 @uint32ToInt16(i32 3000)
%54 = icmp eq i32 %53, 3000
%55 = zext i1 %54 to i32
%56 = tail call i32 @assertTrue(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0), i32 %55)
%57 = tail call i32 @uint32ToInt16(i32 262144)
%58 = icmp eq i32 %57, 0
%59 = zext i1 %58 to i32
%60 = tail call i32 @assertTrue(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0), i32 %59)
%61 = tail call i32 @uint32ToUint16(i32 0)
%62 = icmp eq i32 %61, 0
%63 = zext i1 %62 to i32
%64 = tail call i32 @assertTrue(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0), i32 %63)
%65 = tail call i32 @uint32ToUint16(i32 1026)
%66 = icmp eq i32 %65, 1026
%67 = zext i1 %66 to i32
%68 = tail call i32 @assertTrue(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i32 %67)
%69 = tail call i32 @uint32ToUint16(i32 4096)
%70 = icmp eq i32 %69, 4096
%71 = zext i1 %70 to i32
%72 = tail call i32 @assertTrue(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0), i32 %71)
%73 = tail call i32 @uint32ToUint16(i32 65535)
%74 = icmp eq i32 %73, 65535
%75 = zext i1 %74 to i32
%76 = tail call i32 @assertTrue(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), i32 %75)
%77 = tail call i32 @uint32ToUint16(i32 65539)
%78 = icmp eq i32 %77, 3
%79 = zext i1 %78 to i32
%80 = tail call i32 @assertTrue(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.19, i64 0, i64 0), i32 %79)
%81 = tail call i32 @uint32ToUint64(i32 0)
%82 = icmp eq i32 %81, 0
%83 = zext i1 %82 to i32
%84 = tail call i32 @assertTrue(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i64 0, i64 0), i32 %83)
%85 = tail call i32 @uint32ToUint64(i32 255)
%86 = icmp eq i32 %85, 255
%87 = zext i1 %86 to i32
%88 = tail call i32 @assertTrue(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.21, i64 0, i64 0), i32 %87)
%89 = tail call i32 @uint32ToUint64(i32 -1)
%90 = tail call i32 @assertTrue(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.22, i64 0, i64 0), i32 0)
%91 = tail call i32 @uint32ToUint64(i32 0)
%92 = icmp eq i32 %91, 0
%93 = zext i1 %92 to i32
%94 = tail call i32 @assertTrue(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.23, i64 0, i64 0), i32 %93)
%95 = tail call i32 @uint32ToUint64(i32 255)
%96 = icmp eq i32 %95, 255
%97 = zext i1 %96 to i32
%98 = tail call i32 @assertTrue(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.24, i64 0, i64 0), i32 %97)
%99 = tail call i32 @uint32ToUint64(i32 -1)
%100 = tail call i32 @assertTrue(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.22, i64 0, i64 0), i32 0)
ret void
}