void check_assign() {
  int a;
  assert(({
           typeof(5) __x = (5);
           typeof(a) __y = __x;
           (__x == __y && ((__x < 1) == (__y < 1)) ? (void)((a) = __y), 0 : 1);
         }) == 0 &&
         a == 5);
  a = 23;
  assert(({
           typeof((unsigned int)-23) __x = ((unsigned int)-23);
           typeof(a) __y = __x;
           (__x == __y && ((__x < 1) == (__y < 1)) ? (void)((a) = __y), 0 : 1);
         }) == 1);
}


x86 assembly (clang, -O0):
<check_assign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1162 <check_assign+0x52>
cmpl   $0x1,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x1,-0xc(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1162 <check_assign+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,-0x20(%rbp)
jmp    116f <check_assign+0x5f>
mov    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    116f <check_assign+0x5f>
mov    -0x20(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x21(%rbp)
jne    118e <check_assign+0x7e>
cmpl   $0x5,-0x4(%rbp)
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movl   $0x17,-0x4(%rbp)
movl   $0xffffffe9,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    11ee <check_assign+0xde>
cmpl   $0x1,-0x14(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x1,-0x18(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    11ee <check_assign+0xde>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,-0x28(%rbp)
jmp    11fb <check_assign+0xeb>
mov    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11fb <check_assign+0xeb>
mov    -0x28(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_assign>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @check_assign() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 5, i32* %2
%8 = load i32, i32* %2
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %0
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 1
%15 = zext i1 %14 to i32
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 1
%18 = zext i1 %17 to i32
%19 = icmp eq i32 %15, %18
br i1 %19, label %20, label %22
20: ; preds = %12
%21 = load i32, i32* %3
store i32 %21, i32* %1
br label %23
22: ; preds = %12, %0
br label %23
23: ; preds = %22, %20
%24 = phi i32 [ 0, %20 ], [ 1, %22 ]
store i32 %24, i32* %4
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i32, i32* %1
%29 = icmp eq i32 %28, 5
br label %30
30: ; preds = %27, %23
%31 = phi i1 [ false, %23 ], [ %29, %27 ]
%32 = zext i1 %31 to i32
%33 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %32)
store i32 23, i32* %1
store i32 -23, i32* %5
%34 = load i32, i32* %5
store i32 %34, i32* %6
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = icmp eq i32 %35, %36
br i1 %37, label %38, label %48
38: ; preds = %30
%39 = load i32, i32* %5
%40 = icmp ult i32 %39, 1
%41 = zext i1 %40 to i32
%42 = load i32, i32* %6
%43 = icmp slt i32 %42, 1
%44 = zext i1 %43 to i32
%45 = icmp eq i32 %41, %44
br i1 %45, label %46, label %48
46: ; preds = %38
%47 = load i32, i32* %6
store i32 %47, i32* %1
br label %49
48: ; preds = %38, %30
br label %49
49: ; preds = %48, %46
%50 = phi i32 [ 0, %46 ], [ 1, %48 ]
store i32 %50, i32* %7
%51 = load i32, i32* %7
%52 = icmp eq i32 %51, 1
%53 = zext i1 %52 to i32
%54 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %53)
ret void
}

LLVM IR (-O2):
define void @check_assign() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret void
}