#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 */
unsigned int INT_MIN;
unsigned int SCHAR_MIN;
int UINT_MAX;
int /*<<< orphan*/ fsc(unsigned char);
int /*<<< orphan*/ fsi(unsigned int);
int /*<<< orphan*/ fuc(char);
int /*<<< orphan*/ fui(char);
void h(int x) {
  unsigned int ui = 3;
  int si = 3;
  unsigned char uc = 3;
  signed char sc = 3;
  uc = ui;
  uc = si;
  sc = ui;
  sc = si;
  fuc(ui);
  fuc(si);
  fsc(ui);
  fsc(si);
  fsi(si);
  fui(ui);
  fsi(uc);
  si = uc;
  fui(uc);
  ui = uc;
  fui('A');
  ui = 'A';
  fsi('A');
  si = 'A';
  fuc('A');
  uc = 'A';
  uc = x ? 1U : -1;
  uc = x ? SCHAR_MIN : 1U;
  uc = x ? 1 : -1;
  uc = x ? SCHAR_MIN : 1;
  ui = x ? 1U : -1;
  ui = x ? INT_MIN : 1U;
  ui = ui ? SCHAR_MIN : 1U;
  ui = 1U * -1;
  ui = ui + INT_MIN;
  ui = x ? 1 : -1;
  ui = ui ? SCHAR_MIN : 1;
  fuc(-1);
  uc = -1;
  fui(-1);
  ui = -1;
  fuc('\xa0');
  uc = '\xa0';
  fui('\xa0');
  ui = '\xa0';
  fsi(0x80000000);
  si = 0x80000000;
  fsi(UINT_MAX - 1);
  si = UINT_MAX - 1;
  fsi(UINT_MAX - 1U);
  si = UINT_MAX - 1U;
  fsi(UINT_MAX / 3U);
  si = UINT_MAX / 3U;
  fsi(UINT_MAX / 3);
  si = UINT_MAX / 3;
  fui(UINT_MAX - 1);
  ui = UINT_MAX - 1;
  uc = (unsigned char)-1;
  ui = -1 * (1 * -1);
  ui = (unsigned)-1;
  fsc(uc);
  sc = uc;
  fuc(sc);
  uc = sc;
  fsi(ui);
  si = ui;
  fui(si);
  ui = si;
  fui(sc);
  ui = sc;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movb   $0x3,-0xd(%rbp)
movb   $0x3,-0xe(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xe(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1060 <fuc@plt>
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1060 <fuc@plt>
mov    -0x8(%rbp),%eax
movzbl %al,%edi
call   1050 <fsc@plt>
mov    -0xc(%rbp),%eax
movzbl %al,%edi
call   1050 <fsc@plt>
mov    -0xc(%rbp),%edi
call   1030 <fsi@plt>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1040 <fui@plt>
movzbl -0xd(%rbp),%edi
call   1030 <fsi@plt>
movzbl -0xd(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsbl -0xd(%rbp),%edi
call   1040 <fui@plt>
movzbl -0xd(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x41,%edi
call   1040 <fui@plt>
movl   $0x41,-0x8(%rbp)
mov    $0x41,%edi
call   1030 <fsi@plt>
movl   $0x41,-0xc(%rbp)
mov    $0x41,%edi
call   1060 <fuc@plt>
movb   $0x41,-0xd(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0xd(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1239 <h+0xf9>
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    1246 <h+0x106>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1246 <h+0x106>
mov    -0x14(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0xd(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     127d <h+0x13d>
mov    0x2d5d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
jmp    128a <h+0x14a>
mov    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    128a <h+0x14a>
mov    -0x18(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     12c1 <h+0x181>
mov    0x2d29(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    12ce <h+0x18e>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12ce <h+0x18e>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     12ef <h+0x1af>
mov    0x2ceb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
jmp    12fc <h+0x1bc>
mov    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12fc <h+0x1bc>
mov    -0x20(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ccd(%rip),%rcx
add    (%rcx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1349 <h+0x209>
mov    0x2c91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1356 <h+0x216>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1356 <h+0x216>
mov    -0x24(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1060 <fuc@plt>
movb   $0xff,-0xd(%rbp)
mov    $0xffffffff,%edi
call   1040 <fui@plt>
movl   $0xffffffff,-0x8(%rbp)
mov    $0xffffffa0,%edi
call   1060 <fuc@plt>
movb   $0xa0,-0xd(%rbp)
mov    $0xffffffa0,%edi
call   1040 <fui@plt>
movl   $0xffffffa0,-0x8(%rbp)
mov    $0x80000000,%edi
call   1030 <fsi@plt>
movl   $0x80000000,-0xc(%rbp)
mov    0x2c36(%rip),%rax
mov    (%rax),%edi
sub    $0x1,%edi
call   1030 <fsi@plt>
mov    0x2c25(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    0x2c16(%rip),%rax
mov    (%rax),%edi
sub    $0x1,%edi
call   1030 <fsi@plt>
mov    0x2c05(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    0x2bf6(%rip),%rax
mov    (%rax),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1030 <fsi@plt>
mov    0x2bdd(%rip),%rax
mov    (%rax),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
mov    0x2bc8(%rip),%rax
mov    (%rax),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <fsi@plt>
mov    0x2bb0(%rip),%rax
mov    (%rax),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    0x2b9c(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movsbl %al,%edi
call   1040 <fui@plt>
mov    0x2b88(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
movb   $0xff,-0xd(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movzbl -0xd(%rbp),%edi
call   1050 <fsc@plt>
mov    -0xd(%rbp),%al
mov    %al,-0xe(%rbp)
movsbl -0xe(%rbp),%edi
call   1060 <fuc@plt>
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fsi@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1040 <fui@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
movsbl -0xe(%rbp),%edi
call   1040 <fui@plt>
movsbl -0xe(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rbx
mov    $0x3,%edi
call   1060 <fuc@plt>
mov    $0x3,%edi
call   1060 <fuc@plt>
mov    $0x3,%edi
call   1050 <fsc@plt>
mov    $0x3,%edi
call   1050 <fsc@plt>
mov    $0x3,%edi
call   1030 <fsi@plt>
mov    $0x3,%edi
call   1040 <fui@plt>
mov    $0x3,%edi
call   1030 <fsi@plt>
mov    $0x3,%edi
call   1040 <fui@plt>
mov    $0x41,%edi
call   1040 <fui@plt>
mov    $0x41,%edi
call   1030 <fsi@plt>
mov    $0x41,%edi
call   1060 <fuc@plt>
mov    $0xffffffff,%edi
call   1060 <fuc@plt>
mov    $0xffffffff,%edi
call   1040 <fui@plt>
mov    $0xffffffa0,%edi
call   1060 <fuc@plt>
mov    $0xffffffa0,%edi
call   1040 <fui@plt>
mov    $0x80000000,%edi
call   1030 <fsi@plt>
mov    0x2e00(%rip),%rbx
mov    (%rbx),%edi
add    $0xffffffff,%edi
call   1030 <fsi@plt>
mov    (%rbx),%edi
add    $0xffffffff,%edi
call   1030 <fsi@plt>
mov    (%rbx),%eax
mov    $0xaaaaaaab,%edi
imul   %rax,%rdi
shr    $0x21,%rdi
call   1030 <fsi@plt>
movslq (%rbx),%rax
imul   $0x55555556,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
shr    $0x20,%rdi
add    %eax,%edi
call   1030 <fsi@plt>
mov    (%rbx),%al
add    $0xff,%al
movsbl %al,%edi
call   1040 <fui@plt>
mov    $0xff,%edi
call   1050 <fsc@plt>
mov    $0xffffffff,%edi
call   1060 <fuc@plt>
mov    $0xffffffff,%edi
call   1030 <fsi@plt>
mov    $0xffffffff,%edi
call   1040 <fui@plt>
mov    $0xffffffff,%edi
pop    %rbx
jmp    1040 <fui@plt>

LLVM IR (-O0):
@SCHAR_MIN = global i32 0
@INT_MIN = global i32 0
@UINT_MAX = global i32 0
define void @h(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %2
store i32 3, i32* %3
store i32 3, i32* %4
store i8 3, i8* %5
store i8 3, i8* %6
%7 = load i32, i32* %3
%8 = trunc i32 %7 to i8
store i8 %8, i8* %5
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = load i32, i32* %3
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
%13 = load i32, i32* %4
%14 = trunc i32 %13 to i8
store i8 %14, i8* %6
%15 = load i32, i32* %3
%16 = trunc i32 %15 to i8
%17 = call i32 @fuc(i8 signext %16)
%18 = load i32, i32* %4
%19 = trunc i32 %18 to i8
%20 = call i32 @fuc(i8 signext %19)
%21 = load i32, i32* %3
%22 = trunc i32 %21 to i8
%23 = call i32 @fsc(i8 zeroext %22)
%24 = load i32, i32* %4
%25 = trunc i32 %24 to i8
%26 = call i32 @fsc(i8 zeroext %25)
%27 = load i32, i32* %4
%28 = call i32 @fsi(i32 %27)
%29 = load i32, i32* %3
%30 = trunc i32 %29 to i8
%31 = call i32 @fui(i8 signext %30)
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = call i32 @fsi(i32 %33)
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
store i32 %36, i32* %4
%37 = load i8, i8* %5
%38 = call i32 @fui(i8 signext %37)
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
store i32 %40, i32* %3
%41 = call i32 @fui(i8 signext 65)
store i32 65, i32* %3
%42 = call i32 @fsi(i32 65)
store i32 65, i32* %4
%43 = call i32 @fuc(i8 signext 65)
store i8 65, i8* %5
%44 = load i32, i32* %2
%45 = icmp ne i32 %44, 0
%46 = zext i1 %45 to i64
%47 = select i1 %45, i32 1, i32 -1
%48 = trunc i32 %47 to i8
store i8 %48, i8* %5
%49 = load i32, i32* %2
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %1
%52 = load i32, i32* @SCHAR_MIN
br label %54
53: ; preds = %1
br label %54
54: ; preds = %53, %51
%55 = phi i32 [ %52, %51 ], [ 1, %53 ]
%56 = trunc i32 %55 to i8
store i8 %56, i8* %5
%57 = load i32, i32* %2
%58 = icmp ne i32 %57, 0
%59 = zext i1 %58 to i64
%60 = select i1 %58, i32 1, i32 -1
%61 = trunc i32 %60 to i8
store i8 %61, i8* %5
%62 = load i32, i32* %2
%63 = icmp ne i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %54
%65 = load i32, i32* @SCHAR_MIN
br label %67
66: ; preds = %54
br label %67
67: ; preds = %66, %64
%68 = phi i32 [ %65, %64 ], [ 1, %66 ]
%69 = trunc i32 %68 to i8
store i8 %69, i8* %5
%70 = load i32, i32* %2
%71 = icmp ne i32 %70, 0
%72 = zext i1 %71 to i64
%73 = select i1 %71, i32 1, i32 -1
store i32 %73, i32* %3
%74 = load i32, i32* %2
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %67
%77 = load i32, i32* @INT_MIN
br label %79
78: ; preds = %67
br label %79
79: ; preds = %78, %76
%80 = phi i32 [ %77, %76 ], [ 1, %78 ]
store i32 %80, i32* %3
%81 = load i32, i32* %3
%82 = icmp ne i32 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %79
%84 = load i32, i32* @SCHAR_MIN
br label %86
85: ; preds = %79
br label %86
86: ; preds = %85, %83
%87 = phi i32 [ %84, %83 ], [ 1, %85 ]
store i32 %87, i32* %3
store i32 -1, i32* %3
%88 = load i32, i32* %3
%89 = load i32, i32* @INT_MIN
%90 = add i32 %88, %89
store i32 %90, i32* %3
%91 = load i32, i32* %2
%92 = icmp ne i32 %91, 0
%93 = zext i1 %92 to i64
%94 = select i1 %92, i32 1, i32 -1
store i32 %94, i32* %3
%95 = load i32, i32* %3
%96 = icmp ne i32 %95, 0
br i1 %96, label %97, label %99
97: ; preds = %86
%98 = load i32, i32* @SCHAR_MIN
br label %100
99: ; preds = %86
br label %100
100: ; preds = %99, %97
%101 = phi i32 [ %98, %97 ], [ 1, %99 ]
store i32 %101, i32* %3
%102 = call i32 @fuc(i8 signext -1)
store i8 -1, i8* %5
%103 = call i32 @fui(i8 signext -1)
store i32 -1, i32* %3
%104 = call i32 @fuc(i8 signext -96)
store i8 -96, i8* %5
%105 = call i32 @fui(i8 signext -96)
store i32 -96, i32* %3
%106 = call i32 @fsi(i32 -2147483648)
store i32 -2147483648, i32* %4
%107 = load i32, i32* @UINT_MAX
%108 = sub nsw i32 %107, 1
%109 = call i32 @fsi(i32 %108)
%110 = load i32, i32* @UINT_MAX
%111 = sub nsw i32 %110, 1
store i32 %111, i32* %4
%112 = load i32, i32* @UINT_MAX
%113 = sub i32 %112, 1
%114 = call i32 @fsi(i32 %113)
%115 = load i32, i32* @UINT_MAX
%116 = sub i32 %115, 1
store i32 %116, i32* %4
%117 = load i32, i32* @UINT_MAX
%118 = udiv i32 %117, 3
%119 = call i32 @fsi(i32 %118)
%120 = load i32, i32* @UINT_MAX
%121 = udiv i32 %120, 3
store i32 %121, i32* %4
%122 = load i32, i32* @UINT_MAX
%123 = sdiv i32 %122, 3
%124 = call i32 @fsi(i32 %123)
%125 = load i32, i32* @UINT_MAX
%126 = sdiv i32 %125, 3
store i32 %126, i32* %4
%127 = load i32, i32* @UINT_MAX
%128 = sub nsw i32 %127, 1
%129 = trunc i32 %128 to i8
%130 = call i32 @fui(i8 signext %129)
%131 = load i32, i32* @UINT_MAX
%132 = sub nsw i32 %131, 1
store i32 %132, i32* %3
store i8 -1, i8* %5
store i32 1, i32* %3
store i32 -1, i32* %3
%133 = load i8, i8* %5
%134 = call i32 @fsc(i8 zeroext %133)
%135 = load i8, i8* %5
store i8 %135, i8* %6
%136 = load i8, i8* %6
%137 = call i32 @fuc(i8 signext %136)
%138 = load i8, i8* %6
store i8 %138, i8* %5
%139 = load i32, i32* %3
%140 = call i32 @fsi(i32 %139)
%141 = load i32, i32* %3
store i32 %141, i32* %4
%142 = load i32, i32* %4
%143 = trunc i32 %142 to i8
%144 = call i32 @fui(i8 signext %143)
%145 = load i32, i32* %4
store i32 %145, i32* %3
%146 = load i8, i8* %6
%147 = call i32 @fui(i8 signext %146)
%148 = load i8, i8* %6
%149 = sext i8 %148 to i32
store i32 %149, i32* %3
ret void
}

LLVM IR (-O2):
@SCHAR_MIN = global i32 0
@INT_MIN = global i32 0
@UINT_MAX = global i32 0
define void @h(i32 %0) {
%2 = tail call i32 @fuc(i8 signext 3)
%3 = tail call i32 @fuc(i8 signext 3)
%4 = tail call i32 @fsc(i8 zeroext 3)
%5 = tail call i32 @fsc(i8 zeroext 3)
%6 = tail call i32 @fsi(i32 3)
%7 = tail call i32 @fui(i8 signext 3)
%8 = tail call i32 @fsi(i32 3)
%9 = tail call i32 @fui(i8 signext 3)
%10 = tail call i32 @fui(i8 signext 65)
%11 = tail call i32 @fsi(i32 65)
%12 = tail call i32 @fuc(i8 signext 65)
%13 = tail call i32 @fuc(i8 signext -1)
%14 = tail call i32 @fui(i8 signext -1)
%15 = tail call i32 @fuc(i8 signext -96)
%16 = tail call i32 @fui(i8 signext -96)
%17 = tail call i32 @fsi(i32 -2147483648)
%18 = load i32, i32* @UINT_MAX
%19 = add nsw i32 %18, -1
%20 = tail call i32 @fsi(i32 %19)
%21 = load i32, i32* @UINT_MAX
%22 = add i32 %21, -1
%23 = tail call i32 @fsi(i32 %22)
%24 = load i32, i32* @UINT_MAX
%25 = udiv i32 %24, 3
%26 = tail call i32 @fsi(i32 %25)
%27 = load i32, i32* @UINT_MAX
%28 = sdiv i32 %27, 3
%29 = tail call i32 @fsi(i32 %28)
%30 = load i32, i32* @UINT_MAX
%31 = trunc i32 %30 to i8
%32 = add i8 %31, -1
%33 = tail call i32 @fui(i8 signext %32)
%34 = tail call i32 @fsc(i8 zeroext -1)
%35 = tail call i32 @fuc(i8 signext -1)
%36 = tail call i32 @fsi(i32 -1)
%37 = tail call i32 @fui(i8 signext -1)
%38 = tail call i32 @fui(i8 signext -1)
ret void
}