#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*/ fsi32(int);
int /*<<< orphan*/ fuc(char);
int /*<<< orphan*/ fui(char);
void h(int x) {
  unsigned int ui = 3;
  int si = 3;
  int si32 = 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';
  fsi32(0x80000000);
  si32 = 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)
movl   $0x3,-0x10(%rbp)
movb   $0x3,-0x11(%rbp)
movb   $0x3,-0x12(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x12(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1070 <fuc@plt>
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1070 <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 -0x11(%rbp),%edi
call   1030 <fsi@plt>
movzbl -0x11(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsbl -0x11(%rbp),%edi
call   1040 <fui@plt>
movzbl -0x11(%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   1070 <fuc@plt>
movb   $0x41,-0x11(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x11(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1250 <h+0x100>
mov    0x2d8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
jmp    125d <h+0x10d>
mov    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    125d <h+0x10d>
mov    -0x18(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x11(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1294 <h+0x144>
mov    0x2d46(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    12a1 <h+0x151>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12a1 <h+0x151>
mov    -0x1c(%rbp),%eax
mov    %al,-0x11(%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     12d8 <h+0x188>
mov    0x2d12(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
jmp    12e5 <h+0x195>
mov    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12e5 <h+0x195>
mov    -0x20(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1306 <h+0x1b6>
mov    0x2cd4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1313 <h+0x1c3>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1313 <h+0x1c3>
mov    -0x24(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2cb6(%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     1360 <h+0x210>
mov    0x2c7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
jmp    136d <h+0x21d>
mov    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    136d <h+0x21d>
mov    -0x28(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1070 <fuc@plt>
movb   $0xff,-0x11(%rbp)
mov    $0xffffffff,%edi
call   1040 <fui@plt>
movl   $0xffffffff,-0x8(%rbp)
mov    $0xffffffa0,%edi
call   1070 <fuc@plt>
movb   $0xa0,-0x11(%rbp)
mov    $0xffffffa0,%edi
call   1040 <fui@plt>
movl   $0xffffffa0,-0x8(%rbp)
mov    $0x80000000,%edi
call   1060 <fsi32@plt>
movl   $0x80000000,-0x10(%rbp)
mov    0x2c1f(%rip),%rax
mov    (%rax),%edi
sub    $0x1,%edi
call   1030 <fsi@plt>
mov    0x2c0e(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    0x2bff(%rip),%rax
mov    (%rax),%edi
sub    $0x1,%edi
call   1030 <fsi@plt>
mov    0x2bee(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    0x2bdf(%rip),%rax
mov    (%rax),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1030 <fsi@plt>
mov    0x2bc6(%rip),%rax
mov    (%rax),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
mov    0x2bb1(%rip),%rax
mov    (%rax),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <fsi@plt>
mov    0x2b99(%rip),%rax
mov    (%rax),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    0x2b85(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movsbl %al,%edi
call   1040 <fui@plt>
mov    0x2b71(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
movb   $0xff,-0x11(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movzbl -0x11(%rbp),%edi
call   1050 <fsc@plt>
mov    -0x11(%rbp),%al
mov    %al,-0x12(%rbp)
movsbl -0x12(%rbp),%edi
call   1070 <fuc@plt>
mov    -0x12(%rbp),%al
mov    %al,-0x11(%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 -0x12(%rbp),%edi
call   1040 <fui@plt>
movsbl -0x12(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

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